campfire-notifier 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -0
- data/Gemfile +8 -0
- data/README.rdoc +39 -0
- data/Rakefile +52 -0
- data/VERSION +1 -0
- data/bin/campfire_notifier +6 -0
- data/campfire-notifier.gemspec +59 -0
- data/settings.yml.sample +3 -0
- data/spec/campfire_notifier_spec.rb +37 -0
- data/spec/fixtures/rooms.json +1 -0
- data/spec/spec.opts +4 -0
- data/spec/spec_helper.rb +17 -0
- data/vendor/gems/cache/crack-0.1.4.gem +0 -0
- data/vendor/gems/cache/httparty-0.5.0.gem +0 -0
- data/vendor/gems/cache/json_pure-1.2.0.gem +0 -0
- data/vendor/gems/cache/rspec-1.2.9.gem +0 -0
- metadata +31 -14
data/.gitignore
ADDED
data/Gemfile
ADDED
data/README.rdoc
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
= Campfire Notifier
|
2
|
+
|
3
|
+
Most of the time when I want to use the Campfire API, I just want to send it
|
4
|
+
a simple message. So, I created a stupid simple way to send a message to
|
5
|
+
Campfire.
|
6
|
+
|
7
|
+
I've include a command line tool as well to make it really easy to use this
|
8
|
+
with low-ish level system tools (i.e. cron).
|
9
|
+
|
10
|
+
== Install
|
11
|
+
|
12
|
+
gem install campfire_notifier
|
13
|
+
|
14
|
+
== Settings
|
15
|
+
|
16
|
+
In ~/.campfire_notifier.yml, put your campfire subdomain, the room id (not the name) to which you want to
|
17
|
+
send a message, and your API token, which you can find on your campfire user
|
18
|
+
edit page.
|
19
|
+
|
20
|
+
See here for more details: http://developer.37signals.com/campfire/index
|
21
|
+
|
22
|
+
== Requirements
|
23
|
+
|
24
|
+
Nothing! This baby uses gem bundler, so you shouldn't need to install
|
25
|
+
any other gems.
|
26
|
+
|
27
|
+
Still, just in case:
|
28
|
+
* HTTParty
|
29
|
+
* json_pure
|
30
|
+
|
31
|
+
|
32
|
+
== Potential Uses
|
33
|
+
|
34
|
+
* Deployment notifications
|
35
|
+
* CI Build notifications
|
36
|
+
* Git hooks
|
37
|
+
* Cron jobs
|
38
|
+
* Annoying your co-workers
|
39
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'jeweler'
|
6
|
+
Jeweler::Tasks.new do |gem|
|
7
|
+
gem.name = "campfire-notifier"
|
8
|
+
gem.summary = %Q{A really simple gem for sending simple messages to Campfire.}
|
9
|
+
gem.description = %Q{See github page.}
|
10
|
+
gem.email = "ajsharp@gmail.com"
|
11
|
+
gem.homepage = "http://github.com/ajsharp/campfire_notifier"
|
12
|
+
gem.authors = ["Alex Sharp"]
|
13
|
+
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
14
|
+
end
|
15
|
+
Jeweler::GemcutterTasks.new
|
16
|
+
rescue LoadError
|
17
|
+
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
18
|
+
end
|
19
|
+
|
20
|
+
require 'rake/testtask'
|
21
|
+
Rake::TestTask.new(:test) do |test|
|
22
|
+
test.libs << 'lib' << 'test'
|
23
|
+
test.pattern = 'test/**/test_*.rb'
|
24
|
+
test.verbose = true
|
25
|
+
end
|
26
|
+
|
27
|
+
begin
|
28
|
+
require 'rcov/rcovtask'
|
29
|
+
Rcov::RcovTask.new do |test|
|
30
|
+
test.libs << 'test'
|
31
|
+
test.pattern = 'test/**/test_*.rb'
|
32
|
+
test.verbose = true
|
33
|
+
end
|
34
|
+
rescue LoadError
|
35
|
+
task :rcov do
|
36
|
+
abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
task :test => :check_dependencies
|
41
|
+
|
42
|
+
task :default => :test
|
43
|
+
|
44
|
+
require 'rake/rdoctask'
|
45
|
+
Rake::RDocTask.new do |rdoc|
|
46
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
47
|
+
|
48
|
+
rdoc.rdoc_dir = 'rdoc'
|
49
|
+
rdoc.title = "campfire-notifier #{version}"
|
50
|
+
rdoc.rdoc_files.include('README*')
|
51
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
52
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.1
|
@@ -0,0 +1,59 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{campfire-notifier}
|
8
|
+
s.version = "0.1.1"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Alex Sharp"]
|
12
|
+
s.date = %q{2009-12-18}
|
13
|
+
s.default_executable = %q{campfire_notifier}
|
14
|
+
s.description = %q{See github page.}
|
15
|
+
s.email = %q{ajsharp@gmail.com}
|
16
|
+
s.executables = ["campfire_notifier"]
|
17
|
+
s.extra_rdoc_files = [
|
18
|
+
"README.rdoc"
|
19
|
+
]
|
20
|
+
s.files = [
|
21
|
+
".gitignore",
|
22
|
+
"Gemfile",
|
23
|
+
"README.rdoc",
|
24
|
+
"Rakefile",
|
25
|
+
"VERSION",
|
26
|
+
"bin/campfire_notifier",
|
27
|
+
"campfire-notifier.gemspec",
|
28
|
+
"lib/campfire_notifier.rb",
|
29
|
+
"settings.yml.sample",
|
30
|
+
"spec/campfire_notifier_spec.rb",
|
31
|
+
"spec/fixtures/rooms.json",
|
32
|
+
"spec/spec.opts",
|
33
|
+
"spec/spec_helper.rb",
|
34
|
+
"vendor/gems/cache/crack-0.1.4.gem",
|
35
|
+
"vendor/gems/cache/httparty-0.5.0.gem",
|
36
|
+
"vendor/gems/cache/json_pure-1.2.0.gem",
|
37
|
+
"vendor/gems/cache/rspec-1.2.9.gem"
|
38
|
+
]
|
39
|
+
s.homepage = %q{http://github.com/ajsharp/campfire_notifier}
|
40
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
41
|
+
s.require_paths = ["lib"]
|
42
|
+
s.rubygems_version = %q{1.3.5}
|
43
|
+
s.summary = %q{A really simple gem for sending simple messages to Campfire.}
|
44
|
+
s.test_files = [
|
45
|
+
"spec/campfire_notifier_spec.rb",
|
46
|
+
"spec/spec_helper.rb"
|
47
|
+
]
|
48
|
+
|
49
|
+
if s.respond_to? :specification_version then
|
50
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
51
|
+
s.specification_version = 3
|
52
|
+
|
53
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
54
|
+
else
|
55
|
+
end
|
56
|
+
else
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
data/settings.yml.sample
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe CampfireNotifier, ".config" do
|
4
|
+
before :each do
|
5
|
+
settings = { 'token' => 'token', 'subdomain' => 'example', 'room_id' => 111111 }
|
6
|
+
YAML.stub!(:load_file).
|
7
|
+
with(File.expand_path("~/.campfire_notifier.yml")).
|
8
|
+
and_return(settings)
|
9
|
+
@config = CampfireNotifier.config
|
10
|
+
end
|
11
|
+
|
12
|
+
it "should load some configuration settings" do
|
13
|
+
@config.should be_instance_of Hash
|
14
|
+
end
|
15
|
+
|
16
|
+
it "should set the subdomain option" do
|
17
|
+
@config['subdomain'].should_not be_blank
|
18
|
+
end
|
19
|
+
|
20
|
+
it "should set the room name" do
|
21
|
+
@config['room_id'].should_not be_blank
|
22
|
+
end
|
23
|
+
|
24
|
+
it "should set the token" do
|
25
|
+
@config['token'].should_not be_blank
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
describe CampfireNotifier, ".speak" do
|
30
|
+
before :each do
|
31
|
+
CampfireNotifier.stub(:speak).and_return("hello")
|
32
|
+
end
|
33
|
+
|
34
|
+
it "should submit a request to the campfire api" do
|
35
|
+
CampfireNotifier.should respond_to :speak
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
{"rooms":[{"name":"General","created_at":"2009/10/12 14:30:16 +0000","updated_at":"2009/10/17 08:49:16 +0000","topic":"","id":111111,"membership_limit":12}]}
|
data/spec/spec.opts
ADDED
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
$:.unshift(File.dirname(__FILE__) + '/../lib')
|
2
|
+
$:.unshift(File.dirname(__FILE__))
|
3
|
+
|
4
|
+
require 'rubygems'
|
5
|
+
require 'spec'
|
6
|
+
require 'spec/autorun'
|
7
|
+
|
8
|
+
require 'fakeweb'
|
9
|
+
|
10
|
+
require 'campfire_notifier'
|
11
|
+
|
12
|
+
|
13
|
+
fixtures = File.dirname(File.expand_path(__FILE__)) + "/fixtures"
|
14
|
+
|
15
|
+
FakeWeb.allow_net_connect = false
|
16
|
+
FakeWeb.register_uri(:get, "http://example.campfirenow.com/rooms.json", :body => File.read("#{fixtures}/rooms.json"))
|
17
|
+
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: campfire-notifier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Sharp
|
@@ -10,26 +10,42 @@ bindir: bin
|
|
10
10
|
cert_chain: []
|
11
11
|
|
12
12
|
date: 2009-12-18 00:00:00 -08:00
|
13
|
-
default_executable:
|
13
|
+
default_executable: campfire_notifier
|
14
14
|
dependencies: []
|
15
15
|
|
16
|
-
description:
|
17
|
-
email: ajsharp@
|
18
|
-
executables:
|
19
|
-
|
16
|
+
description: See github page.
|
17
|
+
email: ajsharp@gmail.com
|
18
|
+
executables:
|
19
|
+
- campfire_notifier
|
20
20
|
extensions: []
|
21
21
|
|
22
|
-
extra_rdoc_files:
|
23
|
-
|
22
|
+
extra_rdoc_files:
|
23
|
+
- README.rdoc
|
24
24
|
files:
|
25
|
+
- .gitignore
|
26
|
+
- Gemfile
|
27
|
+
- README.rdoc
|
28
|
+
- Rakefile
|
29
|
+
- VERSION
|
30
|
+
- bin/campfire_notifier
|
31
|
+
- campfire-notifier.gemspec
|
25
32
|
- lib/campfire_notifier.rb
|
33
|
+
- settings.yml.sample
|
34
|
+
- spec/campfire_notifier_spec.rb
|
35
|
+
- spec/fixtures/rooms.json
|
36
|
+
- spec/spec.opts
|
37
|
+
- spec/spec_helper.rb
|
38
|
+
- vendor/gems/cache/crack-0.1.4.gem
|
39
|
+
- vendor/gems/cache/httparty-0.5.0.gem
|
40
|
+
- vendor/gems/cache/json_pure-1.2.0.gem
|
41
|
+
- vendor/gems/cache/rspec-1.2.9.gem
|
26
42
|
has_rdoc: true
|
27
|
-
homepage:
|
43
|
+
homepage: http://github.com/ajsharp/campfire_notifier
|
28
44
|
licenses: []
|
29
45
|
|
30
46
|
post_install_message:
|
31
|
-
rdoc_options:
|
32
|
-
|
47
|
+
rdoc_options:
|
48
|
+
- --charset=UTF-8
|
33
49
|
require_paths:
|
34
50
|
- lib
|
35
51
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -50,6 +66,7 @@ rubyforge_project:
|
|
50
66
|
rubygems_version: 1.3.5
|
51
67
|
signing_key:
|
52
68
|
specification_version: 3
|
53
|
-
summary: A simple gem
|
54
|
-
test_files:
|
55
|
-
|
69
|
+
summary: A really simple gem for sending simple messages to Campfire.
|
70
|
+
test_files:
|
71
|
+
- spec/campfire_notifier_spec.rb
|
72
|
+
- spec/spec_helper.rb
|