Skip to content

Commit

Permalink
v3.0.3 (#161)
Browse files Browse the repository at this point in the history
* fix logging version and add ruby version to useragent (#160)
* Bump version to 3.0.3
  • Loading branch information
Manik Sachdeva committed Jul 10, 2018
1 parent f618f8a commit 7774d3f
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 28 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -17,7 +17,7 @@ Bundler helps manage dependencies for Ruby projects. Find more info here: <http:
Add this gem to your `Gemfile`:

```ruby
gem "opentok", "~> 3.0.2"
gem "opentok", "~> 3.0.3"
```

Allow bundler to install the change.
Expand Down
3 changes: 2 additions & 1 deletion lib/opentok/client.rb
@@ -1,6 +1,7 @@
require "opentok/constants"
require "opentok/exceptions"
require "opentok/extensions/hash"
require "opentok/version"

require "active_support/inflector"
require "httparty"
Expand All @@ -19,7 +20,7 @@ class Client
def initialize(api_key, api_secret, api_url, ua_addendum="")
self.class.base_uri api_url
self.class.headers({
"User-Agent" => "OpenTok-Ruby-SDK/#{VERSION}" + (ua_addendum ? " #{ua_addendum}" : "")
"User-Agent" => "OpenTok-Ruby-SDK/#{VERSION}" + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}" + (ua_addendum ? " #{ua_addendum}" : "")
})
@api_key = api_key
@api_secret = api_secret
Expand Down
2 changes: 1 addition & 1 deletion lib/opentok/version.rb
@@ -1,4 +1,4 @@
module OpenTok
# @private
VERSION = '3.0.2'
VERSION = '3.0.3'
end
30 changes: 15 additions & 15 deletions spec/opentok/archives_spec.rb
Expand Up @@ -28,67 +28,67 @@

it { should be_an_instance_of OpenTok::Archives }

it "should create archives", :vcr => { :erb => { :version => OpenTok::VERSION } } do
it "should create archives", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}" } } do
archive = archives.create session_id
expect(archive).to be_an_instance_of OpenTok::Archive
expect(archive.session_id).to eq session_id
expect(archive.id).not_to be_nil
end

it "should create named archives", :vcr => { :erb => { :version => OpenTok::VERSION } } do
it "should create named archives", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do
archive = archives.create session_id, :name => archive_name
expect(archive).to be_an_instance_of OpenTok::Archive
expect(archive.session_id).to eq session_id
expect(archive.name).to eq archive_name
end

it "should create audio only archives", :vcr => { :erb => { :version => OpenTok::VERSION } } do
it "should create audio only archives", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}" } } do
archive = archives.create session_id, :has_video => false
expect(archive).to be_an_instance_of OpenTok::Archive
expect(archive.session_id).to eq session_id
expect(archive.has_video).to be false
expect(archive.has_audio).to be true
end

it "should create individual archives", :vcr => { :erb => { :version => OpenTok::VERSION } } do
it "should create individual archives", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}" } } do
archive = archives.create session_id, :output_mode => :individual
expect(archive).to be_an_instance_of OpenTok::Archive
expect(archive.session_id).to eq session_id
expect(archive.output_mode).to eq :individual
end

it "should stop archives", :vcr => { :erb => { :version => OpenTok::VERSION } } do
it "should stop archives", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}" } } do
archive = archives.stop_by_id started_archive_id
expect(archive).to be_an_instance_of OpenTok::Archive
expect(archive.status).to eq "stopped"
end

it "should find archives by id", :vcr => { :erb => { :version => OpenTok::VERSION } } do
it "should find archives by id", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}" } } do
archive = archives.find findable_archive_id
expect(archive).to be_an_instance_of OpenTok::Archive
expect(archive.id).to eq findable_archive_id
end

it "should find paused archives by id", :vcr => { :erb => { :version => OpenTok::VERSION } } do
it "should find paused archives by id", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}" } } do
archive = archives.find findable_paused_archive_id
expect(archive).to be_an_instance_of OpenTok::Archive
expect(archive.id).to eq findable_paused_archive_id
expect(archive.status).to eq "paused"
end

it "should delete an archive by id", :vcr => { :erb => { :version => OpenTok::VERSION } } do
it "should delete an archive by id", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}" } } do
success = archives.delete_by_id deletable_archive_id
expect(success).to be_true
# expect(archive.status).to eq ""
end

it "should find expired archives", :vcr => { :erb => { :version => OpenTok::VERSION } } do
it "should find expired archives", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do
archive = archives.find findable_archive_id
expect(archive).to be_an_instance_of OpenTok::Archive
expect(archive.status).to eq "expired"
end

it "should find archives with unknown properties", :vcr => { :erb => { :version => OpenTok::VERSION } } do
it "should find archives with unknown properties", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do
archive = archives.find findable_archive_id
expect(archive).to be_an_instance_of OpenTok::Archive
end
Expand All @@ -101,35 +101,35 @@
# end

context "when many archives are created" do
it "should return all archives", :vcr => { :erb => { :version => OpenTok::VERSION } } do
it "should return all archives", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do
archive_list = archives.all
expect(archive_list).to be_an_instance_of OpenTok::ArchiveList
expect(archive_list.total).to eq 6
expect(archive_list.count).to eq 6
end

it "should return archives with an offset", :vcr => { :erb => { :version => OpenTok::VERSION } } do
it "should return archives with an offset", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do
archive_list = archives.all :offset => 3
expect(archive_list).to be_an_instance_of OpenTok::ArchiveList
expect(archive_list.total).to eq 3
expect(archive_list.count).to eq 3
end

