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
@@ -0,0 +1,19 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'bundler-project/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |gem|
|
7
|
+
gem.authors = ["Postmodern"]
|
8
|
+
gem.email = ["postmodern.mod3@gmail.com"]
|
9
|
+
gem.description = %q{An example Ruby project using Bundler}
|
10
|
+
gem.summary = %q{Example Bundler project}
|
11
|
+
gem.homepage = ""
|
12
|
+
|
13
|
+
gem.files = `git ls-files`.split($\)
|
14
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
15
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
16
|
+
gem.name = "bundler-project"
|
17
|
+
gem.require_paths = ["lib"]
|
18
|
+
gem.version = Bundler::Project::VERSION
|
19
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 Postmodern
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# Rubygems::Project
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
$ gem install rubygems-project
|
8
|
+
|
9
|
+
## Examples
|
10
|
+
|
11
|
+
## Contributing
|
12
|
+
|
13
|
+
1. Fork it
|
14
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
15
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
16
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
17
|
+
5. Create new Pull Request
|
18
|
+
|
19
|
+
## License
|
20
|
+
|
21
|
+
See `LICENSE.txt`.
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'rubygems/project/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |gem|
|
7
|
+
gem.name = "rubygems-project-lite"
|
8
|
+
gem.version = Rubygems::Project::VERSION
|
9
|
+
gem.authors = ["Postmodern"]
|
10
|
+
gem.email = ["postmodern.mod3@gmail.com"]
|
11
|
+
gem.description = %q{An example of a RubyGems project (lite edition)}
|
12
|
+
gem.summary = %q{Example RubyGems project}
|
13
|
+
gem.homepage = ""
|
14
|
+
|
15
|
+
gem.files = `git ls-files`.split($\)
|
16
|
+
gem.executables = []
|
17
|
+
gem.test_files = []
|
18
|
+
gem.require_paths = ["lib"]
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'rubygems/project/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |gem|
|
7
|
+
gem.name = "rubygems-project"
|
8
|
+
gem.version = Rubygems::Project::VERSION
|
9
|
+
gem.authors = ["Postmodern"]
|
10
|
+
gem.email = ["postmodern.mod3@gmail.com"]
|
11
|
+
gem.description = %q{An example of a RubyGems project}
|
12
|
+
gem.summary = %q{Example RubyGems project}
|
13
|
+
gem.homepage = ""
|
14
|
+
|
15
|
+
gem.files = `git ls-files`.split($\)
|
16
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
17
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
|
+
gem.require_paths = ["lib"]
|
19
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 Postmodern
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# Rubygems::Project
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
$ gem install rubygems-project
|
8
|
+
|
9
|
+
## Examples
|
10
|
+
|
11
|
+
## Contributing
|
12
|
+
|
13
|
+
1. Fork it
|
14
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
15
|
+
3. Commit your changes (`git commit -am 'Added some feature'`)
|
16
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
17
|
+
5. Create new Pull Request
|
18
|
+
|
19
|
+
## License
|
20
|
+
|
21
|
+
See `LICENSE.txt`.
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'rubygems/project/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |gem|
|
7
|
+
gem.name = "rubygems-project"
|
8
|
+
gem.version = Rubygems::Project::VERSION
|
9
|
+
gem.authors = ["Postmodern"]
|
10
|
+
gem.email = ["postmodern.mod3@gmail.com"]
|
11
|
+
gem.description = %q{An example of a RubyGems project}
|
12
|
+
gem.summary = %q{Example RubyGems project}
|
13
|
+
gem.homepage = ""
|
14
|
+
|
15
|
+
gem.files = `git ls-files`.split($\)
|
16
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
17
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
|
+
gem.require_paths = ["lib"]
|
19
|
+
end
|
data/spec/push_spec.rb
CHANGED
@@ -11,7 +11,7 @@ describe Gem::Tasks::Push do
|
|
11
11
|
|
12
12
|
context "defaults" do
|
13
13
|
it "should use `gem push`" do
|
14
|
-
subject.
|
14
|
+
expect(subject).to receive(:run).with('gem', 'push', path)
|
15
15
|
|
16
16
|
subject.push(path)
|
17
17
|
end
|
@@ -23,7 +23,7 @@ describe Gem::Tasks::Push do
|
|
23
23
|
subject { described_class.new(:host => host) }
|
24
24
|
|
25
25
|
it "should include the --host option" do
|
26
|
-
subject.
|
26
|
+
expect(subject).to receive(:run).with('gem', 'push', path, '--host', host)
|
27
27
|
|
28
28
|
subject.push(path)
|
29
29
|
end
|
data/spec/rake_context.rb
CHANGED
data/spec/scm/push_spec.rb
CHANGED
@@ -7,9 +7,9 @@ describe Gem::Tasks::SCM::Push do
|
|
7
7
|
describe "#push!" do
|
8
8
|
context "git" do
|
9
9
|
it "should run `git push --tags`" do
|
10
|
-
subject.project.
|
11
|
-
subject.
|
12
|
-
subject.
|
10
|
+
allow(subject.project).to receive(:scm).and_return(:git)
|
11
|
+
expect(subject).to receive(:run).with('git', 'push')
|
12
|
+
expect(subject).to receive(:run).with('git', 'push', '--tags')
|
13
13
|
|
14
14
|
subject.push!
|
15
15
|
end
|
@@ -17,8 +17,8 @@ describe Gem::Tasks::SCM::Push do
|
|
17
17
|
|
18
18
|
context "hg" do
|
19
19
|
it "should run `hg push`" do
|
20
|
-
subject.project.
|
21
|
-
subject.
|
20
|
+
allow(subject.project).to receive(:scm).and_return(:hg)
|
21
|
+
expect(subject).to receive(:run).with('hg', 'push')
|
22
22
|
|
23
23
|
subject.push!
|
24
24
|
end
|
@@ -26,9 +26,9 @@ describe Gem::Tasks::SCM::Push do
|
|
26
26
|
|
27
27
|
context "otherwise" do
|
28
28
|
it "should return true" do
|
29
|
-
subject.project.
|
29
|
+
allow(subject.project).to receive(:scm).and_return(:svn)
|
30
30
|
|
31
|
-
subject.push
|
31
|
+
expect(subject.push!).to eq(true)
|
32
32
|
end
|
33
33
|
end
|
34
34
|
end
|
data/spec/scm/status_spec.rb
CHANGED
@@ -9,9 +9,9 @@ describe Gem::Tasks::SCM::Status do
|
|
9
9
|
include_context "rake"
|
10
10
|
|
11
11
|
it "should run `git status --untracked-files=no`" do
|
12
|
-
subject.project.
|
12
|
+
allow(subject.project).to receive(:scm).and_return(:git)
|
13
13
|
|
14
|
-
subject.
|
14
|
+
expect(subject).to receive(:run).with(
|
15
15
|
'git', 'status', '--untracked-files=no'
|
16
16
|
)
|
17
17
|
|
@@ -23,9 +23,9 @@ describe Gem::Tasks::SCM::Status do
|
|
23
23
|
include_context "rake"
|
24
24
|
|
25
25
|
it "should run `hg status --quiet`" do
|
26
|
-
subject.project.
|
26
|
+
allow(subject.project).to receive(:scm).and_return(:hg)
|
27
27
|
|
28
|
-
subject.
|
28
|
+
expect(subject).to receive(:run).with(
|
29
29
|
'hg', 'status', '--quiet'
|
30
30
|
)
|
31
31
|
|
@@ -37,9 +37,9 @@ describe Gem::Tasks::SCM::Status do
|
|
37
37
|
include_context "rake"
|
38
38
|
|
39
39
|
it "should run `svn status --quiet`" do
|
40
|
-
subject.project.
|
40
|
+
allow(subject.project).to receive(:scm).and_return(:svn)
|
41
41
|
|
42
|
-
subject.
|
42
|
+
expect(subject).to receive(:run).with(
|
43
43
|
'svn', 'status', '--quiet'
|
44
44
|
)
|
45
45
|
|
data/spec/scm/tag_spec.rb
CHANGED
@@ -11,7 +11,7 @@ describe Gem::Tasks::SCM::Tag do
|
|
11
11
|
include_context "rake"
|
12
12
|
|
13
13
|
it "should have a 'v' prefix" do
|
14
|
-
subject.version_tag(version).
|
14
|
+
expect(subject.version_tag(version)).to eq("v#{version}")
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
@@ -20,20 +20,20 @@ describe Gem::Tasks::SCM::Tag do
|
|
20
20
|
|
21
21
|
let(:format) { 'release-%s' }
|
22
22
|
|
23
|
-
subject { described_class.new(:
|
23
|
+
subject { described_class.new(format: format) }
|
24
24
|
|
25
25
|
it "should apply the format String to the version" do
|
26
|
-
subject.version_tag(version).
|
26
|
+
expect(subject.version_tag(version)).to eq("release-#{version}")
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
30
|
context "with format Proc" do
|
31
31
|
let(:format) { proc { |ver| "REL_" + ver.tr('.','_') } }
|
32
32
|
|
33
|
-
subject { described_class.new(:
|
33
|
+
subject { described_class.new(format: format) }
|
34
34
|
|
35
35
|
it "should call the format Proc with the version" do
|
36
|
-
subject.version_tag(version).
|
36
|
+
expect(subject.version_tag(version)).to eq("REL_1_2_3")
|
37
37
|
end
|
38
38
|
end
|
39
39
|
end
|
@@ -46,12 +46,12 @@ describe Gem::Tasks::SCM::Tag do
|
|
46
46
|
context "without signing" do
|
47
47
|
include_context "rake"
|
48
48
|
|
49
|
-
subject { described_class.new(:
|
49
|
+
subject { described_class.new(sign: false) }
|
50
50
|
|
51
51
|
it "should run `git tag`" do
|
52
|
-
subject.project.
|
52
|
+
allow(subject.project).to receive(:scm).and_return(:git)
|
53
53
|
|
54
|
-
subject.
|
54
|
+
expect(subject).to receive(:run).with(
|
55
55
|
'git', 'tag', '-m', message, name
|
56
56
|
)
|
57
57
|
|
@@ -62,12 +62,12 @@ describe Gem::Tasks::SCM::Tag do
|
|
62
62
|
context "signing" do
|
63
63
|
include_context "rake"
|
64
64
|
|
65
|
-
subject { described_class.new(:
|
65
|
+
subject { described_class.new(sign: true) }
|
66
66
|
|
67
67
|
it "should run `git tag -s`" do
|
68
|
-
subject.project.
|
68
|
+
allow(subject.project).to receive(:scm).and_return(:git)
|
69
69
|
|
70
|
-
subject.
|
70
|
+
expect(subject).to receive(:run).with(
|
71
71
|
'git', 'tag', '-m', message, '-s', name
|
72
72
|
)
|
73
73
|
|
@@ -80,12 +80,12 @@ describe Gem::Tasks::SCM::Tag do
|
|
80
80
|
context "without signing" do
|
81
81
|
include_context "rake"
|
82
82
|
|
83
|
-
subject { described_class.new(:
|
83
|
+
subject { described_class.new(sign: false) }
|
84
84
|
|
85
85
|
it "should run `hg tag`" do
|
86
|
-
subject.project.
|
86
|
+
allow(subject.project).to receive(:scm).and_return(:hg)
|
87
87
|
|
88
|
-
subject.
|
88
|
+
expect(subject).to receive(:run).with(
|
89
89
|
'hg', 'tag', '-m', message, name
|
90
90
|
)
|
91
91
|
|
@@ -96,15 +96,15 @@ describe Gem::Tasks::SCM::Tag do
|
|
96
96
|
context "with signing" do
|
97
97
|
include_context "rake"
|
98
98
|
|
99
|
-
subject { described_class.new(:
|
99
|
+
subject { described_class.new(sign: true) }
|
100
100
|
|
101
101
|
it "should run `hg sign` then `hg tag`" do
|
102
|
-
subject.project.
|
102
|
+
allow(subject.project).to receive(:scm).and_return(:hg)
|
103
103
|
|
104
|
-
subject.
|
104
|
+
expect(subject).to receive(:run).with(
|
105
105
|
'hg', 'sign', '-m', "Signing #{name}"
|
106
106
|
)
|
107
|
-
subject.
|
107
|
+
expect(subject).to receive(:run).with(
|
108
108
|
'hg', 'tag', '-m', message, name
|
109
109
|
)
|
110
110
|
|
data/spec/sign/pgp_spec.rb
CHANGED
@@ -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.
|
13
|
+
expect(subject).to receive(:run).with(
|
14
14
|
'gpg', '--sign', '--detach-sign', '--armor', path
|
15
15
|
)
|
16
16
|
|
data/spec/spec_helper.rb
CHANGED
@@ -1,12 +1,29 @@
|
|
1
|
-
gem 'rspec', '~> 2.4'
|
2
1
|
require 'rspec'
|
2
|
+
require 'fileutils'
|
3
|
+
require 'tmpdir'
|
3
4
|
|
4
|
-
|
5
|
-
|
5
|
+
# clear the $RUBYCONSOLE env variable
|
6
|
+
ENV.delete('RUBYCONSOLE')
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
|
8
|
+
RSpec.configure do |rspec|
|
9
|
+
rspec.before(:suite) do
|
10
|
+
PROJECTS_DIR = Dir.mktmpdir('rubygems-tasks')
|
10
11
|
|
11
|
-
|
12
|
-
|
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
|