version_info 1.7.4 → 1.7.5

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c50148d26c1d9cf20391b428792016d4135b6994
4
+ data.tar.gz: 92ec858d0f11b4dc0cae2d77d433c07cfec85942
5
+ SHA512:
6
+ metadata.gz: 93fa94284766f3cbfcf04cd6ab9c6852cd3fc5741e169ef5e2b21100ab82f1389c9a0f63976c6989aa9ec40522f04f86cbc83d55f75b04d57e67ea4c47fa408f
7
+ data.tar.gz: 0763701f7deaa063d996cf141e564d42bdef93b0a85be4af840425275db0740e4c762d640de9502ea5bdebba48966bb212b37c9d9b48651d47a1306244f4422a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- version_info (1.7.3)
4
+ version_info (1.7.4)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
@@ -18,7 +18,7 @@ module VersionInfo
18
18
  extend(ModuleStorage)
19
19
  end
20
20
  reset
21
- file_name = nil
21
+ self.file_name = nil
22
22
  end
23
23
 
24
24
  def file_name
@@ -48,13 +48,13 @@ module VersionInfo
48
48
  end
49
49
 
50
50
  def load
51
- load_from(File.read(file_name))
52
- self
51
+ File.open(file_name, 'r') {|io| load_from(io)}
52
+ self
53
53
  end
54
54
 
55
55
  def save
56
- File.open(file_name, 'w' ) {|out| save_to(out)}
57
- self
56
+ File.open(file_name, 'w' ) {|out| save_to(out)}
57
+ self
58
58
  end
59
59
 
60
60
  def to_s
@@ -78,7 +78,7 @@ module VersionInfo
78
78
  end
79
79
 
80
80
  def set_version_info(tag_str)
81
- values = tag_str.split('.')
81
+ values = tag_str.to_s.split('.')
82
82
  VersionInfo.segments.each{|sgm| self.send("#{sgm}=", values.shift.match(/(\d+)/).to_s.to_i) }
83
83
  end
84
84
 
@@ -14,7 +14,8 @@ module VersionInfo
14
14
  end
15
15
 
16
16
  def load_from(io)
17
- content = io.string.split("\n") unless io.is_a? Array
17
+ #content = io.string.split("\n") unless io.is_a? Array
18
+ content = io.readlines
18
19
  str = content.shift
19
20
  custom = content.inject({}) {|result, line| k, v = line.chomp.split(':'); result[k.strip.to_sym] = v.strip; result}
20
21
  self.set_version_info(str)
@@ -1,6 +1,6 @@
1
1
 
2
2
  module VersionInfo
3
- VERSION = "1.7.4"
3
+ VERSION = "1.7.5"
4
4
  versionable(self)
5
5
  VERSION.file_name = __FILE__
6
6
  end
@@ -8,7 +8,6 @@ describe "Text file format" do
8
8
  @test_module::VERSION.file_name = nil
9
9
  end
10
10
 
11
-
12
11
  it "has default filename" do
13
12
  @test_module::VERSION.file_name.should == Dir.pwd + '/' + 'VERSION'
14
13
  end
@@ -19,7 +18,7 @@ describe "Text file format" do
19
18
 
20
19
  it "can save " do
21
20
  io = StringIO.new
22
- File.stub!(:open).and_yield(io)
21
+ File.should_receive(:open).and_yield(io)
23
22
  @test_module::VERSION.bump(:minor)
24
23
  @test_module::VERSION.save
25
24
  io.string.should == "0.1.0\n"
@@ -27,7 +26,7 @@ describe "Text file format" do
27
26
 
28
27
  it "can save custom data " do
29
28
  io = StringIO.new
30
- File.stub!(:open).and_yield(io)
29
+ File.should_receive(:open).and_yield(io)
31
30
  @test_module::VERSION.bump(:minor)
32
31
  @test_module::VERSION.author = 'jcangas'
33
32
  @test_module::VERSION.email = 'jorge.cangas@gmail.com'
@@ -42,14 +41,14 @@ END
42
41
 
43
42
  it "can load " do
44
43
  io = StringIO.new("1.2.3")
45
- File.should_receive(:read).and_return{io}
44
+ File.should_receive(:open).and_yield(io)
46
45
  @test_module::VERSION.load
47
46
  @test_module::VERSION.to_hash.should == {:major => 1, :minor => 2, :patch => 3 }
48
47
  end
49
48
 
50
49
  it "can load custom data " do
51
50
  io = StringIO.new("1.2.3\nauthor: jcangas\n")
52
- File.should_receive(:read).and_return{io}
51
+ File.should_receive(:open).and_yield(io)
53
52
  @test_module::VERSION.load
54
53
  @test_module::VERSION.to_hash.should == {:major => 1, :minor => 2, :patch => 3, :author => 'jcangas' }
55
54
  end
@@ -18,7 +18,7 @@ describe "Yaml file format" do
18
18
 
19
19
  it "can save " do
20
20
  io = StringIO.new
21
- File.stub!(:open).and_yield(io)
21
+ File.should_receive(:open).and_yield(io)
22
22
  @test_module::VERSION.bump(:minor)
23
23
  @test_module::VERSION.save
24
24
  # Seems like YAML has removed one space in ruby 1.9.2p290
@@ -32,7 +32,7 @@ describe "Yaml file format" do
32
32
 
33
33
  it "can save custom data " do
34
34
  io = StringIO.new
