pushover 1.0.4 → 2.0.0

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: 315c0ceeee45f022f8d00fc608399bf53a71b131
4
- data.tar.gz: 377d69dd15226e298deaaf4d179360710b54d5ec
3
+ metadata.gz: 070ec388b3b147c9cdaa660e44655ed570018779
4
+ data.tar.gz: '09023c3ab9cbcdf4e87c4363c75c5ab53f30cf74'
5
5
  SHA512:
6
- metadata.gz: f0bdb2755a96aca9c8c22e43e187718930a76fff3f3b5d72bfd062c35cbaf85211cac7897f7a1da163f11950c9149627c7f61d9fa9392552aa66222833991bc6
7
- data.tar.gz: d36021c61c655ba7897c78aa2d1cf717d4854d7b9b51f580e7445b768893bb6e06b12773ca599a3825dc194d12b0cd2c727513d0fdadc05b7441eba37bd347a9
6
+ metadata.gz: 4f01c3d41f2dd85311e338a205a9fd0909cb5caf3ef0586dc0f81ffef1e843f72dcfa36fa9f38cc63c9835f3a74891e1ffdbeeeaebf21e3a6a7f26c182d81ff2
7
+ data.tar.gz: ba00579dc02b4a7debe9ad1c4910805dffdf726a6821ca1d18b4ac8e09d02fc6dcca2309ddbc99e46d2bc37e0b16a9d6785901511e2145cbdd464f55c1bd0514
@@ -0,0 +1,78 @@
1
+ require: rubocop-rspec
2
+
3
+ AllCops:
4
+ TargetRubyVersion: 2.4.0
5
+ Exclude:
6
+ - 'vendor/**/*'
7
+ - 'tmp/**/*'
8
+ - 'spec/spec_helper.rb'
9
+
10
+ # The defaults for these seem to be based on a rails env, this is not rails.
11
+ Metrics/ModuleLength:
12
+ CountComments: false
13
+ Max: 250
14
+
15
+ Metrics/ClassLength:
16
+ Max: 250
17
+
18
+ Metrics/MethodLength:
19
+ Max: 20
20
+
21
+ Metrics/AbcSize:
22
+ Max: 25
23
+
24
+ Metrics/CyclomaticComplexity:
25
+ Max: 8
26
+
27
+ Metrics/PerceivedComplexity:
28
+ Max: 10
29
+
30
+ # it's 2016, people have wide monitors.
31
+ Metrics/LineLength:
32
+ Enabled: false
33
+
34
+ Metrics/BlockLength:
35
+ Exclude:
36
+ - 'Guardfile'
37
+ - '*.gemspec'
38
+ - 'spec/**/*'
39
+
40
+ # we exclude these two files since they are generated, the rest of our projects
41
+ # should use // style regexps.
42
+ Style/RegexpLiteral:
43
+ EnforcedStyle: slashes
44
+ AllowInnerSlashes: true
45
+ Exclude:
46
+ - 'Guardfile'
47
+ - '*.gemspec'
48
+
49
+ # Prefer single-quoted strings when you don't need string interpolation or special symbols
50
+ Style/StringLiterals:
51
+ Enabled: false
52
+
53
+ Style/WordArray:
54
+ EnforcedStyle: brackets
55
+
56
+ Style/FrozenStringLiteralComment:
57
+ Enabled: false
58
+
59
+ Style/MixinUsage:
60
+ Exclude:
61
+ - 'bin/*'
62
+
63
+ # Specs don't need inline documentation.
64
+ Style/Documentation:
65
+ Enabled: true
66
+ Exclude:
67
+ - 'spec/**/*'
68
+
69
+ RSpec/NamedSubject:
70
+ Enabled: false
71
+
72
+ Lint/Debugger:
73
+ Enabled: false
74
+
75
+ # Purty hashes.
76
+ Layout/AlignHash:
77
+ EnforcedHashRocketStyle: table
78
+ EnforcedColonStyle: table
@@ -0,0 +1,46 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ ## Our Standards
8
+
9
+ Examples of behavior that contributes to creating a positive environment include:
10
+
11
+ * Using welcoming and inclusive language
12
+ * Being respectful of differing viewpoints and experiences
13
+ * Gracefully accepting constructive criticism
14
+ * Focusing on what is best for the community
15
+ * Showing empathy towards other community members
16
+
17
+ Examples of unacceptable behavior by participants include:
18
+
19
+ * The use of sexualized language or imagery and unwelcome sexual attention or advances
20
+ * Trolling, insulting/derogatory comments, and personal or political attacks
21
+ * Public or private harassment
22
+ * Publishing others' private information, such as a physical or electronic address, without explicit permission
23
+ * Other conduct which could reasonably be considered inappropriate in a professional setting
24
+
25
+ ## Our Responsibilities
26
+
27
+ Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28
+
29
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30
+
31
+ ## Scope
32
+
33
+ This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34
+
35
+ ## Enforcement
36
+
37
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at ebrodeur@ujami.net. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38
+
39
+ Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40
+
41
+ ## Attribution
42
+
43
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44
+
45
+ [homepage]: http://contributor-covenant.org
46
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile CHANGED
@@ -1,40 +1,3 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
-
5
- platforms :rbx do
6
- gem 'racc'
7
- gem 'rubysl', '~> 2.0'
8
- gem 'psych'
9
- end
10
-
11
- group :development do
12
- gem "pry", :require => false
13
- gem "guard", :require => false
14
- gem "guard-bundler", :require => false
15
- gem "guard-rspec", :require => false
16
- gem "guard-yard", :require => false
17
- gem "guard-shell", :require => false
18
- gem 'libnotify', :require => false
19
- gem 'growl', :require => false
20
- gem 'rb-inotify', :require => false
21
- gem 'rb-fsevent', :require => false
22
- gem 'rb-fchange', :require => false
23
- end
24
-
25
- group :test do
26
- gem "rspec", "~> 2.13.0"
27
- gem "rspec-core", "~> 2.13.0"
28
- gem "rspec-expectations", "~> 2.13.0"
29
- gem "rspec-mocks", "~> 2.13.0"
30
- gem "rake", "~> 10.1.0"
31
- gem "webmock", "~> 1.13.0"
32
- end
33
-
34
- group :extended_testing do
35
- gem "childprocess", "~> 0.3.9"
36
- gem 'simplecov', "~> 0.7.1", :require => false
37
- gem 'simplecov-rcov', "~> 0.2.3", :require => false
38
- end
39
-
40
-
data/Guardfile CHANGED
@@ -1,33 +1,43 @@
1
- #!/usr/bin/ruby
2
- # Must be an array
3
- test_cmd = [
4
- "bundle exec pushover a message"
5
- ]
1
+ clearing :on
6
2
 
