tinder 1.4.4 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
File without changes
data/.rspec CHANGED
@@ -1,2 +1,3 @@
1
- --colour
2
- --backtrace
1
+ --color
2
+ --format=nested
3
+ --backtrace
data/Gemfile CHANGED
@@ -1,2 +1,3 @@
1
- source "http://rubygems.org"
1
+ source 'http://rubygems.org'
2
+
2
3
  gemspec
data/Rakefile CHANGED
@@ -3,8 +3,7 @@ Bundler::GemHelper.install_tasks
3
3
 
4
4
  require 'rspec/core/rake_task'
5
5
  desc 'Run the specs'
6
- RSpec::Core::RakeTask.new do |r|
7
- r.verbose = false
8
- end
6
+ RSpec::Core::RakeTask.new
9
7
 
10
- task :default => :spec
8
+ task :default => :spec
9
+ task :test => :spec
@@ -0,0 +1,9 @@
1
+ require 'faraday'
2
+
3
+ module Faraday
4
+ class Response::RaiseOnAuthenticationFailure < Response::Middleware
5
+ def on_complete(response)
6
+ raise Tinder::AuthenticationFailed if response[:status] == 401
7
+ end
8
+ end
9
+ end
@@ -1,11 +1,6 @@
1
- require 'active_support'
2
- require 'active_support/json'
3
- require 'mime/types'
4
-
5
1
  require 'tinder/connection'
6
2
  require 'tinder/campfire'
7
3
  require 'tinder/room'
8
- require 'tinder/middleware'
9
4
 
10
5
  module Tinder
11
6
  class Error < StandardError; end
@@ -32,6 +32,11 @@ module Tinder
32
32
  Room.new(connection, room)
33
33
  end
34
34
  end
35
+
36
+ # Find a campfire room by id
37
+ def find_room_by_id(id)
38
+ rooms.detect { |room| room.id == id }
39
+ end
35
40
 
36
41
  # Find a campfire room by name
37
42
  def find_room_by_name(name)
@@ -1,30 +1,31 @@
1
- require 'uri'
1
+ require 'active_support/json'
2
2
  require 'faraday'
3
+ require 'faraday/response/raise_on_authentication_failure'
4
+ require 'faraday_middleware'
5
+ require 'uri'
3
6
 
4
7
  module Tinder
5
8
  class Connection
6
- HOST = "campfirenow.com"
9
+ HOST = 'campfirenow.com'
7
10
 
8
11
  attr_reader :subdomain, :uri, :options
9
12
 
10
13
  def self.connection
11
- @connection ||= Faraday::Connection.new do |conn|
12
- conn.use Faraday::Request::ActiveSupportJson
13
- conn.adapter Faraday.default_adapter
14
- conn.use Tinder::FaradayResponse::RaiseOnAuthenticationFailure
15
- conn.use Faraday::Response::ActiveSupportJson
16
- conn.use Tinder::FaradayResponse::WithIndifferentAccess
17
-
18
- conn.headers['Content-Type'] = 'application/json'
14
+ @connection ||= Faraday.new do |builder|
15
+ builder.use Faraday::Request::JSON
16
+ builder.use Faraday::Response::Mashify
17
+ builder.use Faraday::Response::ParseJson
18
+ builder.use Faraday::Response::RaiseOnAuthenticationFailure
19
+ builder.adapter Faraday.default_adapter
19
20
  end
20
21
  end
21
22
 
22
23
  def self.raw_connection
23
- @raw_connection ||= Faraday::Connection.new do |conn|
24
- conn.adapter Faraday.default_adapter
25
- conn.use Tinder::FaradayResponse::RaiseOnAuthenticationFailure
26
- conn.use Faraday::Response::ActiveSupportJson
27
- conn.use Tinder::FaradayResponse::WithIndifferentAccess
24
+ @raw_connection ||= Faraday.new do |builder|
25
+ builder.use Faraday::Response::Mashify
26
+ builder.use Faraday::Response::ParseJson
27
+ builder.use Faraday::Response::RaiseOnAuthenticationFailure
28
+ builder.adapter Faraday.default_adapter
28
29
  end
29
30
  end
30
31
 
@@ -39,7 +40,7 @@ module Tinder
39
40
  end
40
41
 
41
42
  def basic_auth_settings
42
- { :username => token, :password => 'X' }
43
+ {:username => token, :password => 'X'}
43
44
  end
44
45
 
45
46
  def connection
@@ -127,6 +127,9 @@ module Tinder
127
127
 
128
128
  join # you have to be in the room to listen
129
129
 
130
+ require 'active_support/json'
131
+ require 'hashie'
132
+ require 'multi_json'
130
133
  require 'twitter/json_stream'
131
134
 
132
135
  auth = connection.basic_auth_settings
@@ -140,20 +143,20 @@ module Tinder
140
143
  EventMachine::run do
141
144
  @stream = Twitter::JSONStream.connect(options)
142
145
  @stream.each_item do |message|
143
- message = HashWithIndifferentAccess.new(ActiveSupport::JSON.decode(message))
146
+ message = Hashie::Mash.new(MultiJson.decode(message))
144
147
  message[:user] = user(message.delete(:user_id))
145
148
  message[:created_at] = Time.parse(message[:created_at])
146
149
  yield(message)
147
150
  end
148
151
 
149
152
  @stream.on_error do |message|
150
- raise ListenFailed.new("got an error! #{message.inspect}!")
153
+ raise ListenFailed.new("got an error! #{message.inspect}!")
151
154
  end
152
155
 
153
156
  @stream.on_max_reconnects do |timeout, retries|
154
157
  raise ListenFailed.new("Tried #{retries} times to connect. Got disconnected from #{@name}!")
155
158
  end
156
-
159
+
157
160
  # if we really get disconnected
158
161
  raise ListenFailed.new("got disconnected from #{@name}!") if !EventMachine.reactor_running?
159
162
  end
@@ -192,6 +195,7 @@ module Tinder
192
195
  end
193
196
 
194
197
  def upload(file, content_type = nil, filename = nil)
198
+ require 'mime/types'
195
199
  content_type ||= MIME::Types.type_for(filename || file)
196
200
  raw_post(:uploads, { :upload => Faraday::UploadIO.new(file, content_type, filename) })
197
201
  end
@@ -1,3 +1,3 @@
1
1
  module Tinder
2
- VERSION = '1.4.4' unless defined?(::Tinder::VERSION)
2
+ VERSION = '1.5.0' unless defined?(::Tinder::VERSION)
3
3
  end
@@ -1,8 +1,6 @@
1
1
  $:.unshift File.expand_path(File.dirname(__FILE__) + '/../lib')
2
2
 
3
- require 'rubygems'
4
3
  require 'rspec'
5
- gem 'activesupport', ENV['RAILS_VERSION'] if ENV['RAILS_VERSION']
6
4
  require 'tinder'
7
5
  require 'fakeweb'
8
6
 
@@ -15,13 +13,13 @@ end
15
13
  def stub_connection(object, &block)
16
14
  @stubs ||= Faraday::Adapter::Test::Stubs.new
17
15
 
18
- object.connection.build do |conn|
19
- conn.use Faraday::Request::ActiveSupportJson
20
- conn.adapter :test, @stubs
21
- conn.use Tinder::FaradayResponse::RaiseOnAuthenticationFailure
22
- conn.use Faraday::Response::ActiveSupportJson
23
- conn.use Tinder::FaradayResponse::WithIndifferentAccess
16
+ object.connection.build do |builder|
17
+ builder.use Faraday::Request::JSON
18
+ builder.use Faraday::Response::Mashify
19
+ builder.use Faraday::Response::ParseJson
20
+ builder.use Faraday::Response::RaiseOnAuthenticationFailure
21
+ builder.adapter :test, @stubs
24
22
  end
25
23
 
26
24
  block.call(@stubs)
27
- end
25
+ end
@@ -4,26 +4,62 @@ describe Tinder::Campfire do
4
4
  before do
5
5
  @campfire = Tinder::Campfire.new('test', :token => 'mytoken')
6
6
  end
7
-
7
+
8
8
  describe "rooms" do
9
9
  before do
10
10
  stub_connection(@campfire.connection) do |stub|
11
11
  stub.get('/rooms.json') {[ 200, {}, fixture('rooms.json') ]}
12
12
  end
13
13
  end
14
-
14
+
15
15
  it "should return rooms" do
16
16
  @campfire.rooms.size.should == 2
17
17
  @campfire.rooms.first.should be_kind_of(Tinder::Room)
18
18
  end
19
-
19
+
20
20
  it "should set the room name and id" do
21
21
  room = @campfire.rooms.first
22
22
  room.name.should == 'Room 1'
23
23
  room.id.should == 80749
24
24
  end
25
25
  end
26
-
26
+
27
+ describe "find_by_id" do
28
+ before do
29
+ stub_connection(@campfire.connection) do |stub|
30
+ stub.get('/rooms.json') {[ 200, {}, fixture('rooms.json') ]}
31
+ end
32
+ end
33
+
34
+ it "should return a Tinder::Room object when a match is found" do
35
+ room = @campfire.find_room_by_id 80749
36
+ room.should be_kind_of(Tinder::Room)
37
+ end
38
+
39
+ it "should return nil when no match is found" do
40
+ room = @campfire.find_room_by_id 123
41
+ room.should be nil
42
+ end
43
+ end
44
+
45
+ describe "find_room_by_name" do
46
+ before do
47
+ stub_connection(@campfire.connection) do |stub|
48
+ stub.get('/rooms.json') {[ 200, {}, fixture('rooms.json') ]}
49
+ end
50
+ end
51
+
52
+ it "should return a Tinder::Room object when a match is found" do
53
+ room = @campfire.find_room_by_name 'Room 1'
54
+ room.should be_kind_of(Tinder::Room)
55
+ end
56
+
57
+ it "should return nil when no match is found" do
58
+ room = @campfire.find_room_by_name 'asdf'
59
+ room.should be nil
60
+ end
61
+ end
62
+
27
63
  describe "users" do
28
64
  before do
29
65
  stub_connection(@campfire.connection) do |stub|
@@ -34,21 +70,21 @@ describe Tinder::Campfire do
34
70
  end
35
71
  end
36
72
  end
37
-
73
+
38
74
  it "should return a sorted list of users in all rooms" do
39
75
  @campfire.users.length.should == 2
40
76
  @campfire.users.first[:name].should == "Jane Doe"
41
77
  @campfire.users.last[:name].should == "John Doe"
42
78
  end
43
79
  end
44
-
80
+
45
81
  describe "me" do
46
82
  before do
47
83
  stub_connection(@campfire.connection) do |stub|
48
84
  stub.get("/users/me.json") {[ 200, {}, fixture('users/me.json') ]}
49
85
  end
50
86
  end
51
-
87
+
52
88
  it "should return the current user's information" do
53
89
  @campfire.me["name"].should == "John Doe"
54
90
  end
@@ -10,7 +10,7 @@ describe Tinder::Connection do
10
10
  connection = Tinder::Connection.new('test', :token => 'foo')
11
11
  lambda { connection.get('/rooms.json') }.should raise_error(Tinder::AuthenticationFailed)
12
12
  end
13
-
13
+
14
14
  it "should lookup token when username/password provided" do
15
15
  stub_connection(Tinder::Connection) do |stub|
16
16
  stub.get("/users/me.json") {[ 200, {}, fixture('users/me.json') ]}
@@ -19,8 +19,8 @@ describe Tinder::Connection do
19
19
  connection = Tinder::Connection.new('test', :username => 'user', :password => 'pass')
20
20
  connection.token.should.should == "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
21
21
  end
22
-
23
-
22
+
23
+
24
24
  it "should use basic auth for credentials" do
25
25
  stub_connection(Tinder::Connection) do |stub|
26
26
  stub.get("/rooms.json") {[ 200, {}, fixture('rooms.json') ]}
@@ -29,4 +29,4 @@ describe Tinder::Connection do
29
29
  lambda { connection.get('/rooms.json') }.should_not raise_error
30
30
  end
31
31
  end
32
- end
32
+ end
@@ -1,57 +1,31 @@
1
1
  # -*- encoding: utf-8 -*-
