scamp 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +2 -1
- data/lib/scamp/channels.rb +2 -1
- data/lib/scamp/version.rb +1 -1
- data/scamp.gemspec +3 -2
- metadata +23 -12
data/README.md
CHANGED
@@ -16,7 +16,8 @@ Matchers are tested in order and all that satisfy the match and conditions will
|
|
16
16
|
|
17
17
|
require 'scamp'
|
18
18
|
|
19
|
-
|
19
|
+
# Add :verbose => true to get debug output, otherwise the logger will output INFO
|
20
|
+
scamp = Scamp.new(:api_key => "YOUR API KEY", :subdomain => "yoursubdomain", :verbose => true)
|
20
21
|
|
21
22
|
scamp.behaviour do
|
22
23
|
#
|
data/lib/scamp/channels.rb
CHANGED
@@ -97,7 +97,8 @@ class Scamp
|
|
97
97
|
json_parser.on_parse_complete = method(:process_message)
|
98
98
|
|
99
99
|
url = "https://streaming.campfirenow.com/room/#{channel_id}/live.json"
|
100
|
-
|
100
|
+
# Timeout per https://github.com/igrigorik/em-http-request/wiki/Redirects-and-Timeouts
|
101
|
+
http = EventMachine::HttpRequest.new(url, :connect_timeout => 20, :inactivity_timeout => 0).get :head => {'authorization' => [api_key, 'X']}
|
101
102
|
http.errback { logger.error "Couldn't stream channel #{channel_id} at url #{url}" }
|
102
103
|
http.callback { logger.error "Disconnected from #{url}" }
|
103
104
|
http.stream {|chunk| json_parser << chunk }
|
data/lib/scamp/version.rb
CHANGED
data/scamp.gemspec
CHANGED
@@ -16,9 +16,10 @@ Gem::Specification.new do |s|
|
|
16
16
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
17
17
|
s.require_paths = ["lib"]
|
18
18
|
|
19
|
-
s.add_dependency('eventmachine', '~> 0.
|
19
|
+
s.add_dependency('eventmachine', '~> 1.0.0.beta.4')
|
20
20
|
s.add_dependency('yajl-ruby', '~> 0.8.3')
|
21
|
-
s.add_dependency('em-http-request', '~> 0.
|
21
|
+
s.add_dependency('em-http-request', '~> 1.0.0.beta.4')
|
22
22
|
|
23
23
|
s.add_development_dependency "rspec", "~> 2.6.0"
|
24
|
+
s.add_development_dependency "mocha", "~> 0.10.0"
|
24
25
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scamp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,22 +9,22 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-09-
|
12
|
+
date: 2011-09-19 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: eventmachine
|
16
|
-
requirement: &
|
16
|
+
requirement: &2160350540 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 0.
|
21
|
+
version: 1.0.0.beta.4
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2160350540
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: yajl-ruby
|
27
|
-
requirement: &
|
27
|
+
requirement: &2160349260 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,21 +32,21 @@ dependencies:
|
|
32
32
|
version: 0.8.3
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2160349260
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: em-http-request
|
38
|
-
requirement: &
|
38
|
+
requirement: &2160348020 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: 0.
|
43
|
+
version: 1.0.0.beta.4
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *2160348020
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rspec
|
49
|
-
requirement: &
|
49
|
+
requirement: &2160346640 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,7 +54,18 @@ dependencies:
|
|
54
54
|
version: 2.6.0
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *2160346640
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: mocha
|
60
|
+
requirement: &2160345740 !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
62
|
+
requirements:
|
63
|
+
- - ~>
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: 0.10.0
|
66
|
+
type: :development
|
67
|
+
prerelease: false
|
68
|
+
version_requirements: *2160345740
|
58
69
|
description: Eventmachine based Campfire bot framework
|
59
70
|
email:
|
60
71
|
- will@willj.net
|