7
3
  guard :bundler do
8
- watch 'Gemfile'
9
- watch '*.gemspec'
4
+ require 'guard/bundler'
5
+ require 'guard/bundler/verify'
6
+ helper = Guard::Bundler::Verify.new
7
+
8
+ files = ['Gemfile']
9
+ files += Dir['*.gemspec'] if files.any? { |f| helper.uses_gemspec?(f) }
10
+
11
+ # Assume files are symlinked from somewhere
12
+ files.each { |file| watch(helper.real_path(file)) }
10
13
  end
11
14
 
12
- guard :rspec do
13
- watch(%r{^spec/.+_spec\.rb$})
14
- watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
15
- watch(%r{^bin/(.+)\.rb$}) { |m| "spec/bin/#{m[1]}_spec.rb" }
16
- watch('spec/spec_helper.rb') { "spec" }
15
+ guard :rspec, cmd: 'bundle exec rspec' do
16
+ require 'guard/rspec/dsl'
17
+ dsl = Guard::RSpec::Dsl.new(self)
18
+
19
+ # RSpec files
20
+ rspec = dsl.rspec
21
+ watch(rspec.spec_helper) { rspec.spec_dir }
22
+ watch(rspec.spec_support) { rspec.spec_dir }
23
+ watch(rspec.spec_files)
24
+
25
+ # Ruby files
26
+ ruby = dsl.ruby
27
+ dsl.watch_spec_files_for(ruby.lib_files)
17
28
  end
18
29
 
19
- # guard :yard do
20
- # watch(%r{^lib/(.+)\.rb$})
21
- # end
22
-
23
- # guard :shell do
24
- # watch /.*/ do |m|
25
- # puts "Time: #{Time.now}, file saved: #{m}"
26
- # test_cmd.each do |cmd|
27
-
28
- # puts "=" * 80
29
- # puts "cmd: #{cmd}"
30
- # puts `#{cmd}`
31
- # end
32
- # end
33
- # end
30
+ unless ENV["DISABLE_RUBOCOP"] == 'true'
31
+ guard :rubocop do
32
+ watch(/.+\.rb$/)
33
+ watch(%r{(?:.+/)?\.rubocop(?:_todo)?\.yml$}) { |m| File.dirname(m[0]) }
34
+ end
35
+ end
36
+
37
+ unless ENV["DISABLE_YARD"] == 'true'
38
+ guard 'yard' do
39
+ watch(%r{app\/.+\.rb})
40
+ watch(%r{lib\/.+\.rb})
41
+ watch(%r{ext\/.+\.c})
42
+ end
43
+ end
data/LICENSE CHANGED
@@ -1,36 +1,21 @@
1
- All software in this package is covered by the MIT license and beerware (rev42).
1
+ MIT License
2
2
 
