PushIt 1.0.1 → 1.0.2

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.
Files changed (3) hide show
  1. checksums.yaml +5 -5
  2. data/bin/pushit +12 -9
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- data.tar.gz: d7d4ea0f5bd22ec67a351e36d8eab3f42d1edf62
4
- metadata.gz: 958b2ffbd0dad4959f7c81e8ed5f7c9d04b0de50
5
2
  SHA512:
6
- data.tar.gz: 9ee5b42877d196fc860c72db44a11d7482c9b5407ff06f305548fdfeaf80d81237c2dfa56b1be5a160717c4793e386d24a76aa8a26d3c8f9fbf16e74f75e9272
7
- metadata.gz: 8c06fa5377abb1cbefbf1076b283e08bddb97ae8e9fb15c5ef2f601d3b79e901d5fda7a036e26347e799a04df711e188cc3e66d921c8258e6e7d7f5918f3e8d2
3
+ metadata.gz: 03f75a14866eab8d43265462e041a64ca1606f3bcf7602a379f3c314b1ad8b0f3ef130f1ebd93f513f56a4690cb3283b01f2f75023b3c98cdf62197965a690e3
4
+ data.tar.gz: 280125e2ff29ae6a3cd879e804e0bd0806008b6dac854043addd8f5be35ac27926ff1a1905fd7e3a696227f1513c8e13d2f1f9efc0438334cc0150d5ad8f557e
5
+ SHA1:
6
+ metadata.gz: 5d49449b5b6753f0a32c447c9e90946094d689f5
7
+ data.tar.gz: 50a3adfef7525ec5f0bb423a5940dd627ec06ddf
data/bin/pushit CHANGED
@@ -13,14 +13,18 @@ HighLine.track_eof = false # Fix for built-in Ruby
13
13
 
14
14
  program :name, 'PushIt'
15
15
  program :version, '1.0'
16
- program :description, 'Sends push notifications to development iOS apps. Ensure that your certificate path is relative to your current directory.'
16
+ program :description, 'Sends push notifications to iOS apps. Ensure that your certificate path is relative to your current directory.'
17
17
 
18
18
  program :help, 'Author', 'Oletha Lai'
19
19
  program :help_formatter, :compact
20
20
 
21
21
  default_command :help
22
22
 
23
- @devices = YAML::load_file "devices.yaml"
23
+ begin
24
+ @devices = YAML::load_file "devices.yaml"
25
+ rescue
26
+ say_error 'No devices.yaml file was found.'.red
27
+ end
24
28
 
25
29
  # Convenience method for debug logging.
26
30
  # Takes a String as the log parameter.
@@ -34,12 +38,12 @@ command :devices do |c|
34
38
  c.syntax = 'pushit devices [options]'
35
39
  c.description = 'Prints out the list of available devices to push to.'
36
40
 
37
- c.example 'Print the list.', 'pushit devices -f "mini"'
41
+ c.example 'Print the list.', 'pushit devices -f mini'
38
42
 
39
43
  c.option '-f', '--filter STRING', 'Filters printed results by device type.'
40
44
  c.option '-d', '--debug', 'Enables debug mode.'
41
45
 
42
- c.action do |options|
46
+ c.action do |args, options|
43
47
  $DEBUG_MODE = options.debug.nil? ? false : true
44
48
 
45
49
  # Check that there is at least 1 device available
@@ -47,7 +51,7 @@ command :devices do |c|
47
51
 
48
52
  # Filter the list if filtering has been requested.
49
53
  if options.filter
50
- filter = options.filter.downcase
54
+ @filter = options.filter.downcase
51
55
  debug_log "filter: #{@filter}"
52
56
  @filtered_devices = Hash.new
53
57
  debug_log "Created filtered devices hash."
@@ -110,11 +114,11 @@ command :push do |c|
110
114
  c.syntax = 'pushit push DEVICE [options]'
111
115
  c.description = 'Push a notification to the given device. Try running --help for options.'
112
116
 
113
- c.example 'Send the reference name for your device and any additional options.', 'pushit push laipad --web-link -i'
117
+ c.example 'Send the reference name for your device and any additional options.', 'pushit push johns_ipad --link web -m This is a web link! -b 1'
114
118
 
115
119
  # The command should send different payloads based on the options specified.
116
120
 
117
- c.option '-a', '--app STRING', 'Specify the app you want the notification to be sent to. Ensure you have the certificate for the app named <app>.pem in this directory.'
121
+ c.option '-a', '--app STRING', 'Specify the app you want the notification to be sent to. Ensure you have the certificate for the app named <app>.pem in this directory. You could also specify the path to the certificate from this directory, less ".pem".'
118
122
 
119
123
  c.option '-m', '--message STRING', 'The message to appear on the notification.'
120
124
  c.option '-b', '--badge NUMBER', 'Sets the app badge when the notification is received.'
@@ -154,7 +158,7 @@ command :push do |c|
154
158
  debug_log "Setting environment..."
155
159
  if options.environment
156
160
  @environment = options.environment
157
- say_error "Invalid environment,'#{@environment}' (should be either :development or :production)" and abort unless [:development, :production].include?(@environment)
161
+ say_error "Invalid environment,'#{@environment}' (should be either development or production)" and abort unless [:development, :production].include?(@environment)
158
162
  else
159
163
  @environment = :development
160
164
  end
@@ -228,7 +232,6 @@ command :push do |c|
228
232
  custom_payload = Hash.new
229
233
  debug_log "Created custom payload hash."
230
234
 
231
- # TODO: Find out what the actual name is for :issue.
232
235
  custom_payload.merge!({:new_issue_identifier => "#{@issue_id}"}) if @issue_id
233
236
  custom_payload.merge!({:pmps => {:'link-url' => "#{@link}"}}) if @link
234
237
  custom_payload.merge!({'alert' => {:body => "#{@message}", :'action-loc-key' => "#{@button}"}}) if @button
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: PushIt
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oletha Lai
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2013-06-08 00:00:00 Z
12
+ date: 2013-06-21 00:00:00 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: houston