bozo-scripts 0.2.1 → 0.2.2

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.2
@@ -5,6 +5,17 @@ module Bozo::Hooks
5
5
  def post_dependencies
6
6
  env['GIT_HASH'] = `git log -1 --format="%h"`.strip
7
7
  env['GIT_HASH_FULL'] = `git log -1 --format="%H"`.strip
8
+ env['BUILD_VERSION'] = build_version
9
+ end
10
+
11
+ private
12
+
13
+ def build_version
14
+ if pre_release?
15
+ Bozo::Versioning::Version.new(version.major, version.minor, version.patch, "pre#{env['GIT_HASH']}")
16
+ else
17
+ version
18
+ end
8
19
  end
9
20
 
10
21
  end
@@ -6,9 +6,9 @@ module Bozo::Hooks
6
6
 
7
7
  def post_publish
8
8
  return unless build_server?
9
- log_info "Tagging repository for release #{version}"
9
+ log_info "Tagging repository for release #{env['BUILD_VERSION']}"
10
10
 
11
- tag_name = "rel-#{version}"
11
+ tag_name = "rel-#{env['BUILD_VERSION']}"
12
12
 
13
13
  if `git tag`.split("\n").include? tag_name
14
14
  raise Bozo::ConfigurationError.new "The tag #{tag_name} already exists"
@@ -54,13 +54,7 @@ module Bozo::Packagers
54
54
 
55
55
  # Returns the version that the package should be given.
56
56
  def package_version
57
- # If running on a build server then it is a real release, otherwise it is
58
- # a preview release and the version should reflect that.
59
- if pre_release?
60
- "#{version}-pre#{env['GIT_HASH']}"
61
- else
62
- version
63
- end
57
+ env['BUILD_VERSION']
64
58
  end
65
59
 
66
60
  private
@@ -16,21 +16,35 @@ module Bozo::Packagers
16
16
  private
17
17
 
18
18
  def build_gem(spec)
19
- version_file = File.expand_path(File.dirname(File.realpath(__FILE__)) + '/../../../VERSION')
20
-
21
19
  if pre_release?
22
- File.open(version_file, 'w') { |f| f << "#{version}.pre#{env['GIT_HASH']}" }
20
+ package_version.write_to_file
23
21
  end
24
22
 
25
23
  begin
26
24
  execute_command :rubygems, ['gem', 'build', spec]
27
25
  ensure
28
26
  if pre_release?
29
- File.open(version_file, 'w') { |f| f << version.to_s }
27
+ version.write_to_file
30
28
  end
31
29
  end
32
30
  end
33
31
 
32
+ def package_version
33
+ RubyGemVersion.parse(env['BUILD_VERSION'])
34
+ end
35
+
36
+ class RubyGemVersion < Bozo::Versioning::Version
37
+
38
+ def self.parse(version)
39
+ new version.major, version.minor, version.patch, version.extension
40
+ end
41
+
42
+ def to_s
43
+ "#{major}.#{minor}.#{patch}.#{extension}"
44
+ end
45
+
46
+ end
47
+
34
48
  end
35
49
 
36
50
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bozo-scripts
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -67,7 +67,7 @@ dependencies:
67
67
  requirements:
68
68
  - - ~>
69
69
  - !ruby/object:Gem::Version
70
- version: 0.3.6
70
+ version: 0.3.7
71
71
  type: :runtime
72
72
  prerelease: false
73
73
  version_requirements: !ruby/object:Gem::Requirement
@@ -75,7 +75,7 @@ dependencies:
75
75
  requirements:
76
76
  - - ~>
77
77
  - !ruby/object:Gem::Version
78
- version: 0.3.6
78
+ version: 0.3.7
79
79
  - !ruby/object:Gem::Dependency
80
80
  name: zip
81
81
  requirement: !ruby/object:Gem::Requirement
@@ -141,7 +141,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
141
141
  version: '0'
142
142
  segments:
143
143
  - 0
144
- hash: -2539903823020422155
144
+ hash: 95684068576653217
145
145
  required_rubygems_version: !ruby/object:Gem::Requirement
146
146
  none: false
147
147
  requirements:
@@ -150,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
150
150
  version: '0'
151
151
  segments:
152
152
  - 0
153
- hash: -2539903823020422155
153
+ hash: 95684068576653217
154
154
  requirements: []
155
155
  rubyforge_project: bozo-scripts
156
156
  rubygems_version: 1.8.24