pusher 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +49 -0
- data/README.md +8 -0
- data/Rakefile +2 -59
- data/lib/pusher.rb +13 -4
- data/lib/pusher/channel.rb +11 -1
- data/pusher.gemspec +21 -69
- data/spec/channel_spec.rb +46 -69
- data/spec/pusher_spec.rb +0 -2
- data/spec/spec_helper.rb +6 -4
- metadata +45 -24
- data/VERSION +0 -1
- data/spec/spec.opts +0 -1
data/.gitignore
CHANGED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
pusher (0.6.0)
|
5
|
+
crack (~> 0.1.0)
|
6
|
+
json (~> 1.4.0)
|
7
|
+
ruby-hmac (~> 0.4.0)
|
8
|
+
signature (~> 0.1.2)
|
9
|
+
|
10
|
+
GEM
|
11
|
+
remote: http://rubygems.org/
|
12
|
+
specs:
|
13
|
+
addressable (2.2.2)
|
14
|
+
crack (0.1.8)
|
15
|
+
diff-lcs (1.1.2)
|
16
|
+
em-http-request (0.2.14)
|
17
|
+
addressable (>= 2.0.0)
|
18
|
+
eventmachine (>= 0.12.9)
|
19
|
+
eventmachine (0.12.10)
|
20
|
+
json (1.4.6)
|
21
|
+
rspec (2.0.1)
|
22
|
+
rspec-core (~> 2.0.1)
|
23
|
+
rspec-expectations (~> 2.0.1)
|
24
|
+
rspec-mocks (~> 2.0.1)
|
25
|
+
rspec-core (2.0.1)
|
26
|
+
rspec-expectations (2.0.1)
|
27
|
+
diff-lcs (>= 1.1.2)
|
28
|
+
rspec-mocks (2.0.1)
|
29
|
+
rspec-core (~> 2.0.1)
|
30
|
+
rspec-expectations (~> 2.0.1)
|
31
|
+
ruby-hmac (0.4.0)
|
32
|
+
signature (0.1.2)
|
33
|
+
ruby-hmac
|
34
|
+
webmock (1.4.0)
|
35
|
+
addressable (>= 2.2.2)
|
36
|
+
crack (>= 0.1.7)
|
37
|
+
|
38
|
+
PLATFORMS
|
39
|
+
ruby
|
40
|
+
|
41
|
+
DEPENDENCIES
|
42
|
+
crack (~> 0.1.0)
|
43
|
+
em-http-request (~> 0.2.7)
|
44
|
+
json (~> 1.4.0)
|
45
|
+
pusher!
|
46
|
+
rspec (~> 2.0)
|
47
|
+
ruby-hmac (~> 0.4.0)
|
48
|
+
signature (~> 0.1.2)
|
49
|
+
webmock
|
data/README.md
CHANGED
@@ -47,6 +47,14 @@ The Pusher Gem also deals with signing requests for authenticated private channe
|
|
47
47
|
|
48
48
|
Read more about private channels in [the docs](http://pusherapp.com/docs/private_channels).
|
49
49
|
|
50
|
+
Developing
|
51
|
+
----------
|
52
|
+
|
53
|
+
Use bundler in order to run specs with the correct dependencies.
|
54
|
+
|
55
|
+
bundle
|
56
|
+
bundle exec rspec spec/*_spec.rb
|
57
|
+
|
50
58
|
Copyright
|
51
59
|
---------
|
52
60
|
|
data/Rakefile
CHANGED
@@ -1,59 +1,2 @@
|
|
1
|
-
require '
|
2
|
-
|
3
|
-
|
4
|
-
begin
|
5
|
-
require 'jeweler'
|
6
|
-
Jeweler::Tasks.new do |gem|
|
7
|
-
gem.name = "pusher"
|
8
|
-
gem.summary = %Q{Pusher App client}
|
9
|
-
gem.description = %Q{Wrapper for pusherapp.com REST api}
|
10
|
-
gem.email = "support@pusherapp.com"
|
11
|
-
gem.homepage = "http://github.com/newbamboo/pusher-gem"
|
12
|
-
gem.authors = ["New Bamboo"]
|
13
|
-
# gem.add_development_dependency "thoughtbot-shoulda", ">= 0"
|
14
|
-
gem.add_dependency "json"
|
15
|
-
gem.add_dependency "crack"
|
16
|
-
gem.add_dependency "ruby-hmac"
|
17
|
-
gem.add_dependency 'signature'
|
18
|
-
# gem.add_dependency 'em-http-request', ">= 0.2.7"
|
19
|
-
gem.add_development_dependency "rspec", ">= 1.2.9"
|
20
|
-
gem.add_development_dependency "webmock"
|
21
|
-
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
22
|
-
end
|
23
|
-
Jeweler::GemcutterTasks.new
|
24
|
-
rescue LoadError
|
25
|
-
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
26
|
-
end
|
27
|
-
|
28
|
-
require 'spec/rake/spectask'
|
29
|
-
Spec::Rake::SpecTask.new(:spec) do |spec|
|
30
|
-
spec.libs << 'lib' << 'spec'
|
31
|
-
spec.spec_files = FileList['spec/**/*_spec.rb']
|
32
|
-
end
|
33
|
-
|
34
|
-
Spec::Rake::SpecTask.new(:rcov) do |spec|
|
35
|
-
spec.libs << 'lib' << 'spec'
|
36
|
-
spec.pattern = 'spec/**/*_spec.rb'
|
37
|
-
spec.rcov = true
|
38
|
-
end
|
39
|
-
|
40
|
-
|
41
|
-
Spec::Rake::SpecTask.new(:rcov) do |spec|
|
42
|
-
spec.libs << 'lib' << 'spec'
|
43
|
-
spec.pattern = 'spec/**/*_spec.rb'
|
44
|
-
spec.rcov = true
|
45
|
-
end
|
46
|
-
|
47
|
-
task :spec => :check_dependencies
|
48
|
-
|
49
|
-
task :default => :spec
|
50
|
-
|
51
|
-
require 'rake/rdoctask'
|
52
|
-
Rake::RDocTask.new do |rdoc|
|
53
|
-
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
54
|
-
|
55
|
-
rdoc.rdoc_dir = 'rdoc'
|
56
|
-
rdoc.title = "test #{version}"
|
57
|
-
rdoc.rdoc_files.include('README*')
|
58
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
59
|
-
end
|
1
|
+
require 'bundler'
|
2
|
+
Bundler::GemHelper.install_tasks
|
data/lib/pusher.rb
CHANGED
@@ -7,7 +7,7 @@ module Pusher
|
|
7
7
|
class ConfigurationError < Error; end
|
8
8
|
|
9
9
|
class << self
|
10
|
-
attr_accessor :host, :port
|
10
|
+
attr_accessor :scheme, :host, :port
|
11
11
|
attr_writer :logger
|
12
12
|
attr_accessor :app_id, :key, :secret
|
13
13
|
|
@@ -25,7 +25,8 @@ module Pusher
|
|
25
25
|
|
26
26
|
# Builds a connection url for Pusherapp
|
27
27
|
def url
|
28
|
-
|
28
|
+
URI::Generic.build({
|
29
|
+
:scheme => self.scheme,
|
29
30
|
:host => self.host,
|
30
31
|
:port => self.port,
|
31
32
|
:path => "/apps/#{self.app_id}"
|
@@ -42,15 +43,23 @@ module Pusher
|
|
42
43
|
self.port = uri.port
|
43
44
|
end
|
44
45
|
|
46
|
+
# Configure ssl by setting Pusher.encrypted = true
|
47
|
+
def encrypted=(boolean)
|
48
|
+
Pusher.scheme = boolean ? 'https' : 'http'
|
49
|
+
# Configure port if it hasn't already been configured
|
50
|
+
Pusher.port ||= boolean ? 443 : 80
|
51
|
+
end
|
52
|
+
|
45
53
|
private
|
46
54
|
|
47
55
|
def configured?
|
48
|
-
host &&
|
56
|
+
host && scheme && key && secret && app_id
|
49
57
|
end
|
50
58
|
end
|
51
59
|
|
60
|
+
# Defaults
|
61
|
+
self.scheme = 'http'
|
52
62
|
self.host = 'api.pusherapp.com'
|
53
|
-
self.port = 80
|
54
63
|
|
55
64
|
if ENV['PUSHER_URL']
|
56
65
|
self.url = ENV['PUSHER_URL']
|
data/lib/pusher/channel.rb
CHANGED
@@ -45,8 +45,14 @@ module Pusher
|
|
45
45
|
|
46
46
|
def trigger!(event_name, data, socket_id = nil)
|
47
47
|
require 'net/http' unless defined?(Net::HTTP)
|
48
|
+
require 'net/https' if (ssl? && !defined?(Net::HTTPS))
|
48
49
|
|
49
|
-
@http_sync ||=
|
50
|
+
@http_sync ||= begin
|
51
|
+
http = Net::HTTP.new(@uri.host, @uri.port)
|
52
|
+
http.use_ssl = true if ssl?
|
53
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE if ssl?
|
54
|
+
http
|
55
|
+
end
|
50
56
|
|
51
57
|
request = Pusher::Request.new(@uri, event_name, data, socket_id)
|
52
58
|
|
@@ -110,5 +116,9 @@ module Pusher
|
|
110
116
|
raise Error, "Unknown error in Pusher: #{body}"
|
111
117
|
end
|
112
118
|
end
|
119
|
+
|
120
|
+
def ssl?
|
121
|
+
@uri.scheme == 'https'
|
122
|
+
end
|
113
123
|
end
|
114
124
|
end
|
data/pusher.gemspec
CHANGED
@@ -1,75 +1,27 @@
|
|
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__)
|
5
3
|
|
6
4
|
Gem::Specification.new do |s|
|
7
|
-
s.name
|
8
|
-
s.version
|
9
|
-
|
10
|
-
s.
|
11
|
-
s.
|
12
|
-
s.
|
5
|
+
s.name = "pusher"
|
6
|
+
s.version = "0.7.0"
|
7
|
+
s.platform = Gem::Platform::RUBY
|
8
|
+
s.authors = ["New Bamboo"]
|
9
|
+
s.email = ["support@pusherapp.com"]
|
10
|
+
s.homepage = "http://github.com/newbamboo/pusher-gem"
|
11
|
+
s.summary = %q{Pusherapp client}
|
13
12
|
s.description = %q{Wrapper for pusherapp.com REST api}
|
14
|
-
|
15
|
-
s.
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
"README.md",
|
24
|
-
"Rakefile",
|
25
|
-
"VERSION",
|
26
|
-
"lib/pusher.rb",
|
27
|
-
"lib/pusher/channel.rb",
|
28
|
-
"lib/pusher/json.rb",
|
29
|
-
"lib/pusher/request.rb",
|
30
|
-
"pusher.gemspec",
|
31
|
-
"spec/channel_spec.rb",
|
32
|
-
"spec/pusher_spec.rb",
|
33
|
-
"spec/spec.opts",
|
34
|
-
"spec/spec_helper.rb"
|
35
|
-
]
|
36
|
-
s.homepage = %q{http://github.com/newbamboo/pusher-gem}
|
37
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
38
|
-
s.require_paths = ["lib"]
|
39
|
-
s.rubygems_version = %q{1.3.6}
|
40
|
-
s.summary = %q{Pusher App client}
|
41
|
-
s.test_files = [
|
42
|
-
"spec/channel_spec.rb",
|
43
|
-
"spec/pusher_spec.rb",
|
44
|
-
"spec/spec_helper.rb"
|
45
|
-
]
|
46
|
-
|
47
|
-
if s.respond_to? :specification_version then
|
48
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
49
|
-
s.specification_version = 3
|
13
|
+
|
14
|
+
s.add_dependency "json", "~> 1.4.0"
|
15
|
+
s.add_dependency "crack", "~> 0.1.0"
|
16
|
+
s.add_dependency "ruby-hmac", "~> 0.4.0"
|
17
|
+
s.add_dependency 'signature', "~> 0.1.2"
|
18
|
+
|
19
|
+
s.add_development_dependency "rspec", "~> 2.0"
|
20
|
+
s.add_development_dependency "webmock"
|
21
|
+
s.add_development_dependency "em-http-request", "~> 0.2.7"
|
50
22
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
s.add_runtime_dependency(%q<signature>, [">= 0"])
|
56
|
-
s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
|
57
|
-
s.add_development_dependency(%q<webmock>, [">= 0"])
|
58
|
-
else
|
59
|
-
s.add_dependency(%q<json>, [">= 0"])
|
60
|
-
s.add_dependency(%q<crack>, [">= 0"])
|
61
|
-
s.add_dependency(%q<ruby-hmac>, [">= 0"])
|
62
|
-
s.add_dependency(%q<signature>, [">= 0"])
|
63
|
-
s.add_dependency(%q<rspec>, [">= 1.2.9"])
|
64
|
-
s.add_dependency(%q<webmock>, [">= 0"])
|
65
|
-
end
|
66
|
-
else
|
67
|
-
s.add_dependency(%q<json>, [">= 0"])
|
68
|
-
s.add_dependency(%q<crack>, [">= 0"])
|
69
|
-
s.add_dependency(%q<ruby-hmac>, [">= 0"])
|
70
|
-
s.add_dependency(%q<signature>, [">= 0"])
|
71
|
-
s.add_dependency(%q<rspec>, [">= 1.2.9"])
|
72
|
-
s.add_dependency(%q<webmock>, [">= 0"])
|
73
|
-
end
|
23
|
+
s.files = `git ls-files`.split("\n")
|
24
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
25
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
26
|
+
s.require_paths = ["lib"]
|
74
27
|
end
|
75
|
-
|
data/spec/channel_spec.rb
CHANGED
@@ -7,6 +7,7 @@ describe Pusher::Channel do
|
|
7
7
|
Pusher.secret = '12345678900000001'
|
8
8
|
Pusher.host = 'api.pusherapp.com'
|
9
9
|
Pusher.port = 80
|
10
|
+
Pusher.encrypted = false
|
10
11
|
end
|
11
12
|
|
12
13
|
after do
|
@@ -17,6 +18,7 @@ describe Pusher::Channel do
|
|
17
18
|
|
18
19
|
describe 'trigger!' do
|
19
20
|
before :each do
|
21
|
+
WebMock.disable_net_connect!
|
20
22
|
WebMock.stub_request(
|
21
23
|
:post, %r{/apps/20/channels/test_channel/events}
|
22
24
|
).to_return(:status => 202)
|
@@ -25,17 +27,21 @@ describe Pusher::Channel do
|
|
25
27
|
|
26
28
|
it 'should configure HTTP library to talk to pusher API' do
|
27
29
|
@channel.trigger!('new_event', 'Some data')
|
28
|
-
WebMock.
|
30
|
+
WebMock.should have_requested(:post, %r{http://api.pusherapp.com})
|
29
31
|
end
|
30
32
|
|
31
|
-
it
|
33
|
+
it "should POST to https api if ssl enabled" do
|
34
|
+
Pusher.encrypted = true
|
35
|
+
Pusher::Channel.new(Pusher.url, 'test_channel').trigger('new_event', 'Some data')
|
36
|
+
WebMock.should have_requested(:post, %r{https://api.pusherapp.com})
|
37
|
+
end
|
38
|
+
|
39
|
+
it 'should POST hashes by encoding as JSON in the request body' do
|
32
40
|
@channel.trigger!('new_event', {
|
33
41
|
:name => 'Pusher',
|
34
42
|
:last_name => 'App'
|
35
43
|
})
|
36
|
-
WebMock.
|
37
|
-
with do |req|
|
38
|
-
|
44
|
+
WebMock.should have_requested(:post, %r{/apps/20/channels/test_channel/events}).with do |req|
|
39
45
|
query_hash = req.uri.query_values
|
40
46
|
query_hash["name"].should == 'new_event'
|
41
47
|
query_hash["auth_key"].should == Pusher.key
|
@@ -48,18 +54,18 @@ describe Pusher::Channel do
|
|
48
54
|
}
|
49
55
|
|
50
56
|
req.headers['Content-Type'].should == 'application/json'
|
51
|
-
end
|
57
|
+
end
|
52
58
|
end
|
53
59
|
|
54
|
-
it "should
|
60
|
+
it "should POST string data unmodified in request body" do
|
55
61
|
string = "foo\nbar\""
|
56
62
|
@channel.trigger!('new_event', string)
|
57
|
-
WebMock.
|
63
|
+
WebMock.should have_requested(:post, %r{/apps/20/channels/test_channel/events}).with do |req|
|
58
64
|
req.body.should == "foo\nbar\""
|
59
|
-
end
|
65
|
+
end
|
60
66
|
end
|
61
67
|
|
62
|
-
it "should raise error
|
68
|
+
it "should raise error on non string values with cannot be jsonified" do
|
63
69
|
lambda {
|
64
70
|
@channel.trigger!('new_event', Object.new)
|
65
71
|
}.should raise_error(JSON::GeneratorError)
|
@@ -126,57 +132,42 @@ describe Pusher::Channel do
|
|
126
132
|
|
127
133
|
describe "trigger_async" do
|
128
134
|
before :each do
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
#in order to match URLs when testing http requests
|
133
|
-
#override the method that converts query hash to string
|
134
|
-
#to include a sort so URL is consistent
|
135
|
-
module EventMachine
|
136
|
-
module HttpEncoding
|
137
|
-
def encode_query(path, query, uri_query)
|
138
|
-
encoded_query = if query.kind_of?(Hash)
|
139
|
-
query.sort{|a, b| a.to_s <=> b.to_s}.
|
140
|
-
map { |k, v| encode_param(k, v) }.
|
141
|
-
join('&')
|
142
|
-
else
|
143
|
-
query.to_s
|
144
|
-
end
|
145
|
-
if !uri_query.to_s.empty?
|
146
|
-
encoded_query = [encoded_query, uri_query].reject {|part| part.empty?}.join("&")
|
147
|
-
end
|
148
|
-
return path if encoded_query.to_s.empty?
|
149
|
-
"#{path}?#{encoded_query}"
|
150
|
-
end
|
151
|
-
end
|
152
|
-
end
|
153
|
-
|
154
|
-
EM::HttpRequest.reset_registry!
|
155
|
-
EM::HttpRequest.reset_counts!
|
156
|
-
EM::HttpRequest.pass_through_requests = false
|
157
|
-
end
|
135
|
+
WebMock.reset_webmock
|
136
|
+
WebMock.disable_net_connect!
|
158
137
|
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
url = 'http://api.pusherapp.com:80/apps/20/channels/test_channel/events?auth_key=12345678900000001&auth_signature=0ffe2a3749f886ca69c3f516a30c7bc9a12d2ebd8bda5b718b90ad58507c8261&auth_timestamp=123&auth_version=1.0&body_md5=5b82f8bf4df2bfb0e66ccaa7306fd024&name=new_event'
|
138
|
+
@pusher_url_regexp = %r{/apps/20/channels/test_channel/events}
|
139
|
+
end
|
163
140
|
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
141
|
+
it "should by default POST to http api" do
|
142
|
+
EM.run {
|
143
|
+
stub_request(:post, @pusher_url_regexp).to_return(:status => 202)
|
144
|
+
channel = Pusher::Channel.new(Pusher.url, 'test_channel')
|
145
|
+
channel.trigger_async('new_event', 'Some data').callback {
|
146
|
+
WebMock.should have_requested(:post, %r{http://api.pusherapp.com})
|
147
|
+
EM.stop
|
148
|
+
}
|
149
|
+
}
|
150
|
+
end
|
170
151
|
|
171
|
-
|
172
|
-
|
152
|
+
it "should POST to https api if ssl enabled" do
|
153
|
+
Pusher.encrypted = true
|
154
|
+
EM.run {
|
155
|
+
stub_request(:post, @pusher_url_regexp).to_return(:status => 202)
|
156
|
+
channel = Pusher::Channel.new(Pusher.url, 'test_channel')
|
157
|
+
channel.trigger_async('new_event', 'Some data').callback {
|
158
|
+
WebMock.should have_requested(:post, %r{https://api.pusherapp.com})
|
159
|
+
EM.stop
|
160
|
+
}
|
161
|
+
}
|
162
|
+
end
|
173
163
|
|
174
|
-
|
164
|
+
it "should return a deferrable which succeeds in success case" do
|
165
|
+
stub_request(:post, @pusher_url_regexp).to_return(:status => 202)
|
175
166
|
|
176
167
|
EM.run {
|
177
168
|
d = Pusher['test_channel'].trigger_async('new_event', 'Some data')
|
178
169
|
d.callback {
|
179
|
-
|
170
|
+
WebMock.should have_requested(:post, @pusher_url_regexp)
|
180
171
|
EM.stop
|
181
172
|
}
|
182
173
|
d.errback {
|
@@ -187,21 +178,7 @@ describe Pusher::Channel do
|
|
187
178
|
end
|
188
179
|
|
189
180
|
it "should return a deferrable which fails (with exception) in fail case" do
|
190
|
-
|
191
|
-
|
192
|
-
url = 'http://api.pusherapp.com:80/apps/20/channels/test_channel/events?auth_key=12345678900000001&auth_signature=0ffe2a3749f886ca69c3f516a30c7bc9a12d2ebd8bda5b718b90ad58507c8261&auth_timestamp=123&auth_version=1.0&body_md5=5b82f8bf4df2bfb0e66ccaa7306fd024&name=new_event'
|
193
|
-
|
194
|
-
data = <<-RESPONSE.gsub(/^ +/, '')
|
195
|
-
HTTP/1.1 401 Unauthorized
|
196
|
-
Content-Type: text/html
|
197
|
-
Content-Length: 130
|
198
|
-
Connection: keep-alive
|
199
|
-
Server: thin 1.2.7 codename No Hup
|
200
|
-
|
201
|
-
401 UNAUTHORIZED: Timestamp expired: Given timestamp (2010-05-05T11:24:42Z) not within 600s of server time (2010-05-05T11:51:42Z)
|
202
|
-
RESPONSE
|
203
|
-
|
204
|
-
EM::HttpRequest.register(url, :post, data)
|
181
|
+
stub_request(:post, @pusher_url_regexp).to_return(:status => 401)
|
205
182
|
|
206
183
|
EM.run {
|
207
184
|
d = Pusher['test_channel'].trigger_async('new_event', 'Some data')
|
@@ -209,7 +186,7 @@ describe Pusher::Channel do
|
|
209
186
|
fail
|
210
187
|
}
|
211
188
|
d.errback { |error|
|
212
|
-
|
189
|
+
WebMock.should have_requested(:post, @pusher_url_regexp)
|
213
190
|
error.should be_kind_of(Pusher::AuthenticationError)
|
214
191
|
EM.stop
|
215
192
|
}
|
data/spec/pusher_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
|
3
|
-
require '
|
4
|
-
require '
|
3
|
+
require 'rspec'
|
4
|
+
require 'rspec/autorun'
|
5
|
+
require 'em-http' # As of webmock 1.4.0, em-http must be loaded first
|
6
|
+
require 'webmock/rspec'
|
5
7
|
|
6
8
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
7
9
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
@@ -9,6 +11,6 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
|
9
11
|
require 'pusher'
|
10
12
|
require 'eventmachine'
|
11
13
|
|
12
|
-
|
13
|
-
|
14
|
+
RSpec.configure do |config|
|
15
|
+
config.include WebMock::API
|
14
16
|
end
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
-
-
|
7
|
+
- 7
|
8
8
|
- 0
|
9
|
-
version: 0.
|
9
|
+
version: 0.7.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- New Bamboo
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-11-22 00:00:00 +00:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -22,11 +22,13 @@ dependencies:
|
|
22
22
|
prerelease: false
|
23
23
|
requirement: &id001 !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- -
|
25
|
+
- - ~>
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
segments:
|
28
|
+
- 1
|
29
|
+
- 4
|
28
30
|
- 0
|
29
|
-
version:
|
31
|
+
version: 1.4.0
|
30
32
|
type: :runtime
|
31
33
|
version_requirements: *id001
|
32
34
|
- !ruby/object:Gem::Dependency
|
@@ -34,11 +36,13 @@ dependencies:
|
|
34
36
|
prerelease: false
|
35
37
|
requirement: &id002 !ruby/object:Gem::Requirement
|
36
38
|
requirements:
|
37
|
-
- -
|
39
|
+
- - ~>
|
38
40
|
- !ruby/object:Gem::Version
|
39
41
|
segments:
|
40
42
|
- 0
|
41
|
-
|
43
|
+
- 1
|
44
|
+
- 0
|
45
|
+
version: 0.1.0
|
42
46
|
type: :runtime
|
43
47
|
version_requirements: *id002
|
44
48
|
- !ruby/object:Gem::Dependency
|
@@ -46,11 +50,13 @@ dependencies:
|
|
46
50
|
prerelease: false
|
47
51
|
requirement: &id003 !ruby/object:Gem::Requirement
|
48
52
|
requirements:
|
49
|
-
- -
|
53
|
+
- - ~>
|
50
54
|
- !ruby/object:Gem::Version
|
51
55
|
segments:
|
52
56
|
- 0
|
53
|
-
|
57
|
+
- 4
|
58
|
+
- 0
|
59
|
+
version: 0.4.0
|
54
60
|
type: :runtime
|
55
61
|
version_requirements: *id003
|
56
62
|
- !ruby/object:Gem::Dependency
|
@@ -58,11 +64,13 @@ dependencies:
|
|
58
64
|
prerelease: false
|
59
65
|
requirement: &id004 !ruby/object:Gem::Requirement
|
60
66
|
requirements:
|
61
|
-
- -
|
67
|
+
- - ~>
|
62
68
|
- !ruby/object:Gem::Version
|
63
69
|
segments:
|
64
70
|
- 0
|
65
|
-
|
71
|
+
- 1
|
72
|
+
- 2
|
73
|
+
version: 0.1.2
|
66
74
|
type: :runtime
|
67
75
|
version_requirements: *id004
|
68
76
|
- !ruby/object:Gem::Dependency
|
@@ -70,13 +78,12 @@ dependencies:
|
|
70
78
|
prerelease: false
|
71
79
|
requirement: &id005 !ruby/object:Gem::Requirement
|
72
80
|
requirements:
|
73
|
-
- -
|
81
|
+
- - ~>
|
74
82
|
- !ruby/object:Gem::Version
|
75
83
|
segments:
|
76
|
-
- 1
|
77
84
|
- 2
|
78
|
-
-
|
79
|
-
version:
|
85
|
+
- 0
|
86
|
+
version: "2.0"
|
80
87
|
type: :development
|
81
88
|
version_requirements: *id005
|
82
89
|
- !ruby/object:Gem::Dependency
|
@@ -91,22 +98,37 @@ dependencies:
|
|
91
98
|
version: "0"
|
92
99
|
type: :development
|
93
100
|
version_requirements: *id006
|
101
|
+
- !ruby/object:Gem::Dependency
|
102
|
+
name: em-http-request
|
103
|
+
prerelease: false
|
104
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
105
|
+
requirements:
|
106
|
+
- - ~>
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
segments:
|
109
|
+
- 0
|
110
|
+
- 2
|
111
|
+
- 7
|
112
|
+
version: 0.2.7
|
113
|
+
type: :development
|
114
|
+
version_requirements: *id007
|
94
115
|
description: Wrapper for pusherapp.com REST api
|
95
|
-
email:
|
116
|
+
email:
|
117
|
+
- support@pusherapp.com
|
96
118
|
executables: []
|
97
119
|
|
98
120
|
extensions: []
|
99
121
|
|
100
|
-
extra_rdoc_files:
|
101
|
-
|
102
|
-
- README.md
|
122
|
+
extra_rdoc_files: []
|
123
|
+
|
103
124
|
files:
|
104
125
|
- .document
|
105
126
|
- .gitignore
|
127
|
+
- Gemfile
|
128
|
+
- Gemfile.lock
|
106
129
|
- LICENSE
|
107
130
|
- README.md
|
108
131
|
- Rakefile
|
109
|
-
- VERSION
|
110
132
|
- lib/pusher.rb
|
111
133
|
- lib/pusher/channel.rb
|
112
134
|
- lib/pusher/json.rb
|
@@ -114,15 +136,14 @@ files:
|
|
114
136
|
- pusher.gemspec
|
115
137
|
- spec/channel_spec.rb
|
116
138
|
- spec/pusher_spec.rb
|
117
|
-
- spec/spec.opts
|
118
139
|
- spec/spec_helper.rb
|
119
140
|
has_rdoc: true
|
120
141
|
homepage: http://github.com/newbamboo/pusher-gem
|
121
142
|
licenses: []
|
122
143
|
|
123
144
|
post_install_message:
|
124
|
-
rdoc_options:
|
125
|
-
|
145
|
+
rdoc_options: []
|
146
|
+
|
126
147
|
require_paths:
|
127
148
|
- lib
|
128
149
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -145,7 +166,7 @@ rubyforge_project:
|
|
145
166
|
rubygems_version: 1.3.6
|
146
167
|
signing_key:
|
147
168
|
specification_version: 3
|
148
|
-
summary:
|
169
|
+
summary: Pusherapp client
|
149
170
|
test_files:
|
150
171
|
- spec/channel_spec.rb
|
151
172
|
- spec/pusher_spec.rb
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.6.0
|
data/spec/spec.opts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
--color
|