transporter-campfire 0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,3 @@
1
+ doc/*
2
+ dist/*
3
+ tmp/*
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ (The MIT License)
2
+
3
+ Copyright (c) 2008-2009 Nicolas Sanguinetti
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 NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
20
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,33 @@
1
+ = Transporter::Campfire
2
+
3
+ Notify your Campfire from Transporter
4
+
5
+ See Transporter[http://github.com/foca/transporter] for a description of the
6
+ library.
7
+
8
+ == How to use
9
+
10
+ require "transporter/campfire"
11
+
12
+ Transporter.deliver(
13
+ :message => { :short => "..." },
14
+ :using => {
15
+ :campfire => {
16
+ :subdomain => "myaccount", # account/subdomain your campfire uses
17
+ :ssl => true, # either true or false (optional)
18
+ :proxy => "proxy url", # see Tinder's API docs (optional)
19
+ :login => "your email",
20
+ :password => "your password",
21
+ :room => "room name"
22
+ }
23
+ }
24
+ )
25
+
26
+ == Install
27
+
28
+ gem install transporter-campfire
29
+
30
+ == Credits
31
+
32
+ Author:: Nicolás Sanguinetti (foca[http://github.com/foca])
33
+ License:: MIT (see LICENSE file)
@@ -0,0 +1,20 @@
1
+ require "rake/testtask"
2
+
3
+ begin
4
+ require "hanna/rdoctask"
5
+ rescue LoadError
6
+ require "rake/rdoctask"
7
+ end
8
+
9
+ Rake::RDocTask.new do |rd|
10
+ rd.main = "README"
11
+ rd.title = "API Documentation for Transporter::Campfire"
12
+ rd.rdoc_files.include("README.rdoc", "LICENSE", "lib/**/*.rb")
13
+ rd.rdoc_dir = "doc"
14
+ end
15
+
16
+ begin
17
+ require "mg"
18
+ MG.new("transporter-campfire.gemspec")
19
+ rescue LoadError
20
+ end
@@ -0,0 +1,26 @@
1
+ require "transporter"
2
+ require "tinder"
3
+
4
+ module Transporter
5
+ class Campfire < Service
6
+ validate_config do |config|
7
+ config.has_keys :subdomain, :room, :login, :password
8
+ config.key_is_one_of :ssl, [true, false]
9
+ end
10
+
11
+ def deliver(package)
12
+ room.speak(package.short)
13
+ end
14
+
15
+ private
16
+
17
+ def room
18
+ return @room if @room
19
+ campfire = Tinder::Campfire.new(config[:subdomain], :ssl => config[:ssl], :proxy => config[:proxy])
20
+ campfire.login(config[:login], config[:password])
21
+ @room = campfire.find_room_by_name(config[:room])
22
+ end
23
+ end
24
+
25
+ register :campfire, Campfire
26
+ end
@@ -0,0 +1,33 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = "transporter-campfire"
3
+ s.version = "0.1"
4
+ s.date = "2009-08-10"
5
+
6
+ s.description = "Deliver messages to your Campfire room"
7
+ s.summary = "Campfire adapter for Transporter"
8
+ s.homepage = "http://github.com/foca/Transporter"
9
+
10
+ s.authors = ["Nicolás Sanguinetti"]
11
+ s.email = "contacto@nicolassanguinetti.info"
12
+
13
+ s.require_paths = ["lib"]
14
+ s.rubyforge_project = "transporter"
15
+ s.has_rdoc = true
16
+ s.rubygems_version = "1.3.1"
17
+
18
+ s.add_dependency "transporter"
19
+ s.add_dependency "tinder"
20
+
21
+ if s.respond_to?(:add_development_dependency)
22
+ s.add_development_dependency "sr-mg"
23
+ end
24
+
25
+ s.files = %w[
26
+ .gitignore
27
+ LICENSE
28
+ README.rdoc
29
+ Rakefile
30
+ transporter-campfire.gemspec
31
+ lib/transporter/campfire.rb
32
+ ]
33
+ end
metadata ADDED
@@ -0,0 +1,89 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: transporter-campfire
3
+ version: !ruby/object:Gem::Version
4
+ version: "0.1"
5
+ platform: ruby
6
+ authors:
7
+ - "Nicol\xC3\xA1s Sanguinetti"
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-08-10 00:00:00 -03:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: transporter
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "0"
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: tinder
27
+ type: :runtime
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: "0"
34
+ version:
35
+ - !ruby/object:Gem::Dependency
36
+ name: sr-mg
37
+ type: :development
38
+ version_requirement:
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: "0"
44
+ version:
45
+ description: Deliver messages to your Campfire room
46
+ email: contacto@nicolassanguinetti.info
47
+ executables: []
48
+
49
+ extensions: []
50
+
51
+ extra_rdoc_files: []
52
+
53
+ files:
54
+ - .gitignore
55
+ - LICENSE
56
+ - README.rdoc
57
+ - Rakefile
58
+ - transporter-campfire.gemspec
59
+ - lib/transporter/campfire.rb
60
+ has_rdoc: true
61
+ homepage: http://github.com/foca/Transporter
62
+ licenses: []
63
+
64
+ post_install_message:
65
+ rdoc_options: []
66
+
67
+ require_paths:
68
+ - lib
69
+ required_ruby_version: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: "0"
74
+ version:
75
+ required_rubygems_version: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ version: "0"
80
+ version:
81
+ requirements: []
82
+
83
+ rubyforge_project: transporter
84
+ rubygems_version: 1.3.4
85
+ signing_key:
86
+ specification_version: 3
87
+ summary: Campfire adapter for Transporter
88
+ test_files: []
89
+