growl_car 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 +17 -0
- data/.rspec +1 -0
- data/.travis.yml +33 -0
- data/CHANGELOG.md +3 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +77 -0
- data/Rakefile +6 -0
- data/growl_car.gemspec +30 -0
- data/lib/growl_car.rb +38 -0
- data/lib/growl_car/client.rb +26 -0
- data/lib/growl_car/configuration.rb +58 -0
- data/lib/growl_car/error.rb +7 -0
- data/lib/growl_car/growl_notification.rb +27 -0
- data/lib/growl_car/request.rb +32 -0
- data/lib/growl_car/version.rb +3 -0
- data/spec/growl_car/configuration_spec.rb +18 -0
- data/spec/growl_car/growl_notification_spec.rb +27 -0
- data/spec/growl_car_spec.rb +94 -0
- data/spec/spec_helper.rb +18 -0
- metadata +180 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 7141fc307f5039f7db2c7938af4c2f9c1806170f
|
4
|
+
data.tar.gz: c55b24d953b7f528ce4d588476c1cceb66a10884
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 3da53d7b279e37e665658c56640e7b892a20a8b188536912e259f422e5511d40ce3f8ac38c1fa56fe08b5d45687adba56f687c737519d35df45507233244c217
|
7
|
+
data.tar.gz: ba498a8e629d748901845d68036692e41ebf2bd5c11e8728146820e2ff777577f70170b8b52780c0a89edd0ba89a028ab516c977fcc57ebfe0b71fb760a03594
|
data/.gitignore
ADDED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/.travis.yml
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
language: ruby
|
2
|
+
rvm:
|
3
|
+
- jruby-19mode
|
4
|
+
- rbx-19mode
|
5
|
+
- 1.9.3
|
6
|
+
- 2.0.0
|
7
|
+
- ruby-head
|
8
|
+
- jruby-head
|
9
|
+
jdk:
|
10
|
+
- openjdk6
|
11
|
+
- openjdk7
|
12
|
+
- oraclejdk7
|
13
|
+
matrix:
|
14
|
+
allow_failures:
|
15
|
+
- rvm: ruby-head
|
16
|
+
- rvm: jruby-head
|
17
|
+
exclude:
|
18
|
+
- rvm: 1.9.3
|
19
|
+
jdk: openjdk7
|
20
|
+
- rvm: 1.9.3
|
21
|
+
jdk: oraclejdk7
|
22
|
+
- rvm: 2.0.0
|
23
|
+
jdk: openjdk7
|
24
|
+
- rvm: 2.0.0
|
25
|
+
jdk: oraclejdk7
|
26
|
+
- rvm: ruby-head
|
27
|
+
jdk: openjdk7
|
28
|
+
- rvm: ruby-head
|
29
|
+
jdk: oraclejdk7
|
30
|
+
- rvm: rbx-19mode
|
31
|
+
jdk: openjdk7
|
32
|
+
- rvm: rbx-19mode
|
33
|
+
jdk: oraclejdk7
|
data/CHANGELOG.md
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Matthew Shafer
|
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,77 @@
|
|
1
|
+
# GrowlCar
|
2
|
+
[](https://travis-ci.org/matthewshafer/growl_car)
|
3
|
+
[](https://gemnasium.com/matthewshafer/growl_car)
|
4
|
+
[](https://codeclimate.com/github/matthewshafer/growl_car)
|
5
|
+
[](https://coveralls.io/r/matthewshafer/growl_car)
|
6
|
+
|
7
|
+
Sending notifications to the growl provider on boxcar.io
|
8
|
+
|
9
|
+
## Installation
|
10
|
+
|
11
|
+
Add this line to your application's Gemfile:
|
12
|
+
|
13
|
+
gem 'growl_car'
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install growl_car
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
You will need to enable the Growl provider on your boxcar account.
|
26
|
+
|
27
|
+
### Sample Usage
|
28
|
+
|
29
|
+
```ruby
|
30
|
+
require 'growl_car'
|
31
|
+
|
32
|
+
GrowlCar.configure do |config|
|
33
|
+
config.username = "YOUR_BOXCAR_USERNAME"
|
34
|
+
config.password = "YOUR_BOXCAR_PASSWORD"
|
35
|
+
end
|
36
|
+
|
37
|
+
GrowlCar.send_growl_notification("GrowlCar-test", "This message is from GrowlCar")
|
38
|
+
```
|
39
|
+
|
40
|
+
It is also possible to instantiate a ``` GrowlCar::Client ``` to handle multiple users:
|
41
|
+
|
42
|
+
```ruby
|
43
|
+
matt = GrowlCar::Client.new(username: MATT_BOXCAR_USERNAME, password: MATT_BOXCAR_PASSWORD)
|
44
|
+
|
45
|
+
alex = GrowlCar::Client.new(username: ALEX_BOXCAR_USERNAME, password: ALEX_BOXCAR_PASSWORD)
|
46
|
+
|
47
|
+
matt.send_growl_notification("GrowlCar-matt", "Hey how's it going?")
|
48
|
+
|
49
|
+
alex.send_growl_notification("GrowlCar-alex", "The Food is ready")
|
50
|
+
```
|
51
|
+
|
52
|
+
### Errors
|
53
|
+
|
54
|
+
the ``` send_growl_notification ``` method can raise errors if it encounters any issues with boxcar.
|
55
|
+
If is unable to log in (unauthorized response) it will raise a ``` GrowlCar::Error::UnauthorizedError ```
|
56
|
+
For any response that is not a 200 or 401 (unauthorized) it will raise a ``` GrowlCar::Error::HttpError ```
|
57
|
+
|
58
|
+
## Documentation
|
59
|
+
|
60
|
+
You can find the latest documentation of the master branch here: http://rubydoc.info/github/matthewshafer/growl_car/
|
61
|
+
|
62
|
+
## Contributing
|
63
|
+
|
64
|
+
### Issues
|
65
|
+
|
66
|
+
Issues can be reported right here on the github repo.
|
67
|
+
Everyone is encouraged to write an issue if they find a bug or have a request.
|
68
|
+
|
69
|
+
### Pull Requests
|
70
|
+
|
71
|
+
Everyone can also submit pull requests. Here are some guidelines:
|
72
|
+
|
73
|
+
1. Fork the repo
|
74
|
+
2. Create a branch (make the name descriptive)
|
75
|
+
3. Write tests and work on your changes
|
76
|
+
4. Make sure all tests pass and your code is covered
|
77
|
+
5. Open a pull request and write a description of what you did
|
data/Rakefile
ADDED
data/growl_car.gemspec
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'growl_car/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "growl_car"
|
8
|
+
spec.version = GrowlCar::VERSION
|
9
|
+
spec.authors = ["Matthew Shafer"]
|
10
|
+
spec.email = ["matthewshafer@mac.com"]
|
11
|
+
spec.description = %q{Sending growl notifications to boxcar.io}
|
12
|
+
spec.summary = %q{A tool to allow sending notifications to the growl provider on boxcar.io}
|
13
|
+
spec.homepage = "https://github.com/matthewshafer/growl_car"
|
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", "~> 2.13.0"
|
24
|
+
spec.add_development_dependency "webmock", "~> 1.11.0"
|
25
|
+
spec.add_development_dependency "simplecov", "~> 0.7.1"
|
26
|
+
spec.add_development_dependency "coveralls", "~> 0.6.4"
|
27
|
+
|
28
|
+
spec.add_dependency "atomic", "~> 1.1.0"
|
29
|
+
spec.add_dependency "httpclient", "~> 2.3.3"
|
30
|
+
end
|
data/lib/growl_car.rb
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
require "growl_car/version"
|
2
|
+
require "growl_car/configuration"
|
3
|
+
require "growl_car/client"
|
4
|
+
require "growl_car/error"
|
5
|
+
require 'atomic'
|
6
|
+
|
7
|
+
module GrowlCar
|
8
|
+
|
9
|
+
@client = ::Atomic.new
|
10
|
+
|
11
|
+
class << self
|
12
|
+
include Configuration
|
13
|
+
|
14
|
+
def client
|
15
|
+
create_client unless @client.value
|
16
|
+
@client.value
|
17
|
+
end
|
18
|
+
|
19
|
+
def respond_to?(method)
|
20
|
+
return client.respond_to?(method)
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
def method_missing(method_name, *args, &block)
|
26
|
+
return super unless client.respond_to?(method_name)
|
27
|
+
client.send(method_name, *args, &block)
|
28
|
+
end
|
29
|
+
|
30
|
+
def create_client
|
31
|
+
begin
|
32
|
+
@client.try_update { GrowlCar::Client.new(credentials) }
|
33
|
+
rescue Atomic::ConcurrentUpdateError
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require "growl_car/configuration"
|
2
|
+
require "growl_car/request"
|
3
|
+
require "growl_car/growl_notification"
|
4
|
+
|
5
|
+
module GrowlCar
|
6
|
+
class Client
|
7
|
+
include GrowlCar::Request
|
8
|
+
include GrowlCar::GrowlNotification
|
9
|
+
|
10
|
+
# Initialize a new GrowlCar::Client
|
11
|
+
#
|
12
|
+
# @param options [Hash]
|
13
|
+
# @return [GrowlCar::Client]
|
14
|
+
def initialize(options={})
|
15
|
+
GrowlCar::Configuration.keys.each do |key|
|
16
|
+
instance_variable_set(:"@#{key}", options[key])
|
17
|
+
end
|
18
|
+
|
19
|
+
super()
|
20
|
+
|
21
|
+
set_auth(@username, @password)
|
22
|
+
end
|
23
|
+
|
24
|
+
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
module GrowlCar
|
2
|
+
module Configuration
|
3
|
+
attr_writer :username, :password
|
4
|
+
|
5
|
+
class << self
|
6
|
+
|
7
|
+
# List of keys used for configuration
|
8
|
+
#
|
9
|
+
# @return [Array]
|
10
|
+
def keys
|
11
|
+
@keys ||= [
|
12
|
+
:username,
|
13
|
+
:password
|
14
|
+
]
|
15
|
+
end
|
16
|
+
|
17
|
+
# Url for boxcar.io
|
18
|
+
#
|
19
|
+
# @return [String]
|
20
|
+
def boxcar_url
|
21
|
+
"https://boxcar.io/notifications"
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
# Convenience method to allow GrowlCar configuration to be set in a block
|
26
|
+
#
|
27
|
+
# @raise [GrowlCar::Error::ConfigurationError] if credentials are not in the form of a string
|
28
|
+
def configure
|
29
|
+
yield self
|
30
|
+
validate_credentials!
|
31
|
+
self
|
32
|
+
end
|
33
|
+
|
34
|
+
# Set all configuration values to nil
|
35
|
+
def reset!
|
36
|
+
GrowlCar::Configuration.keys.each do |key|
|
37
|
+
instance_variable_set(:"@#{key}", nil)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
private
|
42
|
+
|
43
|
+
def credentials
|
44
|
+
{
|
45
|
+
:username => @username,
|
46
|
+
:password => @password
|
47
|
+
}
|
48
|
+
end
|
49
|
+
|
50
|
+
def validate_credentials!
|
51
|
+
credentials.each do |credential, value|
|
52
|
+
unless value.is_a?(String)
|
53
|
+
raise GrowlCar::Error::ConfigurationError, "Invalid #{credential}. Must be a string"
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module GrowlCar
|
2
|
+
module GrowlNotification
|
3
|
+
|
4
|
+
# Sends a notification to the boxcar.io growl provider
|
5
|
+
#
|
6
|
+
# @param from [String] name of the sender of the message
|
7
|
+
# @param message [String] message to be sent to boxcar
|
8
|
+
# @raise [GrowlCar::Error::UnauthorizedError] if username or password is incorrect
|
9
|
+
# @raise [GrowlCar::Error::HttpError] if http response is not 200 or 401
|
10
|
+
# @return [Boolean] on successful notification
|
11
|
+
def send_growl_notification(from, message)
|
12
|
+
boxcar_post_fields = {
|
13
|
+
"notification[from_screen_name]" => from,
|
14
|
+
"notification[message]" => message,
|
15
|
+
"notification[from_remote_service_id]" => random_growl_number
|
16
|
+
}
|
17
|
+
|
18
|
+
post_notification(boxcar_post_fields)
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def random_growl_number
|
24
|
+
Random.rand(9999999999)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'httpclient'
|
2
|
+
|
3
|
+
module GrowlCar
|
4
|
+
module Request
|
5
|
+
|
6
|
+
# Initialize HTTPClient for requests
|
7
|
+
def initialize
|
8
|
+
@http = HTTPClient.new
|
9
|
+
end
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def post_notification(query)
|
14
|
+
raise_if_status_not_ok(@http.post(GrowlCar::Configuration.boxcar_url, query).status)
|
15
|
+
end
|
16
|
+
|
17
|
+
def raise_if_status_not_ok(status)
|
18
|
+
case status
|
19
|
+
when 200
|
20
|
+
true
|
21
|
+
when 401
|
22
|
+
raise GrowlCar::Error::UnauthorizedError
|
23
|
+
else
|
24
|
+
raise GrowlCar::Error::HttpError
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def set_auth(username, password)
|
29
|
+
@http.set_auth(GrowlCar::Configuration.boxcar_url, username, password)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe GrowlCar::Configuration do
|
4
|
+
|
5
|
+
context ".keys" do
|
6
|
+
|
7
|
+
it "returns an array of keys" do
|
8
|
+
expect(GrowlCar::Configuration.keys).to eql([:username, :password])
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
context ".boxcar_url" do
|
13
|
+
|
14
|
+
it "returns the boxcar url to post growl notifications to" do
|
15
|
+
expect(GrowlCar::Configuration.boxcar_url).to eql("https://boxcar.io/notifications")
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe GrowlCar::Client do
|
4
|
+
|
5
|
+
context ".new" do
|
6
|
+
|
7
|
+
let(:client) { GrowlCar::Client.new }
|
8
|
+
|
9
|
+
describe "#send_growl_notification" do
|
10
|
+
|
11
|
+
it "returns true when the request status is 200" do
|
12
|
+
stub_post("/notifications").to_return(status: 200)
|
13
|
+
expect(client.send_growl_notification("test", "test")).to be_true
|
14
|
+
end
|
15
|
+
|
16
|
+
it "raises a GrowlCar::Error::UnauthorizedError when a username or password is incorrect" do
|
17
|
+
stub_post("/notifications").to_return(status: [401, "Unauthorized"])
|
18
|
+
expect { client.send_growl_notification("test", "test") }.to raise_error(GrowlCar::Error::UnauthorizedError)
|
19
|
+
end
|
20
|
+
|
21
|
+
it "raises a GrowlCar::Error::HttpError when a status other than 200 or 401 is encountered" do
|
22
|
+
stub_post("/notifications").to_return(status: [404, "Not Found"])
|
23
|
+
expect { client.send_growl_notification("test", "test") }.to raise_error(GrowlCar::Error::HttpError)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,94 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe GrowlCar do
|
4
|
+
|
5
|
+
context "when delegating to a client" do
|
6
|
+
|
7
|
+
before do
|
8
|
+
GrowlCar::Client.any_instance.stub(:test).and_return("testing")
|
9
|
+
end
|
10
|
+
|
11
|
+
it "delegates to GrowlCar::Client" do
|
12
|
+
expect(GrowlCar.test).to eql("testing")
|
13
|
+
end
|
14
|
+
|
15
|
+
describe ".respond_to?" do
|
16
|
+
|
17
|
+
it "delegates to GrowlCar::Client" do
|
18
|
+
expect(GrowlCar.respond_to?(:test)).to be_true
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
describe ".client" do
|
23
|
+
it "returns a GrowlCar::Client" do
|
24
|
+
expect(GrowlCar.client).to be_kind_of(GrowlCar::Client)
|
25
|
+
end
|
26
|
+
|
27
|
+
it "does not create a new GrowlCar::Client when one is already created" do
|
28
|
+
client = GrowlCar.client
|
29
|
+
expect(GrowlCar.client).to eql(client)
|
30
|
+
end
|
31
|
+
|
32
|
+
it "rescues an Atomic::ConcurrentUpdateError and does nothing" do
|
33
|
+
atomic_exception = double("Atomic", value: nil).as_null_object
|
34
|
+
atomic_exception.stub(:try_update).and_raise(Atomic::ConcurrentUpdateError)
|
35
|
+
GrowlCar.instance_variable_set(:"@client", atomic_exception)
|
36
|
+
expect { GrowlCar.client }.not_to raise_error(Atomic::ConcurrentUpdateError)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
describe ".configuration" do
|
42
|
+
|
43
|
+
context "when invalid configuration data is provided" do
|
44
|
+
|
45
|
+
it "raises a configuration error" do
|
46
|
+
expect {
|
47
|
+
GrowlCar.configure do |config|
|
48
|
+
config.username = 1234
|
49
|
+
config.password = "test_password"
|
50
|
+
end
|
51
|
+
}.to raise_error(GrowlCar::Error::ConfigurationError)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
context "when valid configuration data is provided" do
|
56
|
+
|
57
|
+
before do
|
58
|
+
GrowlCar.configure do |config|
|
59
|
+
config.username = "test"
|
60
|
+
config.password = "pass"
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
it "sets the username" do
|
65
|
+
expect(GrowlCar.instance_variable_get(:"@username")).to eql("test")
|
66
|
+
end
|
67
|
+
|
68
|
+
it "sets the password" do
|
69
|
+
expect(GrowlCar.instance_variable_get(:"@password")).to eql("pass")
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
describe ".reset!" do
|
75
|
+
|
76
|
+
context "resets valid valid configuration details" do
|
77
|
+
|
78
|
+
before do
|
79
|
+
GrowlCar.configure do |config|
|
80
|
+
config.username = "test"
|
81
|
+
config.password = "pass"
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
it "sets the username to nil" do
|
86
|
+
expect { GrowlCar.reset! }.to change { GrowlCar.instance_variable_get(:"@username") }
|
87
|
+
end
|
88
|
+
|
89
|
+
it "sets the password to nil" do
|
90
|
+
expect { GrowlCar.reset! }.to change { GrowlCar.instance_variable_get(:"@password") }
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'simplecov'
|
2
|
+
require 'coveralls'
|
3
|
+
|
4
|
+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
5
|
+
SimpleCov::Formatter::HTMLFormatter,
|
6
|
+
Coveralls::SimpleCov::Formatter
|
7
|
+
]
|
8
|
+
SimpleCov.start
|
9
|
+
|
10
|
+
require 'growl_car'
|
11
|
+
require 'rspec'
|
12
|
+
require 'webmock/rspec'
|
13
|
+
|
14
|
+
WebMock.disable_net_connect!(allow: 'coveralls.io')
|
15
|
+
|
16
|
+
def stub_post(path)
|
17
|
+
stub_request(:post, "https://boxcar.io" + path)
|
18
|
+
end
|
metadata
ADDED
@@ -0,0 +1,180 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: growl_car
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Matthew Shafer
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-04-11 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: 2.13.0
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 2.13.0
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: webmock
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 1.11.0
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ~>
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: 1.11.0
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: simplecov
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ~>
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.7.1
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ~>
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.7.1
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: coveralls
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ~>
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 0.6.4
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ~>
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 0.6.4
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: atomic
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ~>
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 1.1.0
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ~>
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 1.1.0
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: httpclient
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ~>
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: 2.3.3
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ~>
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: 2.3.3
|
125
|
+
description: Sending growl notifications to boxcar.io
|
126
|
+
email:
|
127
|
+
- matthewshafer@mac.com
|
128
|
+
executables: []
|
129
|
+
extensions: []
|
130
|
+
extra_rdoc_files: []
|
131
|
+
files:
|
132
|
+
- .gitignore
|
133
|
+
- .rspec
|
134
|
+
- .travis.yml
|
135
|
+
- CHANGELOG.md
|
136
|
+
- Gemfile
|
137
|
+
- LICENSE.txt
|
138
|
+
- README.md
|
139
|
+
- Rakefile
|
140
|
+
- growl_car.gemspec
|
141
|
+
- lib/growl_car.rb
|
142
|
+
- lib/growl_car/client.rb
|
143
|
+
- lib/growl_car/configuration.rb
|
144
|
+
- lib/growl_car/error.rb
|
145
|
+
- lib/growl_car/growl_notification.rb
|
146
|
+
- lib/growl_car/request.rb
|
147
|
+
- lib/growl_car/version.rb
|
148
|
+
- spec/growl_car/configuration_spec.rb
|
149
|
+
- spec/growl_car/growl_notification_spec.rb
|
150
|
+
- spec/growl_car_spec.rb
|
151
|
+
- spec/spec_helper.rb
|
152
|
+
homepage: https://github.com/matthewshafer/growl_car
|
153
|
+
licenses:
|
154
|
+
- MIT
|
155
|
+
metadata: {}
|
156
|
+
post_install_message:
|
157
|
+
rdoc_options: []
|
158
|
+
require_paths:
|
159
|
+
- lib
|
160
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
161
|
+
requirements:
|
162
|
+
- - '>='
|
163
|
+
- !ruby/object:Gem::Version
|
164
|
+
version: '0'
|
165
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
166
|
+
requirements:
|
167
|
+
- - '>='
|
168
|
+
- !ruby/object:Gem::Version
|
169
|
+
version: '0'
|
170
|
+
requirements: []
|
171
|
+
rubyforge_project:
|
172
|
+
rubygems_version: 2.0.0
|
173
|
+
signing_key:
|
174
|
+
specification_version: 4
|
175
|
+
summary: A tool to allow sending notifications to the growl provider on boxcar.io
|
176
|
+
test_files:
|
177
|
+
- spec/growl_car/configuration_spec.rb
|
178
|
+
- spec/growl_car/growl_notification_spec.rb
|
179
|
+
- spec/growl_car_spec.rb
|
180
|
+
- spec/spec_helper.rb
|