lex-pushover 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.idea/.rakeTasks +7 -0
- data/.idea/lex-pushover.iml +43 -0
- data/.idea/misc.xml +7 -0
- data/.idea/modules.xml +8 -0
- data/.idea/vagrant.xml +7 -0
- data/.idea/workspace.xml +13 -0
- data/.rspec +3 -0
- data/.rubocop.yml +25 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +91 -0
- data/LICENSE.txt +21 -0
- data/README.md +37 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/legion-extensions-pushover.gemspec +37 -0
- data/lib/legion/extensions/pushover/helpers/client.rb +31 -0
- data/lib/legion/extensions/pushover/runners/message.rb +53 -0
- data/lib/legion/extensions/pushover/version.rb +7 -0
- data/lib/legion/extensions/pushover.rb +10 -0
- metadata +207 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f522d5563230a13aab4803ca9b91aa6ae7a7f237438c8f3339e828c8dc83cda0
|
4
|
+
data.tar.gz: 4c1169d384ca701d854928768f687e06046d0a235f5a445e1088f1095bf1855c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 77de8d3369426845e6a36509a5ff622f7c1cb7074c6a9c7b832d3e22715bc11b8d0ed57c7e7dc48c287076bc18469b65bd40829b333ad2ce67cee369d1bd28c2
|
7
|
+
data.tar.gz: b72252eaefbd7b218f1a9df8130854a14d1767b53b877fe58401814b06527a482882c609136020c323a8e6d4467447c978807bfb4dd9b7cbcaf84479ebd6fb3e
|
data/.gitignore
ADDED
data/.idea/.rakeTasks
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<Settings><!--This file was automatically generated by Ruby plugin.
|
3
|
+
You are allowed to:
|
4
|
+
1. Remove rake task
|
5
|
+
2. Add existing rake tasks
|
6
|
+
To add existing rake tasks automatically delete this file and reload the project.
|
7
|
+
--><RakeGroup description="" fullCmd="" taksId="rake"><RakeTask description="Build lex-pushover-0.1.0.gem into the pkg directory" fullCmd="build" taksId="build" /><RakeTask description="Remove any temporary products" fullCmd="clean" taksId="clean" /><RakeTask description="Remove any generated files" fullCmd="clobber" taksId="clobber" /><RakeTask description="Build and install lex-pushover-0.1.0.gem into system gems" fullCmd="install" taksId="install" /><RakeGroup description="" fullCmd="" taksId="install"><RakeTask description="Build and install lex-pushover-0.1.0.gem into system gems without network access" fullCmd="install:local" taksId="local" /></RakeGroup><RakeTask description="Create tag v0.1.0 and build and push lex-pushover-0.1.0.gem to rubygems.org" fullCmd="release[remote]" taksId="release[remote]" /><RakeTask description="Run RSpec code examples" fullCmd="spec" taksId="spec" /><RakeTask description="" fullCmd="default" taksId="default" /><RakeTask description="" fullCmd="release" taksId="release" /><RakeGroup description="" fullCmd="" taksId="release"><RakeTask description="" fullCmd="release:guard_clean" taksId="guard_clean" /><RakeTask description="" fullCmd="release:rubygem_push" taksId="rubygem_push" /><RakeTask description="" fullCmd="release:source_control_push" taksId="source_control_push" /></RakeGroup></RakeGroup></Settings>
|
@@ -0,0 +1,43 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<module type="RUBY_MODULE" version="4">
|
3
|
+
<component name="ModuleRunConfigurationManager">
|
4
|
+
<shared />
|
5
|
+
</component>
|
6
|
+
<component name="NewModuleRootManager">
|
7
|
+
<content url="file://$MODULE_DIR$" />
|
8
|
+
<orderEntry type="inheritedJdk" />
|
9
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
10
|
+
<orderEntry type="library" scope="PROVIDED" name="ast (v2.4.0, RVM: ruby-2.6.3) [gem]" level="application" />
|
11
|
+
<orderEntry type="library" scope="PROVIDED" name="bundler (v2.1.4, RVM: ruby-2.6.3) [gem]" level="application" />
|
12
|
+
<orderEntry type="library" scope="PROVIDED" name="chef (v15.8.23, RVM: ruby-2.6.3) [gem]" level="application" />
|
13
|
+
<orderEntry type="library" scope="PROVIDED" name="codecov (v0.1.16, RVM: ruby-2.6.3) [gem]" level="application" />
|
14
|
+
<orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.3, RVM: ruby-2.6.3) [gem]" level="application" />
|
15
|
+
<orderEntry type="library" scope="PROVIDED" name="docile (v1.3.2, RVM: ruby-2.6.3) [gem]" level="application" />
|
16
|
+
<orderEntry type="library" scope="PROVIDED" name="excon (v0.72.0, RVM: ruby-2.6.3) [gem]" level="application" />
|
17
|
+
<orderEntry type="library" scope="PROVIDED" name="gli (v2.19.0, RVM: ruby-2.6.3) [gem]" level="application" />
|
18
|
+
<orderEntry type="library" scope="PROVIDED" name="jaro_winkler (v1.5.4, RVM: ruby-2.6.3) [gem]" level="application" />
|
19
|
+
<orderEntry type="library" scope="PROVIDED" name="json (v2.3.0, RVM: ruby-2.6.3) [gem]" level="application" />
|
20
|
+
<orderEntry type="library" scope="PROVIDED" name="oj (v3.10.5, RVM: ruby-2.6.3) [gem]" level="application" />
|
21
|
+
<orderEntry type="library" scope="PROVIDED" name="parallel (v1.19.1, RVM: ruby-2.6.3) [gem]" level="application" />
|
22
|
+
<orderEntry type="library" scope="PROVIDED" name="parser (v2.7.0.4, RVM: ruby-2.6.3) [gem]" level="application" />
|
23
|
+
<orderEntry type="library" scope="PROVIDED" name="pushover (v3.0.3@cd29a0, RVM: ruby-2.6.3) [gem]" level="application" />
|
24
|
+
<orderEntry type="library" scope="PROVIDED" name="rainbow (v3.0.0, RVM: ruby-2.6.3) [gem]" level="application" />
|
25
|
+
<orderEntry type="library" scope="PROVIDED" name="rake (v13.0.1, RVM: ruby-2.6.3) [gem]" level="application" />
|
26
|
+
<orderEntry type="library" scope="PROVIDED" name="rexml (v3.2.4, RVM: ruby-2.6.3) [gem]" level="application" />
|
27
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec (v3.9.0, RVM: ruby-2.6.3) [gem]" level="application" />
|
28
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec-core (v3.9.1, RVM: ruby-2.6.3) [gem]" level="application" />
|
29
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v3.9.0, RVM: ruby-2.6.3) [gem]" level="application" />
|
30
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v3.9.1, RVM: ruby-2.6.3) [gem]" level="application" />
|
31
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec-support (v3.9.2, RVM: ruby-2.6.3) [gem]" level="application" />
|
32
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec_junit_formatter (v0.4.1, RVM: ruby-2.6.3) [gem]" level="application" />
|
33
|
+
<orderEntry type="library" scope="PROVIDED" name="rubocop (v0.80.1, RVM: ruby-2.6.3) [gem]" level="application" />
|
34
|
+
<orderEntry type="library" scope="PROVIDED" name="rubocop-md (v0.3.2, RVM: ruby-2.6.3) [gem]" level="application" />
|
35
|
+
<orderEntry type="library" scope="PROVIDED" name="rubocop-performance (v1.5.2, RVM: ruby-2.6.3) [gem]" level="application" />
|
36
|
+
<orderEntry type="library" scope="PROVIDED" name="rubocop-rspec (v1.38.1, RVM: ruby-2.6.3) [gem]" level="application" />
|
37
|
+
<orderEntry type="library" scope="PROVIDED" name="ruby-progressbar (v1.10.1, RVM: ruby-2.6.3) [gem]" level="application" />
|
38
|
+
<orderEntry type="library" scope="PROVIDED" name="simplecov (v0.18.5, RVM: ruby-2.6.3) [gem]" level="application" />
|
39
|
+
<orderEntry type="library" scope="PROVIDED" name="simplecov-html (v0.12.2, RVM: ruby-2.6.3) [gem]" level="application" />
|
40
|
+
<orderEntry type="library" scope="PROVIDED" name="unicode-display_width (v1.6.1, RVM: ruby-2.6.3) [gem]" level="application" />
|
41
|
+
<orderEntry type="library" scope="PROVIDED" name="url (v0.3.2, RVM: ruby-2.6.3) [gem]" level="application" />
|
42
|
+
</component>
|
43
|
+
</module>
|
data/.idea/misc.xml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<project version="4">
|
3
|
+
<component name="JavaScriptSettings">
|
4
|
+
<option name="languageLevel" value="ES6" />
|
5
|
+
</component>
|
6
|
+
<component name="ProjectRootManager" version="2" project-jdk-name="RVM: ruby-2.6.3" project-jdk-type="RUBY_SDK" />
|
7
|
+
</project>
|
data/.idea/modules.xml
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<project version="4">
|
3
|
+
<component name="ProjectModuleManager">
|
4
|
+
<modules>
|
5
|
+
<module fileurl="file://$PROJECT_DIR$/.idea/lex-pushover.iml" filepath="$PROJECT_DIR$/.idea/lex-pushover.iml" />
|
6
|
+
</modules>
|
7
|
+
</component>
|
8
|
+
</project>
|
data/.idea/vagrant.xml
ADDED
data/.idea/workspace.xml
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<project version="4">
|
3
|
+
<component name="CoverageOptionsProvider">
|
4
|
+
<option name="myAddOrReplace" value="0" />
|
5
|
+
</component>
|
6
|
+
<component name="Git.Settings">
|
7
|
+
<option name="PUSH_AUTO_UPDATE" value="true" />
|
8
|
+
<option name="ROOT_SYNC" value="DONT_SYNC" />
|
9
|
+
</component>
|
10
|
+
<component name="PropertiesComponent">
|
11
|
+
<property name="settings.editor.selected.configurable" value="reference.settingsdialog.project.vagrant" />
|
12
|
+
</component>
|
13
|
+
</project>
|
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
Layout/LineLength:
|
2
|
+
Max: 120
|
3
|
+
Metrics/MethodLength:
|
4
|
+
Max: 30
|
5
|
+
Metrics/ClassLength:
|
6
|
+
Max: 1500
|
7
|
+
Metrics/BlockLength:
|
8
|
+
Max: 50
|
9
|
+
Layout/SpaceAroundEqualsInParameterDefault:
|
10
|
+
EnforcedStyle: space
|
11
|
+
Style/SymbolArray:
|
12
|
+
Enabled: true
|
13
|
+
Layout/HashAlignment:
|
14
|
+
EnforcedHashRocketStyle: table
|
15
|
+
EnforcedColonStyle: table
|
16
|
+
Style/Documentation:
|
17
|
+
Enabled: false
|
18
|
+
AllCops:
|
19
|
+
TargetRubyVersion: 2.5
|
20
|
+
Style/FrozenStringLiteralComment:
|
21
|
+
Enabled: false
|
22
|
+
Naming/FileName:
|
23
|
+
Enabled: false
|
24
|
+
Style/ClassAndModuleChildren:
|
25
|
+
Enabled: false
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,91 @@
|
|
1
|
+
GIT
|
2
|
+
remote: https://github.com/erniebrodeur/pushover.git
|
3
|
+
revision: cd29a0063c6531b8624424431ab5df69f3a01677
|
4
|
+
specs:
|
5
|
+
pushover (3.0.3)
|
6
|
+
excon
|
7
|
+
gli
|
8
|
+
oj
|
9
|
+
|
10
|
+
PATH
|
11
|
+
remote: .
|
12
|
+
specs:
|
13
|
+
lex-pushover (0.1.0)
|
14
|
+
pushover
|
15
|
+
|
16
|
+
GEM
|
17
|
+
remote: https://rubygems.org/
|
18
|
+
specs:
|
19
|
+
ast (2.4.0)
|
20
|
+
codecov (0.1.16)
|
21
|
+
json
|
22
|
+
simplecov
|
23
|
+
url
|
24
|
+
diff-lcs (1.3)
|
25
|
+
docile (1.3.2)
|
26
|
+
excon (0.72.0)
|
27
|
+
gli (2.19.0)
|
28
|
+
jaro_winkler (1.5.4)
|
29
|
+
json (2.3.0)
|
30
|
+
oj (3.10.5)
|
31
|
+
parallel (1.19.1)
|
32
|
+
parser (2.7.0.4)
|
33
|
+
ast (~> 2.4.0)
|
34
|
+
rainbow (3.0.0)
|
35
|
+
rake (13.0.1)
|
36
|
+
rexml (3.2.4)
|
37
|
+
rspec (3.9.0)
|
38
|
+
rspec-core (~> 3.9.0)
|
39
|
+
rspec-expectations (~> 3.9.0)
|
40
|
+
rspec-mocks (~> 3.9.0)
|
41
|
+
rspec-core (3.9.1)
|
42
|
+
rspec-support (~> 3.9.1)
|
43
|
+
rspec-expectations (3.9.0)
|
44
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
45
|
+
rspec-support (~> 3.9.0)
|
46
|
+
rspec-mocks (3.9.1)
|
47
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
48
|
+
rspec-support (~> 3.9.0)
|
49
|
+
rspec-support (3.9.2)
|
50
|
+
rspec_junit_formatter (0.4.1)
|
51
|
+
rspec-core (>= 2, < 4, != 2.12.0)
|
52
|
+
rubocop (0.80.1)
|
53
|
+
jaro_winkler (~> 1.5.1)
|
54
|
+
parallel (~> 1.10)
|
55
|
+
parser (>= 2.7.0.1)
|
56
|
+
rainbow (>= 2.2.2, < 4.0)
|
57
|
+
rexml
|
58
|
+
ruby-progressbar (~> 1.7)
|
59
|
+
unicode-display_width (>= 1.4.0, < 1.7)
|
60
|
+
rubocop-md (0.3.1)
|
61
|
+
rubocop (~> 0.60)
|
62
|
+
rubocop-performance (1.5.2)
|
63
|
+
rubocop (>= 0.71.0)
|
64
|
+
rubocop-rspec (1.38.1)
|
65
|
+
rubocop (>= 0.68.1)
|
66
|
+
ruby-progressbar (1.10.1)
|
67
|
+
simplecov (0.18.5)
|
68
|
+
docile (~> 1.1)
|
69
|
+
simplecov-html (~> 0.11)
|
70
|
+
simplecov-html (0.12.2)
|
71
|
+
unicode-display_width (1.6.1)
|
72
|
+
url (0.3.2)
|
73
|
+
|
74
|
+
PLATFORMS
|
75
|
+
ruby
|
76
|
+
|
77
|
+
DEPENDENCIES
|
78
|
+
bundler
|
79
|
+
codecov
|
80
|
+
lex-pushover!
|
81
|
+
pushover!
|
82
|
+
rake
|
83
|
+
rspec
|
84
|
+
rspec_junit_formatter
|
85
|
+
rubocop
|
86
|
+
rubocop-md
|
87
|
+
rubocop-performance
|
88
|
+
rubocop-rspec
|
89
|
+
|
90
|
+
BUNDLED WITH
|
91
|
+
2.1.4
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2020 Esity
|
4
|
+
|
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:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
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
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
# Legion::Extensions::Pushover
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/legion/extensions/pushover`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'legion-extensions-pushover'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle install
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install legion-extensions-pushover
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
|
24
|
+
## Development
|
25
|
+
|
26
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
27
|
+
|
28
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
29
|
+
|
30
|
+
## Contributing
|
31
|
+
|
32
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/legion-extensions-pushover.
|
33
|
+
|
34
|
+
|
35
|
+
## License
|
36
|
+
|
37
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'legion/extensions/pushover'
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require 'irb'
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
require_relative 'lib/legion/extensions/pushover/version'
|
2
|
+
|
3
|
+
Gem::Specification.new do |spec|
|
4
|
+
spec.name = 'lex-pushover'
|
5
|
+
spec.version = Legion::Extensions::Pushover::VERSION
|
6
|
+
spec.authors = ['Esity']
|
7
|
+
spec.email = ['matthewdiverson@gmail.com']
|
8
|
+
|
9
|
+
spec.summary = 'LEX::Pushover'
|
10
|
+
spec.description = 'Used to connect Legion to Pushover'
|
11
|
+
spec.homepage = 'https://bitbucket.org/legion-io/lex-pushover'
|
12
|
+
spec.license = 'MIT'
|
13
|
+
spec.required_ruby_version = Gem::Requirement.new('>= 2.5.0')
|
14
|
+
|
15
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
16
|
+
spec.metadata['source_code_uri'] = 'https://bitbucket.org/legion-io/lex-pushover'
|
17
|
+
spec.metadata['changelog_uri'] = 'https://bitbucket.org/legion-io/lex-pushover/src/master/CHANGELOG.md'
|
18
|
+
|
19
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
20
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
21
|
+
end
|
22
|
+
spec.bindir = 'exe'
|
23
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
24
|
+
spec.require_paths = ['lib']
|
25
|
+
|
26
|
+
spec.add_development_dependency 'bundler'
|
27
|
+
spec.add_development_dependency 'codecov'
|
28
|
+
spec.add_development_dependency 'rake'
|
29
|
+
spec.add_development_dependency 'rspec'
|
30
|
+
spec.add_development_dependency 'rspec_junit_formatter'
|
31
|
+
spec.add_development_dependency 'rubocop'
|
32
|
+
spec.add_development_dependency 'rubocop-md'
|
33
|
+
spec.add_development_dependency 'rubocop-performance'
|
34
|
+
spec.add_development_dependency 'rubocop-rspec'
|
35
|
+
|
36
|
+
spec.add_dependency 'pushover'
|
37
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'pushover'
|
2
|
+
|
3
|
+
module Legion::Extensions::Pushover
|
4
|
+
module Helpers
|
5
|
+
module Client
|
6
|
+
def message(**opts)
|
7
|
+
client_hash = {}
|
8
|
+
%i[message priority device title url url_title sound expire retry callback].each do |thing|
|
9
|
+
client_hash[thing] = opts[thing] if opts.key?(thing) && !opts[thing].nil?
|
10
|
+
end
|
11
|
+
::Pushover::Message.new(token: token(opts),
|
12
|
+
user: user(opts),
|
13
|
+
timestamp: Time.now.getlocal,
|
14
|
+
**client_hash)
|
15
|
+
end
|
16
|
+
|
17
|
+
def timestamp(**opts)
|
18
|
+
opts[:timstamp] if opts.key? :timestamp
|
19
|
+
Time.now.getutc
|
20
|
+
end
|
21
|
+
|
22
|
+
def token(**opts)
|
23
|
+
find_setting('token', opts)
|
24
|
+
end
|
25
|
+
|
26
|
+
def user(**opts)
|
27
|
+
find_setting('user', opts)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# require 'pushover'
|
2
|
+
|
3
|
+
module Legion::Extensions::Pushover
|
4
|
+
module Runners
|
5
|
+
module Message
|
6
|
+
include Legion::Extensions::Pushover::Helpers::Client
|
7
|
+
|
8
|
+
def push(message:, title: nil, **opts)
|
9
|
+
result = message(message: message, title: title, **opts).push
|
10
|
+
raise IOError, result.errors unless result.errors.nil?
|
11
|
+
|
12
|
+
{}
|
13
|
+
end
|
14
|
+
|
15
|
+
def emergency(message:, title: nil, **opts)
|
16
|
+
result = message(message: message, title: title, **opts).push
|
17
|
+
raise IOError, result.errors unless result.errors.nil?
|
18
|
+
|
19
|
+
{}
|
20
|
+
end
|
21
|
+
|
22
|
+
def high(message:, title: nil, **opts)
|
23
|
+
result = message(message: message, title: title, **opts).push
|
24
|
+
raise IOError, result.errors unless result.errors.nil?
|
25
|
+
|
26
|
+
{}
|
27
|
+
end
|
28
|
+
|
29
|
+
def normal(message:, title: nil, **opts)
|
30
|
+
result = message(message: message, title: title, **opts).push
|
31
|
+
raise IOError, result.errors unless result.errors.nil?
|
32
|
+
|
33
|
+
{}
|
34
|
+
end
|
35
|
+
|
36
|
+
def low(message:, title: nil, **opts)
|
37
|
+
result = message(message: message, title: title, **opts).push
|
38
|
+
raise IOError, result.errors unless result.errors.nil?
|
39
|
+
|
40
|
+
{}
|
41
|
+
end
|
42
|
+
|
43
|
+
def lowest(message:, title: nil, **opts)
|
44
|
+
result = message(message: message, title: title, **opts).push
|
45
|
+
raise IOError, result.errors unless result.errors.nil?
|
46
|
+
|
47
|
+
{}
|
48
|
+
end
|
49
|
+
|
50
|
+
include Legion::Extensions::Helpers::Lex
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
metadata
ADDED
@@ -0,0 +1,207 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: lex-pushover
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Esity
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-03-26 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: codecov
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec_junit_formatter
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rubocop
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rubocop-md
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rubocop-performance
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: rubocop-rspec
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: pushover
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :runtime
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
description: Used to connect Legion to Pushover
|
154
|
+
email:
|
155
|
+
- matthewdiverson@gmail.com
|
156
|
+
executables: []
|
157
|
+
extensions: []
|
158
|
+
extra_rdoc_files: []
|
159
|
+
files:
|
160
|
+
- ".gitignore"
|
161
|
+
- ".idea/.rakeTasks"
|
162
|
+
- ".idea/lex-pushover.iml"
|
163
|
+
- ".idea/misc.xml"
|
164
|
+
- ".idea/modules.xml"
|
165
|
+
- ".idea/vagrant.xml"
|
166
|
+
- ".idea/workspace.xml"
|
167
|
+
- ".rspec"
|
168
|
+
- ".rubocop.yml"
|
169
|
+
- Gemfile
|
170
|
+
- Gemfile.lock
|
171
|
+
- LICENSE.txt
|
172
|
+
- README.md
|
173
|
+
- Rakefile
|
174
|
+
- bin/console
|
175
|
+
- bin/setup
|
176
|
+
- legion-extensions-pushover.gemspec
|
177
|
+
- lib/legion/extensions/pushover.rb
|
178
|
+
- lib/legion/extensions/pushover/helpers/client.rb
|
179
|
+
- lib/legion/extensions/pushover/runners/message.rb
|
180
|
+
- lib/legion/extensions/pushover/version.rb
|
181
|
+
homepage: https://bitbucket.org/legion-io/lex-pushover
|
182
|
+
licenses:
|
183
|
+
- MIT
|
184
|
+
metadata:
|
185
|
+
homepage_uri: https://bitbucket.org/legion-io/lex-pushover
|
186
|
+
source_code_uri: https://bitbucket.org/legion-io/lex-pushover
|
187
|
+
changelog_uri: https://bitbucket.org/legion-io/lex-pushover/src/master/CHANGELOG.md
|
188
|
+
post_install_message:
|
189
|
+
rdoc_options: []
|
190
|
+
require_paths:
|
191
|
+
- lib
|
192
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
193
|
+
requirements:
|
194
|
+
- - ">="
|
195
|
+
- !ruby/object:Gem::Version
|
196
|
+
version: 2.5.0
|
197
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
198
|
+
requirements:
|
199
|
+
- - ">="
|
200
|
+
- !ruby/object:Gem::Version
|
201
|
+
version: '0'
|
202
|
+
requirements: []
|
203
|
+
rubygems_version: 3.0.8
|
204
|
+
signing_key:
|
205
|
+
specification_version: 4
|
206
|
+
summary: LEX::Pushover
|
207
|
+
test_files: []
|