it "should return count number of archives", :vcr => { :erb => { :version => OpenTok::VERSION } } do
it "should return count number of archives", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do
archive_list = archives.all :count => 2
expect(archive_list).to be_an_instance_of OpenTok::ArchiveList
expect(archive_list.count).to eq 2
expect(archive_list.count).to eq 2
end

it "should return part of the archives when using offset and count", :vcr => { :erb => { :version => OpenTok::VERSION } } do
it "should return part of the archives when using offset and count", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do
archive_list = archives.all :count => 4, :offset => 2
expect(archive_list).to be_an_instance_of OpenTok::ArchiveList
expect(archive_list.count).to eq 4
expect(archive_list.count).to eq 4
end

it "should return session archives", :vcr => { :erb => { :version => OpenTok::VERSION } } do
it "should return session archives", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do
archive_list = archives.all :sessionId => session_id
expect(archive_list).to be_an_instance_of OpenTok::ArchiveList
expect(archive_list.total).to eq 3
Expand Down
18 changes: 9 additions & 9 deletions spec/opentok/opentok_spec.rb
Expand Up @@ -37,7 +37,7 @@

let(:location) { '12.34.56.78' }

it "creates default sessions", :vcr => { :erb => { :version => OpenTok::VERSION } } do
it "creates default sessions", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}" } } do
session = opentok.create_session
expect(session).to be_an_instance_of OpenTok::Session
# TODO: do we need to be any more specific about what a valid session_id looks like?
Expand All @@ -46,54 +46,54 @@
expect(session.location).to eq nil
end

it "creates relayed media sessions", :vcr => { :erb => { :version => OpenTok::VERSION } } do
it "creates relayed media sessions", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do
session = opentok.create_session :media_mode => :relayed
expect(session).to be_an_instance_of OpenTok::Session
expect(session.session_id).to be_an_instance_of String
expect(session.media_mode).to eq :relayed
expect(session.location).to eq nil
end

it "creates routed media sessions", :vcr => { :erb => { :version => OpenTok::VERSION } } do
it "creates routed media sessions", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do
session = opentok.create_session :media_mode => :routed
expect(session).to be_an_instance_of OpenTok::Session
expect(session.session_id).to be_an_instance_of String
expect(session.media_mode).to eq :routed
expect(session.location).to eq nil
end

it "creates sessions with a location hint", :vcr => { :erb => { :version => OpenTok::VERSION } } do
it "creates sessions with a location hint", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do
session = opentok.create_session :location => location
expect(session).to be_an_instance_of OpenTok::Session
expect(session.session_id).to be_an_instance_of String
expect(session.media_mode).to eq :relayed
expect(session.location).to eq location
end

it "creates relayed media sessions with a location hint", :vcr => { :erb => { :version => OpenTok::VERSION } } do
it "creates relayed media sessions with a location hint", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do
session = opentok.create_session :media_mode => :relayed, :location => location
expect(session).to be_an_instance_of OpenTok::Session
expect(session.session_id).to be_an_instance_of String
expect(session.media_mode).to eq :relayed
expect(session.location).to eq location
end

it "creates routed media sessions with a location hint", :vcr => { :erb => { :version => OpenTok::VERSION } } do
it "creates routed media sessions with a location hint", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do
session = opentok.create_session :media_mode => :routed, :location => location
expect(session).to be_an_instance_of OpenTok::Session
expect(session.session_id).to be_an_instance_of String
expect(session.media_mode).to eq :routed
expect(session.location).to eq location
end

it "creates relayed media sessions for invalid media modes", :vcr => { :erb => { :version => OpenTok::VERSION } } do
it "creates relayed media sessions for invalid media modes", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do
session = opentok.create_session :media_mode => :blah
expect(session).to be_an_instance_of OpenTok::Session
expect(session.session_id).to be_an_instance_of String
expect(session.media_mode).to eq :relayed
expect(session.location).to eq nil
end
it "creates always archived sessions", :vcr => { :erb => { :version => OpenTok::VERSION } } do
it "creates always archived sessions", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do
session = opentok.create_session :media_mode => :routed, :archive_mode => :always
expect(session).to be_an_instance_of OpenTok::Session
expect(session.session_id).to be_an_instance_of String
Expand Down Expand Up @@ -150,7 +150,7 @@
end

# NOTE: ua_addendum is hardcoded into cassette
it "should append the addendum to the user agent header", :vcr => { :erb => { :version => OpenTok::VERSION } } do
it "should append the addendum to the user agent header", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do
session = opentok.create_session
expect(session).to be_an_instance_of OpenTok::Session
end
Expand Down
3 changes: 2 additions & 1 deletion spec/opentok/sip_spec.rb
@@ -1,5 +1,6 @@
require "opentok/opentok"
require "opentok/sip"
require "opentok/version"
require "spec_helper"

describe OpenTok::Sip do
Expand All @@ -19,7 +20,7 @@
let(:sip) { opentok.sip }
subject { sip }

it "receives a valid response", :vcr => { :erb => { :version => OpenTok::VERSION } } do
it "receives a valid response", :vcr => { :erb => { :version => OpenTok::VERSION + "-Ruby-Version-#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"} } do
opts = { "auth" => { "username" => sip_username,
"password" => sip_password },
"secure" => "true"
Expand Down

0 comments on commit 7774d3f

Please sign in to comment.