instapusher 0.0.17 → 0.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +2 -2
- data/bin/instapusher +27 -4
- data/lib/instapusher/commands.rb +11 -8
- data/lib/instapusher/version.rb +1 -1
- metadata +3 -3
data/README.md
CHANGED
data/bin/instapusher
CHANGED
@@ -1,10 +1,33 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
require_relative '../lib/instapusher/commands'
|
4
|
+
require_relative '../lib/instapusher/version'
|
5
5
|
|
6
|
-
|
6
|
+
require 'optparse'
|
7
|
+
|
8
|
+
options = {}
|
9
|
+
OptionParser.new do |opts|
|
10
|
+
|
11
|
+
opts.on("-v", "--version", "show version") do |v|
|
12
|
+
options[:version] = v
|
13
|
+
end
|
14
|
+
|
15
|
+
opts.on("--quick", "Run quickly") do |v|
|
16
|
+
options[:quickly] = v
|
17
|
+
end
|
18
|
+
|
19
|
+
opts.on("--local", "Run locally") do |v|
|
20
|
+
options[:local] = v
|
21
|
+
end
|
22
|
+
|
23
|
+
opts.on("--debug", "Show debug messages") do |v|
|
24
|
+
options[:debug] = v
|
25
|
+
end
|
26
|
+
end.parse!
|
27
|
+
|
28
|
+
if options[:version]
|
7
29
|
puts Instapusher::VERSION
|
8
30
|
else
|
9
|
-
|
31
|
+
debugger
|
32
|
+
Instapusher::Commands.deploy(options)
|
10
33
|
end
|
data/lib/instapusher/commands.rb
CHANGED
@@ -7,28 +7,31 @@ module Instapusher
|
|
7
7
|
class Commands
|
8
8
|
DEFAULT_HOSTNAME = 'instapusher.com'
|
9
9
|
|
10
|
-
def self.deploy(
|
11
|
-
|
10
|
+
def self.deploy(_options)
|
11
|
+
|
12
|
+
debug = _options(:debug)
|
13
|
+
|
12
14
|
hostname = ENV['INSTAPUSHER_HOST'] || DEFAULT_HOSTNAME
|
13
|
-
hostname = "localhost:3000" if
|
15
|
+
hostname = "localhost:3000" if _options[:local]
|
14
16
|
|
15
17
|
url = "http://#{hostname}/heroku.json"
|
16
18
|
git = Git.new
|
17
|
-
branch_name
|
18
|
-
project_name
|
19
|
+
branch_name = _options[:project_name] || ENV['INSTAPUSHER_BRANCH'] || git.current_branch
|
20
|
+
project_name = _options[:branch_name] || ENV['INSTAPUSHER_PROJECT'] || git.project_name
|
19
21
|
|
20
22
|
api_key = ENV['API_KEY'] || Instapusher::Configuration.api_key || ""
|
23
|
+
|
21
24
|
if api_key.to_s.length == 0
|
22
25
|
puts "Please enter instapusher api_key at ~/.instapusher "
|
23
26
|
end
|
24
27
|
|
25
28
|
options = { project: project_name,
|
26
29
|
branch: branch_name,
|
27
|
-
quick:
|
28
|
-
local:
|
30
|
+
quick: _options[:quick],
|
31
|
+
local: _options[:local],
|
29
32
|
api_key: api_key }
|
30
33
|
|
31
|
-
if debug
|
34
|
+
if debug || true
|
32
35
|
puts "url to hit: #{url.inspect}"
|
33
36
|
puts "options being passed to the url: #{options.inspect}"
|
34
37
|
end
|
data/lib/instapusher/version.rb
CHANGED
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.
|
4
|
+
version: 0.0.18
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -81,7 +81,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
81
81
|
version: '0'
|
82
82
|
segments:
|
83
83
|
- 0
|
84
|
-
hash:
|
84
|
+
hash: 2098198211942867454
|
85
85
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
86
86
|
none: false
|
87
87
|
requirements:
|
@@ -90,7 +90,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
90
90
|
version: '0'
|
91
91
|
segments:
|
92
92
|
- 0
|
93
|
-
hash:
|
93
|
+
hash: 2098198211942867454
|
94
94
|
requirements: []
|
95
95
|
rubyforge_project:
|
96
96
|
rubygems_version: 1.8.23
|