rubygems-tasks 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +0 -1
  3. data/.travis.yml +9 -0
  4. data/ChangeLog.md +8 -0
  5. data/LICENSE.txt +1 -1
  6. data/README.md +22 -12
  7. data/Rakefile +4 -49
  8. data/gemspec.yml +10 -4
  9. data/lib/rubygems/tasks.rb +140 -2
  10. data/lib/rubygems/tasks/build/gem.rb +0 -2
  11. data/lib/rubygems/tasks/build/tar.rb +0 -2
  12. data/lib/rubygems/tasks/build/task.rb +9 -14
  13. data/lib/rubygems/tasks/console.rb +0 -3
  14. data/lib/rubygems/tasks/install.rb +1 -1
  15. data/lib/rubygems/tasks/project.rb +3 -3
  16. data/lib/rubygems/tasks/push.rb +2 -2
  17. data/lib/rubygems/tasks/sign/checksum.rb +3 -2
  18. data/lib/rubygems/tasks/sign/pgp.rb +1 -1
  19. data/lib/rubygems/tasks/sign/task.rb +13 -17
  20. data/lib/rubygems/tasks/task.rb +7 -7
  21. data/rubygems-tasks.gemspec +38 -87
  22. data/spec/console_spec.rb +10 -14
  23. data/spec/install_spec.rb +1 -1
  24. data/spec/project_spec.rb +30 -27
  25. data/spec/projects/bundler-project/.gitignore +17 -0
  26. data/spec/projects/bundler-project/Gemfile +4 -0
  27. data/spec/projects/bundler-project/LICENSE +22 -0
  28. data/spec/projects/bundler-project/README.md +29 -0
  29. data/spec/projects/bundler-project/Rakefile +2 -0
  30. data/spec/projects/bundler-project/bundler-project.gemspec +19 -0
  31. data/spec/projects/bundler-project/lib/bundler-project.rb +7 -0
  32. data/spec/projects/bundler-project/lib/bundler-project/version.rb +5 -0
  33. data/spec/projects/rubygems-multi-project/.gitignore +17 -0
  34. data/spec/projects/rubygems-multi-project/LICENSE.txt +22 -0
  35. data/spec/projects/rubygems-multi-project/README.md +21 -0
  36. data/spec/projects/rubygems-multi-project/lib/rubygems/project/version.rb +5 -0
  37. data/spec/projects/rubygems-multi-project/rubygems-project-lite.gemspec +19 -0
  38. data/spec/projects/rubygems-multi-project/rubygems-project.gemspec +19 -0
  39. data/spec/projects/rubygems-project/.gitignore +17 -0
  40. data/spec/projects/rubygems-project/LICENSE.txt +22 -0
  41. data/spec/projects/rubygems-project/README.md +21 -0
  42. data/spec/projects/rubygems-project/lib/rubygems/project/version.rb +5 -0
  43. data/spec/projects/rubygems-project/rubygems-project.gemspec +19 -0
  44. data/spec/push_spec.rb +2 -2
  45. data/spec/rake_context.rb +1 -3
  46. data/spec/scm/push_spec.rb +7 -7
  47. data/spec/scm/status_spec.rb +6 -6
  48. data/spec/scm/tag_spec.rb +18 -18
  49. data/spec/sign/pgp_spec.rb +1 -1
  50. data/spec/spec_helper.rb +25 -8
  51. data/spec/tasks_spec.rb +195 -55
  52. metadata +89 -83
  53. data/lib/rubygems/tasks/tasks.rb +0 -147
@@ -10,7 +10,7 @@ describe Gem::Tasks::Sign::PGP do
10
10
  let(:path) { File.join('pkg','foo-1.2.3.gem') }
11
11
 
12
12
  it "should run `gpg --sign --detach-sign --armor ...`" do
