pushwagner 0.0.1.2 → 0.0.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,7 +11,8 @@ module Pushwagner
11
11
  def initialize(opts = {})
12
12
  opts = HashWithIndifferentAccess.new(opts)
13
13
 
14
- config_file = opts[:config_file] || File.join(File.dirname(__FILE__), '/config/deploy.yml')
14
+ config_file = look_for_config_file(opts[:config_file])
15
+
15
16
  @version = opts[:version] && opts[:version].to_s
16
17
  @current = opts[:environment] || 'development'
17
18
 
@@ -53,5 +54,17 @@ module Pushwagner
53
54
  def user
54
55
  environment['user'] || "nobody"
55
56
  end
57
+
58
+ private
59
+ def look_for_config_file(file)
60
+ locations = [file, './deploy.yml', './.pw.yml', './config/deploy.yml']
61
+
62
+ locations.each do |location|
63
+ return location if File.exist? location
64
+ cf = File.join(File.dirname(__FILE__), location) # i.e rake/thor.
65
+ return cf if File.exist? cf
66
+ end
67
+ raise "Couldn't find config file in locations: #{locations.join(', ')}"
68
+ end
56
69
  end
57
70
  end
@@ -1,3 +1,3 @@
1
1
  module Pushwagner
2
- VERSION = "0.0.1.2"
2
+ VERSION = "0.0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pushwagner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.2
4
+ version: 0.0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: