rubygems-tasks 0.2.5 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +31 -0
  3. data/.gitignore +4 -2
  4. data/ChangeLog.md +20 -0
  5. data/Gemfile +12 -0
  6. data/LICENSE.txt +1 -1
  7. data/README.md +114 -80
  8. data/Rakefile +6 -20
  9. data/gemspec.yml +13 -5
  10. data/lib/rubygems/tasks/build/gem.rb +5 -6
  11. data/lib/rubygems/tasks/build/tar.rb +5 -6
  12. data/lib/rubygems/tasks/build/task.rb +4 -2
  13. data/lib/rubygems/tasks/build/zip.rb +5 -6
  14. data/lib/rubygems/tasks/build.rb +61 -3
  15. data/lib/rubygems/tasks/console.rb +13 -10
  16. data/lib/rubygems/tasks/install.rb +4 -5
  17. data/lib/rubygems/tasks/printing.rb +2 -0
  18. data/lib/rubygems/tasks/project.rb +3 -1
  19. data/lib/rubygems/tasks/push.rb +20 -7
  20. data/lib/rubygems/tasks/release.rb +4 -5
  21. data/lib/rubygems/tasks/scm/push.rb +5 -6
  22. data/lib/rubygems/tasks/scm/status.rb +5 -6
  23. data/lib/rubygems/tasks/scm/tag.rb +9 -12
  24. data/lib/rubygems/tasks/scm.rb +52 -3
  25. data/lib/rubygems/tasks/sign/checksum.rb +21 -14
  26. data/lib/rubygems/tasks/sign/pgp.rb +5 -6
  27. data/lib/rubygems/tasks/sign/task.rb +4 -2
  28. data/lib/rubygems/tasks/sign.rb +42 -2
  29. data/lib/rubygems/tasks/task.rb +11 -3
  30. data/lib/rubygems/tasks.rb +67 -66
  31. data/rubygems-tasks.gemspec +1 -0
  32. data/spec/build_spec.rb +72 -0
  33. data/spec/console_spec.rb +45 -18
  34. data/spec/install_spec.rb +5 -1
  35. data/spec/project_spec.rb +19 -19
  36. data/spec/push_spec.rb +15 -3
  37. data/spec/scm/push_spec.rb +6 -6
  38. data/spec/scm/status_spec.rb +8 -12
  39. data/spec/scm/tag_spec.rb +18 -28
  40. data/spec/scm_spec.rb +72 -0
  41. data/spec/sign/pgp_spec.rb +1 -1
  42. data/spec/sign_spec.rb +52 -0
  43. data/spec/tasks_spec.rb +18 -191
  44. metadata +32 -26
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e30996ab5613db9af366535a259cac3855b8e656a8611b2c6bdf3ed1f657e6a0
4
- data.tar.gz: f432dd0dc3df8a8ce075afb54f90a39cb2ff3308eda13be9de632273dd65ae76
3
+ metadata.gz: 4c796aef54b6d54c6c4afcf50f0588ee2204a5fae8527cee9c4a53f1881bf32d
4
+ data.tar.gz: 275002c2d14b8d6198c23cafb9a348742117fb32addcec9bb9ce879a18d57161
5
5
  SHA512:
