instapusher 0.0.32 → 0.0.33
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/instapusher +9 -0
- data/lib/instapusher/commands.rb +3 -1
- data/lib/instapusher/configuration.rb +24 -0
- data/lib/instapusher/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5aea7c28d485e5da5d92108068aa64d45460047c
|
4
|
+
data.tar.gz: 83c404ff149c0f2d1c1b6ede8fc5923ee347a46b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2ede15b7e66302be92d158d738453cd41458e62f21b8d4c92393aa38495e922c11600ef7a89fccc399a0f5dcb51a5bea4ed2bcf1cc522710ae8e17f7421b9a6
|
7
|
+
data.tar.gz: 38a943dcde9fcd56b2908894389c097c38d3864faa2077aff2fbf279808da004f10b38731647597bfd8ff8c85a1cc0c4ce1671c8754ae16e0bd7aa42d760fe9e
|
data/bin/instapusher
CHANGED
@@ -22,10 +22,19 @@ OptionParser.new do |opts|
|
|
22
22
|
opts.on("--debug", "Show debug messages") do |v|
|
23
23
|
options[:debug] = v
|
24
24
|
end
|
25
|
+
|
26
|
+
opts.on("--api-key", "Setup Instapusher api key") do |v|
|
27
|
+
options[:api_key] = v
|
28
|
+
end
|
29
|
+
|
25
30
|
end.parse!
|
26
31
|
|
27
32
|
if options[:version]
|
28
33
|
puts Instapusher::VERSION
|
34
|
+
|
35
|
+
elsif options[:api_key]
|
36
|
+
Instapusher::Configuration.ask_for_and_write_api_key
|
37
|
+
|
29
38
|
else
|
30
39
|
Instapusher::Commands.new(options).deploy
|
31
40
|
end
|
data/lib/instapusher/commands.rb
CHANGED
@@ -48,7 +48,9 @@ module Instapusher
|
|
48
48
|
@api_key = ENV['API_KEY'] || Instapusher::Configuration.api_key(debug) || ""
|
49
49
|
|
50
50
|
if @api_key.to_s.length == 0
|
51
|
-
|
51
|
+
puts ''
|
52
|
+
abort "No instapusher API key was found. Please execute instapusher --api-key to setup instapusher API key."
|
53
|
+
|
52
54
|
elsif debug
|
53
55
|
puts "api_key is #{@api_key}"
|
54
56
|
end
|
@@ -21,6 +21,30 @@ module Instapusher
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
+
def ask_for_api_key
|
25
|
+
puts ""
|
26
|
+
puts "Note: Your instapusher API key is available at http://www.instapusher.com/my/api_key"
|
27
|
+
puts ""
|
28
|
+
puts "Enter your Instapusher API key:"
|
29
|
+
api_key = ask
|
30
|
+
api_key
|
31
|
+
end
|
32
|
+
|
33
|
+
def ask_for_and_write_api_key
|
34
|
+
api_key = ask_for_api_key
|
35
|
+
instapusher_config = {"api_key" => api_key}
|
36
|
+
File.open(File.join(Dir.home, ".instapusher"), "w") do |file|
|
37
|
+
file.write instapusher_config.to_yaml
|
38
|
+
end
|
39
|
+
|
40
|
+
puts ""
|
41
|
+
puts "You are all set. Start using instapusher."
|
42
|
+
end
|
43
|
+
|
44
|
+
def ask
|
45
|
+
$stdin.gets.to_s.strip
|
46
|
+
end
|
47
|
+
|
24
48
|
def method_missing(name, *args, &block)
|
25
49
|
self.load
|
26
50
|
@_settings[name.to_s]
|
data/lib/instapusher/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.33
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Neeraj Singh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: hashr
|