instapusher 0.0.32 → 0.0.33

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e45cd7073b93ae94073b85e65f142f6a73f784f8
4
- data.tar.gz: c6fe4620be563ece6383b52d1117eeef4180d476
3
+ metadata.gz: 5aea7c28d485e5da5d92108068aa64d45460047c
4
+ data.tar.gz: 83c404ff149c0f2d1c1b6ede8fc5923ee347a46b
5
5
  SHA512:
6
- metadata.gz: e0812c4b3acb2cc4a10ee6bf4c7b6a77120547d34fbf708d0124b55690527b62d3a0f56b90d49a8401ce565563dfdf0c2cfb9c9e2f70b60bef2cd1fc69713724
7
- data.tar.gz: abd661bf3630ed7b8bc4f8c31dd4ebda165c03b1580af4e85cbcc6d6c0d548444f4a3db99525642207cb6355e419fc2555b91f5821c475d5b394551681f8f212
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
@@ -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
- abort "Please enter instapusher api_key at ~/.instapusher "
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]
@@ -1,3 +1,3 @@
1
1
  module Instapusher
2
- VERSION = "0.0.32"
2
+ VERSION = "0.0.33"
3
3
  end
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.32
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: 2013-12-24 00:00:00.000000000 Z
11
+ date: 2014-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hashr