instapusher 0.0.29 → 0.0.30

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: 5d89c736b9fd7d073547bbdec7eeddee6c26bfdb
4
- data.tar.gz: 07f64e3c809a223877067090da1973248dcd8abc
3
+ metadata.gz: 5c057c5f47fcd5fb412ebc03fafc6e6cb33fe4bc
4
+ data.tar.gz: f790807c4dbeea8066c21fbcdb4d98e4c5dcf957
5
5
  SHA512:
6
- metadata.gz: 738dc2ca3b1ed7053979e1cf9394603e18160237337fc93bc32e7664033cfd33bc02d4bd2510dc6b0118ea465d58411e080a662c7a83261e0a261be53ae3a98b
7
- data.tar.gz: a142cb1005844542134f4e6c3eec5fef674b28ab2a02759a669a91dafd2da362abdf3f908b2a9f21d5e44ac3e7b1f1a674df30182aa27aa266533126a89257bb
6
+ metadata.gz: fda59d795317ace3829f1d76843ac62227224f32b8226b4d7495fe9cf016cbc35f60c4dca76bc217a5f430c21b053d40cf7eb5774e5d48ccc2124bd4a8fb6a45
7
+ data.tar.gz: ab5582d90c1c85740455ce73f3ff75db5da633aee8b213c46d58658d946c4543d175e7a160d83c53999a183f99fb484a0968bbc885f2d1d11e90abed500f11df
@@ -1,52 +1,54 @@
1
- class JobSubmission
1
+ module Instapusher
2
+ class JobSubmission
2
3
 
3
- attr_reader :options, :debug, :job_status_url
4
+ attr_reader :options, :debug, :job_status_url
4
5
 
5
- DEFAULT_HOSTNAME = 'instapusher.com'
6
+ DEFAULT_HOSTNAME = 'instapusher.com'
6
7
 
7
- def initialize debug, options
8
- @debug = debug
9
- @options = options
10
- end
8
+ def initialize debug, options
9
+ @debug = debug
10
+ @options = options
11
+ end
11
12
 
12
- def success?
13
- job_status_url && job_status_url != ""
14
- end
13
+ def success?
14
+ job_status_url && job_status_url != ""
15
+ end
15
16
 
16
- def pre_submission_feedback_to_user
17
- puts "url to hit: #{url_to_submit_job.inspect}"
18
- puts "options being passed to the url: #{options.inspect}"
19
- puts "connecting to #{url_to_submit_job} to send data"
20
- end
17
+ def pre_submission_feedback_to_user
18
+ puts "url to hit: #{url_to_submit_job.inspect}"
19
+ puts "options being passed to the url: #{options.inspect}"
20
+ puts "connecting to #{url_to_submit_job} to send data"
21
+ end
21
22
 
22
- def feedback_to_user
23
- puts 'The appliction will be deployed to: ' + response_body['heroku_url']
24
- puts 'Monitor the job status at: ' + job_status_url
25
- cmd = "open #{job_status_url}"
26
- `#{cmd}`
27
- end
23
+ def feedback_to_user
24
+ puts 'The appliction will be deployed to: ' + response_body['heroku_url']
25
+ puts 'Monitor the job status at: ' + job_status_url
26
+ cmd = "open #{job_status_url}"
27
+ `#{cmd}`
28
+ end
28
29
 
29
- def error_message
30
- response_body['error']
31
- end
30
+ def error_message
31
+ response_body['error']
32
+ end
32
33
 
33
- def submit_the_job
34
- pre_submission_feedback_to_user if debug
34
+ def submit_the_job
35
+ pre_submission_feedback_to_user if debug
35
36
 
36
- response = Net::HTTP.post_form URI.parse(url_to_submit_job), options
37
- @response_body = ::JSON.parse(response.body)
38
- puts "response_body: #{response_body.inspect}" if debug
39
- @job_status_url = response_body['status'] || response_body['job_status_url']
40
- end
37
+ response = Net::HTTP.post_form URI.parse(url_to_submit_job), options
38
+ @response_body = ::JSON.parse(response.body)
39
+ puts "response_body: #{response_body.inspect}" if debug
40
+ @job_status_url = response_body['status'] || response_body['job_status_url']
41
+ end
41
42
 
42
- def url_to_submit_job
43
- @url ||= begin
44
- hostname = if options[:local]
45
- "localhost:3000"
46
- else
47
- ENV['INSTAPUSHER_HOST'] || DEFAULT_HOSTNAME
48
- end
49
- "http://#{hostname}/heroku.json"
43
+ def url_to_submit_job
44
+ @url ||= begin
45
+ hostname = if options[:local]
46
+ "localhost:3000"
47
+ else
48
+ ENV['INSTAPUSHER_HOST'] || DEFAULT_HOSTNAME
49
+ end
50
+ "http://#{hostname}/heroku.json"
51
+ end
50
52
  end
51
53
  end
52
54
  end
@@ -1,21 +1,23 @@
1
- class TagTheRelease
1
+ module Instapusher
2
+ class TagTheRelease
2
3
 
3
- def initialize branch_name, debug
4
- @branch_name = branch_name
5
- @debug = debug
6
- end
4
+ def initialize branch_name, debug
5
+ @branch_name = branch_name
6
+ @debug = debug
7
+ end
7
8
 
8
- def tagit
9
- version_number = Time.current.to_s.parameterize
10
- tag_name = "#{branch_name}-#{version_number}"
9
+ def tagit
10
+ version_number = Time.current.to_s.parameterize
11
+ tag_name = "#{branch_name}-#{version_number}"
11
12
 
12
- cmd = "git tag -a -m \"Version #{tag_name}\" #{tag_name}"
13
- puts cmd if debug
14
- system cmd
13
+ cmd = "git tag -a -m \"Version #{tag_name}\" #{tag_name}"
14
+ puts cmd if debug
15
+ system cmd
15
16
 
16
- cmd = "git push --tags"
17
- puts cmd if debug
18
- system cmd
19
- end
17
+ cmd = "git push --tags"
18
+ puts cmd if debug
19
+ system cmd
20
+ end
20
21
 
22
+ end
21
23
  end
@@ -1,3 +1,3 @@
1
1
  module Instapusher
2
- VERSION = "0.0.29"
2
+ VERSION = "0.0.30"
3
3
  end
data/lib/instapusher.rb CHANGED
@@ -2,6 +2,9 @@ require_relative './instapusher/git'
2
2
  require_relative './instapusher/commands'
3
3
  require_relative './instapusher/version'
4
4
  require_relative './instapusher/configuration'
5
+ require_relative './instapusher/job_submission'
6
+ require_relative './instapusher/special_instruction_for_production'
7
+ require_relative './instapusher/tag_the_release'
5
8
  require 'active_support/all'
6
9
  require 'json'
7
10
 
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.29
4
+ version: 0.0.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - Neeraj Singh