instapusher 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 13ab1dd3f9f4115e89260265d27c8601475746cb
4
- data.tar.gz: e2c8813f00c7bd5587fbfc28e7f25bd4cae58051
3
+ metadata.gz: ccf47f331db0d63f10218933ba3de941f23a368a
4
+ data.tar.gz: d6cdba7f1bb5aa5465bfa326ccdfdd44c6ac2ae8
5
5
  SHA512:
6
- metadata.gz: 7a82bc73dc54ae135084a42385df7b15cdc26bfe531553c9bdf6f195252b9a4c371837e206d9e5404c200969a140ef2cc2af0d90be7944813496a7417a8764e4
7
- data.tar.gz: 0892a0115c104965f48e9a0666dab590f697056e27b7204c807a590d461d9860e2c9f9ba7f7a5a18a092b8e7f890f10eeae26e659e12cba501693edb2dee8798
6
+ metadata.gz: 5eefe9d5ed03814a03dc7fbd16ef105e86f48dd76ce770446868c95a408bb5a9755ce565548336f2ced57fe608c0ac467b626ce8de3c3432e83af8aa17c88094
7
+ data.tar.gz: faa00d41d405c03b2236da8d6091b872726acf06856f9f66d2a84c81cf5fcdeea9afed00c016c2f51350df03294ed6969819a4e8f45035554d6c9d8fa4099c03
@@ -7,9 +7,10 @@ module Instapusher
7
7
 
8
8
  attr_reader :debug, :api_key, :branch_name, :project_name, :staging
9
9
 
10
- def initialize init_options = {}
10
+ def initialize init_options
11
11
  @debug = init_options[:debug]
12
12
  @staging = init_options[:staging]
13
+ @local = init_options[:local]
13
14
 
14
15
  git = Git.new
15
16
  @branch_name = init_options[:project_name] || ENV['INSTAPUSHER_BRANCH'] || git.current_branch
@@ -36,6 +37,7 @@ module Instapusher
36
37
  def options
37
38
  @options ||= begin
38
39
  { project: project_name,
40
+ local: @local,
39
41
  branch: branch_name,
40
42
  owner: Git.new.repo_owner,
41
43
  version: VERSION,
@@ -1,7 +1,7 @@
1
1
  module Instapusher
2
2
 
3
3
  class RepoOwnerIdentifierService
4
-
4
+
5
5
  attr_reader :string
6
6
 
7
7
  def initialize string
@@ -32,7 +32,7 @@ module Instapusher
32
32
  def current_branch
33
33
  result = %x{git branch}.split("\n")
34
34
  if result.empty?
35
- raise "It seems your app is not a git repo"
35
+ raise "It seems your app is not a git repository. Please check."
36
36
  else
37
37
  result.select { |b| b =~ /^\*/ }.first.split(" ").last.strip
38
38
  end
@@ -8,6 +8,8 @@ module Instapusher
8
8
  def initialize debug, options
9
9
  @debug = debug
10
10
  @options = options
11
+
12
+ puts "options is #{options.inspect}"
11
13
  end
12
14
 
13
15
  def success?
@@ -36,10 +38,10 @@ module Instapusher
36
38
 
37
39
  response = Net::HTTP.post_form URI.parse(url_to_submit_job), options
38
40
  raw_body = response.body
39
- puts "raw_body: #{raw_body}" if debug
41
+ puts "response raw body: #{raw_body}" if debug
40
42
 
41
43
  @response_body = ::JSON.parse(raw_body)
42
- puts "response_body: #{response_body.inspect}" if debug
44
+ puts "JSON parsed response raw body: #{response_body.inspect}" if debug
43
45
  @job_status_url = response_body['status_url']
44
46
  end
45
47
 
@@ -52,11 +54,8 @@ module Instapusher
52
54
  else
53
55
  ENV['INSTAPUSHER_HOST'] || DEFAULT_HOSTNAME
54
56
  end
55
- if use_ssl?
56
- "https://#{hostname}/api/v1/jobs.json"
57
- else
58
- "http://#{hostname}/api/v1/jobs.json"
59
- end
57
+ protocol = use_ssl? ? 'https' : 'http'
58
+ "#{protocol}://#{hostname}/api/v1/jobs.json"
60
59
  end
61
60
  end
62
61
 
@@ -1,3 +1,3 @@
1
1
  module Instapusher
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
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.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Neeraj Singh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-06 00:00:00.000000000 Z
11
+ date: 2014-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hashr