omnibus 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MGQ1NWQyMTRmYTExYjZiNTg1OGMzYWZjNDlkOWIzNjlhN2E3NmM1Nw==
4
+ ZTkxMzRjMmQ2ZmZhZGE4YjBiYzdjOTllOTBhYzFhMDc5ODY0OThhNQ==
5
5
  data.tar.gz: !binary |-
6
- OWRkMzNiOTI5YWMxZGFmNjU1OGI2Y2U2YzlkMDI2ZTE4NWE0Mzc0NA==
6
+ ZmIzYjRiNDdjNDkyYzVhMGY4YTk3ODNiMmVjYTg4YjVlMWE2MDE0YQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- NDZlNjA3N2MyMjViOTVhMGM2OGNlZWE3YTRhYmVhNDk5MWMxY2IxOTgzNjli
10
- NWE0OTZkYjNlOThjYjhkNWVlYjhkOWIzOWZmYzAxNzU0MzAxYWMxY2ZhZGRk
11
- MGQwOWQ3NWI3Yjc3NzUzNDM2Nzk0MmU5MDE4ZjhkYjliNTU3OTc=
9
+ ZjljYzFjNTU4MDI2NDY5YzRhZmEwNjcyOTA4ZmRiNGE1YWVmYThmYzhmOGI3
10
+ NGEwMWZlNDI0YzdjZmY5OTg5YWQ1MjAwOTM4Y2I3MTgxNmJhMjQ4YWI2MDhl
11
+ MjU4OTVlN2E3Zjc4YTY5YjQ2MTNmMmU2MzRjOWVjZTYyOTg3ZmE=
12
12
  data.tar.gz: !binary |-
13
- ZmYyOWVkZDljYTkzMDIwNWQ1NmFjNTA4MGZmMDc4NzkxNjAxYjUzM2RlMmFj
14
- NTcwYjExZDc0ZmEzZTQwOTkwOWRlZjdjZjdhYjVlYTczMThlMGJjMGJjODJj
15
- NWVhZjFlZjg2ZTVmNjgyZmZmZjQ3ZjlmZjRlNTBmYmQ2ODg5Yzg=
13
+ MDEzMmM5MzRiZjM4YWQ4ZTE3NjMxYTkxNjNiYjYxM2RkYmFiNWRiYjk4YjRi
14
+ Zjk0ZGNmNjM1YjhmZDI3ZDU4YjZlMWZmMTc3N2Y3MzNmMGMyNWQxOGFlNWNk
15
+ MmY0NTljMzdjNTI2NjAwNWVkOGE3MGRmYmExODU5NjY2MTliYjQ=
@@ -0,0 +1,5 @@
1
+ language: ruby
2
+ rvm:
3
+ - 1.9.2
4
+ - 1.9.3
5
+ script: rake spec
@@ -1,3 +1,14 @@
1
+ ## 1.0.2 (April 23, 2013)
2
+
3
+ IMPROVEMENTS:
4
+
5
+ * Travis CI support
6
+
7
+ BUG FIXES:
8
+
9
+ * [CHEF-4112] `omnibus build project` command does not respect the
10
+ `--no-timestamp` flag
11
+
1
12
  ## 1.0.1 (April 21, 2013)
2
13
 
3
14
  BUG FIXES:
data/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  ## Omnibus
2
2
 
