combat 0.9.2 → 0.9.5

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/combat.rb +10 -6
  2. data/lib/version.rb +1 -1
  3. metadata +2 -2
@@ -1,5 +1,7 @@
1
1
  class Combat < Thor
2
2
  include Thor::Actions
3
+
4
+ COMBAT_CONFIG_FILE = 'combat.yml'
3
5
 
4
6
  map '-s' => 'setup'
5
7
  map '-d' => 'deploy'
@@ -37,8 +39,8 @@ class Combat < Thor
37
39
  :remote_user => defaults[:remote_user] || 'www-data'
38
40
  }
39
41
 
40
- unless File.exists?('combat.yml')
41
- create_file 'combat.yml', settings.to_yaml
42
+ unless File.exists?(COMBAT_CONFIG_FILE)
43
+ create_file COMBAT_CONFIG_FILE, settings.to_yaml
42
44
  end
43
45
 
44
46
  system "mkdir -p deployed"
@@ -51,8 +53,9 @@ class Combat < Thor
51
53
  end
52
54
 
53
55
  desc "deploy", "Deploy a project to the server for testing"
56
+ method_options :config => :string
54
57
  def deploy
55
- load_config
58
+ load_config(options[:config] || COMBAT_CONFIG_FILE)
56
59
 
57
60
  if @config.valid?
58
61
  deploy_html_file = 'combat_deployed_page.html'
@@ -82,8 +85,9 @@ class Combat < Thor
82
85
  end
83
86
 
84
87
  desc "open", "Open the deploy page in the browser (Mac OS only)"
88
+ method_options :config => :string
85
89
  def open
86
- load_config
90
+ load_config(options[:config] || COMBAT_CONFIG_FILE)
87
91
  %x{open #{@config.url}}
88
92
  end
89
93
 
@@ -97,8 +101,8 @@ class Combat < Thor
97
101
  end
98
102
  end
99
103
 
100
- def load_config
101
- string = File.read("combat.yml")
104
+ def load_config(file)
105
+ string = File.read(file)
102
106
  yml = YAML::load(string)
103
107
  @config = Settings.new(yml)
104
108
  end
@@ -1,3 +1,3 @@
1
1
  module Combat
2
- VERSION = '0.9.2'
2
+ VERSION = '0.9.5'
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: combat
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.9.2
5
+ version: 0.9.5
6
6
  platform: ruby
7
7
  authors:
8
8
  - Tomislav Car
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-10-27 00:00:00 Z
13
+ date: 2011-11-16 00:00:00 Z
14
14
  dependencies: []
15
15
 
16
16
  description: Deploy your iPhone and Android apps to clients with ease. It's like Capistrano, only for mobile apps.