13
- subject.should_receive(:run).with(
13
+ expect(subject).to receive(:run).with(
14
14
  'gpg', '--sign', '--detach-sign', '--armor', path
15
15
  )
16
16
 
@@ -1,12 +1,29 @@
1
- gem 'rspec', '~> 2.4'
2
1
  require 'rspec'
2
+ require 'fileutils'
3
+ require 'tmpdir'
3
4
 
4
- PROJECTS_DIR = File.join('data','projects')
5
- PROJECT_DIRS = lambda { |name| File.join(PROJECTS_DIR,name) }
5
+ # clear the $RUBYCONSOLE env variable
6
+ ENV.delete('RUBYCONSOLE')
6
7
 
7
- unless File.directory?(PROJECTS_DIR)
8
- abort "Please run `rake data:projects` before running the specs!"
9
- end
8
+ RSpec.configure do |rspec|
9
+ rspec.before(:suite) do
10
+ PROJECTS_DIR = Dir.mktmpdir('rubygems-tasks')
10
11
 
11
- # clear the $RUBYCONSOLE env variable
12
- ENV['RUBYCONSOLE'] = nil
12
+ Dir[File.join(File.dirname(__FILE__),'projects','*')].each do |src|
13
+ dest = File.join(PROJECTS_DIR,File.basename(src))
14
+
15
+ FileUtils.cp_r(src,dest)
16
+ Dir.chdir(dest) do
17
+ system 'git init -q'
18
+ system 'git config --local user.email test@example.com'
19
+ system 'git config --local user.name Test'
20
+ system 'git add .'
21
+ system 'git commit -q -a -m "Initial commit"'
22
+ end
23
+ end
24
+ end
25
+
26
+ rspec.after(:suite) do
27
+ FileUtils.rm_rf(PROJECTS_DIR)
28
+ end
29
+ end
@@ -1,127 +1,267 @@
1
1
  require 'spec_helper'
2
2
  require 'rake_context'
3
3
 
4
- require 'rubygems/tasks/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
- its(:build) { should be_kind_of(OpenStruct) }
12
- its('build.gem') { should be_kind_of(Gem::Tasks::Build::Gem) }
13
- its('build.tar') { should be_nil }
14
- its('build.zip') { should be_nil }
15
-
16
- its(:scm) { should be_kind_of(OpenStruct) }
17
- its('scm.status') { should be_kind_of(Gem::Tasks::SCM::Status) }
18
- its('scm.push') { should be_kind_of(Gem::Tasks::SCM::Push) }
19
- its('scm.tag') { should be_kind_of(Gem::Tasks::SCM::Tag) }
20
-
21
- its(:sign) { should be_kind_of(OpenStruct) }
22
- its('sign.checksum') { should be_nil }
23
- its('sign.pgp') { should be_nil }
24
-
25
- its(:console) { should be_kind_of(Gem::Tasks::Console) }
26
- its(:install) { should be_kind_of(Gem::Tasks::Install) }
27
- its(:push) { should be_kind_of(Gem::Tasks::Push) }
28
- its(:release) { should be_kind_of(Gem::Tasks::Release) }
11
+ describe '#build' do
12
+ subject { super().build }
13
+ it { is_expected.to be_kind_of(OpenStruct) }
14
+ end
15
+
16
+ describe '#build' do
17
+ subject { super().build }
18
+ describe '#gem' do
19
+ subject { super().gem }
20
+ it { is_expected.to be_kind_of(Gem::Tasks::Build::Gem) }
21
+ end
22
+ end
23
+
24
+ describe '#build' do
25
+ subject { super().build }
26
+ describe '#tar' do
27
+ subject { super().tar }
28
+ it { is_expected.to be_nil }
29
+ end
30
+ end
31
+
32
+ describe '#build' do
33
+ subject { super().build }
34
+ describe '#zip' do
35
+ subject { super().zip }
36
+ it { is_expected.to be_nil }
37
+ end
38
+ end
39
+
40
+ describe '#scm' do
41
+ subject { super().scm }
42
+ it { is_expected.to be_kind_of(OpenStruct) }
43
+ end
44
+
45
+ describe '#scm' do
46
+ subject { super().scm }
47
+ describe '#status' do
48
+ subject { super().status }
49
+ it { is_expected.to be_kind_of(Gem::Tasks::SCM::Status) }
50
+ end
51
+ end
52
+
53
+ describe '#scm' do
54
+ subject { super().scm }
55
+ describe '#push' do
56
+ subject { super().push }
57
+ it { is_expected.to be_kind_of(Gem::Tasks::SCM::Push) }
58
+ end
59
+ end
60
+
61
+ describe '#scm' do
62
+ subject { super().scm }
63
+ describe '#tag' do
64
+ subject { super().tag }
65
+ it { is_expected.to be_kind_of(Gem::Tasks::SCM::Tag) }
66
+ end
67
+ end
68
+
69
+ describe '#sign' do
70
+ subject { super().sign }
71
+ it { is_expected.to be_kind_of(OpenStruct) }
72
+ end
73
+
74
+ describe '#sign' do
75
+ subject { super().sign }
76
+ describe '#checksum' do
77
+ subject { super().checksum }
78
+ it { is_expected.to be_nil }
79
+ end
80
+ end
81
+
82
+ describe '#sign' do
83
+ subject { super().sign }
84
+ describe '#pgp' do
85
+ subject { super().pgp }
86
+ it { is_expected.to be_nil }
87
+ end
88
+ end
89
+
90
+ describe '#console' do
91
+ subject { super().console }
92
+ it { is_expected.to be_kind_of(Gem::Tasks::Console) }
93
+ end
94
+
95
+ describe '#install' do
96
+ subject { super().install }
97
+ it { is_expected.to be_kind_of(Gem::Tasks::Install) }
98
+ end
99
+
100
+ describe '#push' do
101
+ subject { super().push }
102
+ it { is_expected.to be_kind_of(Gem::Tasks::Push) }
103
+ end
104
+
105
+ describe '#release' do
106
+ subject { super().release }
107
+ it { is_expected.to be_kind_of(Gem::Tasks::Release) }
108
+ end
29
109
  end
30
110
 
31
- context ":build => {:gem => false}" do
111
+ context "build: {gem: false}" do
32
112
  include_context "rake"
33
113
 
34
- subject { described_class.new(:build => {:gem => false}) }
114
+ subject { described_class.new(build: {gem: false}) }
35
115
 
36
- its('build.gem') { should be_nil }
116
+ describe '#build' do
117
+ subject { super().build }
118
+ describe '#gem' do
119
+ subject { super().gem }
120
+ it { is_expected.to be_nil }
121
+ end
122
+ end
37
123
  end
38
124
 
39
- context ":build => {:tar => true}" do
125
+ context "build: {tar: true}" do
40
126
  include_context "rake"
41
127
 
42
- subject { described_class.new(:build => {:tar => true}) }
128
+ subject { described_class.new(build: {tar: true}) }
43
129
 
44
- its('build.tar') { should be_kind_of(Gem::Tasks::Build::Tar) }
130
+ describe '#build' do
131
+ subject { super().build }
132
+ describe '#tar' do
133
+ subject { super().tar }
134
+ it { is_expected.to be_kind_of(Gem::Tasks::Build::Tar) }
135
+ end
136
+ end
45
137
  end
46
138
 
47
- context ":build => {:zip => true}" do
139
+ context "build: {zip: true}" do
48
140
  include_context "rake"
49
141
 
50
- subject { described_class.new(:build => {:zip => true}) }
142
+ subject { described_class.new(build: {zip: true}) }
51
143
 
52
- its('build.zip') { should be_kind_of(Gem::Tasks::Build::Zip) }
144
+ describe '#build' do
145
+ subject { super().build }
146
+ describe '#zip' do
147
+ subject { super().zip }
148
+ it { is_expected.to be_kind_of(Gem::Tasks::Build::Zip) }
149
+ end
150
+ end
53
151
  end
54
152
 
55
- context ":scm => {:status => false}" do
153
+ context "scm: {status: false}" do
56
154
  include_context "rake"
57
155
 
58
- subject { described_class.new(:scm => {:status => false}) }
156
+ subject { described_class.new(scm: {status: false}) }
59
157
 
60
- its('scm.status') { should be_nil }
158
+ describe '#scm' do
159
+ subject { super().scm }
160
+ describe '#status' do
161
+ subject { super().status }
162
+ it { is_expected.to be_nil }
163
+ end
164
+ end
61
165
  end
62
166
 
63
- context ":scm => {:push => false}" do
167
+ context "scm: {push: false}" do
64
168
  include_context "rake"
65
169
 
66
- subject { described_class.new(:scm => {:push => false}) }
170
+ subject { described_class.new(scm: {push: false}) }
67
171
 
68
- its('scm.push') { should be_nil }
172
+ describe '#scm' do
173
+ subject { super().scm }
174
+ describe '#push' do
175
+ subject { super().push }
176
+ it { is_expected.to be_nil }
177
+ end
178
+ end
69
179
  end
70
180
 
71
- context ":scm => {:tag => false}" do
181
+ context "scm: {tag: false}" do
72
182
  include_context "rake"
73
183
 
74
- subject { described_class.new(:scm => {:tag => false}) }
184
+ subject { described_class.new(scm: {tag: false}) }
75
185
 
76
- its('scm.tag') { should be_nil }
186
+ describe '#scm' do
187
+ subject { super().scm }
188
+ describe '#tag' do
189
+ subject { super().tag }
190
+ it { is_expected.to be_nil }
191
+ end
192
+ end
77
193
  end
78
194
 
79
- context ":sign => {:checksum => true}" do
195
+ context "sign: {checksum: true}" do
80
196
  include_context "rake"
81
197
 
82
- subject { described_class.new(:sign => {:checksum => true}) }
198
+ subject { described_class.new(sign: {checksum: true}) }
83
199
 
84
- its('sign.checksum') { should be_kind_of(Gem::Tasks::Sign::Checksum) }
200
+ describe '#sign' do
201
+ subject { super().sign }
202
+ describe '#checksum' do
203
+ subject { super().checksum }
204
+ it { is_expected.to be_kind_of(Gem::Tasks::Sign::Checksum) }
205
+ end
206
+ end
85
207
  end
86
208
 
87
- context ":sign => {:pgp => true}" do
209
+ context "sign: {pgp: true}" do
88
210
  include_context "rake"
89
211
 
90
- subject { described_class.new(:sign => {:pgp => true}) }
212
+ subject { described_class.new(sign: {pgp: true}) }
91
213
 
92
- its('sign.pgp') { should be_kind_of(Gem::Tasks::Sign::PGP) }
214
+ describe '#sign' do
215
+ subject { super().sign }
216
+ describe '#pgp' do
217
+ subject { super().pgp }
218
+ it { is_expected.to be_kind_of(Gem::Tasks::Sign::PGP) }
219
+ end
220
+ end
93
221
  end
94
222
 
95
- context ":console => false" do
223
+ context "console: false" do
96
224
  include_context "rake"
97
225
 
98
- subject { described_class.new(:console => false) }
226
+ subject { described_class.new(console: false) }
99
227
 
100
- its(:console) { should be_nil }
228
+ describe '#console' do
229
+ subject { super().console }
230
+ it { is_expected.to be_nil }
231
+ end
101
232
  end
102
233
 
103
- context ":install => false" do
234
+ context "install: false" do
104
235
  include_context "rake"
105
236
 
106
- subject { described_class.new(:install => false) }
237
+ subject { described_class.new(install: false) }
107
238
 
108
- its(:install) { should be_nil }
239
+ describe '#install' do
240
+ subject { super().install }
241
+ it { is_expected.to be_nil }
242
+ end
109
243
  end
110
244
 
111
- context ":push => false" do
245
+ context "push: false" do
112
246
  include_context "rake"
113
247
 
114
- subject { described_class.new(:push => false) }
248
+ subject { described_class.new(push: false) }
115
249
 
116
- its(:push) { should be_nil }
250
+ describe '#push' do
251
+ subject { super().push }
252
+ it { is_expected.to be_nil }
253
+ end
117
254
  end
118
255
 
119
- context ":release => false" do
256
+ context "release: false" do
120
257
  include_context "rake"
121
258
 
122
- subject { described_class.new(:release => false) }
259
+ subject { described_class.new(release: false) }
123
260
 
124
- its(:release) { should be_nil }
261
+ describe '#release' do
262
+ subject { super().release }
263
+ it { is_expected.to be_nil }
264
+ end
125
265
  end
126
266
  end
127
267
  end
metadata CHANGED
@@ -1,67 +1,74 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: rubygems-tasks
3
- version: !ruby/object:Gem::Version
4
- hash: 31
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.5
11
5
  platform: ruby
12
- authors:
6
+ authors:
13
7
  - Postmodern
14
8
  autorequire:
15
9
  bindir: bin
16
10
  cert_chain: []
17
-
18
- date: 2013-04-08 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
21
- name: rspec
11
+ date: 2020-03-02 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: irb
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.0'
20
+ type: :runtime
22
21
  prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- none: false
25
- requirements:
26
- - - ~>
27
- - !ruby/object:Gem::Version
28
- hash: 11
29
- segments:
30
- - 2
31
- - 4
32
- version: "2.4"
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '3.0'
33
34
  type: :development
34
- version_requirements: *id001
35
- - !ruby/object:Gem::Dependency
36
- name: yard
37
35
  prerelease: false
38
- requirement: &id002 !ruby/object:Gem::Requirement
39
- none: false
40
- requirements:
41
- - - ~>
42
- - !ruby/object:Gem::Version
43
- hash: 5
44
- segments:
45
- - 0
46
- - 7
47
- version: "0.7"
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '3.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: yard
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '0.8'
48
48
  type: :development
49
- version_requirements: *id002
50
- description: Agnostic and unobtrusive Rake tasks for managing and releasing Ruby Gems.
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '0.8'
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
- - .gitignore
63
- - .rspec
64
- - .yardopts
66
+ files:
67
+ - ".document"
68
+ - ".gitignore"
69
+ - ".rspec"
70
+ - ".travis.yml"
71
+ - ".yardopts"
65
72
  - ChangeLog.md
66
73
  - LICENSE.txt
67
74
  - README.md
@@ -88,11 +95,29 @@ files:
88
95
  - lib/rubygems/tasks/sign/pgp.rb
89
96
  - lib/rubygems/tasks/sign/task.rb
90
97
  - lib/rubygems/tasks/task.rb
91
- - lib/rubygems/tasks/tasks.rb
92
98
  - rubygems-tasks.gemspec
93
99
  - spec/console_spec.rb
94
100
  - spec/install_spec.rb
95
101
  - spec/project_spec.rb
102
+ - spec/projects/bundler-project/.gitignore
103
+ - spec/projects/bundler-project/Gemfile
104
+ - spec/projects/bundler-project/LICENSE
105
+ - spec/projects/bundler-project/README.md
106
+ - spec/projects/bundler-project/Rakefile
107
+ - spec/projects/bundler-project/bundler-project.gemspec
108
+ - spec/projects/bundler-project/lib/bundler-project.rb
109
+ - spec/projects/bundler-project/lib/bundler-project/version.rb
110
+ - spec/projects/rubygems-multi-project/.gitignore
111
+ - spec/projects/rubygems-multi-project/LICENSE.txt
112
+ - spec/projects/rubygems-multi-project/README.md
113
+ - spec/projects/rubygems-multi-project/lib/rubygems/project/version.rb
114
+ - spec/projects/rubygems-multi-project/rubygems-project-lite.gemspec
115
+ - spec/projects/rubygems-multi-project/rubygems-project.gemspec
116
+ - spec/projects/rubygems-project/.gitignore
117
+ - spec/projects/rubygems-project/LICENSE.txt
118
+ - spec/projects/rubygems-project/README.md
119
+ - spec/projects/rubygems-project/lib/rubygems/project/version.rb
120
+ - spec/projects/rubygems-project/rubygems-project.gemspec
96
121
  - spec/push_spec.rb
97
122
  - spec/rake_context.rb
98
123
  - spec/scm/push_spec.rb
@@ -102,45 +127,26 @@ files:
102
127
  - spec/spec_helper.rb
103
128
  - spec/tasks_spec.rb
104
129
  homepage: https://github.com/postmodern/rubygems-tasks#readme
105
- licenses: []
106
-
130
+ licenses:
131
+ - MIT
132
+ metadata: {}
107
133
  post_install_message:
108
134
  rdoc_options: []
109
-
110
- require_paths:
135
+ require_paths:
111
136
  - lib
112
- required_ruby_version: !ruby/object:Gem::Requirement
113
- none: false
114
- requirements:
137
+ required_ruby_version: !ruby/object:Gem::Requirement
138
+ requirements:
115
139
  - - ">="
116
- - !ruby/object:Gem::Version
117
- hash: 3
118
- segments:
119
- - 0
120
- version: "0"
121
- required_rubygems_version: !ruby/object:Gem::Requirement
122
- none: false
123
- requirements:
140
+ - !ruby/object:Gem::Version
141
+ version: 2.0.0
142
+ required_rubygems_version: !ruby/object:Gem::Requirement
143
+ requirements:
124
144
  - - ">="
125
- - !ruby/object:Gem::Version
126
- hash: 3
127
- segments:
128
- - 0
129
- version: "0"
145
+ - !ruby/object:Gem::Version
146
+ version: '0'
130
147
  requirements: []
131
-
132
- rubyforge_project:
133
- rubygems_version: 1.8.24
148
+ rubygems_version: 3.0.3
134
149
  signing_key:
135
- specification_version: 3
150
+ specification_version: 4
136
151
  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
152
+ test_files: []