diff options
Diffstat (limited to 'lib/tasks/gems.rake')
-rw-r--r-- | lib/tasks/gems.rake | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/tasks/gems.rake b/lib/tasks/gems.rake index fc70048ea6d..0c4cbbfe3f8 100644 --- a/lib/tasks/gems.rake +++ b/lib/tasks/gems.rake @@ -29,7 +29,7 @@ namespace :gems do end def root_directory - File.expand_path('../../vendor/gems', __dir__) + File.expand_path('../../gems', __dir__) end def generate_gem(vendor_gem_dir:, api_url:, gem_name:, module_name:, docker_image:) @@ -53,14 +53,18 @@ namespace :gems do write_file(gem_dir / 'LICENSE', license) write_file(gem_dir / "#{gem_name}.gemspec") do |content| replace_string(content, 'Unlicense', 'MIT') + replace_string(content, /.*add_development_dependency 'rspec'.*/, '') replace_string(content, /(\.files\s*=).*/, '\1 Dir.glob("lib/**/*")') replace_string(content, /(\.test_files\s*=).*/, '\1 []') end + # This is gem is supposed to be generated. No developer should change code. remove_entry_secure(gem_dir / 'Gemfile') + # The generated code doesn't align well with `gitlab-styles` configuration. remove_entry_secure(gem_dir / '.rubocop.yml') remove_entry_secure(gem_dir / '.travis.yml') remove_entry_secure(gem_dir / 'git_push.sh') + # The RSpec examples are stubs and have no value. remove_entry_secure(gem_dir / 'spec') remove_entry_secure(gem_dir / '.rspec') end @@ -78,14 +82,16 @@ namespace :gems do end def readme_banner(task) - # rubocop:disable Rails/TimeZone <<~BANNER - # Generated by `rake #{task.name}` on #{Time.now.strftime('%Y-%m-%d')} + # #{generated_by(task)} See https://gitlab.com/gitlab-org/gitlab/-/blob/master/doc/development/rake_tasks.md#update-openapi-client-for-error-tracking-feature BANNER - # rubocop:enable Rails/TimeZone + end + + def generated_by(task) + "Generated by `rake #{task.name}` on #{Time.now.strftime('%Y-%m-%d')}" # rubocop:disable Rails/TimeZone end def license |