3
- Copyright (c) 2011 Ernie Brodeur
3
+ Copyright (c) 2018 Ernie Brodeur
4
4
 
5
- Permission is hereby granted, free of charge, to any person
6
- obtaining a copy of this software and associated documentation
7
- files (the "Software"), to deal in the Software without
8
- restriction, including without limitation the rights to use,
9
- copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- copies of the Software, and to permit persons to whom the
11
- Software is furnished to do so, subject to the following
12
- conditions:
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
13
11
 
14
- The above copyright notice and this permission notice shall be
15
- included in all copies or substantial portions of the Software.
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
16
14
 
17
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
19
- OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21
- HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22
- WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24
- OTHER DEALINGS IN THE SOFTWARE.
25
-
26
- /*
27
- * ----------------------------------------------------------------------------
28
- * "THE BEER-WARE LICENSE" (Revision 42):
29
- * Ernie Brodeur wrote this package. As long as you retain this notice you
30
- * can do whatever you want with this stuff. If we meet some day, and you think
31
- * this stuff is worth it, you can buy me a beer in return.
32
- * ----------------------------------------------------------------------------
33
- */
34
-
35
- All contributed code is licensed accordingly and accredited whenever possible.
36
- If I make any mistake about this, please feel free to contact me at ebrodeur@ujami.net.
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md CHANGED
@@ -1,7 +1,4 @@
1
1
  # Pushover