35
- File.stub!(:open).and_yield(io)
35
+ File.should_receive(:open).and_yield(io)
36
36
  @test_module::VERSION.bump(:minor)
37
37
  @test_module::VERSION.author = 'jcangas'
38
38
  @test_module::VERSION.save
@@ -45,14 +45,14 @@ describe "Yaml file format" do
45
45
 
46
46
  it "can load " do
47
47
  io = StringIO.new("--- \nmajor: 1\nminor: 2\npatch: 3\n")
48
- File.should_receive(:read).and_return{io}
48
+ File.should_receive(:open).and_yield(io)
49
49
  @test_module::VERSION.load
50
50
  @test_module::VERSION.to_hash.should == {:major => 1, :minor => 2, :patch => 3 }
51
51
  end
52
52
 
53
53
  it "can load custom data " do
54
54
  io = StringIO.new("--- \nmajor: 1\nminor: 2\npatch: 3\nauthor: jcangas\n")
55
- File.should_receive(:read).and_return{io}
55
+ File.should_receive(:open).and_yield(io)
56
56
  @test_module::VERSION.load
57
57
  @test_module::VERSION.to_hash.should == {:major => 1, :minor => 2, :patch => 3, :author => 'jcangas' }
58
58
  end
metadata CHANGED
@@ -1,71 +1,85 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: version_info
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.4
5
- prerelease:
4
+ version: 1.7.5
6
5
  platform: ruby
7
6
  authors:
8
7
  - Jorge L. Cangas
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-05-14 00:00:00.000000000 Z
11
+ date: 2013-03-20 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: bundler
16
- requirement: &70114498815260 !ruby/object:Gem::Requirement
17
- none: false
15
+ requirement: !ruby/object:Gem::Requirement
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :development
23
21
  prerelease: false
24
- version_requirements: *70114498815260
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
25
27
  - !ruby/object:Gem::Dependency
26
28
  name: rake
27
- requirement: &70114498814500 !ruby/object:Gem::Requirement
28
- none: false
29
+ requirement: !ruby/object:Gem::Requirement
29
30
  requirements:
30
- - - ! '>='
31
+ - - '>='
31
32
  - !ruby/object:Gem::Version
32
33
  version: '0'
33
34
  type: :development
34
35
  prerelease: false
35
- version_requirements: *70114498814500
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
36
41
  - !ruby/object:Gem::Dependency
37
42
  name: rspec
38
- requirement: &70114498813920 !ruby/object:Gem::Requirement
39
- none: false
43
+ requirement: !ruby/object:Gem::Requirement
40
44
  requirements:
41
- - - ! '>='
45
+ - - '>='
42
46
  - !ruby/object:Gem::Version
43
47
  version: '0'
44
48
  type: :development
45
49
  prerelease: false
46
- version_requirements: *70114498813920
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
47
55
  - !ruby/object:Gem::Dependency
48
56
  name: test_notifier
49
- requirement: &70114498812500 !ruby/object:Gem::Requirement
50
- none: false
57
+ requirement: !ruby/object:Gem::Requirement
51
58
  requirements:
52
- - - ! '>='
59
+ - - '>='
53
60
  - !ruby/object:Gem::Version
54
61
  version: '0'
55
62
  type: :development
56
63
  prerelease: false
57
- version_requirements: *70114498812500
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
58
69
  - !ruby/object:Gem::Dependency
59
70
  name: notifier
60
- requirement: &70114498811200 !ruby/object:Gem::Requirement
61
- none: false
71
+ requirement: !ruby/object:Gem::Requirement
62
72
  requirements:
63
- - - ! '>='
73
+ - - '>='
64
74
  - !ruby/object:Gem::Version
65
75
  version: '0'
66
76
  type: :development
67
77
  prerelease: false
68
- version_requirements: *70114498811200
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  description: Easy way to get version label, bump the segments (major, minor, patch),
70
84
  and you can include custom version data
71
85
  email:
@@ -99,32 +113,25 @@ files:
99
113
  - version_info.gemspec
100
114
  homepage: http://github.com/jcangas/version_info
101
115
  licenses: []
116
+ metadata: {}
102
117
  post_install_message:
103
118
  rdoc_options: []
104
119
  require_paths:
105
120
  - lib
106
121
  required_ruby_version: !ruby/object:Gem::Requirement
107
- none: false
108
122
  requirements:
109
- - - ! '>='
123
+ - - '>='
110
124
  - !ruby/object:Gem::Version
111
125
  version: '0'
112
126
  required_rubygems_version: !ruby/object:Gem::Requirement
113
- none: false
114
127
  requirements:
115
- - - ! '>='
128
+ - - '>='
116
129
  - !ruby/object:Gem::Version
117
130
  version: '0'
118
131
  requirements: []
119
132
  rubyforge_project: version_info
120
- rubygems_version: 1.8.17
133
+ rubygems_version: 2.0.3
121
134
  signing_key:
122
- specification_version: 3
135
+ specification_version: 4
123
136
  summary: A Ruby gem to manage your project version data. Rake tasks included!
124
- test_files:
125
- - spec/spec_helper.rb
126
- - spec/version_info/module_format_spec.rb
127
- - spec/version_info/test_file.rb
128
- - spec/version_info/text_format_spec.rb
129
- - spec/version_info/version_info_spec.rb
130
- - spec/version_info/yaml_format_spec.rb
137
+ test_files: []