rubygems-tasks 0.2.6 → 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.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +7 -3
- data/ChangeLog.md +15 -0
- data/Gemfile +2 -0
- data/LICENSE.txt +1 -1
- data/README.md +112 -79
- data/gemspec.yml +6 -4
- data/lib/rubygems/tasks/build/gem.rb +5 -6
- data/lib/rubygems/tasks/build/tar.rb +5 -6
- data/lib/rubygems/tasks/build/task.rb +4 -2
- data/lib/rubygems/tasks/build/zip.rb +5 -6
- data/lib/rubygems/tasks/build.rb +61 -3
- data/lib/rubygems/tasks/console.rb +12 -9
- data/lib/rubygems/tasks/install.rb +4 -5
- data/lib/rubygems/tasks/printing.rb +2 -0
- data/lib/rubygems/tasks/project.rb +3 -1
- data/lib/rubygems/tasks/push.rb +20 -7
- data/lib/rubygems/tasks/release.rb +4 -5
- data/lib/rubygems/tasks/scm/push.rb +5 -6
- data/lib/rubygems/tasks/scm/status.rb +5 -6
- data/lib/rubygems/tasks/scm/tag.rb +9 -12
- data/lib/rubygems/tasks/scm.rb +52 -3
- data/lib/rubygems/tasks/sign/checksum.rb +21 -14
- data/lib/rubygems/tasks/sign/pgp.rb +5 -6
- data/lib/rubygems/tasks/sign/task.rb +4 -2
- data/lib/rubygems/tasks/sign.rb +42 -2
- data/lib/rubygems/tasks/task.rb +4 -2
- data/lib/rubygems/tasks.rb +67 -66
- data/spec/build_spec.rb +72 -0
- data/spec/console_spec.rb +15 -15
- data/spec/install_spec.rb +1 -1
- data/spec/project_spec.rb +19 -19
- data/spec/push_spec.rb +15 -3
- data/spec/scm/push_spec.rb +6 -6
- data/spec/scm/status_spec.rb +8 -12
- data/spec/scm/tag_spec.rb +18 -28
- data/spec/scm_spec.rb +72 -0
- data/spec/sign/pgp_spec.rb +1 -1
- data/spec/sign_spec.rb +52 -0
- data/spec/tasks_spec.rb +20 -169
- metadata +15 -15
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4c796aef54b6d54c6c4afcf50f0588ee2204a5fae8527cee9c4a53f1881bf32d
|
|
4
|
+
data.tar.gz: 275002c2d14b8d6198c23cafb9a348742117fb32addcec9bb9ce879a18d57161
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 322f40592b51da34f2d6c651214b84b8d5a2e97d49bf9e4b30a1c8a808a2e50698058544e65ff5904edee1ffd13fbc639e211d0132dc12610c9732a117349fa7
|
|
7
|
+
data.tar.gz: b8ecbb198b85d8163ea41c591b8c00efab9ad3c007946316743c35918c166078c5d4a20ee8df3da4496027dd2cd5e3aaa22f79998e21df5250b5a5d7bd240cb8
|
data/.github/workflows/ruby.yml
CHANGED
data/ChangeLog.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
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
|
+
|
|
1
16
|
### 0.2.6 / 2023-09-07
|
|
2
17
|
|
|
3
18
|
* Fixed `rake install` so that it runs `gem install -q pkg/...` outside of the
|
data/Gemfile
CHANGED
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
|
@@ -4,125 +4,158 @@
|
|
|
4
4
|
[](https://codeclimate.com/github/postmodern/rubygems-tasks)
|
|
5
5
|
|
|
6
6
|
* [Source](https://github.com/postmodern/rubygems-tasks)
|
|
7
|
-
* [
|
|
8
|
-
|
|
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)
|
|
9
10
|
|
|
10
11
|
## Description
|
|
11
12
|
|
|
12
|
-
rubygems-tasks provides
|
|
13
|
-
|
|
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.
|
|
14
16
|
|
|
15
|
-
|
|
16
|
-
Gem::Tasks.new
|
|
17
|
+
## Features
|
|
17
18
|
|
|
18
|
-
|
|
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.
|
|
19
33
|
|
|
20
|
-
|
|
21
|
-
to the project generator which you used to create the project.
|
|
22
|
-
Project generators have nothing to do with the Rake tasks used to build,
|
|
23
|
-
install and release a Ruby project.
|
|
34
|
+
## Requirements
|
|
24
35
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
forgetting to tag the release. Ruby Developers should have access to
|
|
29
|
-
**agnostic** and **unobtrusive** Rake tasks, to **automate** the release
|
|
30
|
-
process.
|
|
36
|
+
* [ruby] >= 2.0.0
|
|
37
|
+
* [rake] >= 10.0.0
|
|
38
|
+
* [irb] ~> 1.0
|
|
31
39
|
|
|
32
|
-
|
|
40
|
+
## Install
|
|
33
41
|
|
|
34
|
-
|
|
42
|
+
1. Add the following to the `Gemfile`:
|
|
35
43
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
* Supports pushing gems to alternate [gem server]s.
|
|
40
|
-
* Supports optionally building `.tar.gz` and `.zip` archives.
|
|
41
|
-
* `build:tar`
|
|
42
|
-
* `build:zip`
|
|
43
|
-
* Supports [Git], [Mercurial] and [SubVersion] Source-Code-Managers
|
|
44
|
-
(SCMs).
|
|
45
|
-
* Supports creating PGP signed Git/Mercurial tags.
|
|
46
|
-
* Provides optional `sign` tasks for package integrity:
|
|
47
|
-
* `sign:checksum`
|
|
48
|
-
* `sign:pgp`
|
|
49
|
-
* Provides a `console` task, for jumping right into your code.
|
|
50
|
-
* Defines task aliases for users coming from [Jeweler] or [Hoe].
|
|
51
|
-
* ANSI coloured messages!
|
|
52
|
-
|
|
53
|
-
## Anti-Features
|
|
54
|
-
|
|
55
|
-
* **Does not** parse project metadata from the README or the ChangeLog.
|
|
56
|
-
* **Does not** generate or modify code.
|
|
57
|
-
* **Does not** automatically commit changes.
|
|
58
|
-
* **Does not** inject dependencies into gems.
|
|
59
|
-
* **Zero** dependencies.
|
|
44
|
+
```ruby
|
|
45
|
+
gem 'rubygems-tasks', '~> 0.3', require: false
|
|
46
|
+
```
|
|
60
47
|
|
|
61
|
-
|
|
48
|
+
2. Add the following to the `Rakefile`:
|
|
62
49
|
|
|
63
|
-
|
|
64
|
-
|
|
50
|
+
```ruby
|
|
51
|
+
require 'rubygems/tasks'
|
|
52
|
+
Gem::Tasks.new
|
|
53
|
+
```
|
|
65
54
|
|
|
66
|
-
##
|
|
55
|
+
## Synopsis
|
|
67
56
|
|
|
68
|
-
|
|
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
|
+
```
|
|
69
89
|
|
|
70
90
|
## Examples
|
|
71
91
|
|
|
72
|
-
|
|
92
|
+
Default configuration:
|
|
73
93
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
94
|
+
```ruby
|
|
95
|
+
require 'rubygems/tasks'
|
|
96
|
+
Gem::Tasks.new
|
|
97
|
+
```
|
|
77
98
|
|
|
78
|
-
|
|
99
|
+
Change the Ruby REPL for the `console` [Rake] task:
|
|
79
100
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
101
|
+
```ruby
|
|
102
|
+
Gem::Tasks.new do |tasks|
|
|
103
|
+
tasks.console.command = 'pry'
|
|
104
|
+
end
|
|
105
|
+
```
|
|
83
106
|
|
|
84
|
-
|
|
107
|
+
Enable pushing gems to an internal [gem server] instead of [rubygems.org]:
|
|
85
108
|
|
|
86
|
-
|
|
109
|
+
```ruby
|
|
110
|
+
Gem::Tasks.new do |tasks|
|
|
111
|
+
tasks.push.host = 'gems.company.internal'
|
|
112
|
+
end
|
|
113
|
+
```
|
|
87
114
|
|
|
88
|
-
|
|
115
|
+
Disable the `push` [Rake] task:
|
|
89
116
|
|
|
90
|
-
|
|
117
|
+
```ruby
|
|
118
|
+
Gem::Tasks.new(push: false)
|
|
119
|
+
```
|
|
91
120
|
|
|
92
|
-
Enable
|
|
121
|
+
Enable building `.tar.gz` and `.zip` source archives, in addition to the `.gem`
|
|
122
|
+
package:
|
|
93
123
|
|
|
94
|
-
|
|
124
|
+
```ruby
|
|
125
|
+
Gem::Tasks.new(build: {tar: true, zip: true})
|
|
126
|
+
```
|
|
95
127
|
|
|
96
|
-
|
|
128
|
+
Enable generating checksums and PGP signatures for built packages:
|
|
97
129
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
Gem::Tasks::Sign::Checksum.new
|
|
102
|
-
Gem::Tasks::Console.new
|
|
130
|
+
```ruby
|
|
131
|
+
Gem::Tasks.new(sign: {checksum: true, pgp: true})
|
|
132
|
+
```
|
|
103
133
|
|
|
104
|
-
|
|
134
|
+
Selectively defining specific [Rake] tasks:
|
|
105
135
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
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
|
+
```
|
|
110
143
|
|
|
111
144
|
## Copyright
|
|
112
145
|
|
|
113
|
-
Copyright (c) 2011-
|
|
146
|
+
Copyright (c) 2011-2025 Hal Brodigan
|
|
114
147
|
|
|
115
148
|
See {file:LICENSE.txt} for details.
|
|
116
149
|
|
|
117
|
-
[Git]:
|
|
118
|
-
[Mercurial]:
|
|
119
|
-
[SubVersion]:
|
|
150
|
+
[Git]: https://git-scm.com/
|
|
151
|
+
[Mercurial]: https://www.mercurial-scm.org/
|
|
152
|
+
[SubVersion]: https://subversion.apache.org/
|
|
120
153
|
|
|
121
|
-
[
|
|
122
|
-
[Hoe]: https://github.com/seattlerb/hoe#readme
|
|
154
|
+
[Rake]: https://github.com/ruby/rake#readme
|
|
123
155
|
|
|
124
156
|
[rubygems.org]: https://rubygems.org/
|
|
125
157
|
[gem server]: https://github.com/rubygems/rubygems.org#readme
|
|
126
158
|
|
|
127
159
|
[ruby]: https://www.ruby-lang.org/
|
|
128
160
|
[rake]: https://rubygems.org/gems/rake
|
|
161
|
+
[irb]: https://rubygems.org/gems/irb
|
data/gemspec.yml
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
name: rubygems-tasks
|
|
2
|
-
version: 0.
|
|
3
|
-
summary: Rake tasks for
|
|
2
|
+
version: 0.3.0
|
|
3
|
+
summary: Rake tasks for building and releasing Ruby Gems.
|
|
4
4
|
description: |
|
|
5
|
-
|
|
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
|
|
@@ -23,4 +25,4 @@ dependencies:
|
|
|
23
25
|
irb: ~> 1.0
|
|
24
26
|
|
|
25
27
|
development_dependencies:
|
|
26
|
-
bundler:
|
|
28
|
+
bundler: ">= 2.0.0"
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative 'task'
|
|
2
4
|
|
|
3
5
|
module Gem
|
|
4
6
|
class Tasks
|
|
5
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative 'task'
|
|
2
4
|
|
|
3
5
|
module Gem
|
|
4
6
|
class Tasks
|
|
5
|
-
|
|
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
|
-
|
|
15
|
-
# Additional options.
|
|
16
|
-
#
|
|
17
|
-
def initialize(options={})
|
|
16
|
+
def initialize
|
|
18
17
|
super()
|
|
19
18
|
|
|
20
19
|
yield self if block_given?
|
data/lib/rubygems/tasks/build.rb
CHANGED
|
@@ -1,3 +1,61 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
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 [
|
|
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
|
-
# @
|
|
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 =
|
|
38
|
-
@options =
|
|
40
|
+
@command = command
|
|
41
|
+
@options = options
|
|
39
42
|
|
|
40
43
|
yield self if block_given?
|
|
41
44
|
define
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
14
|
-
# Additional options.
|
|
15
|
-
#
|
|
16
|
-
def initialize(options={})
|
|
15
|
+
def initialize
|
|
17
16
|
super()
|
|
18
17
|
|
|
19
18
|
yield self if block_given?
|
data/lib/rubygems/tasks/push.rb
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative 'task'
|
|
2
4
|
|
|
3
5
|
module Gem
|
|
4
6
|
class Tasks
|
|
@@ -8,21 +10,31 @@ module Gem
|
|
|
8
10
|
class Push < Task
|
|
9
11
|
|
|
10
12
|
# The rubygems host to push gems to.
|
|
13
|
+
#
|
|
14
|
+
# @return [String, nil]
|
|
11
15
|
attr_accessor :host
|
|
12
16
|
|
|
17
|
+
# The rubygems API key.
|
|
13
18
|
#
|
|
14
|
-
#
|
|
19
|
+
# @return [String, nil]
|
|
15
20
|
#
|
|
16
|
-
# @
|
|
17
|
-
|
|
21
|
+
# @since 0.3.0
|
|
22
|
+
attr_accessor :key
|
|
23
|
+
|
|
18
24
|
#
|
|
19
|
-
#
|
|
25
|
+
# Initializes the `push` task.
|
|
26
|
+
#
|
|
27
|
+
# @param [String, nil] host
|
|
20
28
|
# The rubygems host to push gems to.
|
|
21
29
|
#
|
|
22
|
-
|
|
30
|
+
# @param [String, nil] key
|
|
31
|
+
# An optional rubygems API key.
|
|
32
|
+
#
|
|
33
|
+
def initialize(host: nil, key: nil)
|
|
23
34
|
super()
|
|
24
35
|
|
|
25
|
-
@host =
|
|
36
|
+
@host = host
|
|
37
|
+
@key = key
|
|
26
38
|
|
|
27
39
|
yield self if block_given?
|
|
28
40
|
define
|
|
@@ -69,6 +81,7 @@ module Gem
|
|
|
69
81
|
#
|
|
70
82
|
def push(path)
|
|
71
83
|
arguments = ['gem', 'push', path]
|
|
84
|
+
arguments.push('--key', @key) if @key
|
|
72
85
|
arguments.push('--host', @host) if @host
|
|
73
86
|
|
|
74
87
|
return run(*arguments)
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
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 `release` task.
|
|
12
14
|
#
|
|
13
|
-
|
|
14
|
-
# Additional options for the `release` task.
|
|
15
|
-
#
|
|
16
|
-
def initialize(options={})
|
|
15
|
+
def initialize
|
|
17
16
|
super()
|
|
18
17
|
|
|
19
18
|
yield self if block_given?
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative '../task'
|
|
2
4
|
|
|
3
5
|
module Gem
|
|
4
6
|
class Tasks
|
|
5
|
-
|
|
7
|
+
class SCM
|
|
6
8
|
#
|
|
7
9
|
# The `scm:push` task.
|
|
8
10
|
#
|
|
@@ -11,10 +13,7 @@ module Gem
|
|
|
11
13
|
#
|
|
12
14
|
# Initializes the `scm:push` task.
|
|
13
15
|
#
|
|
14
|
-
|
|
15
|
-
# Additional options.
|
|
16
|
-
#
|
|
17
|
-
def initialize(options={})
|
|
16
|
+
def initialize
|
|
18
17
|
super()
|
|
19
18
|
|
|
20
19
|
yield self if block_given?
|