2
- **Master** [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/erniebrodeur/pushover) [![Build Status](https://travis-ci.org/erniebrodeur/pushover.png?branch=master)](https://travis-ci.org/erniebrodeur/pushover) [![Dependency Status](https://gemnasium.com/erniebrodeur/pushover.png)](https://gemnasium.com/erniebrodeur/pushover)
3
-
4
- **Development** [![Build Status](https://travis-ci.org/erniebrodeur/pushover.png?branch=development)](https://travis-ci.org/erniebrodeur/pushover)
5
2
 
6
3
  This gem provides a CLI and an API interface to http://pushover.net.
7
4
 
@@ -9,180 +6,56 @@ This gem provides a CLI and an API interface to http://pushover.net.
9
6
 
10
7
  To install:
11
8
 
12
- % gem install pushover
9
+ % gem install pushover
13
10
 
14
11
  To use inside of an application, add this to the your gemfile:
15
12
 
16
- % gem 'pushover'
13
+ % gem 'pushover'
17
14
 
18
15
  and run bundle to make it available:
19
16
 
20
- % bundle
17
+ % bundle
21
18
 
22
19
  ## Usage
23
20
 
24
- ### API:
21
+ ## API
22
+
25
23
  ```ruby
26
24
  require 'pushover'
27
25
  ```
28
26
 
29
- To send with the very minimum amount of information.
27
+ ### Create a message
30
28
 
31
29
  ```ruby
32
- Pushover.notification(message: 'message', title: 'title', user: 'USER_TOKEN', token: 'APP_TOKEN')
30
+ message = Pushover.create {
31
+ user: '...',
32
+ token: '...',
33
+ message: '...'
34
+ }
33
35
  ```
34
36
 
35
- Optional #configuration method:
36
- ```ruby
37
- Pushover.configure do |config|
38
- config.user='USER_TOKEN'
39
- config.token='APP_TOKEN'
40
- end
37
+ ### Send the message
41
38
 
42
- Pushover.notification(message: 'message', title: 'title')
39
+ ```ruby
40
+ response = message.send
43
41
  ```
44
42
 
45
- ### CLI:
46
-
47
- To get help do, try ```--(h)elp```
48
-
49
- % pushover -h
50
-
51
- To send a message.
52
-
53
- % pushover -u user_token -a app_key message is the rest of the cli.
54
-
55
- #### Optional parameters
56
-
57
- Most optional parameters have a shorter form you can use. If that's the case, they will be displayed like ```--(h)elp```.
58
-
59
- #### Config_file
60
-
61
- The file to use for stored settings (including credentials).
62
-
63
- % pushover --(c)onfig_file /tmp/config_file
64
-
65
-
66
- #### Title
67
-
68
- The title of the message, if not supplied it will end up being the app name.
69
-
70
- % pushover --(t)itle "A title"
71
-
72
- % pushover --(t)itle "A title"
73
-
74
- #### Priority
75
-
76
- Priority of the message, either (low,normal,high) or (-1,0,1). For the string you only need the first letter.
77
-
78
- % pushover --(p)riority high
79
-
80
- % pushover --(p)riority h
81
-
82
- % pushover --(p)riority -1
83
-
84
- #### Emergency Notifications
85
-
86
- Currently retry/expire is supported, currently these are in seconds. Callback url's are not.
87
-
88
- % pushover --emergency_retry 60
89
-
90
- % pushover --emergency_expire 3600
91
-
92
- It won't pre-check values sent to the api, so you will need to tune for the current min/max values or check api documentation.
93
-
94
- #### Device
95
-
96
- Specific device to send the message too, must be registered at pushover.net
97
-
98
- % pushover --(d)evice "Device name"
99
-
100
- #### URL
101
-
102
- Supplementary URL that can be passed with the message.
43
+ ### Response
103
44
 
104
- % pushover --url "http://www.github.com/erniebrodeur/pushover"
45
+ - The response will always include `status` and `request`.
46
+ - When set, it will also include `errors` and `receipt`.
105
47
 
106
- ##### URL Title
107
-
108
- The display string of the supplementary URL.
109
-
110
- % pushover --url "http://www.git.com/erniebrodeur/pushover" --url_title "This repo."
111
-
112
- #### Time
113
-
114
- Time is tricky, I just pass the string off to the stdlib ```Time.parse```. Therefore, if it fails I can't do much about it. Though, it shouldn't fail, it seems to take just a ton of stuff. You can always handle this yourself and just pass in an epoch (string or fixnum).
115
-
116
- % pushover --time 1331249662
117
-
118
- % pushover --time "6:30"
119
-
120
- ##### String examples
121
-
122
- As far as I can tell, you can toss a ton of different things and get an output.
123
-
124
- * rfc822: Tue, 14 Nov 2000 14:55:07 -0500
125
- * xml: 1979-08-13T06:30:00.313UTC
126
- * Aug 13, 1979 6:30
127
- * 1979/08/13, 6:30:50 UTC
128
- * 6:30
129
- * 14:30
130
- * Aug 21
131
-
132
- ##### Sounds
133
-
134
- Get the available list of sounds:
135
-
136
- % pushover --sound_list
137
-
138
- Play a specific sound with a message:
139
-
140
- % pushover --sound Magic
141
- % pushover --sound per
142
-
143
- * You only need to supply an unambiguous partial string.
144
- * It is not case sensitive.
145
-
146
- #### Saving
147
-
148
- You can also save and use stored information. The username/application are titles. They can be anything you want to reference them.
149
-
150
- ##### User
151
-
152
- % pushover -u user_token --save-user email@somewhere.net
153
-
154
- ##### Application
155
-
156
- % pushover -a app_key --save-app myApp
157
-
158
- Delete done in the api, not lifted to the cli.
159
-
160
- Now, you can use these to send messages instead of having to remember the key:
161
-
162
- % pushover -a myApp -u email@somewhere.net Hello from somewhere!
163
-
164
- If you don't supply the application or user name, it will use the first one in the save file.
165
-
166
- % pushover so now I can just send an app.
167
-
168
- Anytime you supply tokens directly to the cli, it will ignore any saved information and try them. This allows you to use it as a once-off tool while keeping credentials stored.
169
-
170
- ## TODO
171
-
172
- ### 1.0 tree
173
-
174
- * Callback urls.
175
- * Receipt testing.
176
-
177
- ### 2.0 tree
48
+ ```ruby
49
+ response.status
50
+ response.request
51
+ ```
178
52
 
179
- * Rebuild the CLI so it works more like a git/bundle command.
180
- * More argument/string magic.
181
53
 
182
54
  ## Contributing
183
55
 
184
56
  1. Fork it
185
- 2. Create your feature branch (`git checkout -b my-new-feature`)
186
- 3. Commit your changes (`git commit -am 'Added some feature'`)
187
- 4. Push to the branch (`git push origin my-new-feature`)
188
- 5. Create new Pull Request
57
+ 2. Switch to development (`git checkout developtment`)
58
+ 3. Create your feature branch (`git checkout -b my-new-feature`)
59
+ 4. Commit your changes (`git commit -am 'Added some feature'`)
60
+ 5. Push to the branch (`git push origin my-new-feature`)
61
+ 6. Create new Pull Request against `development`