6
- metadata.gz: a3440f9a95b1e17fcb735fc4172b220d3cb271ef075eca0cbb405dcc6f7ea73bc2f038e4fd4835bf3774ec6af65fc2b84f8fd2956379f91eabd4b9c0f31b7080
7
- data.tar.gz: a7522d3f00a6f4cb132049296d0e53fc0be2ee3927ab46595cdf320c43c35570363790be15c455108f3284a1d1bf3877ea37f8dd964db74bd1b90102c645966f
6
+ metadata.gz: 322f40592b51da34f2d6c651214b84b8d5a2e97d49bf9e4b30a1c8a808a2e50698058544e65ff5904edee1ffd13fbc639e211d0132dc12610c9732a117349fa7
7
+ data.tar.gz: b8ecbb198b85d8163ea41c591b8c00efab9ad3c007946316743c35918c166078c5d4a20ee8df3da4496027dd2cd5e3aaa22f79998e21df5250b5a5d7bd240cb8
@@ -0,0 +1,31 @@
1
+ name: CI
2
+
3
+ on: [ push, pull_request ]
4
+
5
+ jobs:
6
+ tests:
7
+ runs-on: ubuntu-latest
8
+ strategy:
9
+ fail-fast: false
10
+ matrix:
11
+ ruby:
12
+ - '3.0'
13
+ - '3.1'
14
+ - '3.2'
15
+ - '3.3'
16
+ - '3.4'
17
+ - '3.5'
18
+ - '4.0'
19
+ - jruby
20
+ - truffleruby
21
+ name: Ruby ${{ matrix.ruby }}
22
+ steps:
23
+ - uses: actions/checkout@v2
24
+ - name: Set up Ruby
25
+ uses: ruby/setup-ruby@v1
26
+ with:
27
+ ruby-version: ${{ matrix.ruby }}
28
+ - name: Install dependencies
29
+ run: bundle install --jobs 4 --retry 3
30
+ - name: Run tests
31
+ run: bundle exec rake test
data/.gitignore CHANGED
@@ -1,2 +1,4 @@
1
- doc/
2
- pkg/
1
+ /Gemfile.lock
2
+ /doc/
3
+ /pkg/
4
+ /vendor/bundle
data/ChangeLog.md CHANGED
@@ -1,3 +1,23 @@
1
+ ### 0.3.0 / 2025-11-28
2
+
3
+ * Added support for Ruby 3.5 and 4.0.
4
+ * Fixed `ostruct` warnings by refactoring code to use plain-Ruby classes
5
+ instead of `OpenStruct`.
6
+ * {Gem::Tasks::Build} is now a class that can be initialized and will
7
+ define all `build:` sub-tasks.
8
+ * {Gem::Tasks::SCM} is now a class that can be initialized and will define
9
+ all `scm:` sub-tasks.
10
+ * {Gem::Tasks::Sign} is now a class that can be initialized and will define
11
+ all `sign:` sub-tasks.
12
+ * {Gem::Tasks::Push#initialize} now accepts the `key:` keyword argument.
13
+ * Switched to keyword arguments.
14
+ * Added `frozen_string_literal: true` to all files.
15
+
16
+ ### 0.2.6 / 2023-09-07
17
+
18
+ * Fixed `rake install` so that it runs `gem install -q pkg/...` outside of the
19
+ Bundler environment, if currently running under Bundler.
20
+
1
21
  ### 0.2.5 / 2020-03-02
2
22
 
3
23
  * Require Ruby >= 2.0.0.
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ group :development do
6
+ gem 'rake'
7
+ gem 'rspec', '~> 3.0'
8
+ gem 'redcarpet', platform: :mri
9
+ gem 'kramdown'
10
+ gem 'yard', '~> 0.9'
11
+ gem 'yard-spellcheck', require: false
12
+ end
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2011-2020 Hal Brodigan
1
+ Copyright (c) 2011-2025 Hal Brodigan
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -1,127 +1,161 @@
1
1
  # rubygems-tasks
2
2
 
3
- [![Build Status](https://secure.travis-ci.org/postmodern/rubygems-tasks.png?branch=master)](https://travis-ci.org/postmodern/rubygems-tasks)
3
+ [![CI](https://github.com/postmodern/rubygems-tasks/actions/workflows/ruby.yml/badge.svg)](https://github.com/postmodern/rubygems-tasks/actions/workflows/ruby.yml)
4
+ [![Code Climate](https://codeclimate.com/github/postmodern/rubygems-tasks.svg)](https://codeclimate.com/github/postmodern/rubygems-tasks)
4
5
 
5
6
  * [Source](https://github.com/postmodern/rubygems-tasks)
6
- * [Issues](https://github.com/postmodern/rubygems-tasks/issues)
7
- * [Email](mailto:postmodern.mod3 at gmail.com)
7
+ * [Forum](https://github.com/postmodern/rubygems-tasks/discussions) |
8
+ [Issues](https://github.com/postmodern/rubygems-tasks/issues)
9
+ * [Documentation](https://rubydoc.info/gems/rubygems-tasks)
8
10
 
9
11
  ## Description
10
12
 
11
- rubygems-tasks provides agnostic and unobtrusive Rake tasks for building,
12
- installing and releasing Ruby Gems.
13
+ rubygems-tasks provides [Rake] tasks for building and releasing Ruby Gems.
14
+ rubygems-tasks can be added to any Ruby project that has a `Rakefile` and a
15
+ `.gemspec` file.
13
16
 
14
- require 'rubygems/tasks'
15
- Gem::Tasks.new
17
+ ## Features
16
18
 
17
- ## Philosophy
19
+ * Provides [Rake] tasks to build, install, or release gem packages to
20
+ [rubygems.org].
21
+ * Supports pushing gem packages to internal [gem servers].
22
+ * Additionally supports creating `.tar.gz` of `.zip` source archives.
23
+ * Loads all project metadata from the `.gemspec` file.
24
+ * Supports Ruby projects with multiple `.gemspec` files.
25
+ * Supports [Git], [Mercurial], [SubVersion], or even no SCM at all.
26
+ * Enforces important safety checks:
27
+ * Checks for uncommitted changes before building a gem.
28
+ * Pushes all commits and tags before pushing a gem.
29
+ * Provides additional enhanced security features:
30
+ * Supports optionally creating PGP signed [Git] or [Mercurial] tags.
31
+ * Supports optionally generating checksums or PGP signatures of the `.gem`
32
+ package.
18
33
 
19
- The Rake tasks which you use to manage a Ruby project should not be coupled
20
- to the project generator which you used to create the project.
21
- Project generators have nothing to do with the Rake tasks used to build,
22
- install and release a Ruby project.
34
+ ## Requirements
23
35
 
24
- Recently, many Ruby Developers began creating Ruby projects by hand,
25
- building/releasing RubyGems using `gem build` / `gem push`. Sometimes this
26
- resulted in RubyGems being released with uncommitted changes, or the developer
27
- forgetting to tag the release. Ruby Developers should have access to
28
- **agnostic** and **unobtrusive** Rake tasks, to **automate** the release
29
- process.
36
+ * [ruby] >= 2.0.0
37
+ * [rake] >= 10.0.0
38
+ * [irb] ~> 1.0
30
39
 
31
- This is what rubygems-tasks seeks to provide.
40
+ ## Install
32
41
 
33
- ## Features
42
+ 1. Add the following to the `Gemfile`:
34
43
 
35
- * Provides tasks to build, install and push gems to [rubygems.org].
36
- * Loads all project metadata from the `.gemspec` file.
37
- * Supports loading multiple `.gemspec` files.
38
- * Supports pushing gems to alternate [gem server]s.
39
- * Supports optionally building `.tar.gz` and `.zip` archives.
40
- * `build:tar`
41
- * `build:zip`
42
- * Supports [Git], [Mercurial] and [SubVersion] Source-Code-Managers
43
- (SCMs).
44
- * Supports creating PGP signed Git/Mercurial tags.
45
- * Provides optional `sign` tasks for package integrity:
46
- * `sign:checksum`
47
- * `sign:pgp`
48
- * Provides a `console` task, for jumping right into your code.
49
- * Defines task aliases for users coming from [Jeweler] or [Hoe].
50
- * ANSI coloured messages!
51
-
52
- ## Anti-Features
53
-
54
- * **Does not** parse project metadata from the README or the ChangeLog.
55
- * **Does not** generate or modify code.
56
- * **Does not** automatically commit changes.
57
- * **Does not** inject dependencies into gems.
58
- * **Zero** dependencies.
44
+ ```ruby
45
+ gem 'rubygems-tasks', '~> 0.3', require: false
46
+ ```
59
47
 
60
- ## Requirements
48
+ 2. Add the following to the `Rakefile`:
61
49
 
62
- * [ruby] >= 2.0.0
63
- * [rake]
50
+ ```ruby
51
+ require 'rubygems/tasks'
52
+ Gem::Tasks.new
53
+ ```
64
54
 
65
- ## Install
55
+ ## Synopsis
66
56
 
67
- $ gem install rubygems-tasks
57
+ ```
58
+ rake build # Builds all packages
59
+ rake console # Spawns an Interactive Ruby Console
60
+ rake install # Installs all built gem packages
61
+ rake release # Performs a release
62
+ ```
63
+
64
+ Perform a test build of the project and write all build artifacts to the
65
+ `pkg/` directory:
66
+
67
+ ```
68
+ $ rake build
69
+ ```
70
+
71
+ Jump into IRB with the Ruby library preloaded:
72
+
73
+ ```
74
+ $ rake console
75
+ irb(main):001>
76
+ ```
77
+
78
+ Build and install the Ruby gem locally:
79
+
80
+ ```
81
+ $ rake install
82
+ ```
83
+
84
+ Build, tag, and release a new version:
85
+
86
+ ```
87
+ $ rake release
88
+ ```
68
89
 
69
90
  ## Examples
70
91
 
71
- Specifying an alternate Ruby Console to run:
92
+ Default configuration:
72
93
 
73
- Gem::Tasks.new do |tasks|
74
- tasks.console.command = 'pry'
75
- end
94
+ ```ruby
95
+ require 'rubygems/tasks'
96
+ Gem::Tasks.new
97
+ ```
76
98
 
77
- Enable pushing gems to an in-house [gem server]:
99
+ Change the Ruby REPL for the `console` [Rake] task:
78
100
 
79
- Gem::Tasks.new do |tasks|
80
- tasks.push.host = 'gems.company.com'
81
- end
101
+ ```ruby
102
+ Gem::Tasks.new do |tasks|
103
+ tasks.console.command = 'pry'
104
+ end
105
+ ```
82
106
 
83
- Disable the `push` task:
107
+ Enable pushing gems to an internal [gem server] instead of [rubygems.org]:
84
108
 
85
- Gem::Tasks.new(push: false)
109
+ ```ruby
110
+ Gem::Tasks.new do |tasks|
111
+ tasks.push.host = 'gems.company.internal'
112
+ end
113
+ ```
86
114
 
87
- Enable building `.tar.gz` and `.zip` archives:
115
+ Disable the `push` [Rake] task:
88
116
 
89
- Gem::Tasks.new(build: {tar: true, zip: true})
117
+ ```ruby
118
+ Gem::Tasks.new(push: false)
119
+ ```
90
120
 
91
- Enable Checksums and PGP signatures for built packages:
121
+ Enable building `.tar.gz` and `.zip` source archives, in addition to the `.gem`
122
+ package:
92
123
 
93
- Gem::Tasks.new(sign: {checksum: true, pgp: true})
124
+ ```ruby
125
+ Gem::Tasks.new(build: {tar: true, zip: true})
126
+ ```
94
127
 
95
- Selectively defining tasks:
128
+ Enable generating checksums and PGP signatures for built packages:
96
129
 
97
- Gem::Tasks::Build::Tar.new
98
- Gem::Tasks::SCM::Status.new
99
- Gem::Tasks::SCM::Tag.new(format: 'REL-%s')
100
- Gem::Tasks::Sign::Checksum.new
101
- Gem::Tasks::Console.new
130
+ ```ruby
131
+ Gem::Tasks.new(sign: {checksum: true, pgp: true})
132
+ ```
102
133
 
103
- ## Synopsis
134
+ Selectively defining specific [Rake] tasks:
104
135
 
105
- rake build # Builds all packages
106
- rake console # Spawns an Interactive Ruby Console
107
- rake install # Installs all built gem packages
108
- rake release # Performs a release
136
+ ```ruby
137
+ Gem::Tasks::Build::Tar.new
138
+ Gem::Tasks::SCM::Status.new
139
+ Gem::Tasks::SCM::Tag.new(format: 'REL-%s')
140
+ Gem::Tasks::Sign::Checksum.new
141
+ Gem::Tasks::Console.new
142
+ ```
109
143
 
110
144
  ## Copyright
111
145
 
112
- Copyright (c) 2011-2020 Hal Brodigan
146
+ Copyright (c) 2011-2025 Hal Brodigan
113
147
 
114
148
  See {file:LICENSE.txt} for details.
115
149
 
116
- [Git]: http://git-scm.com/
117
- [Mercurial]: http://mercurial.selenic.com/
118
- [SubVersion]: http://subversion.tigris.org/
150
+ [Git]: https://git-scm.com/
151
+ [Mercurial]: https://www.mercurial-scm.org/
152
+ [SubVersion]: https://subversion.apache.org/
119
153
 
120
- [Jeweler]: https://github.com/technicalpickles/jeweler#readme
121
- [Hoe]: https://github.com/seattlerb/hoe#readme
154
+ [Rake]: https://github.com/ruby/rake#readme
122
155
 
123
156
  [rubygems.org]: https://rubygems.org/
124
157
  [gem server]: https://github.com/rubygems/rubygems.org#readme
125
158
 
126
159
  [ruby]: https://www.ruby-lang.org/
127
160
  [rake]: https://rubygems.org/gems/rake
161
+ [irb]: https://rubygems.org/gems/irb
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ require 'rubygems'
2
+
1
3
  require 'rake'
2
4
 
3
5
  lib_dir = File.expand_path('lib',File.dirname(__FILE__))
@@ -9,26 +11,10 @@ Gem::Tasks.new(
9
11
  sign: {checksum: true, pgp: true}
10
12
  )
11
13
 
12
- begin
13
- gem 'rspec', '~> 3.0'
14
- require 'rspec/core/rake_task'
15
-
16
- RSpec::Core::RakeTask.new
17
- rescue LoadError
18
- task :spec do
19
- abort "Please run `gem install rspec` to install RSpec."
20
- end
21
- end
14
+ require 'rspec/core/rake_task'
15
+ RSpec::Core::RakeTask.new
22
16
  task :test => :spec
23
17
  task :default => :spec
24
18
 
25
- begin
26
- gem 'yard', '~> 0.8'
27
- require 'yard'
28
-
29
- YARD::Rake::YardocTask.new
30
- rescue LoadError => e
31
- task :yard do
32
- abort 'Please run `gem install yard` to install YARD.'
33
- end
34
- end
19
+ require 'yard'
20
+ YARD::Rake::YardocTask.new
data/gemspec.yml CHANGED
@@ -1,8 +1,10 @@
1
1
  name: rubygems-tasks
2
- version: 0.2.5
3
- summary: Rake tasks for managing and releasing Ruby Gems.
2
+ version: 0.3.0
3
+ summary: Rake tasks for building and releasing Ruby Gems.
4
4
  description: |
5
- Agnostic and unobtrusive Rake tasks for managing and releasing Ruby Gems.
5
+ rubygems-tasks provides agnostic and unobtrusive Rake tasks for building and
6
+ releasing Ruby Gems. rubygems-tasks can be used in any existing Ruby project
7
+ that has a .gemspec file.
6
8
 
7
9
  authors: Postmodern
8
10
  license: MIT
@@ -10,11 +12,17 @@ email: postmodern.mod3@gmail.com
10
12
  homepage: https://github.com/postmodern/rubygems-tasks#readme
11
13
  has_yard: true
12
14
 
15
+ metadata:
16
+ documentation_uri: https://rubydoc.info/gems/rubygems-tasks
17
+ source_code_uri: https://github.com/postmodern/rubygems-tasks
18
+ bug_tracker_uri: https://github.com/postmodern/rubygems-tasks/issues
19
+ changelog_uri: https://github.com/postmodern/rubygems-tasks/blob/master/ChangeLog.md
20
+
13
21
  required_ruby_version: ">= 2.0.0"
14
22
 
15
23
  dependencies:
24
+ rake: ">= 10.0.0"
16
25
  irb: ~> 1.0
17
26
 
18
27
  development_dependencies:
19
- rspec: ~> 3.0
20
- yard: ~> 0.8
28
+ bundler: ">= 2.0.0"
@@ -1,4 +1,6 @@
1
- require 'rubygems/tasks/build/task'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'task'
2
4
 
3
5
  if Gem::VERSION > '2.' then require 'rubygems/package'
4
6
  else require 'rubygems/builder'
@@ -6,7 +8,7 @@ end
6
8
 
7
9
  module Gem
8
10
  class Tasks
9
- module Build
11
+ class Build
10
12
  #
11
13
  # The `build:gem` task.
12
14
  #
@@ -15,10 +17,7 @@ module Gem
15
17
  #
16
18
  # Initializes the `build:gem` task.
17
19
  #
18
- # @param [Hash] options
19
- # Additional options.
20
- #
21
- def initialize(options={})
20
+ def initialize
22
21
  super()
23
22
 
24
23
  yield self if block_given?
@@ -1,8 +1,10 @@
1
- require 'rubygems/tasks/build/task'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'task'
2
4
 
3
5
  module Gem
4
6
  class Tasks
5
- module Build
7
+ class Build
6
8
  #
7
9
  # The `build:tar` task.
8
10
  #
@@ -11,10 +13,7 @@ module Gem
11
13
  #
12
14
  # Initializes the `build:tar` task.
13
15
  #
14
- # @param [Hash] options
15
- # Additional options.
16
- #
17
- def initialize(options={})
16
+ def initialize
18
17
  super()
19
18
 
20
19
  yield self if block_given?
@@ -1,8 +1,10 @@
1
- require 'rubygems/tasks/task'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../task'
2
4
 
3
5
  module Gem
4
6
  class Tasks
5
- module Build
7
+ class Build
6
8
  class Task < Tasks::Task
7
9
 
8
10
  #
@@ -1,8 +1,10 @@
1
- require 'rubygems/tasks/build/task'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'task'
2
4
 
3
5
  module Gem
4
6
  class Tasks
5
- module Build
7
+ class Build
6
8
  #
7
9
  # The `build:zip` task.
8
10
  #
@@ -11,10 +13,7 @@ module Gem
11
13
  #
12
14
  # Initializes the `build:zip` task.
13
15
  #
14
- # @param [Hash] options
15
- # Additional options.
16
- #
17
- def initialize(options={})
16
+ def initialize
18
17
  super()
19
18
 
20
19
  yield self if block_given?
@@ -1,3 +1,61 @@
1
- require 'rubygems/tasks/build/tar'
2
- require 'rubygems/tasks/build/gem'
3
- require 'rubygems/tasks/build/zip'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'build/tar'
4
+ require_relative 'build/gem'
5
+ require_relative 'build/zip'
6
+
7
+ module Gem
8
+ class Tasks
9
+ #
10
+ # Collection of all `build:*` tasks.
11
+ #
12
+ # * {Build::Gem build:gem}
13
+ # * {Build::Tar build:tar}
14
+ # * {Build::Zip build:zip}
15
+ #
16
+ class Build
17
+
18
+ # The {Gem build:gem} task.
19
+ #
20
+ # @return [Gem, nil]
21
+ #
22
+ # @since 0.3.0
23
+ attr_reader :gem
24
+
25
+ # The {Tar build:tar} task.
26
+ #
27
+ # @return [Tar, nil]
28
+ #
29
+ # @since 0.3.0
30
+ attr_reader :tar
31
+
32
+ # The {Zip build:zip} task.
33
+ #
34
+ # @return [Zip, nil]
35
+ #
36
+ # @since 0.3.0
37
+ attr_reader :zip
38
+
39
+ #
40
+ # Initializes the `build:` tasks.
41
+ #
42
+ # @param [Boolean] gem
43
+ # Enables or disables the {Build::Gem build:gem} task.
44
+ #
45
+ # @param [Boolean] tar
46
+ # Enables or disables the {Build::Tar build:tar} task.
47
+ #
48
+ # @param [Boolean] zip
49
+ # Enables or disables the {Build::Zip build:zip} task.
50
+ #
51
+ # @since 0.3.0
52
+ #
53
+ def initialize(gem: true, tar: nil, zip: nil)
54
+ @gem = Gem.new if gem
55
+ @tar = Tar.new if tar
56
+ @zip = Zip.new if zip
57
+ end
58
+
59
+ end
60
+ end
61
+ end
@@ -1,4 +1,6 @@
1
- require 'rubygems/tasks/task'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'task'
2
4
 
3
5
  module Gem
4
6
  class Tasks
@@ -14,28 +16,29 @@ module Gem
14
16
  DEFAULT_COMMAND = (ENV['RUBYCONSOLE'] || DEFAULT_CONSOLE)
15
17
 
16
18
  # The Ruby Console command
19
+ #
20
+ # @return [String]
17
21
  attr_accessor :command
18
22
 
19
23
  # Additional options for the Ruby Console
24
+ #
25
+ # @return [Array<String>]
20
26
  attr_accessor :options
21
27
 
22
28
  #
23
29
  # Initializes the `console` task.
24
30
  #
25
- # @param [Hash] options
26
- # Additional options.
27
- #
28
- # @option options [String] :command (DEFAULT_COMMAND)
31
+ # @param [String] command
29
32
  # The Ruby Console command to run.
30
33
  #
31
- # @option options [Array] :options
34
+ # @param [Array<String>] options
32
35
  # Additional options for the Ruby Console.
33
36
  #
34
- def initialize(options={})
37
+ def initialize(command: DEFAULT_COMMAND, options: [])
35
38
  super()
36
39
 
37
- @command = options.fetch(:command,DEFAULT_COMMAND)
38
- @options = Array(options[:options])
40
+ @command = command
41
+ @options = options
39
42
 
40
43
  yield self if block_given?
41
44
  define
@@ -78,7 +81,7 @@ module Gem
78
81
  arguments.push(*require_paths.map { |dir| "-I#{dir}" })
79
82
 
80
83
  # add an -r option to require the library
81
- arguments.push('-r' + require_file)
84
+ arguments.push("-r#{require_file}")
82
85
 
83
86
  # push on additional options
84
87
  arguments.push(*@options)
@@ -1,4 +1,6 @@
1
- require 'rubygems/tasks/task'
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'task'
2
4
 
3
5
  module Gem
4
6
  class Tasks
@@ -10,10 +12,7 @@ module Gem
10
12
  #
11
13
  # Initializes the `install` task.
12
14
  #
13
- # @param [Hash] options
14
- # Additional options.
15
- #
16
- def initialize(options={})
15
+ def initialize
17
16
  super()
18
17
 
19
18
  yield self if block_given?
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gem
2
4
  class Tasks
3
5
  #
@@ -1,9 +1,11 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'set'
2
4
 
3
5
  module Gem
4
6
  class Tasks
5
7
  #
6
- # @api semipublic
8
+ # @api private
7
9
  #
8
10
  class Project
9
11