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 +8 -8
- data/.travis.yml +5 -0
- data/CHANGELOG.md +11 -0
- data/README.md +3 -0
- data/lib/omnibus/build_version.rb +6 -5
- data/lib/omnibus/cli/base.rb +1 -0
- data/lib/omnibus/cli/build.rb +1 -5
- data/lib/omnibus/config.rb +9 -0
- data/lib/omnibus/version.rb +1 -1
- data/spec/build_version_spec.rb +35 -13
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZTkxMzRjMmQ2ZmZhZGE4YjBiYzdjOTllOTBhYzFhMDc5ODY0OThhNQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZmIzYjRiNDdjNDkyYzVhMGY4YTk3ODNiMmVjYTg4YjVlMWE2MDE0YQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZjljYzFjNTU4MDI2NDY5YzRhZmEwNjcyOTA4ZmRiNGE1YWVmYThmYzhmOGI3
|
10
|
+
NGEwMWZlNDI0YzdjZmY5OTg5YWQ1MjAwOTM4Y2I3MTgxNmJhMjQ4YWI2MDhl
|
11
|
+
MjU4OTVlN2E3Zjc4YTY5YjQ2MTNmMmU2MzRjOWVjZTYyOTg3ZmE=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MDEzMmM5MzRiZjM4YWQ4ZTE3NjMxYTkxNjNiYjYxM2RkYmFiNWRiYjk4YjRi
|
14
|
+
Zjk0ZGNmNjM1YjhmZDI3ZDU4YjZlMWZmMTc3N2Y3MzNmMGMyNWQxOGFlNWNk
|
15
|
+
MmY0NTljMzdjNTI2NjAwNWVkOGE3MGRmYmExODU5NjY2MTliYjQ=
|
data/.travis.yml
ADDED
data/CHANGELOG.md
CHANGED
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
|
-
|
275
|
-
|
276
|
-
|
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
|
data/lib/omnibus/cli/base.rb
CHANGED
@@ -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."
|
data/lib/omnibus/cli/build.rb
CHANGED
@@ -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
|
data/lib/omnibus/config.rb
CHANGED
@@ -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
|
data/lib/omnibus/version.rb
CHANGED
data/spec/build_version_spec.rb
CHANGED
@@ -156,36 +156,58 @@ describe Omnibus::BuildVersion do
|
|
156
156
|
end
|
157
157
|
end
|
158
158
|
|
159
|
-
describe "
|
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
|
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
|
-
|
166
|
+
describe "ENV['OMNIBUS_APPEND_TIMESTAMP'] is set" do
|
168
167
|
["true","t","yes","y",1].each do |truthy|
|
169
|
-
|
170
|
-
|
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
|
-
|
173
|
-
|
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
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
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
|
-
|
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.
|
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-
|
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
|