rubygems-tasks 0.2.4 → 0.2.6
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 +7 -0
- data/.github/workflows/ruby.yml +27 -0
- data/.gitignore +4 -3
- data/.travis.yml +9 -0
- data/ChangeLog.md +13 -0
- data/Gemfile +10 -0
- data/LICENSE.txt +1 -1
- data/README.md +23 -12
- data/Rakefile +7 -66
- data/gemspec.yml +16 -4
- data/lib/rubygems/tasks/build/gem.rb +0 -2
- data/lib/rubygems/tasks/build/tar.rb +0 -2
- data/lib/rubygems/tasks/build/task.rb +9 -14
- data/lib/rubygems/tasks/console.rb +1 -4
- data/lib/rubygems/tasks/install.rb +1 -1
- data/lib/rubygems/tasks/project.rb +3 -3
- data/lib/rubygems/tasks/push.rb +2 -2
- data/lib/rubygems/tasks/sign/checksum.rb +3 -2
- data/lib/rubygems/tasks/sign/pgp.rb +1 -1
- data/lib/rubygems/tasks/sign/task.rb +13 -17
- data/lib/rubygems/tasks/task.rb +14 -8
- data/lib/rubygems/tasks.rb +140 -2
- data/rubygems-tasks.gemspec +39 -87
- data/spec/console_spec.rb +43 -20
- data/spec/install_spec.rb +5 -1
- data/spec/project_spec.rb +30 -27
- data/spec/projects/bundler-project/.gitignore +17 -0
- data/spec/projects/bundler-project/Gemfile +4 -0
- data/spec/projects/bundler-project/LICENSE +22 -0
- data/spec/projects/bundler-project/README.md +29 -0
- data/spec/projects/bundler-project/Rakefile +2 -0
- data/spec/projects/bundler-project/bundler-project.gemspec +19 -0
- data/spec/projects/bundler-project/lib/bundler-project/version.rb +5 -0
- data/spec/projects/bundler-project/lib/bundler-project.rb +7 -0
- data/spec/projects/rubygems-multi-project/.gitignore +17 -0
- data/spec/projects/rubygems-multi-project/LICENSE.txt +22 -0
- data/spec/projects/rubygems-multi-project/README.md +21 -0
- data/spec/projects/rubygems-multi-project/lib/rubygems/project/version.rb +5 -0
- data/spec/projects/rubygems-multi-project/rubygems-project-lite.gemspec +19 -0
- data/spec/projects/rubygems-multi-project/rubygems-project.gemspec +19 -0
- data/spec/projects/rubygems-project/.gitignore +17 -0
- data/spec/projects/rubygems-project/LICENSE.txt +22 -0
- data/spec/projects/rubygems-project/README.md +21 -0
- data/spec/projects/rubygems-project/lib/rubygems/project/version.rb +5 -0
- data/spec/projects/rubygems-project/rubygems-project.gemspec +19 -0
- data/spec/push_spec.rb +2 -2
- data/spec/rake_context.rb +1 -3
- data/spec/scm/push_spec.rb +7 -7
- data/spec/scm/status_spec.rb +6 -6
- data/spec/scm/tag_spec.rb +18 -18
- data/spec/sign/pgp_spec.rb +1 -1
- data/spec/spec_helper.rb +25 -8
- data/spec/tasks_spec.rb +171 -55
- metadata +99 -87
- data/lib/rubygems/tasks/tasks.rb +0 -147
data/spec/tasks_spec.rb
CHANGED
@@ -1,127 +1,243 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
require 'rake_context'
|
3
3
|
|
4
|
-
require 'rubygems/tasks
|
4
|
+
require 'rubygems/tasks'
|
5
5
|
|
6
6
|
describe Gem::Tasks do
|
7
7
|
describe "#initialize" do
|
8
8
|
context "default options" do
|
9
9
|
include_context "rake"
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
11
|
+
describe '#build' do
|
12
|
+
subject { super().build }
|
13
|
+
it { is_expected.to be_kind_of(OpenStruct) }
|
14
|
+
|
15
|
+
describe '#build.gem' do
|
16
|
+
subject { super().gem }
|
17
|
+
it { is_expected.to be_kind_of(Gem::Tasks::Build::Gem) }
|
18
|
+
end
|
19
|
+
|
20
|
+
describe '#build.tar' do
|
21
|
+
subject { super().tar }
|
22
|
+
it { is_expected.to be_nil }
|
23
|
+
end
|
24
|
+
|
25
|
+
describe '#build.zip' do
|
26
|
+
subject { super().zip }
|
27
|
+
it { is_expected.to be_nil }
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
describe '#scm' do
|
32
|
+
subject { super().scm }
|
33
|
+
it { is_expected.to be_kind_of(OpenStruct) }
|
34
|
+
|
35
|
+
describe '#scm.status' do
|
36
|
+
subject { super().status }
|
37
|
+
it { is_expected.to be_kind_of(Gem::Tasks::SCM::Status) }
|
38
|
+
end
|
39
|
+
|
40
|
+
describe '#scm.push' do
|
41
|
+
subject { super().push }
|
42
|
+
it { is_expected.to be_kind_of(Gem::Tasks::SCM::Push) }
|
43
|
+
end
|
44
|
+
|
45
|
+
describe '#scm.tag' do
|
46
|
+
subject { super().tag }
|
47
|
+
it { is_expected.to be_kind_of(Gem::Tasks::SCM::Tag) }
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
describe '#sign' do
|
52
|
+
subject { super().sign }
|
53
|
+
it { is_expected.to be_kind_of(OpenStruct) }
|
54
|
+
|
55
|
+
describe '#checksum' do
|
56
|
+
subject { super().checksum }
|
57
|
+
it { is_expected.to be_nil }
|
58
|
+
end
|
59
|
+
|
60
|
+
describe '#pgp' do
|
61
|
+
subject { super().pgp }
|
62
|
+
it { is_expected.to be_nil }
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
describe '#console' do
|
67
|
+
subject { super().console }
|
68
|
+
it { is_expected.to be_kind_of(Gem::Tasks::Console) }
|
69
|
+
end
|
70
|
+
|
71
|
+
describe '#install' do
|
72
|
+
subject { super().install }
|
73
|
+
it { is_expected.to be_kind_of(Gem::Tasks::Install) }
|
74
|
+
end
|
75
|
+
|
76
|
+
describe '#push' do
|
77
|
+
subject { super().push }
|
78
|
+
it { is_expected.to be_kind_of(Gem::Tasks::Push) }
|
79
|
+
end
|
80
|
+
|
81
|
+
describe '#release' do
|
82
|
+
subject { super().release }
|
83
|
+
it { is_expected.to be_kind_of(Gem::Tasks::Release) }
|
84
|
+
end
|
29
85
|
end
|
30
86
|
|
31
|
-
context ":
|
87
|
+
context "build: {gem: false}" do
|
32
88
|
include_context "rake"
|
33
89
|
|
34
|
-
subject { described_class.new(:
|
90
|
+
subject { described_class.new(build: {gem: false}) }
|
35
91
|
|
36
|
-
|
92
|
+
describe '#build' do
|
93
|
+
subject { super().build }
|
94
|
+
describe '#gem' do
|
95
|
+
subject { super().gem }
|
96
|
+
it { is_expected.to be_nil }
|
97
|
+
end
|
98
|
+
end
|
37
99
|
end
|
38
100
|
|
39
|
-
context ":
|
101
|
+
context "build: {tar: true}" do
|
40
102
|
include_context "rake"
|
41
103
|
|
42
|
-
subject { described_class.new(:
|
104
|
+
subject { described_class.new(build: {tar: true}) }
|
43
105
|
|
44
|
-
|
106
|
+
describe '#build' do
|
107
|
+
subject { super().build }
|
108
|
+
describe '#tar' do
|
109
|
+
subject { super().tar }
|
110
|
+
it { is_expected.to be_kind_of(Gem::Tasks::Build::Tar) }
|
111
|
+
end
|
112
|
+
end
|
45
113
|
end
|
46
114
|
|
47
|
-
context ":
|
115
|
+
context "build: {zip: true}" do
|
48
116
|
include_context "rake"
|
49
117
|
|
50
|
-
subject { described_class.new(:
|
118
|
+
subject { described_class.new(build: {zip: true}) }
|
51
119
|
|
52
|
-
|
120
|
+
describe '#build' do
|
121
|
+
subject { super().build }
|
122
|
+
describe '#zip' do
|
123
|
+
subject { super().zip }
|
124
|
+
it { is_expected.to be_kind_of(Gem::Tasks::Build::Zip) }
|
125
|
+
end
|
126
|
+
end
|
53
127
|
end
|
54
128
|
|
55
|
-
context ":
|
129
|
+
context "scm: {status: false}" do
|
56
130
|
include_context "rake"
|
57
131
|
|
58
|
-
subject { described_class.new(:
|
132
|
+
subject { described_class.new(scm: {status: false}) }
|
59
133
|
|
60
|
-
|
134
|
+
describe '#scm' do
|
135
|
+
subject { super().scm }
|
136
|
+
describe '#status' do
|
137
|
+
subject { super().status }
|
138
|
+
it { is_expected.to be_nil }
|
139
|
+
end
|
140
|
+
end
|
61
141
|
end
|
62
142
|
|
63
|
-
context ":
|
143
|
+
context "scm: {push: false}" do
|
64
144
|
include_context "rake"
|
65
145
|
|
66
|
-
subject { described_class.new(:
|
146
|
+
subject { described_class.new(scm: {push: false}) }
|
67
147
|
|
68
|
-
|
148
|
+
describe '#scm' do
|
149
|
+
subject { super().scm }
|
150
|
+
describe '#push' do
|
151
|
+
subject { super().push }
|
152
|
+
it { is_expected.to be_nil }
|
153
|
+
end
|
154
|
+
end
|
69
155
|
end
|
70
156
|
|
71
|
-
context ":
|
157
|
+
context "scm: {tag: false}" do
|
72
158
|
include_context "rake"
|
73
159
|
|
74
|
-
subject { described_class.new(:
|
160
|
+
subject { described_class.new(scm: {tag: false}) }
|
75
161
|
|
76
|
-
|
162
|
+
describe '#scm' do
|
163
|
+
subject { super().scm }
|
164
|
+
describe '#tag' do
|
165
|
+
subject { super().tag }
|
166
|
+
it { is_expected.to be_nil }
|
167
|
+
end
|
168
|
+
end
|
77
169
|
end
|
78
170
|
|
79
|
-
context ":
|
171
|
+
context "sign: {checksum: true}" do
|
80
172
|
include_context "rake"
|
81
173
|
|
82
|
-
subject { described_class.new(:
|
174
|
+
subject { described_class.new(sign: {checksum: true}) }
|
83
175
|
|
84
|
-
|
176
|
+
describe '#sign' do
|
177
|
+
subject { super().sign }
|
178
|
+
describe '#checksum' do
|
179
|
+
subject { super().checksum }
|
180
|
+
it { is_expected.to be_kind_of(Gem::Tasks::Sign::Checksum) }
|
181
|
+
end
|
182
|
+
end
|
85
183
|
end
|
86
184
|
|
87
|
-
context ":
|
185
|
+
context "sign: {pgp: true}" do
|
88
186
|
include_context "rake"
|
89
187
|
|
90
|
-
subject { described_class.new(:
|
188
|
+
subject { described_class.new(sign: {pgp: true}) }
|
91
189
|
|
92
|
-
|
190
|
+
describe '#sign' do
|
191
|
+
subject { super().sign }
|
192
|
+
describe '#pgp' do
|
193
|
+
subject { super().pgp }
|
194
|
+
it { is_expected.to be_kind_of(Gem::Tasks::Sign::PGP) }
|
195
|
+
end
|
196
|
+
end
|
93
197
|
end
|
94
198
|
|
95
|
-
context ":
|
199
|
+
context "console: false" do
|
96
200
|
include_context "rake"
|
97
201
|
|
98
|
-
subject { described_class.new(:
|
202
|
+
subject { described_class.new(console: false) }
|
99
203
|
|
100
|
-
|
204
|
+
describe '#console' do
|
205
|
+
subject { super().console }
|
206
|
+
it { is_expected.to be_nil }
|
207
|
+
end
|
101
208
|
end
|
102
209
|
|
103
|
-
context ":
|
210
|
+
context "install: false" do
|
104
211
|
include_context "rake"
|
105
212
|
|
106
|
-
subject { described_class.new(:
|
213
|
+
subject { described_class.new(install: false) }
|
107
214
|
|
108
|
-
|
215
|
+
describe '#install' do
|
216
|
+
subject { super().install }
|
217
|
+
it { is_expected.to be_nil }
|
218
|
+
end
|
109
219
|
end
|
110
220
|
|
111
|
-
context ":
|
221
|
+
context "push: false" do
|
112
222
|
include_context "rake"
|
113
223
|
|
114
|
-
subject { described_class.new(:
|
224
|
+
subject { described_class.new(push: false) }
|
115
225
|
|
116
|
-
|
226
|
+
describe '#push' do
|
227
|
+
subject { super().push }
|
228
|
+
it { is_expected.to be_nil }
|
229
|
+
end
|
117
230
|
end
|
118
231
|
|
119
|
-
context ":
|
232
|
+
context "release: false" do
|
120
233
|
include_context "rake"
|
121
234
|
|
122
|
-
subject { described_class.new(:
|
235
|
+
subject { described_class.new(release: false) }
|
123
236
|
|
124
|
-
|
237
|
+
describe '#release' do
|
238
|
+
subject { super().release }
|
239
|
+
it { is_expected.to be_nil }
|
240
|
+
end
|
125
241
|
end
|
126
242
|
end
|
127
243
|
end
|
metadata
CHANGED
@@ -1,68 +1,77 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubygems-tasks
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 2
|
9
|
-
- 4
|
10
|
-
version: 0.2.4
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.6
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
6
|
+
authors:
|
13
7
|
- Postmodern
|
14
|
-
autorequire:
|
8
|
+
autorequire:
|
15
9
|
bindir: bin
|
16
10
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
11
|
+
date: 2023-09-07 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rake
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 10.0.0
|
20
|
+
type: :runtime
|
22
21
|
prerelease: false
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
name: yard
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 10.0.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: irb
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.0'
|
34
|
+
type: :runtime
|
37
35
|
prerelease: false
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '2.0'
|
48
48
|
type: :development
|
49
|
-
|
50
|
-
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '2.0'
|
55
|
+
description: 'Agnostic and unobtrusive Rake tasks for managing and releasing Ruby
|
56
|
+
Gems.
|
57
|
+
|
58
|
+
'
|
51
59
|
email: postmodern.mod3@gmail.com
|
52
60
|
executables: []
|
53
|
-
|
54
61
|
extensions: []
|
55
|
-
|
56
|
-
extra_rdoc_files:
|
62
|
+
extra_rdoc_files:
|
57
63
|
- ChangeLog.md
|
58
64
|
- LICENSE.txt
|
59
65
|
- README.md
|
60
|
-
files:
|
61
|
-
- .document
|
62
|
-
- .
|
63
|
-
- .
|
64
|
-
- .
|
66
|
+
files:
|
67
|
+
- ".document"
|
68
|
+
- ".github/workflows/ruby.yml"
|
69
|
+
- ".gitignore"
|
70
|
+
- ".rspec"
|
71
|
+
- ".travis.yml"
|
72
|
+
- ".yardopts"
|
65
73
|
- ChangeLog.md
|
74
|
+
- Gemfile
|
66
75
|
- LICENSE.txt
|
67
76
|
- README.md
|
68
77
|
- Rakefile
|
@@ -88,11 +97,29 @@ files:
|
|
88
97
|
- lib/rubygems/tasks/sign/pgp.rb
|
89
98
|
- lib/rubygems/tasks/sign/task.rb
|
90
99
|
- lib/rubygems/tasks/task.rb
|
91
|
-
- lib/rubygems/tasks/tasks.rb
|
92
100
|
- rubygems-tasks.gemspec
|
93
101
|
- spec/console_spec.rb
|
94
102
|
- spec/install_spec.rb
|
95
103
|
- spec/project_spec.rb
|
104
|
+
- spec/projects/bundler-project/.gitignore
|
105
|
+
- spec/projects/bundler-project/Gemfile
|
106
|
+
- spec/projects/bundler-project/LICENSE
|
107
|
+
- spec/projects/bundler-project/README.md
|
108
|
+
- spec/projects/bundler-project/Rakefile
|
109
|
+
- spec/projects/bundler-project/bundler-project.gemspec
|
110
|
+
- spec/projects/bundler-project/lib/bundler-project.rb
|
111
|
+
- spec/projects/bundler-project/lib/bundler-project/version.rb
|
112
|
+
- spec/projects/rubygems-multi-project/.gitignore
|
113
|
+
- spec/projects/rubygems-multi-project/LICENSE.txt
|
114
|
+
- spec/projects/rubygems-multi-project/README.md
|
115
|
+
- spec/projects/rubygems-multi-project/lib/rubygems/project/version.rb
|
116
|
+
- spec/projects/rubygems-multi-project/rubygems-project-lite.gemspec
|
117
|
+
- spec/projects/rubygems-multi-project/rubygems-project.gemspec
|
118
|
+
- spec/projects/rubygems-project/.gitignore
|
119
|
+
- spec/projects/rubygems-project/LICENSE.txt
|
120
|
+
- spec/projects/rubygems-project/README.md
|
121
|
+
- spec/projects/rubygems-project/lib/rubygems/project/version.rb
|
122
|
+
- spec/projects/rubygems-project/rubygems-project.gemspec
|
96
123
|
- spec/push_spec.rb
|
97
124
|
- spec/rake_context.rb
|
98
125
|
- spec/scm/push_spec.rb
|
@@ -102,45 +129,30 @@ files:
|
|
102
129
|
- spec/spec_helper.rb
|
103
130
|
- spec/tasks_spec.rb
|
104
131
|
homepage: https://github.com/postmodern/rubygems-tasks#readme
|
105
|
-
licenses:
|
106
|
-
|
107
|
-
|
132
|
+
licenses:
|
133
|
+
- MIT
|
134
|
+
metadata:
|
135
|
+
documentation_uri: https://rubydoc.info/gems/rubygems-tasks
|
136
|
+
source_code_uri: https://github.com/postmodern/rubygems-tasks
|
137
|
+
bug_tracker_uri: https://github.com/postmodern/rubygems-tasks/issues
|
138
|
+
changelog_uri: https://github.com/postmodern/rubygems-tasks/blob/master/ChangeLog.md
|
139
|
+
post_install_message:
|
108
140
|
rdoc_options: []
|
109
|
-
|
110
|
-
require_paths:
|
141
|
+
require_paths:
|
111
142
|
- lib
|
112
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
113
|
-
|
114
|
-
requirements:
|
143
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
144
|
+
requirements:
|
115
145
|
- - ">="
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
version: "0"
|
121
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
122
|
-
none: false
|
123
|
-
requirements:
|
146
|
+
- !ruby/object:Gem::Version
|
147
|
+
version: 2.0.0
|
148
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
124
150
|
- - ">="
|
125
|
-
- !ruby/object:Gem::Version
|
126
|
-
|
127
|
-
segments:
|
128
|
-
- 0
|
129
|
-
version: "0"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
130
153
|
requirements: []
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
signing_key:
|
135
|
-
specification_version: 3
|
154
|
+
rubygems_version: 3.4.10
|
155
|
+
signing_key:
|
156
|
+
specification_version: 4
|
136
157
|
summary: Rake tasks for managing and releasing Ruby Gems.
|
137
|
-
test_files:
|
138
|
-
- spec/console_spec.rb
|
139
|
-
- spec/install_spec.rb
|
140
|
-
- spec/project_spec.rb
|
141
|
-
- spec/push_spec.rb
|
142
|
-
- spec/scm/push_spec.rb
|
143
|
-
- spec/scm/status_spec.rb
|
144
|
-
- spec/scm/tag_spec.rb
|
145
|
-
- spec/sign/pgp_spec.rb
|
146
|
-
- spec/tasks_spec.rb
|
158
|
+
test_files: []
|
data/lib/rubygems/tasks/tasks.rb
DELETED
@@ -1,147 +0,0 @@
|
|
1
|
-
require 'rubygems/tasks/console'
|
2
|
-
require 'rubygems/tasks/build'
|
3
|
-
require 'rubygems/tasks/install'
|
4
|
-
require 'rubygems/tasks/scm'
|
5
|
-
require 'rubygems/tasks/push'
|
6
|
-
require 'rubygems/tasks/release'
|
7
|
-
require 'rubygems/tasks/sign'
|
8
|
-
|
9
|
-
require 'rake/tasklib'
|
10
|
-
require 'ostruct'
|
11
|
-
|
12
|
-
module Gem
|
13
|
-
#
|
14
|
-
# Defines basic Rake tasks for managing and releasing projects:
|
15
|
-
#
|
16
|
-
# * {Build::Gem build:gem}
|
17
|
-
# * {Build::Tar build:tar}
|
18
|
-
# * {Build::Zip build:zip}
|
19
|
-
# * {SCM::Status scm:status}
|
20
|
-
# * {SCM::Push scm:push}
|
21
|
-
# * {SCM::Tag scm:tag}
|
22
|
-
# * {Console console}
|
23
|
-
# * {Install install}
|
24
|
-
# * {Push push}
|
25
|
-
# * {Release release}
|
26
|
-
# * {Sign::Checksum sign:checksum}
|
27
|
-
# * {Sign::PGP sign:pgp}
|
28
|
-
#
|
29
|
-
class Tasks
|
30
|
-
|
31
|
-
#
|
32
|
-
# The `build` tasks.
|
33
|
-
#
|
34
|
-
# @return [OpenStruct]
|
35
|
-
# The collection of `build` tasks.
|
36
|
-
#
|
37
|
-
attr_reader :build
|
38
|
-
|
39
|
-
#
|
40
|
-
# The `scm` tasks.
|
41
|
-
#
|
42
|
-
# @return [OpenStruct]
|
43
|
-
# The collection of `scm` tasks.
|
44
|
-
#
|
45
|
-
attr_reader :scm
|
46
|
-
|
47
|
-
#
|
48
|
-
# The `sign` tasks.
|
49
|
-
#
|
50
|
-
# @return [OpenStruct]
|
51
|
-
# The collection of `sign` tasks.
|
52
|
-
#
|
53
|
-
attr_reader :sign
|
54
|
-
|
55
|
-
# The {Console console} task.
|
56
|
-
attr_reader :console
|
57
|
-
|
58
|
-
# The {Install install} task.
|
59
|
-
attr_reader :install
|
60
|
-
|
61
|
-
# The {Push push} task.
|
62
|
-
attr_reader :push
|
63
|
-
|
64
|
-
# The {Release release} task.
|
65
|
-
attr_reader :release
|
66
|
-
|
67
|
-
#
|
68
|
-
# Initializes the project tasks.
|
69
|
-
#
|
70
|
-
# @param [Hash{Symbol => Hash}] options
|
71
|
-
# Enables or disables individual tasks.
|
72
|
-
#
|
73
|
-
# @option options [Hash{Symbol => Boolean}] :build
|
74
|
-
# Enables or disables the `build` tasks.
|
75
|
-
#
|
76
|
-
# @option options [Hash{Symbol => Boolean}] :scm
|
77
|
-
# Enables or disables the `scm` tasks.
|
78
|
-
#
|
79
|
-
# @option options [Boolean] :console (true)
|
80
|
-
# Enables or disables the {Console console} task.
|
81
|
-
#
|
82
|
-
# @option options [Boolean] :install (true)
|
83
|
-
# Enables or disables the {Install install} task.
|
84
|
-
#
|
85
|
-
# @option options [Boolean] :push (true)
|
86
|
-
# Enables or disables the {Push push} task.
|
87
|
-
#
|
88
|
-
# @option options [Boolean] :release (true)
|
89
|
-
# Enables or disables the {Release release} task.
|
90
|
-
#
|
91
|
-
# @option options [Hash{Symbol => Boolean}] :sign
|
92
|
-
# Enables or disables the `sign` tasks.
|
93
|
-
#
|
94
|
-
# @yield [tasks]
|
95
|
-
# If a block is given, it will be passed the newly created tasks,
|
96
|
-
# before they are fully defined.
|
97
|
-
#
|
98
|
-
# @yieldparam [Tasks] tasks
|
99
|
-
# The newly created tasks.
|
100
|
-
#
|
101
|
-
# @example Enables building of `.gem` and `.tar.gz` packages:
|
102
|
-
# Gem::Tasks.new(:build => {:gem => true, :tar => true})
|
103
|
-
#
|
104
|
-
# @example Disables pushing `.gem` packages to [rubygems.org](rubygems.org):
|
105
|
-
# Gem::Tasks.new(:push => false)
|
106
|
-
#
|
107
|
-
# @example Configures the version tag format:
|
108
|
-
# Gem::Tasks.new do |tasks|
|
109
|
-
# tasks.scm.tag.format = "release-%s"
|
110
|
-
# end
|
111
|
-
#
|
112
|
-
def initialize(options={})
|
113
|
-
build_options = options.fetch(:build,{})
|
114
|
-
scm_options = options.fetch(:scm,{})
|
115
|
-
sign_options = options.fetch(:sign,{})
|
116
|
-
|
117
|
-
@scm = OpenStruct.new
|
118
|
-
@build = OpenStruct.new
|
119
|
-
@sign = OpenStruct.new
|
120
|
-
|
121
|
-
if build_options
|
122
|
-
@build.gem = (Build::Gem.new if build_options.fetch(:gem,true))
|
123
|
-
@build.tar = (Build::Tar.new if build_options[:tar])
|
124
|
-
@build.zip = (Build::Zip.new if build_options[:zip])
|
125
|
-
end
|
126
|
-
|
127
|
-
if scm_options
|
128
|
-
@scm.status = (SCM::Status.new if scm_options.fetch(:status,true))
|
129
|
-
@scm.tag = (SCM::Tag.new if scm_options.fetch(:tag,true))
|
130
|
-
@scm.push = (SCM::Push.new if scm_options.fetch(:push,true))
|
131
|
-
end
|
132
|
-
|
133
|
-
if sign_options
|
134
|
-
@sign.checksum = (Sign::Checksum.new if sign_options[:checksum])
|
135
|
-
@sign.pgp = (Sign::PGP.new if sign_options[:pgp])
|
136
|
-
end
|
137
|
-
|
138
|
-
@console = (Console.new if options.fetch(:console,true))
|
139
|
-
@install = (Install.new if options.fetch(:install,true))
|
140
|
-
@push = (Push.new if options.fetch(:push,true))
|
141
|
-
@release = (Release.new if options.fetch(:release,true))
|
142
|
-
|
143
|
-
yield self if block_given?
|
144
|
-
end
|
145
|
-
|
146
|
-
end
|
147
|
-
end
|