geordi 0.9.3 → 0.9.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/geordi/version.rb +1 -1
  2. data/lib/geordi.rb +4 -2
  3. metadata +4 -4
@@ -1,3 +1,3 @@
1
1
  module Geordi
2
- VERSION = '0.9.3'
2
+ VERSION = '0.9.4'
3
3
  end
data/lib/geordi.rb CHANGED
@@ -31,7 +31,7 @@ module Geordi
31
31
  @user = retrieve! "user", /^set :user,/
32
32
  @server = retrieve! "server", /^server /
33
33
  @path = retrieve!("deploy_to", /^set :deploy_to,/) + '/current'
34
- @env = retrieve! "environment", /^set :rails_env,/
34
+ @env = retrieve!("environment", /^set :rails_env,/, 'production')
35
35
 
36
36
  # fix
37
37
  %w[user server path env].each do |attr|
@@ -50,10 +50,12 @@ module Geordi
50
50
  current
51
51
  end
52
52
 
53
- def retrieve!(name, regex)
53
+ def retrieve!(name, regex, default = nil)
54
54
  if line = @lines.find{ |line| line =~ regex }
55
55
  line.match(/["'](.*)["']/)
56
56
  $1
57
+ elsif default
58
+ default
57
59
  else
58
60
  raise "Could not find :#{name} for stage '#{stage}'!\nAborting..."
59
61
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geordi
3
3
  version: !ruby/object:Gem::Version
4
- hash: 61
4
+ hash: 51
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
- - 3
10
- version: 0.9.3
9
+ - 4
10
+ version: 0.9.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Henning Koch
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-02-22 00:00:00 +01:00
18
+ date: 2012-02-23 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies: []
21
21