rubygems-tasks 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +27 -0
- data/.gitignore +4 -2
- data/ChangeLog.md +5 -0
- data/Gemfile +10 -0
- data/README.md +2 -1
- data/Rakefile +6 -20
- data/gemspec.yml +9 -3
- data/lib/rubygems/tasks/console.rb +1 -1
- data/lib/rubygems/tasks/task.rb +7 -1
- data/rubygems-tasks.gemspec +1 -0
- data/spec/console_spec.rb +39 -12
- data/spec/install_spec.rb +4 -0
- data/spec/tasks_spec.rb +6 -30
- metadata +26 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be886af586a0508f6dbe548247677067920db2f38b4590c4cd54f3b96b0449ee
|
4
|
+
data.tar.gz: 7d3c7deb140448cfebfba8ebbf184eccfe4bc167823f2088192c5e4f0f69acc3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5906ece048555085e8ec9b5959f262c3d642ee28d8001f8f42221ce53a1c76e39ce41a5e18cdafae1c8ed67fa1ef97b009a28f66b0223c117efba4d78e44f7c
|
7
|
+
data.tar.gz: '038f3abd105da7c5705632c4e65dc3d268567da424bb5e74411b667b93a940a3ff563a801e2ddee32959d7514e4ba821b39e8db0797fce7819814cd8498b2b9a'
|
@@ -0,0 +1,27 @@
|
|
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
|
+
- jruby
|
16
|
+
- truffleruby
|
17
|
+
name: Ruby ${{ matrix.ruby }}
|
18
|
+
steps:
|
19
|
+
- uses: actions/checkout@v2
|
20
|
+
- name: Set up Ruby
|
21
|
+
uses: ruby/setup-ruby@v1
|
22
|
+
with:
|
23
|
+
ruby-version: ${{ matrix.ruby }}
|
24
|
+
- name: Install dependencies
|
25
|
+
run: bundle install --jobs 4 --retry 3
|
26
|
+
- name: Run tests
|
27
|
+
run: bundle exec rake test
|
data/.gitignore
CHANGED
data/ChangeLog.md
CHANGED
data/Gemfile
ADDED
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# rubygems-tasks
|
2
2
|
|
3
|
-
[![
|
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
7
|
* [Issues](https://github.com/postmodern/rubygems-tasks/issues)
|
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
|
-
|
13
|
-
|
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
|
-
|
26
|
-
|
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,5 +1,5 @@
|
|
1
1
|
name: rubygems-tasks
|
2
|
-
version: 0.2.
|
2
|
+
version: 0.2.6
|
3
3
|
summary: Rake tasks for managing and releasing Ruby Gems.
|
4
4
|
description: |
|
5
5
|
Agnostic and unobtrusive Rake tasks for managing and releasing Ruby Gems.
|
@@ -10,11 +10,17 @@ email: postmodern.mod3@gmail.com
|
|
10
10
|
homepage: https://github.com/postmodern/rubygems-tasks#readme
|
11
11
|
has_yard: true
|
12
12
|
|
13
|
+
metadata:
|
14
|
+
documentation_uri: https://rubydoc.info/gems/rubygems-tasks
|
15
|
+
source_code_uri: https://github.com/postmodern/rubygems-tasks
|
16
|
+
bug_tracker_uri: https://github.com/postmodern/rubygems-tasks/issues
|
17
|
+
changelog_uri: https://github.com/postmodern/rubygems-tasks/blob/master/ChangeLog.md
|
18
|
+
|
13
19
|
required_ruby_version: ">= 2.0.0"
|
14
20
|
|
15
21
|
dependencies:
|
22
|
+
rake: ">= 10.0.0"
|
16
23
|
irb: ~> 1.0
|
17
24
|
|
18
25
|
development_dependencies:
|
19
|
-
|
20
|
-
yard: ~> 0.8
|
26
|
+
bundler: ~> 2.0
|
data/lib/rubygems/tasks/task.rb
CHANGED
@@ -67,7 +67,13 @@ module Gem
|
|
67
67
|
# @api semipublic
|
68
68
|
#
|
69
69
|
def gem(command,*arguments)
|
70
|
-
|
70
|
+
if defined?(Bundler)
|
71
|
+
Bundler.with_original_env do
|
72
|
+
run 'gem', command, *arguments
|
73
|
+
end
|
74
|
+
else
|
75
|
+
run 'gem', command, *arguments
|
76
|
+
end
|
71
77
|
end
|
72
78
|
|
73
79
|
#
|
data/rubygems-tasks.gemspec
CHANGED
@@ -20,6 +20,7 @@ Gem::Specification.new do |gem|
|
|
20
20
|
gem.authors = Array(gemspec['authors'])
|
21
21
|
gem.email = gemspec['email']
|
22
22
|
gem.homepage = gemspec['homepage']
|
23
|
+
gem.metadata = gemspec['metadata'] if gemspec['metadata']
|
23
24
|
|
24
25
|
glob = lambda { |patterns| gem.files & Dir[*patterns] }
|
25
26
|
|
data/spec/console_spec.rb
CHANGED
@@ -13,15 +13,24 @@ describe Gem::Tasks::Console do
|
|
13
13
|
let(:custom_options) { %w[-Ivendor -rfoo] }
|
14
14
|
|
15
15
|
context "defaults" do
|
16
|
-
|
17
|
-
|
16
|
+
context "when project.bundler? == false" do
|
17
|
+
before do
|
18
|
+
allow(subject.project).to receive(:bundler?).and_return(false)
|
19
|
+
end
|
20
|
+
|
21
|
+
it "should run `irb`" do
|
22
|
+
expect(subject).to receive(:run).with('irb',*default_options)
|
18
23
|
|
19
|
-
|
24
|
+
subject.console
|
25
|
+
end
|
20
26
|
end
|
21
27
|
|
22
28
|
context "when project.bundler? == true" do
|
23
|
-
|
29
|
+
before do
|
24
30
|
allow(subject.project).to receive(:bundler?).and_return(true)
|
31
|
+
end
|
32
|
+
|
33
|
+
it "should use `bundle exec`" do
|
25
34
|
expect(subject).to receive(:run).with(
|
26
35
|
'bundle', 'exec', 'irb', *default_options
|
27
36
|
)
|
@@ -34,15 +43,24 @@ describe Gem::Tasks::Console do
|
|
34
43
|
context "with custom command" do
|
35
44
|
subject { described_class.new(:command => custom_command) }
|
36
45
|
|
37
|
-
|
38
|
-
|
46
|
+
context "when project.bundler? == false" do
|
47
|
+
before do
|
48
|
+
allow(subject.project).to receive(:bundler?).and_return(false)
|
49
|
+
end
|
50
|
+
|
51
|
+
it "should run the custom console" do
|
52
|
+
expect(subject).to receive(:run).with(custom_command,*default_options)
|
39
53
|
|
40
|
-
|
54
|
+
subject.console
|
55
|
+
end
|
41
56
|
end
|
42
57
|
|
43
58
|
context "when project.bundler? == true" do
|
44
|
-
|
59
|
+
before do
|
45
60
|
allow(subject.project).to receive(:bundler?).and_return(true)
|
61
|
+
end
|
62
|
+
|
63
|
+
it "should use `bundle exec`" do
|
46
64
|
expect(subject).to receive(:run).with(
|
47
65
|
'bundle', 'exec', custom_command, *default_options
|
48
66
|
)
|
@@ -55,15 +73,24 @@ describe Gem::Tasks::Console do
|
|
55
73
|
context "with custom options" do
|
56
74
|
subject { described_class.new(:options => custom_options) }
|
57
75
|
|
58
|
-
|
59
|
-
|
76
|
+
context "when project.bundler? == false" do
|
77
|
+
before do
|
78
|
+
allow(subject.project).to receive(:bundler?).and_return(false)
|
79
|
+
end
|
80
|
+
|
81
|
+
it "should pass custom options to `irb`" do
|
82
|
+
expect(subject).to receive(:run).with('irb', *(default_options + custom_options))
|
60
83
|
|
61
|
-
|
84
|
+
subject.console
|
85
|
+
end
|
62
86
|
end
|
63
87
|
|
64
88
|
context "when project.bundler? == true" do
|
65
|
-
|
89
|
+
before do
|
66
90
|
allow(subject.project).to receive(:bundler?).and_return(true)
|
91
|
+
end
|
92
|
+
|
93
|
+
it "should use `bundle exec ...`" do
|
67
94
|
expect(subject).to receive(:run).with('bundle', 'exec', 'irb', *(default_options + custom_options))
|
68
95
|
|
69
96
|
subject.console
|
data/spec/install_spec.rb
CHANGED
@@ -8,6 +8,10 @@ describe Gem::Tasks::Install do
|
|
8
8
|
let(:path) { 'pkg/foo-1.2.3.gem' }
|
9
9
|
|
10
10
|
it "should use `gem install -q`" do
|
11
|
+
if defined?(Bundler)
|
12
|
+
expect(Bundler).to receive(:with_original_env).and_yield()
|
13
|
+
end
|
14
|
+
|
11
15
|
expect(subject).to receive(:run).with('gem', 'install', '-q', path)
|
12
16
|
|
13
17
|
subject.install(path)
|
data/spec/tasks_spec.rb
CHANGED
@@ -11,27 +11,18 @@ describe Gem::Tasks do
|
|
11
11
|
describe '#build' do
|
12
12
|
subject { super().build }
|
13
13
|
it { is_expected.to be_kind_of(OpenStruct) }
|
14
|
-
end
|
15
14
|
|
16
|
-
|
17
|
-
subject { super().build }
|
18
|
-
describe '#gem' do
|
15
|
+
describe '#build.gem' do
|
19
16
|
subject { super().gem }
|
20
17
|
it { is_expected.to be_kind_of(Gem::Tasks::Build::Gem) }
|
21
18
|
end
|
22
|
-
end
|
23
19
|
|
24
|
-
|
25
|
-
subject { super().build }
|
26
|
-
describe '#tar' do
|
20
|
+
describe '#build.tar' do
|
27
21
|
subject { super().tar }
|
28
22
|
it { is_expected.to be_nil }
|
29
23
|
end
|
30
|
-
end
|
31
24
|
|
32
|
-
|
33
|
-
subject { super().build }
|
34
|
-
describe '#zip' do
|
25
|
+
describe '#build.zip' do
|
35
26
|
subject { super().zip }
|
36
27
|
it { is_expected.to be_nil }
|
37
28
|
end
|
@@ -40,27 +31,18 @@ describe Gem::Tasks do
|
|
40
31
|
describe '#scm' do
|
41
32
|
subject { super().scm }
|
42
33
|
it { is_expected.to be_kind_of(OpenStruct) }
|
43
|
-
end
|
44
34
|
|
45
|
-
|
46
|
-
subject { super().scm }
|
47
|
-
describe '#status' do
|
35
|
+
describe '#scm.status' do
|
48
36
|
subject { super().status }
|
49
37
|
it { is_expected.to be_kind_of(Gem::Tasks::SCM::Status) }
|
50
38
|
end
|
51
|
-
end
|
52
39
|
|
53
|
-
|
54
|
-
subject { super().scm }
|
55
|
-
describe '#push' do
|
40
|
+
describe '#scm.push' do
|
56
41
|
subject { super().push }
|
57
42
|
it { is_expected.to be_kind_of(Gem::Tasks::SCM::Push) }
|
58
43
|
end
|
59
|
-
end
|
60
44
|
|
61
|
-
|
62
|
-
subject { super().scm }
|
63
|
-
describe '#tag' do
|
45
|
+
describe '#scm.tag' do
|
64
46
|
subject { super().tag }
|
65
47
|
it { is_expected.to be_kind_of(Gem::Tasks::SCM::Tag) }
|
66
48
|
end
|
@@ -69,18 +51,12 @@ describe Gem::Tasks do
|
|
69
51
|
describe '#sign' do
|
70
52
|
subject { super().sign }
|
71
53
|
it { is_expected.to be_kind_of(OpenStruct) }
|
72
|
-
end
|
73
54
|
|
74
|
-
describe '#sign' do
|
75
|
-
subject { super().sign }
|
76
55
|
describe '#checksum' do
|
77
56
|
subject { super().checksum }
|
78
57
|
it { is_expected.to be_nil }
|
79
58
|
end
|
80
|
-
end
|
81
59
|
|
82
|
-
describe '#sign' do
|
83
|
-
subject { super().sign }
|
84
60
|
describe '#pgp' do
|
85
61
|
subject { super().pgp }
|
86
62
|
it { is_expected.to be_nil }
|
metadata
CHANGED
@@ -1,61 +1,61 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubygems-tasks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Postmodern
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: rake
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 10.0.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 10.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: irb
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
34
|
-
type: :
|
33
|
+
version: '1.0'
|
34
|
+
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '1.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0
|
47
|
+
version: '2.0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '0
|
54
|
+
version: '2.0'
|
55
55
|
description: 'Agnostic and unobtrusive Rake tasks for managing and releasing Ruby
|
56
56
|
Gems.
|
57
57
|
|
58
|
-
'
|
58
|
+
'
|
59
59
|
email: postmodern.mod3@gmail.com
|
60
60
|
executables: []
|
61
61
|
extensions: []
|
@@ -65,11 +65,13 @@ extra_rdoc_files:
|
|
65
65
|
- README.md
|
66
66
|
files:
|
67
67
|
- ".document"
|
68
|
+
- ".github/workflows/ruby.yml"
|
68
69
|
- ".gitignore"
|
69
70
|
- ".rspec"
|
70
71
|
- ".travis.yml"
|
71
72
|
- ".yardopts"
|
72
73
|
- ChangeLog.md
|
74
|
+
- Gemfile
|
73
75
|
- LICENSE.txt
|
74
76
|
- README.md
|
75
77
|
- Rakefile
|
@@ -129,8 +131,12 @@ files:
|
|
129
131
|
homepage: https://github.com/postmodern/rubygems-tasks#readme
|
130
132
|
licenses:
|
131
133
|
- MIT
|
132
|
-
metadata:
|
133
|
-
|
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:
|
134
140
|
rdoc_options: []
|
135
141
|
require_paths:
|
136
142
|
- lib
|
@@ -145,8 +151,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
145
151
|
- !ruby/object:Gem::Version
|
146
152
|
version: '0'
|
147
153
|
requirements: []
|
148
|
-
rubygems_version: 3.
|
149
|
-
signing_key:
|
154
|
+
rubygems_version: 3.4.10
|
155
|
+
signing_key:
|
150
156
|
specification_version: 4
|
151
157
|
summary: Rake tasks for managing and releasing Ruby Gems.
|
152
158
|
test_files: []
|