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 CHANGED
@@ -1,4 +1,11 @@
1
- ### 0.1.0 / 2011-08-30
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
@@ -1,5 +1,5 @@
1
1
  name: rubygems-tasks
2
- version: 0.1.0
2
+ version: 0.1.1
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.
@@ -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(*gemspec.require_paths.map { |dir| "-I#{dir}" })
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)
@@ -1,5 +1,3 @@
1
- require 'rake/tasklib'
2
-
3
1
  require 'set'
4
2
 
5
3
  module Gem
@@ -39,7 +39,7 @@ module Gem
39
39
  def sign(path)
40
40
  status "Signing #{File.basename(path)} ..."
41
41
 
42
- run 'gpg', '--sign', path
42
+ run 'gpg', '-a', '--sign', path
43
43
  end
44
44
 
45
45
  end
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
- let(:command) { 'ripl' }
11
- let(:options) { %w[-Ivendor -rfoo] }
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','-Ilib')
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 => 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(command, '-Ilib')
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('bundle', 'exec', command, '-Ilib')
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 => 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', '-Ilib', *options)
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', '-Ilib', *options)
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.0
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-25 00:00:00.000000000 Z
12
+ date: 2012-04-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec