tinder 1.4.3 → 1.4.4
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -3
- data/{spec/spec.opts → .rspec} +0 -0
- data/Gemfile +2 -0
- data/Rakefile +7 -49
- data/lib/tinder/room.rb +10 -1
- data/lib/tinder/version.rb +3 -0
- data/spec/spec_helper.rb +1 -1
- data/spec/tinder/room_spec.rb +2 -0
- data/tinder.gemspec +6 -41
- metadata +13 -7
- data/VERSION +0 -1
data/.gitignore
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
*.gem
|
2
|
+
.bundle
|
3
|
+
Gemfile.lock
|
4
|
+
pkg/*
|
data/{spec/spec.opts → .rspec}
RENAMED
File without changes
|
data/Gemfile
ADDED
data/Rakefile
CHANGED
@@ -1,52 +1,10 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
Jeweler::Tasks.new do |gem|
|
4
|
-
gem.name = "tinder"
|
5
|
-
gem.summary = "Ruby wrapper for the Campfire API"
|
6
|
-
gem.description = "A Ruby API for interfacing with Campfire, the 37Signals chat application."
|
7
|
-
gem.authors = ['Brandon Keepers']
|
8
|
-
gem.email = 'brandon@opensoul.org'
|
9
|
-
gem.homepage = 'http://github.com/collectiveidea/tinder'
|
10
|
-
gem.rubyforge_project = "tinder"
|
11
|
-
gem.add_dependency "activesupport"
|
12
|
-
gem.add_dependency "faraday", "~> 0.5.1"
|
13
|
-
gem.add_dependency "multipart-post"
|
14
|
-
gem.add_dependency "mime-types"
|
15
|
-
gem.add_dependency "twitter-stream"
|
16
|
-
gem.add_dependency "eventmachine"
|
17
|
-
gem.add_development_dependency "rspec"
|
18
|
-
gem.add_development_dependency "fakeweb"
|
19
|
-
end
|
20
|
-
Jeweler::GemcutterTasks.new
|
21
|
-
rescue LoadError
|
22
|
-
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
|
23
|
-
end
|
24
|
-
|
25
|
-
require 'rake/rdoctask'
|
26
|
-
Rake::RDocTask.new do |rdoc|
|
27
|
-
if File.exist?('VERSION')
|
28
|
-
version = File.read('VERSION')
|
29
|
-
else
|
30
|
-
version = ""
|
31
|
-
end
|
1
|
+
require 'bundler'
|
2
|
+
Bundler::GemHelper.install_tasks
|
32
3
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
4
|
+
require 'rspec/core/rake_task'
|
5
|
+
desc 'Run the specs'
|
6
|
+
RSpec::Core::RakeTask.new do |r|
|
7
|
+
r.verbose = false
|
37
8
|
end
|
38
9
|
|
39
|
-
|
40
|
-
desc "Run the specs under spec"
|
41
|
-
Spec::Rake::SpecTask.new do |t|
|
42
|
-
t.spec_opts = ['--options', "spec/spec.opts"]
|
43
|
-
t.spec_files = FileList['spec/**/*_spec.rb']
|
44
|
-
end
|
45
|
-
task :spec => :check_dependencies
|
46
|
-
|
47
|
-
task :default do
|
48
|
-
%w(2.3.5 2.3.9 3.0.0).each do |version|
|
49
|
-
puts "Running specs with Rails #{version}"
|
50
|
-
system("RAILS_VERSION=#{version} rake -s spec;")
|
51
|
-
end
|
52
|
-
end
|
10
|
+
task :default => :spec
|
data/lib/tinder/room.rb
CHANGED
@@ -140,11 +140,20 @@ module Tinder
|
|
140
140
|
EventMachine::run do
|
141
141
|
@stream = Twitter::JSONStream.connect(options)
|
142
142
|
@stream.each_item do |message|
|
143
|
-
message = HashWithIndifferentAccess.new(JSON.
|
143
|
+
message = HashWithIndifferentAccess.new(ActiveSupport::JSON.decode(message))
|
144
144
|
message[:user] = user(message.delete(:user_id))
|
145
145
|
message[:created_at] = Time.parse(message[:created_at])
|
146
146
|
yield(message)
|
147
147
|
end
|
148
|
+
|
149
|
+
@stream.on_error do |message|
|
150
|
+
raise ListenFailed.new("got an error! #{message.inspect}!")
|
151
|
+
end
|
152
|
+
|
153
|
+
@stream.on_max_reconnects do |timeout, retries|
|
154
|
+
raise ListenFailed.new("Tried #{retries} times to connect. Got disconnected from #{@name}!")
|
155
|
+
end
|
156
|
+
|
148
157
|
# if we really get disconnected
|
149
158
|
raise ListenFailed.new("got disconnected from #{@name}!") if !EventMachine.reactor_running?
|
150
159
|
end
|
data/spec/spec_helper.rb
CHANGED
data/spec/tinder/room_spec.rb
CHANGED
data/tinder.gemspec
CHANGED
@@ -1,59 +1,24 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
1
|
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "tinder/version"
|
5
4
|
|
6
5
|
Gem::Specification.new do |s|
|
7
6
|
s.name = %q{tinder}
|
8
|
-
s.version =
|
9
|
-
|
7
|
+
s.version = Tinder::VERSION
|
10
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
9
|
s.authors = ["Brandon Keepers"]
|
12
|
-
s.date = %q{2010-12-07}
|
13
10
|
s.description = %q{A Ruby API for interfacing with Campfire, the 37Signals chat application.}
|
14
11
|
s.email = %q{brandon@opensoul.org}
|
15
12
|
s.extra_rdoc_files = [
|
16
13
|
"README.markdown"
|
17
14
|
]
|
18
|
-
s.files = [
|
19
|
-
".gitignore",
|
20
|
-
"CHANGELOG.txt",
|
21
|
-
"MIT-LICENSE",
|
22
|
-
"README.markdown",
|
23
|
-
"Rakefile",
|
24
|
-
"VERSION",
|
25
|
-
"init.rb",
|
26
|
-
"lib/tinder.rb",
|
27
|
-
"lib/tinder/campfire.rb",
|
28
|
-
"lib/tinder/connection.rb",
|
29
|
-
"lib/tinder/middleware.rb",
|
30
|
-
"lib/tinder/room.rb",
|
31
|
-
"site/index.html",
|
32
|
-
"site/stylesheets/style.css",
|
33
|
-
"spec/fixtures/rooms.json",
|
34
|
-
"spec/fixtures/rooms/room80749.json",
|
35
|
-
"spec/fixtures/rooms/room80751.json",
|
36
|
-
"spec/fixtures/rooms/show.json",
|
37
|
-
"spec/fixtures/users/me.json",
|
38
|
-
"spec/spec.opts",
|
39
|
-
"spec/spec_helper.rb",
|
40
|
-
"spec/tinder/campfire_spec.rb",
|
41
|
-
"spec/tinder/connection_spec.rb",
|
42
|
-
"spec/tinder/room_spec.rb",
|
43
|
-
"tinder.gemspec"
|
44
|
-
]
|
45
15
|
s.homepage = %q{http://github.com/collectiveidea/tinder}
|
46
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
47
|
-
s.require_paths = ["lib"]
|
48
16
|
s.rubyforge_project = %q{tinder}
|
49
17
|
s.rubygems_version = %q{1.3.6}
|
50
18
|
s.summary = %q{Ruby wrapper for the Campfire API}
|
51
|
-
s.
|
52
|
-
|
53
|
-
|
54
|
-
"spec/tinder/connection_spec.rb",
|
55
|
-
"spec/tinder/room_spec.rb"
|
56
|
-
]
|
19
|
+
s.files = `git ls-files`.split("\n")
|
20
|
+
s.test_files = `git ls-files -- spec/*`.split("\n")
|
21
|
+
s.require_paths = ["lib"]
|
57
22
|
|
58
23
|
if s.respond_to? :specification_version then
|
59
24
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 4
|
8
|
-
-
|
9
|
-
version: 1.4.
|
8
|
+
- 4
|
9
|
+
version: 1.4.4
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Brandon Keepers
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date:
|
17
|
+
date: 2011-04-26 00:00:00 -04:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -125,17 +125,19 @@ extra_rdoc_files:
|
|
125
125
|
- README.markdown
|
126
126
|
files:
|
127
127
|
- .gitignore
|
128
|
+
- .rspec
|
128
129
|
- CHANGELOG.txt
|
130
|
+
- Gemfile
|
129
131
|
- MIT-LICENSE
|
130
132
|
- README.markdown
|
131
133
|
- Rakefile
|
132
|
-
- VERSION
|
133
134
|
- init.rb
|
134
135
|
- lib/tinder.rb
|
135
136
|
- lib/tinder/campfire.rb
|
136
137
|
- lib/tinder/connection.rb
|
137
138
|
- lib/tinder/middleware.rb
|
138
139
|
- lib/tinder/room.rb
|
140
|
+
- lib/tinder/version.rb
|
139
141
|
- site/index.html
|
140
142
|
- site/stylesheets/style.css
|
141
143
|
- spec/fixtures/rooms.json
|
@@ -143,7 +145,6 @@ files:
|
|
143
145
|
- spec/fixtures/rooms/room80751.json
|
144
146
|
- spec/fixtures/rooms/show.json
|
145
147
|
- spec/fixtures/users/me.json
|
146
|
-
- spec/spec.opts
|
147
148
|
- spec/spec_helper.rb
|
148
149
|
- spec/tinder/campfire_spec.rb
|
149
150
|
- spec/tinder/connection_spec.rb
|
@@ -154,8 +155,8 @@ homepage: http://github.com/collectiveidea/tinder
|
|
154
155
|
licenses: []
|
155
156
|
|
156
157
|
post_install_message:
|
157
|
-
rdoc_options:
|
158
|
-
|
158
|
+
rdoc_options: []
|
159
|
+
|
159
160
|
require_paths:
|
160
161
|
- lib
|
161
162
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -180,6 +181,11 @@ signing_key:
|
|
180
181
|
specification_version: 3
|
181
182
|
summary: Ruby wrapper for the Campfire API
|
182
183
|
test_files:
|
184
|
+
- spec/fixtures/rooms.json
|
185
|
+
- spec/fixtures/rooms/room80749.json
|
186
|
+
- spec/fixtures/rooms/room80751.json
|
187
|
+
- spec/fixtures/rooms/show.json
|
188
|
+
- spec/fixtures/users/me.json
|
183
189
|
- spec/spec_helper.rb
|
184
190
|
- spec/tinder/campfire_spec.rb
|
185
191
|
- spec/tinder/connection_spec.rb
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
1.4.3
|