bellow 0.0.1
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 +7 -0
- data/.gitignore +18 -0
- data/.rspec +2 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +51 -0
- data/Rakefile +1 -0
- data/bellow.gemspec +26 -0
- data/lib/bellow/version.rb +3 -0
- data/lib/bellow.rb +24 -0
- data/spec/bellow_spec.rb +11 -0
- data/spec/spec_helper.rb +26 -0
- metadata +128 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: bb60fc44d06f97852570b0e361ec08eba36de8ce
|
4
|
+
data.tar.gz: fc5cbd0fdc95fa8a4059e02ef7433358e483301f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: b5a381ad898c6c4b758bfb7a6c24150964418301d1f3a09ca0837c629e6799cecbe510f1677d778f7847c48201663d8826fde9baa234654d3b6796eb96798835
|
7
|
+
data.tar.gz: 56da81a10e59205026989ab67dd21d9a9194ed42d478ce7485d7a5a85755629104379dede3bff427eaa3bd5e013053cb4a1613b492dccf802fb16c56c41d0ae9
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Keyvan Fatehi
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
# Bellow
|
2
|
+
|
3
|
+
Simple gem that uses the gems 'prowl' and 'ruby-notify-my-android'.
|
4
|
+
|
5
|
+
It simplifies these two gems down to a very simple API: `Bellow.notify(people, title, message)`
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
gem 'bellow'
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install bellow
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
# Create your structure
|
25
|
+
people = {
|
26
|
+
:guillaume => {
|
27
|
+
:prowl => "f7a1879f0331667e0a993b501127a5f21ce7fbff",
|
28
|
+
:nma => "baa2ab11aa424a08945938a3df1e0341ce935d30704eca0b"
|
29
|
+
},
|
30
|
+
'keyvan fatehi' => {
|
31
|
+
:prowl => "757e5b121f243d7309eafa041ba93f5d794336cd"
|
32
|
+
},
|
33
|
+
:steve => {
|
34
|
+
:prowl => "85138c449bd3ee2f48039c8ca471f710c4257f70"
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
38
|
+
app = "McDonalds"
|
39
|
+
message = "Hey guys I just ordered a Big Mac LOL"
|
40
|
+
|
41
|
+
# Notify them all with Bellow
|
42
|
+
Bellow.notify(people, app, message)
|
43
|
+
```
|
44
|
+
|
45
|
+
## Contributing
|
46
|
+
|
47
|
+
1. Fork it
|
48
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
49
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
50
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
51
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/bellow.gemspec
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'bellow/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "bellow"
|
8
|
+
spec.version = Bellow::VERSION
|
9
|
+
spec.authors = ["Keyvan Fatehi"]
|
10
|
+
spec.email = ["keyvanfatehi@gmail.com"]
|
11
|
+
spec.description = %q{Wrap Prowl and NotifyMyAndroid into a single basic API to notify lists of users}
|
12
|
+
spec.summary = %q{Wraps Prowl and NotifyMyAndroid APIs to notify lists}
|
13
|
+
spec.homepage = "https://github.com/keyvanfatehi/bellow"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
22
|
+
spec.add_development_dependency "rake"
|
23
|
+
spec.add_development_dependency "rspec"
|
24
|
+
spec.add_runtime_dependency "prowl", '~> 0.1.3'
|
25
|
+
spec.add_runtime_dependency "ruby-notify-my-android", '~> 0.4.3'
|
26
|
+
end
|
data/lib/bellow.rb
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
require "bellow/version"
|
2
|
+
|
3
|
+
require 'prowl'
|
4
|
+
require 'ruby-notify-my-android'
|
5
|
+
|
6
|
+
module Bellow
|
7
|
+
def self.notify(users, app_name, message)
|
8
|
+
users.each do |user, services|
|
9
|
+
if key = services[:prowl]
|
10
|
+
prowl = Prowl.new(:apikey => key, :application => app_name)
|
11
|
+
prowl.add(:event => message)
|
12
|
+
end
|
13
|
+
if key = services[:nma]
|
14
|
+
NMA.notify do |n|
|
15
|
+
n.apikey = key
|
16
|
+
n.priority = NMA::Priority::MODERATE
|
17
|
+
n.application = app_name
|
18
|
+
n.event = "Notification"
|
19
|
+
n.description = message
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/spec/bellow_spec.rb
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Bellow do
|
4
|
+
describe ".notify" do
|
5
|
+
it "will accept the example inputs without error" do
|
6
|
+
lambda {
|
7
|
+
Bellow.notify(PEOPLE, "McDonalds", "Hey guys I just ordered a Big Mac LOL")
|
8
|
+
}.should_not raise_error
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'bellow'
|
2
|
+
|
3
|
+
RSpec.configure do |config|
|
4
|
+
config.treat_symbols_as_metadata_keys_with_true_values = true
|
5
|
+
config.run_all_when_everything_filtered = true
|
6
|
+
config.filter_run :focus
|
7
|
+
|
8
|
+
# Run specs in random order to surface order dependencies. If you find an
|
9
|
+
# order dependency and want to debug it, you can fix the order by providing
|
10
|
+
# the seed, which is printed after each run.
|
11
|
+
# --seed 1234
|
12
|
+
config.order = 'random'
|
13
|
+
end
|
14
|
+
|
15
|
+
PEOPLE = {
|
16
|
+
:guillaume => {
|
17
|
+
:prowl => "f7a1879f0331667e0a993b501127a5f21ce7fbff",
|
18
|
+
:nma => "baa2ab11aa424a08945938a3df1e0341ce935d30704eca0b"
|
19
|
+
},
|
20
|
+
'keyvan fatehi' => {
|
21
|
+
:prowl => "757e5b121f243d7309eafa041ba93f5d794336cd"
|
22
|
+
},
|
23
|
+
:steve => {
|
24
|
+
:prowl => "85138c449bd3ee2f48039c8ca471f710c4257f70"
|
25
|
+
}
|
26
|
+
}
|
metadata
ADDED
@@ -0,0 +1,128 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: bellow
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Keyvan Fatehi
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-05-14 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: '1.3'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
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: rspec
|
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: prowl
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.1.3
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ~>
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 0.1.3
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: ruby-notify-my-android
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ~>
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.4.3
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ~>
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.4.3
|
83
|
+
description: Wrap Prowl and NotifyMyAndroid into a single basic API to notify lists
|
84
|
+
of users
|
85
|
+
email:
|
86
|
+
- keyvanfatehi@gmail.com
|
87
|
+
executables: []
|
88
|
+
extensions: []
|
89
|
+
extra_rdoc_files: []
|
90
|
+
files:
|
91
|
+
- .gitignore
|
92
|
+
- .rspec
|
93
|
+
- Gemfile
|
94
|
+
- LICENSE.txt
|
95
|
+
- README.md
|
96
|
+
- Rakefile
|
97
|
+
- bellow.gemspec
|
98
|
+
- lib/bellow.rb
|
99
|
+
- lib/bellow/version.rb
|
100
|
+
- spec/bellow_spec.rb
|
101
|
+
- spec/spec_helper.rb
|
102
|
+
homepage: https://github.com/keyvanfatehi/bellow
|
103
|
+
licenses:
|
104
|
+
- MIT
|
105
|
+
metadata: {}
|
106
|
+
post_install_message:
|
107
|
+
rdoc_options: []
|
108
|
+
require_paths:
|
109
|
+
- lib
|
110
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
111
|
+
requirements:
|
112
|
+
- - '>='
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
version: '0'
|
115
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - '>='
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: '0'
|
120
|
+
requirements: []
|
121
|
+
rubyforge_project:
|
122
|
+
rubygems_version: 2.0.3
|
123
|
+
signing_key:
|
124
|
+
specification_version: 4
|
125
|
+
summary: Wraps Prowl and NotifyMyAndroid APIs to notify lists
|
126
|
+
test_files:
|
127
|
+
- spec/bellow_spec.rb
|
128
|
+
- spec/spec_helper.rb
|