rubygems-tasks 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog.md +8 -1
- data/gemspec.yml +1 -1
- data/lib/rubygems/tasks/console.rb +10 -1
- data/lib/rubygems/tasks/project.rb +0 -2
- data/lib/rubygems/tasks/sign/pgp.rb +1 -1
- data/spec/console_spec.rb +17 -9
- metadata +2 -2
data/ChangeLog.md
CHANGED
@@ -1,4 +1,11 @@
|
|
1
|
-
### 0.1.
|
1
|
+
### 0.1.1 / 2012-04-26
|
2
|
+
|
3
|
+
* {Gem::Tasks::Sign::PGP} now creates ASCII armored signatures.
|
4
|
+
* {Gem::Tasks::Console}
|
5
|
+
* require `rubygems` on Ruby 1.8.
|
6
|
+
* require the first `lib/` file to load the project.
|
7
|
+
|
8
|
+
### 0.1.0 / 2012-04-24
|
2
9
|
|
3
10
|
* Initial release:
|
4
11
|
* Added {Gem::Tasks::Project}.
|
data/gemspec.yml
CHANGED
@@ -67,10 +67,19 @@ module Gem
|
|
67
67
|
def console(name=nil)
|
68
68
|
gemspec = @project.gemspec(name)
|
69
69
|
|
70
|
+
require_paths = gemspec.require_paths
|
71
|
+
require_file = gemspec.files.find { |path| path.start_with?('lib/') }
|
72
|
+
|
70
73
|
arguments = [@command]
|
71
74
|
|
72
75
|
# add -I options for lib/ or ext/ directories
|
73
|
-
arguments.push(*
|
76
|
+
arguments.push(*require_paths.map { |dir| "-I#{dir}" })
|
77
|
+
|
78
|
+
# add a -rrubygems to explicitly load rubygems on Ruby 1.8
|
79
|
+
arguments.push('-rrubygems') if RUBY_VERSION < '1.9'
|
80
|
+
|
81
|
+
# add an -r option to require the library
|
82
|
+
arguments.push('-r' + require_file.sub('lib/','')) if require_file
|
74
83
|
|
75
84
|
# push on additional options
|
76
85
|
arguments.push(*@options)
|
data/spec/console_spec.rb
CHANGED
@@ -7,12 +7,18 @@ describe Gem::Tasks::Console do
|
|
7
7
|
describe "#console" do
|
8
8
|
include_context "rake"
|
9
9
|
|
10
|
-
|
11
|
-
|
10
|
+
if RUBY_VERSION < '1.9'
|
11
|
+
let(:default_options) { %w[-Ilib -rrubygems -rrubygems/tasks.rb] }
|
12
|
+
else
|
13
|
+
let(:default_options) { %w[-Ilib -rrubygems/tasks.rb] }
|
14
|
+
end
|
15
|
+
|
16
|
+
let(:custom_command) { 'ripl' }
|
17
|
+
let(:custom_options) { %w[-Ivendor -rfoo] }
|
12
18
|
|
13
19
|
context "defaults" do
|
14
20
|
it "should run `irb`" do
|
15
|
-
subject.should_receive(:run).with('irb'
|
21
|
+
subject.should_receive(:run).with('irb',*default_options)
|
16
22
|
|
17
23
|
subject.console
|
18
24
|
end
|
@@ -28,10 +34,10 @@ describe Gem::Tasks::Console do
|
|
28
34
|
end
|
29
35
|
|
30
36
|
context "with custom command" do
|
31
|
-
subject { described_class.new(:command =>
|
37
|
+
subject { described_class.new(:command => custom_command) }
|
32
38
|
|
33
39
|
it "should run the custom console" do
|
34
|
-
subject.should_receive(:run).with(
|
40
|
+
subject.should_receive(:run).with(custom_command,*default_options)
|
35
41
|
|
36
42
|
subject.console
|
37
43
|
end
|
@@ -39,7 +45,9 @@ describe Gem::Tasks::Console do
|
|
39
45
|
context "when project.bundler? == true" do
|
40
46
|
it "should use `bundle exec`" do
|
41
47
|
subject.project.stub!(:bundler?).and_return(true)
|
42
|
-
subject.should_receive(:run).with(
|
48
|
+
subject.should_receive(:run).with(
|
49
|
+
'bundle', 'exec', custom_command, *default_options
|
50
|
+
)
|
43
51
|
|
44
52
|
subject.console
|
45
53
|
end
|
@@ -47,10 +55,10 @@ describe Gem::Tasks::Console do
|
|
47
55
|
end
|
48
56
|
|
49
57
|
context "with custom options" do
|
50
|
-
subject { described_class.new(:options =>
|
58
|
+
subject { described_class.new(:options => custom_options) }
|
51
59
|
|
52
60
|
it "should pass custom options to `irb`" do
|
53
|
-
subject.should_receive(:run).with('irb',
|
61
|
+
subject.should_receive(:run).with('irb', *(default_options + custom_options))
|
54
62
|
|
55
63
|
subject.console
|
56
64
|
end
|
@@ -58,7 +66,7 @@ describe Gem::Tasks::Console do
|
|
58
66
|
context "when project.bundler? == true" do
|
59
67
|
it "should use `bundle exec ...`" do
|
60
68
|
subject.project.stub!(:bundler?).and_return(true)
|
61
|
-
subject.should_receive(:run).with('bundle', 'exec', 'irb',
|
69
|
+
subject.should_receive(:run).with('bundle', 'exec', 'irb', *(default_options + custom_options))
|
62
70
|
|
63
71
|
subject.console
|
64
72
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubygems-tasks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-04-
|
12
|
+
date: 2012-04-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|