2
- $:.push File.expand_path("../lib", __FILE__)
3
- require "tinder/version"
2
+ $:.push File.expand_path('../lib', __FILE__)
3
+ require 'tinder/version'
4
4
 
5
- Gem::Specification.new do |s|
6
- s.name = %q{tinder}
7
- s.version = Tinder::VERSION
8
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
9
- s.authors = ["Brandon Keepers"]
10
- s.description = %q{A Ruby API for interfacing with Campfire, the 37Signals chat application.}
11
- s.email = %q{brandon@opensoul.org}
12
- s.extra_rdoc_files = [
13
- "README.markdown"
14
- ]
15
- s.homepage = %q{http://github.com/collectiveidea/tinder}
16
- s.rubyforge_project = %q{tinder}
17
- s.rubygems_version = %q{1.3.6}
18
- s.summary = %q{Ruby wrapper for the Campfire API}
19
- s.files = `git ls-files`.split("\n")
20
- s.test_files = `git ls-files -- spec/*`.split("\n")
21
- s.require_paths = ["lib"]
5
+ Gem::Specification.new do |gem|
6
+ gem.add_development_dependency 'fakeweb', '~> 1.3'
7
+ gem.add_development_dependency 'rake', '~> 0.8'
8
+ gem.add_development_dependency 'rspec', '~> 2.6'
9
+ gem.add_runtime_dependency 'activesupport', ['>= 2.3', '< 4']
10
+ gem.add_runtime_dependency 'eventmachine', '~> 0.12'
11
+ gem.add_runtime_dependency 'faraday', ['>= 0.6', '< 0.8']
12
+ gem.add_runtime_dependency 'faraday_middleware', ['>= 0.6', '< 0.8']
13
+ gem.add_runtime_dependency 'hashie', '~> 1.0'
14
+ gem.add_runtime_dependency 'mime-types', '~> 1.16'
15
+ gem.add_runtime_dependency 'multi_json', '~> 1.0'
16
+ gem.add_runtime_dependency 'multipart-post', '~> 1.1'
17
+ gem.add_runtime_dependency 'twitter-stream', '~> 0.1'
22
18
 
23
- if s.respond_to? :specification_version then
24
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
25
- s.specification_version = 3
26
-
27
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
28
- s.add_runtime_dependency(%q<activesupport>, [">= 0"])
29
- s.add_runtime_dependency(%q<faraday>, ["~> 0.5.1"])
30
- s.add_runtime_dependency(%q<multipart-post>, [">= 0"])
31
- s.add_runtime_dependency(%q<mime-types>, [">= 0"])
32
- s.add_runtime_dependency(%q<twitter-stream>, [">= 0"])
33
- s.add_runtime_dependency(%q<eventmachine>, [">= 0"])
34
- s.add_development_dependency(%q<rspec>, [">= 0"])
35
- s.add_development_dependency(%q<fakeweb>, [">= 0"])
36
- else
37
- s.add_dependency(%q<activesupport>, [">= 0"])
38
- s.add_dependency(%q<faraday>, ["~> 0.5.1"])
39
- s.add_dependency(%q<multipart-post>, [">= 0"])
40
- s.add_dependency(%q<mime-types>, [">= 0"])
41
- s.add_dependency(%q<twitter-stream>, [">= 0"])
42
- s.add_dependency(%q<eventmachine>, [">= 0"])
43
- s.add_dependency(%q<rspec>, [">= 0"])
44
- s.add_dependency(%q<fakeweb>, [">= 0"])
45
- end
46
- else
47
- s.add_dependency(%q<activesupport>, [">= 0"])
48
- s.add_dependency(%q<faraday>, ["~> 0.5.1"])
49
- s.add_dependency(%q<multipart-post>, [">= 0"])
50
- s.add_dependency(%q<mime-types>, [">= 0"])
51
- s.add_dependency(%q<twitter-stream>, [">= 0"])
52
- s.add_dependency(%q<eventmachine>, [">= 0"])
53
- s.add_dependency(%q<rspec>, [">= 0"])
54
- s.add_dependency(%q<fakeweb>, [">= 0"])
55
- end
19
+ gem.authors = ["Brandon Keepers"]
20
+ gem.description = %q{A Ruby API for interfacing with Campfire, the 37Signals chat application.}
21
+ gem.email = ['brandon@opensoul.org']
22
+ gem.extra_rdoc_files = ['README.markdown']
23
+ gem.files = `git ls-files`.split("\n")
24
+ gem.homepage = 'http://github.com/collectiveidea/tinder'
25
+ gem.name = 'tinder'
26
+ gem.require_paths = ['lib']
27
+ gem.required_rubygems_version = Gem::Requirement.new('>= 1.3.6')
28
+ gem.summary = %q{Ruby wrapper for the Campfire API}
29
+ gem.test_files = `git ls-files -- spec/*`.split("\n")
30
+ gem.version = Tinder::VERSION
56
31
  end
57
-
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tinder
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
4
+ hash: 3
5
+ prerelease:
5
6
  segments:
6
7
  - 1
7
- - 4
8
- - 4
9
- version: 1.4.4
8
+ - 5
9
+ - 0
10
+ version: 1.5.0
10
11
  platform: ruby
11
12
  authors:
12
13
  - Brandon Keepers
@@ -14,109 +15,211 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2011-04-26 00:00:00 -04:00
18
- default_executable:
18
+ date: 2011-08-17 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
- name: activesupport
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
21
+ version_requirements: &id001 !ruby/object:Gem::Requirement
22
+ none: false
24
23
  requirements:
25
- - - ">="
24
+ - - ~>
26
25
  - !ruby/object:Gem::Version
26
+ hash: 9
27
27
  segments:
28
- - 0
29
- version: "0"
30
- type: :runtime
31
- version_requirements: *id001
32
- - !ruby/object:Gem::Dependency
33
- name: faraday
28
+ - 1
29
+ - 3
30
+ version: "1.3"
31
+ name: fakeweb
32
+ type: :development
34
33
  prerelease: false
35
- requirement: &id002 !ruby/object:Gem::Requirement
34
+ requirement: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ version_requirements: &id002 !ruby/object:Gem::Requirement
37
+ none: false
36
38
  requirements:
37
39
  - - ~>
38
40
  - !ruby/object:Gem::Version
41
+ hash: 27
39
42
  segments:
40
43
  - 0
41
- - 5
42
- - 1
43
- version: 0.5.1
44
- type: :runtime
45
- version_requirements: *id002
44
+ - 8
45
+ version: "0.8"
46
+ name: rake
47
+ type: :development
48
+ prerelease: false
49
+ requirement: *id002
46
50
  - !ruby/object:Gem::Dependency
47
- name: multipart-post
51
+ version_requirements: &id003 !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ~>
55
+ - !ruby/object:Gem::Version
56
+ hash: 15
57
+ segments:
58
+ - 2
59
+ - 6
60
+ version: "2.6"
61
+ name: rspec
62
+ type: :development
48
63
  prerelease: false
49
- requirement: &id003 !ruby/object:Gem::Requirement
64
+ requirement: *id003
65
+ - !ruby/object:Gem::Dependency
66
+ version_requirements: &id004 !ruby/object:Gem::Requirement
67
+ none: false
50
68
  requirements:
51
69
  - - ">="
52
70
  - !ruby/object:Gem::Version
71
+ hash: 5
53
72
  segments:
54
- - 0
55
- version: "0"
73
+ - 2
74
+ - 3
75
+ version: "2.3"
76
+ - - <
77
+ - !ruby/object:Gem::Version
78
+ hash: 11
79
+ segments:
80
+ - 4
81
+ version: "4"
82
+ name: activesupport
56
83
  type: :runtime
57
- version_requirements: *id003
84
+ prerelease: false
85
+ requirement: *id004
58
86
  - !ruby/object:Gem::Dependency
59
- name: mime-types
87
+ version_requirements: &id005 !ruby/object:Gem::Requirement
88
+ none: false
89
+ requirements:
90
+ - - ~>
91
+ - !ruby/object:Gem::Version
92
+ hash: 19
93
+ segments:
94
+ - 0
95
+ - 12
96
+ version: "0.12"
97
+ name: eventmachine
98
+ type: :runtime
60
99
  prerelease: false
61
- requirement: &id004 !ruby/object:Gem::Requirement
100
+ requirement: *id005
101
+ - !ruby/object:Gem::Dependency
102
+ version_requirements: &id006 !ruby/object:Gem::Requirement
103
+ none: false
62
104
  requirements:
63
105
  - - ">="
64
106
  - !ruby/object:Gem::Version
107
+ hash: 7
65
108
  segments:
66
109
  - 0
67
- version: "0"
110
+ - 6
111
+ version: "0.6"
112
+ - - <
113
+ - !ruby/object:Gem::Version
114
+ hash: 27
115
+ segments:
116
+ - 0
117
+ - 8
118
+ version: "0.8"
119
+ name: faraday
68
120
  type: :runtime
69
- version_requirements: *id004
70
- - !ruby/object:Gem::Dependency
71
- name: twitter-stream
72
121
  prerelease: false
73
- requirement: &id005 !ruby/object:Gem::Requirement
122
+ requirement: *id006
123
+ - !ruby/object:Gem::Dependency
124
+ version_requirements: &id007 !ruby/object:Gem::Requirement
125
+ none: false
74
126
  requirements:
75
127
  - - ">="
76
128
  - !ruby/object:Gem::Version
129
+ hash: 7
130
+ segments:
131
+ - 0
132
+ - 6
133
+ version: "0.6"
134
+ - - <
135
+ - !ruby/object:Gem::Version
136
+ hash: 27
77
137
  segments:
78
138
  - 0
79
- version: "0"
139
+ - 8
140
+ version: "0.8"
141
+ name: faraday_middleware
80
142
  type: :runtime
81
- version_requirements: *id005
82
- - !ruby/object:Gem::Dependency
83
- name: eventmachine
84
143
  prerelease: false
85
- requirement: &id006 !ruby/object:Gem::Requirement
144
+ requirement: *id007
145
+ - !ruby/object:Gem::Dependency
146
+ version_requirements: &id008 !ruby/object:Gem::Requirement
147
+ none: false
86
148
  requirements:
87
- - - ">="
149
+ - - ~>
88
150
  - !ruby/object:Gem::Version
151
+ hash: 15
89
152
  segments:
153
+ - 1
90
154
  - 0
91
- version: "0"
155
+ version: "1.0"
156
+ name: hashie
92
157
  type: :runtime
93
- version_requirements: *id006
158
+ prerelease: false
159
+ requirement: *id008
94
160
  - !ruby/object:Gem::Dependency
95
- name: rspec
161
+ version_requirements: &id009 !ruby/object:Gem::Requirement
162
+ none: false
163
+ requirements:
164
+ - - ~>
165
+ - !ruby/object:Gem::Version
166
+ hash: 47
167
+ segments:
168
+ - 1
169
+ - 16
170
+ version: "1.16"
171
+ name: mime-types
172
+ type: :runtime
96
173
  prerelease: false
97
- requirement: &id007 !ruby/object:Gem::Requirement
174
+ requirement: *id009
175
+ - !ruby/object:Gem::Dependency
176
+ version_requirements: &id010 !ruby/object:Gem::Requirement
177
+ none: false
98
178
  requirements:
99
- - - ">="
179
+ - - ~>
100
180
  - !ruby/object:Gem::Version
181
+ hash: 15
101
182
  segments:
183
+ - 1
102
184
  - 0
103
- version: "0"
104
- type: :development
105
- version_requirements: *id007
185
+ version: "1.0"
186
+ name: multi_json
187
+ type: :runtime
188
+ prerelease: false
189
+ requirement: *id010
106
190
  - !ruby/object:Gem::Dependency
107
- name: fakeweb
191
+ version_requirements: &id011 !ruby/object:Gem::Requirement
192
+ none: false
193
+ requirements:
194
+ - - ~>
195
+ - !ruby/object:Gem::Version
196
+ hash: 13
197
+ segments:
198
+ - 1
199
+ - 1
200
+ version: "1.1"
201
+ name: multipart-post
202
+ type: :runtime
108
203
  prerelease: false
109
- requirement: &id008 !ruby/object:Gem::Requirement
204
+ requirement: *id011
205
+ - !ruby/object:Gem::Dependency
206
+ version_requirements: &id012 !ruby/object:Gem::Requirement
207
+ none: false
110
208
  requirements:
111
- - - ">="
209
+ - - ~>
112
210
  - !ruby/object:Gem::Version
211
+ hash: 9
113
212
  segments:
114
213
  - 0
115
- version: "0"
116
- type: :development
117
- version_requirements: *id008
214
+ - 1
215
+ version: "0.1"
216
+ name: twitter-stream
217
+ type: :runtime
218
+ prerelease: false
219
+ requirement: *id012
118
220
  description: A Ruby API for interfacing with Campfire, the 37Signals chat application.
119
- email: brandon@opensoul.org
221
+ email:
222
+ - brandon@opensoul.org
120
223
  executables: []
121
224
 
122
225
  extensions: []
@@ -124,6 +227,7 @@ extensions: []
124
227
  extra_rdoc_files:
125
228
  - README.markdown
126
229
  files:
230
+ - .gemtest
127
231
  - .gitignore
128
232
  - .rspec
129
233
  - CHANGELOG.txt
@@ -132,10 +236,10 @@ files:
132
236
  - README.markdown
133
237
  - Rakefile
134
238
  - init.rb
239
+ - lib/faraday/response/raise_on_authentication_failure.rb
135
240
  - lib/tinder.rb
136
241
  - lib/tinder/campfire.rb
137
242
  - lib/tinder/connection.rb
138
- - lib/tinder/middleware.rb
139
243
  - lib/tinder/room.rb
140
244
  - lib/tinder/version.rb
141
245
  - site/index.html
@@ -150,7 +254,6 @@ files:
150
254
  - spec/tinder/connection_spec.rb
151
255
  - spec/tinder/room_spec.rb
152
256
  - tinder.gemspec
153
- has_rdoc: true
154
257
  homepage: http://github.com/collectiveidea/tinder
155
258
  licenses: []
156
259
 
@@ -160,23 +263,29 @@ rdoc_options: []
160
263
  require_paths:
161
264
  - lib
162
265
  required_ruby_version: !ruby/object:Gem::Requirement
266
+ none: false
163
267
  requirements:
164
268
  - - ">="
165
269
  - !ruby/object:Gem::Version
270
+ hash: 3
166
271
  segments:
167
272
  - 0
168
273
  version: "0"
169
274
  required_rubygems_version: !ruby/object:Gem::Requirement
275
+ none: false
170
276
  requirements:
171
277
  - - ">="
172
278
  - !ruby/object:Gem::Version
279
+ hash: 23
173
280
  segments:
174
- - 0
175
- version: "0"
281
+ - 1
282
+ - 3
283
+ - 6
284
+ version: 1.3.6
176
285
  requirements: []
177
286
 
178
- rubyforge_project: tinder
179
- rubygems_version: 1.3.6
287
+ rubyforge_project:
288
+ rubygems_version: 1.8.6
180
289
  signing_key:
181
290
  specification_version: 3
182
291
  summary: Ruby wrapper for the Campfire API
@@ -1,30 +0,0 @@
1
- module Tinder
2
- module FaradayResponse
3
- class WithIndifferentAccess < ::Faraday::Response::Middleware
4
- begin
5
- require 'active_support/core_ext/hash/indifferent_access'
6
- rescue LoadError, NameError => error
7
- self.load_error = error
8
- end
9
-
10
- def self.register_on_complete(env)
11
- env[:response].on_complete do |response|
12
- json = response[:body]
13
- if json.is_a?(Hash)
14
- response[:body] = ::HashWithIndifferentAccess.new(json)
15
- elsif json.is_a?(Array) and json.first.is_a?(Hash)
16
- response[:body] = json.map{|item| ::HashWithIndifferentAccess.new(item) }
17
- end
18
- end
19
- end
20
- end
21
-
22
- class RaiseOnAuthenticationFailure < ::Faraday::Response::Middleware
23
- def self.register_on_complete(env)
24
- env[:response].on_complete do |response|
25
- raise AuthenticationFailed if response[:status] == 401
26
- end
27
- end
28
- end
29
- end
30
- end