3
+ [![Build Status](https://travis-ci.org/opscode/omnibus-ruby.png?branch=master)](https://travis-ci.org/opscode/omnibus-ruby)
4
+ [![Code Climate](https://codeclimate.com/github/opscode/omnibus-ruby.png)](https://codeclimate.com/github/opscode/omnibus-ruby)
5
+
3
6
  Easily create full-stack installers for your project across a variety
4
7
  of platforms.
5
8
 
@@ -269,13 +269,14 @@ module Omnibus
269
269
  version_regexp.match(git_describe)[1..3]
270
270
  end
271
271
 
272
-
273
272
  def append_timestamp?
274
- append_timestamp = true
275
- if ENV['OMNIBUS_APPEND_TIMESTAMP'] && (ENV['OMNIBUS_APPEND_TIMESTAMP'] =~ (/(false|f|no|n|0)$/i))
276
- append_timestamp = false
273
+ if ENV['OMNIBUS_APPEND_TIMESTAMP'] && (ENV['OMNIBUS_APPEND_TIMESTAMP'] =~ (/^(false|f|no|n|0)$/i))
274
+ false
275
+ elsif ENV['OMNIBUS_APPEND_TIMESTAMP'] && (ENV['OMNIBUS_APPEND_TIMESTAMP'] =~ (/^(true|t|yes|y|1)$/i))
276
+ true
277
+ else
278
+ Omnibus::Config.append_timestamp
277
279
  end
278
- append_timestamp
279
280
  end
280
281
  end
281
282
  end
@@ -45,6 +45,7 @@ module Omnibus
45
45
  # TODO: merge in all relevant CLI options here, as they should
46
46
  # override anything from a configuration file.
47
47
  Omnibus::Config.project_root(path)
48
+ Omnibus::Config.append_timestamp(@options[:timestamp]) if @options.key?('timestamp')
48
49
 
49
50
  unless Omnibus.project_files.any?
50
51
  raise Omnibus::CLI::Error, "Given path '#{path}' does not appear to be a valid Omnibus project root."
@@ -39,14 +39,10 @@ module Omnibus
39
39
  project = load_project!(project_name)
40
40
  project_task_name = "projects:#{project.name}"
41
41
 
42
- say("Building #{project.name}", :green)
43
42
  unless options[:timestamp]
44
43
  say("I won't append a timestamp to the version identifier.", :yellow)
45
44
  end
46
-
47
- # Until we have time to integrate the CLI deeply into the Omnibus codebase
48
- # this will have to suffice! (sadpanda)
49
- ENV['OMNIBUS_APPEND_TIMESTAMP'] = options[:timestamp].to_s
45
+ say("Building #{project.name} #{project.build_version}", :green)
50
46
 
51
47
  Rake::Task[project_task_name].invoke
52
48
  end
@@ -159,6 +159,15 @@ module Omnibus
159
159
 
160
160
  # @!endgroup
161
161
 
162
+ # @!group Build Version Parameters
163
+
164
+ # @!attribute [rw] append_timestamp
165
+ #
166
+ # @return [Boolean]
167
+ append_timestamp true
168
+
169
+ # # @!endgroup
170
+
162
171
  # @!group Validation Methods
163
172
 
164
173
  # Asserts that the Config object is in a valid state. If invalid
@@ -16,5 +16,5 @@
16
16
  #
17
17
 
18
18
  module Omnibus
19
- VERSION = "1.0.1"
19
+ VERSION = "1.0.2"
20
20
  end
@@ -156,36 +156,58 @@ describe Omnibus::BuildVersion do
156
156
  end
157
157
  end
158
158
 
159
- describe "ENV['OMNIBUS_APPEND_TIMESTAMP'] usage" do
160
-
159
+ describe "appending a timestamp" do
161
160
  let(:git_describe){ "11.0.0-alpha-3-207-g694b062" }
162
161
 
163
- it "appends a timestamp if not set" do
162
+ it "appends a timestamp by default" do
164
163
  build_version.semver.should =~ /11.0.0-alpha.3\+#{today_string}[0-9]+.git.207.694b062/
165
164
  end
166
165
 
167
- context "appends a timestamp if set to a truthy value" do
166
+ describe "ENV['OMNIBUS_APPEND_TIMESTAMP'] is set" do
168
167
  ["true","t","yes","y",1].each do |truthy|
169
- let(:value) { truthy }
170
- before { ENV['OMNIBUS_APPEND_TIMESTAMP'] = value.to_s }
168
+ context "to #{truthy}" do
169
+ before { ENV['OMNIBUS_APPEND_TIMESTAMP'] = truthy.to_s }
170
+ it "appends a timestamp" do
171
+ build_version.semver.should =~ /11.0.0-alpha.3\+#{today_string}[0-9]+.git.207.694b062/
172
+ end
173
+ end
174
+ end
171
175
 
172
- it "with #{truthy}" do
173
- build_version.semver.should =~ /11.0.0-alpha.3\+#{today_string}[0-9]+.git.207.694b062/
176
+ ["false","f","no","n",0].each do |falsey|
177
+ context "to #{falsey}" do
178
+ before { ENV['OMNIBUS_APPEND_TIMESTAMP'] = falsey.to_s }
179
+ it "does not append a timestamp" do
180
+ build_version.semver.should =~ /11.0.0-alpha.3\+git.207.694b062/
181
+ end
174
182
  end
175
183
  end
176
184
  end
177
185
 
178
- context "does not append a timestamp if set to a falsey value" do
179
- ["false","f","no","n",0].each do |falsey|
180
- let(:value) { falsey }
181
- before { ENV['OMNIBUS_APPEND_TIMESTAMP'] = value.to_s }
186
+ describe "Omnibus::Config.append_timestamp is set" do
187
+ context "is true" do
188
+ before { Omnibus::Config.append_timestamp(true) }
189
+ it "appends a timestamp" do
190
+ build_version.semver.should =~ /11.0.0-alpha.3\+#{today_string}[0-9]+.git.207.694b062/
191
+ end
192
+ end
182
193
 
183
- it "with #{falsey}" do
194
+ context "is false" do
195
+ before { Omnibus::Config.append_timestamp(false) }
196
+ it "does not append a timestamp" do
184
197
  build_version.semver.should =~ /11.0.0-alpha.3\+git.207.694b062/
185
198
  end
186
199
  end
187
200
  end
188
201
 
202
+ describe "both are set" do
203
+ before do
204
+ ENV['OMNIBUS_APPEND_TIMESTAMP'] = "false"
205
+ Omnibus::Config.append_timestamp(true)
206
+ end
207
+ it "prefers the value from ENV['OMNIBUS_APPEND_TIMESTAMP']" do
208
+ build_version.semver.should =~ /11.0.0-alpha.3\+git.207.694b062/
209
+ end
210
+ end
189
211
  end
190
212
  end
191
213
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omnibus
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Opscode
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-21 00:00:00.000000000 Z
11
+ date: 2013-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mixlib-shellout
@@ -145,6 +145,7 @@ extra_rdoc_files: []
145
145
  files:
146
146
  - .gitignore
147
147
  - .rspec
148
+ - .travis.yml
148
149
  - .yardopts
149
150
  - CHANGELOG.md
150
151
  - Gemfile