evostream 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ebca9c1de8b04b344b8121a4cedf391a1862e277
4
- data.tar.gz: 3cac40b9818ea7285d8f738dae1bb53449dcfc31
3
+ metadata.gz: e96996c80df23fe35f8d843a58959252c1c1ba1a
4
+ data.tar.gz: bec3aa2eaebca6cf3c1d17365f63520cf6823a5b
5
5
  SHA512:
6
- metadata.gz: 6e2f8b84d2dd842b0ddc44c8c8c14d331d4aabc848dd58c17dedd053b7e4eecb38a599b93a0afa46c381dc0e426b1922dffb98d6af70046608b9545f430961a3
7
- data.tar.gz: 878b924abbf7ede2608927a414ee649df4bbd9a538a86268ed7bbb0e1e810d28fca3ea7b0a05fe0183c7ec8c3e084dd4a43ad9cdee413c9ac6355768c9d64631
6
+ metadata.gz: abe5df5b5d7f9cb81ab71d29e496feb2e1d12efde304d140f3ab36a763513e76c14db02dcae9879a3998872eb32f6b369e5b8baabf9c7741cac6de8d123593e2
7
+ data.tar.gz: b93f9921f9b26bfb78b3614a10053a8ae6ea4bf103094e4a605d40815241db3053bd5860de802b25ffc913a3efee1771cf85f31d09c5a5f2b294714dab6cf1bd
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-2.0.0-p247
1
+ ruby-2.1.1
data/.travis.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  language: ruby
2
2
  rvm:
3
+ - 2.1.1
3
4
  - 2.0.0
4
5
  - 1.9.3
5
- - 1.8.7
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Evostream
2
2
 
3
+ [![Build Status](https://travis-ci.org/globocom/evostream.png?branch=master)](https://travis-ci.org/globocom/evostream)
4
+
3
5
  Ruby wrapper for the Evostream API
4
6
 
5
7
  ## Installation
@@ -18,6 +20,13 @@ Or install it yourself as:
18
20
 
19
21
  ## Usage
20
22
 
23
+ ```ruby
24
+ client = Evostream::Client.new host: 'evostream.example.com', port: 80, path_prefix: '/evo'
25
+ client.liststreams
26
+ # With parameters
27
+ client.pullstream uri: "rtmp://localhost/live/my_stream", localstreamname: "master", keepalive: 1
28
+ ```
29
+
21
30
  You may use the block style configuration. The following code could be placed
22
31
  into a +config/initializers/evostream.rb+ when used in a Rails project.
23
32
 
@@ -38,11 +38,7 @@ module Evostream
38
38
 
39
39
  def api_call(method, params)
40
40
  url = URI.parse(service_url(method, params))
41
- request = Net::HTTP::Get.new(url.to_s)
42
- response = Net::HTTP.start(url.host, url.port) {|http|
43
- http.request(request)
44
- }
45
- response
41
+ Net::HTTP.get_response(url)
46
42
  end
47
43
 
48
44
  def service_url(service, params)
@@ -59,7 +55,7 @@ module Evostream
59
55
  end
60
56
 
61
57
  def encode_params(params)
62
- Base64.encode64(params.map {|k, v| "#{k}=#{v}" }.join(' ')).chomp
58
+ Base64.urlsafe_encode64(params.map {|k, v| "#{k}=#{v}" }.join(' ')).chomp
63
59
  end
64
60
 
65
61
  def parse(text)
@@ -1,4 +1,4 @@
1
1
  # coding: utf-8
2
2
  module Evostream
3
- VERSION = "0.0.3"
3
+ VERSION = "0.0.4"
4
4
  end
data/spec/client_spec.rb CHANGED
@@ -56,4 +56,11 @@ describe Evostream::Client do
56
56
  subject.some_service('first_param' => 'xxx', 'second_param' => 'xxx')
57
57
  WebMock.should have_requested(:get, "http://somehost:80/some_path/some_service?params=Zmlyc3RfcGFyYW09eHh4IHNlY29uZF9wYXJhbT14eHg=")
58
58
  end
59
+
60
+ it "should encode params with url safe base64 to support longer param values" do
61
+ stub_request(:get, /.*some_service.*/).
62
+ to_return(status: 200, body: '{"data":null,"description":"","status":"SUCCESS"}')
63
+ subject.some_service(:first_param => 'xxx', :second_param => 'xxx', :third_param => 'xxx')
64
+ WebMock.should have_requested(:get, "http://somehost:80/some_path/some_service?params=Zmlyc3RfcGFyYW09eHh4IHNlY29uZF9wYXJhbT14eHggdGhpcmRfcGFyYW09eHh4")
65
+ end
59
66
  end
metadata CHANGED
@@ -1,83 +1,83 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evostream
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lucas Mundim
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-19 00:00:00.000000000 Z
11
+ date: 2014-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.3'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: webmock
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: debugger
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  description: Ruby wrapper for the Evostream API
@@ -87,11 +87,11 @@ executables: []
87
87
  extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
- - .gitignore
91
- - .rspec
92
- - .ruby-gemset
93
- - .ruby-version
94
- - .travis.yml
90
+ - ".gitignore"
91
+ - ".rspec"
92
+ - ".ruby-gemset"
93
+ - ".ruby-version"
94
+ - ".travis.yml"
95
95
  - Gemfile
96
96
  - LICENSE.txt
97
97
  - README.md
@@ -115,17 +115,17 @@ require_paths:
115
115
  - lib
116
116
  required_ruby_version: !ruby/object:Gem::Requirement
117
117
  requirements:
118
- - - '>='
118
+ - - ">="
119
119
  - !ruby/object:Gem::Version
120
120
  version: '0'
121
121
  required_rubygems_version: !ruby/object:Gem::Requirement
122
122
  requirements:
123
- - - '>='
123
+ - - ">="
124
124
  - !ruby/object:Gem::Version
125
125
  version: '0'
126
126
  requirements: []
127
127
  rubyforge_project:
128
- rubygems_version: 2.0.3
128
+ rubygems_version: 2.2.2
129
129
  signing_key:
130
130
  specification_version: 4
131
131
  summary: Ruby wrapper for the Evostream API