instapusher 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/instapusher.gemspec CHANGED
@@ -17,4 +17,5 @@ Gem::Specification.new do |gem|
17
17
 
18
18
  gem.add_dependency("hashr", "~> 0.0.19")
19
19
  gem.add_dependency("heroku", "~> 2.25.0")
20
+ gem.add_dependency("multi_json")
20
21
  end
@@ -7,38 +7,31 @@ module Instapusher
7
7
  class Commands
8
8
  DEFAULT_HOSTNAME = 'instapusher.com'
9
9
 
10
- def self.deploy
10
+ def self.deploy(project_name=nil, branch_name=nil)
11
11
 
12
12
  hostname = ENV['INSTAPUSHER_HOST'] || DEFAULT_HOSTNAME
13
+ hostname = "localhost:3000" if ENV['LOCAL']
13
14
 
14
- #TODO: Remove this env and use host instead of duplication
15
- if ENV['LOCAL']
16
- hostname = "localhost:3000"
17
- end
18
- url = "http://#{hostname}/heroku"
19
-
20
-
21
- git = Git.new
22
- branch_name = git.current_branch
23
- project_name = git.project_name
15
+ url = "http://#{hostname}/heroku.json"
16
+ git = Git.new
17
+ branch_name ||= git.current_branch
18
+ project_name ||= git.project_name
24
19
 
25
20
  api_key = Instapusher::Configuration.api_key || ""
26
21
  if api_key.to_s.length == 0
27
22
  puts "Please enter instapusher api_key at ~/.instapusher "
28
23
  end
29
24
 
30
- options = { project: project_name,
31
- branch: branch_name,
32
- local: ENV['LOCAL'],
33
- api_key: api_key }
25
+ options = { project: project_name,
26
+ branch: branch_name,
27
+ local: ENV['LOCAL'],
28
+ api_key: api_key }
34
29
 
35
30
  response = Net::HTTP.post_form URI.parse(url), options
36
-
37
- response_body = MultiJson.load(response.body)
38
- job_status_url = response_body['status'] || response_body['job_status_url']
31
+ response_body = MultiJson.load(response.body)
32
+ job_status_url = response_body['status'] || response_body['job_status_url']
39
33
 
40
34
  if job_status_url && job_status_url != ""
41
- job_status_url = job_status_url.gsub(DEFAULT_HOSTNAME, hostname) if ENV['LOCAL']
42
35
  puts 'The appliction will be deployed to: ' + response_body['heroku_url']
43
36
  puts 'Monitor the job status at: ' + job_status_url
44
37
  cmd = "open #{job_status_url}"
@@ -1,3 +1,3 @@
1
1
  module Instapusher
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: instapusher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-04 00:00:00.000000000 Z
12
+ date: 2013-03-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: hashr
@@ -43,6 +43,22 @@ dependencies:
43
43
  - - ~>
44
44
  - !ruby/object:Gem::Version
45
45
  version: 2.25.0
46
+ - !ruby/object:Gem::Dependency
47
+ name: multi_json
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
46
62
  description: instapusher makes it easy to push code to heroku
47
63
  email:
48
64
  - neeraj@bigbinary.com
@@ -81,7 +97,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
81
97
  version: '0'
82
98
  segments:
83
99
  - 0
84
- hash: 2440395512267177846
100
+ hash: 3024614146394705757
85
101
  required_rubygems_version: !ruby/object:Gem::Requirement
86
102
  none: false
87
103
  requirements:
@@ -90,7 +106,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
90
106
  version: '0'
91
107
  segments:
92
108
  - 0
93
- hash: 2440395512267177846
109
+ hash: 3024614146394705757
94
110
  requirements: []
95
111
  rubyforge_project:
96
112
  rubygems_version: 1.8.23