gem_publisher 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,11 +6,12 @@ require "rubygems/specification"
6
6
  module GemPublisher
7
7
  class Publisher
8
8
  attr_accessor :git_remote, :builder, :pusher
9
+ attr_reader :version
9
10
 
10
11
  def initialize(gemspec)
11
12
  @gemspec = gemspec
12
13
 
13
- @version = eval(File.read(gemspec)).version.to_s
14
+ @version = eval(File.read(gemspec), TOPLEVEL_BINDING).version.to_s
14
15
 
15
16
  @git_remote = GitRemote.new
16
17
  @builder = Builder.new
@@ -1,3 +1,3 @@
1
1
  module GemPublisher
2
- VERSION = "1.3.0"
2
+ VERSION = "1.3.1"
3
3
  end
@@ -0,0 +1,12 @@
1
+ gemspec = Gem::Specification.new do |s|
2
+ s.name = 'toplevel_version'
3
+ s.version = VERSION
4
+ s.summary = 'summary'
5
+ s.description = 'description'
6
+ s.files = []
7
+ s.require_path = 'lib'
8
+ s.has_rdoc = true
9
+ s.homepage = 'http://example.com'
10
+ s.authors = ['Luther Blisset']
11
+ s.email = 'user@example.com'
12
+ end
@@ -78,5 +78,13 @@ module GemPublisher
78
78
  p.git_remote.expects(:add_tag).with("v0.0.3")
79
79
  assert_equal "foo-0.0.3.gem", p.publish_if_updated(:method)
80
80
  end
81
+
82
+ ::VERSION = "0.2.3"
83
+ def test_should_eval_gemspec_in_root_context
84
+ # Previously this would pick up GemPublisher::VERSION incorrectly
85
+ p = Publisher.new(data_file_path("toplevel_version.gemspec"))
86
+
87
+ assert_equal "0.2.3", p.version
88
+ end
81
89
  end
82
90
  end
metadata CHANGED
@@ -1,97 +1,100 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: gem_publisher
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.3.1
4
5
  prerelease:
5
- version: 1.3.0
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Paul Battley
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2013-07-29 00:00:00 Z
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
12
+ date: 2014-01-09 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
16
15
  name: mocha
17
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
18
17
  none: false
19
- requirements:
20
- - - ">="
21
- - !ruby/object:Gem::Version
22
- version: "0"
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
23
22
  type: :development
24
23
  prerelease: false
25
- version_requirements: *id001
26
- - !ruby/object:Gem::Dependency
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
27
31
  name: rake
28
- requirement: &id002 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
29
33
  none: false
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: "0"
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
34
38
  type: :development
35
39
  prerelease: false
36
- version_requirements: *id002
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
37
46
  description: Automatically build, tag, and push a gem when its version has been updated.
38
47
  email: pbattley@gmail.com
39
48
  executables: []
40
-
41
49
  extensions: []
42
-
43
50
  extra_rdoc_files: []
44
-
45
- files:
51
+ files:
46
52
  - lib/gem_publisher.rb
53
+ - lib/rubygems_plugin.rb
54
+ - lib/gem_publisher/builder.rb
55
+ - lib/gem_publisher/git_remote.rb
47
56
  - lib/gem_publisher/version.rb
48
57
  - lib/gem_publisher/cli_facade.rb
49
- - lib/gem_publisher/publisher.rb
50
58
  - lib/gem_publisher/pusher.rb
51
- - lib/gem_publisher/builder.rb
52
- - lib/gem_publisher/git_remote.rb
53
- - lib/rubygems_plugin.rb
54
- - test/builder_test.rb
55
- - test/git_remote_test.rb
59
+ - lib/gem_publisher/publisher.rb
56
60
  - test/cli_facade_test.rb
57
61
  - test/common.rb
58
- - test/integration_test.rb
62
+ - test/builder_test.rb
59
63
  - test/publisher_test.rb
60
- - test/data/gem_build
61
- - test/data/tags
62
64
  - test/data/example.gemspec
65
+ - test/data/tags
66
+ - test/data/gem_build
67
+ - test/data/toplevel_version.gemspec
68
+ - test/integration_test.rb
69
+ - test/git_remote_test.rb
63
70
  homepage: http://github.com/alphagov/gem_publisher
64
71
  licenses: []
65
-
66
72
  post_install_message:
67
73
  rdoc_options: []
68
-
69
- require_paths:
74
+ require_paths:
70
75
  - lib
71
- required_ruby_version: !ruby/object:Gem::Requirement
76
+ required_ruby_version: !ruby/object:Gem::Requirement
72
77
  none: false
73
- requirements:
74
- - - ">="
75
- - !ruby/object:Gem::Version
76
- hash: 298962477350743974
77
- segments:
78
+ requirements:
79
+ - - ! '>='
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ segments:
78
83
  - 0
79
- version: "0"
80
- required_rubygems_version: !ruby/object:Gem::Requirement
84
+ hash: -2417477431817489351
85
+ required_rubygems_version: !ruby/object:Gem::Requirement
81
86
  none: false
82
- requirements:
83
- - - ">="
84
- - !ruby/object:Gem::Version
85
- hash: 298962477350743974
86
- segments:
87
+ requirements:
88
+ - - ! '>='
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ segments:
87
92
  - 0
88
- version: "0"
93
+ hash: -2417477431817489351
89
94
  requirements: []
90
-
91
95
  rubyforge_project:
92
- rubygems_version: 1.8.24
96
+ rubygems_version: 1.8.23
93
97
  signing_key:
94
98
  specification_version: 3
95
99
  summary: Automatically build, tag, and push gems
96
100
  test_files: []
97
-