pushover 1.0.2 → 1.0.3
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 +4 -4
- data/bin/pushover +9 -6
- data/lib/pushover/version.rb +1 -1
- data/spec/bin/pushover_spec.rb +6 -4
- data/whatsnew.md +3 -0
- 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: 5a70f1e785179b7356c2c887632f283de549006f
|
4
|
+
data.tar.gz: d54b26659eeefb08394b6c266af442832182f5d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 465930a2259084a11269263cd8eb5d4048a9c0551c9214e282bbc6277684f271686812acbd80dc26558325cd6ef9ccc5badddf97c8ca51f6100322fa8296daf6
|
7
|
+
data.tar.gz: d3e911be81b0e044f3dde95a06c114d3f8ad8005a64e2de665aa2aeb829bcbb7edbb4de342d73d4b5d5d0defac475b0153787b2ea139e8c7abe3c4be5cecb90e
|
data/bin/pushover
CHANGED
@@ -13,8 +13,8 @@ Options.on("-c", "--config_file [FILE]", "Set the target config file.") {|o| Opt
|
|
13
13
|
Options.on("--url [URL]", "Supplementary URL") { |o| Options[:url] = o }
|
14
14
|
Options.on("--url_title [TITLE]", "Supplementary URL title.") { |o| Options[:url_title] = o }
|
15
15
|
Options.on("--time [TIME]", "Set the messages time.") {|o| Options[:timestamp] = o}
|
16
|
-
Options.on("--save-app NAME", "Saves the application to the config file under NAME.") { |o| Options[:save_app] =
|
17
|
-
Options.on("--save-user NAME", "Saves the user to the config file under NAME.") { |o| Options[:save_user] =
|
16
|
+
Options.on("--save-app NAME", "Saves the application to the config file under NAME.") { |o| Options[:save_app] = o}
|
17
|
+
Options.on("--save-user NAME", "Saves the user to the config file under NAME.") { |o| Options[:save_user] = o}
|
18
18
|
Options.on("--sound [SOUND]", "Specify the sound to use. Can be a partial string as long as it is unambiguous enough.") { |o| Options[:sound] = o}
|
19
19
|
Options.on("--sound_list", "Display the current list of available sounds. Requires an app token.") { |o| Options[:sound_list] = true}
|
20
20
|
Options.on("--emergency_retry [TIME]", "The time in seconds between retries.") { |o| Options[:retry] = o}
|
@@ -29,17 +29,20 @@ bail = false
|
|
29
29
|
if Options[:config_file]
|
30
30
|
Bini::Config.options[:file] = Options[:config_file]
|
31
31
|
puts "Selected config file: #{Options[:config_file]}"
|
32
|
+
# TODO: Make a healper for changing config so it clears/loads automatically.
|
33
|
+
Bini::Config.clear
|
34
|
+
Bini::Config.load
|
32
35
|
end
|
33
36
|
|
34
37
|
if Options[:save_app]
|
35
|
-
App.add Options[:save_app]
|
36
|
-
puts "Saved application #{Options[:
|
38
|
+
App.add Options[:save_app], Options[:token]
|
39
|
+
puts "Saved application #{Options[:token]} to #{Options[:save_app]}."
|
37
40
|
bail = true
|
38
41
|
end
|
39
42
|
|
40
43
|
if Options[:save_user]
|
41
|
-
User.add Options[:save_user]
|
42
|
-
puts "Saved user #{Options[:
|
44
|
+
User.add Options[:save_user], Options[:user]
|
45
|
+
puts "Saved user #{Options[:user]} to #{Options[:save_user]}."
|
43
46
|
bail = true
|
44
47
|
end
|
45
48
|
|
data/lib/pushover/version.rb
CHANGED
data/spec/bin/pushover_spec.rb
CHANGED
@@ -50,16 +50,18 @@ if ENV["TEST_CLI"] =~ /^t/
|
|
50
50
|
|
51
51
|
describe "saving" do
|
52
52
|
it "saves app:key pairs" do
|
53
|
-
p = CLIProcess.new "#{CMD} --config_file #{FAKE_CRED_FILE} --save-app
|
53
|
+
p = CLIProcess.new "#{CMD} --config_file #{FAKE_CRED_FILE} --save-app saveapp --app application"
|
54
54
|
p.run!
|
55
55
|
p.stdout.should include 'Saved'
|
56
|
-
open(FAKE_CRED_FILE).read
|
56
|
+
output = YAML.load open(FAKE_CRED_FILE).read
|
57
|
+
output[:applications]["saveapp"].should eq 'application'
|
57
58
|
end
|
58
59
|
it "saves user:token pairs" do
|
59
|
-
p = CLIProcess.new "#{CMD} --config_file #{FAKE_CRED_FILE} --save-user
|
60
|
+
p = CLIProcess.new "#{CMD} --config_file #{FAKE_CRED_FILE} --save-user saveuser --user user"
|
60
61
|
p.run!
|
61
62
|
p.stdout.should include 'Saved'
|
62
|
-
open(FAKE_CRED_FILE).read
|
63
|
+
output = YAML.load open(FAKE_CRED_FILE).read
|
64
|
+
output[:users]["saveuser"].should eq 'user'
|
63
65
|
end
|
64
66
|
end
|
65
67
|
describe "sounds" do
|
data/whatsnew.md
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pushover
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ernie Brodeur
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: yajl-ruby
|