opentok 2.4.0 → 2.4.1

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: 5a1348f9a120404e5fa6a5dd9710a7f7d44b2be8
4
- data.tar.gz: 194a975415e454028ab738929df4462c5dd8213a
3
+ metadata.gz: 25c2985a61c6db455329b4cb491d573660acb9d0
4
+ data.tar.gz: e123cf51b9921306d2abec19a15a4dc6d1ce802c
5
5
  SHA512:
6
- metadata.gz: 6870dd1f8e7dfb518fd1027f40605f1267c9d4aa740916aaf03828c87f1f019d90cc48389134a6b5a18cd3c1f5bcdd2c7a5c2fa1b010acd43b4a86a14f6192cc
7
- data.tar.gz: b5f30aa15b3db675de70b97065ef8165830c89de6193af18dda0c99d3253f4e49e7025d14030c79d553eed26ea1b69d624532af07577a822d3a1e1e7a0356224
6
+ metadata.gz: e3e879ddd1f69bb0e03806fe0e2e594daadb8b11a964b3cd46ed26d7be161ab21df7d43af8d63803b8d0fe4aed9344f0eae2ae32245e144c99e0df00dddab51e
7
+ data.tar.gz: 7703872a8a0c651cab4cb92a15c0d5ba83b0b26a0ddac8843e6cd6ae0fe164446752361fb868c6cbd7a3cbd5475502af11c8124b9224c691d5d6ddecee200e43
@@ -41,7 +41,7 @@ Common tasks:
41
41
  In order to create a release, the following should be completed in order.
42
42
 
43
43
  1. Ensure all tests are passing (`rake spec`) and that there is enough test coverage.
44
- 1. Make sure you are on the `master` branch of the repository, with all changes merged/committed already.
44
+ 1. Make sure you are on the `dev` branch of the repository, with all changes merged/committed already.
45
45
  1. Update the version number in the source code (`lib/opentok/version.rb`) and the README. See [Versioning](#versioning) for
46
46
  information about selecting an appropriate version number.
47
47
  1. Commit the version number change with the message ("Update to version v.x.x.x"), substituting the new version number.
@@ -49,7 +49,7 @@ In order to create a release, the following should be completed in order.
49
49
  1. Run `rake release`, which will create a git tag for the version number, build, and push the gem to Rubygems.
50
50
  1. Change the version number for future development by adding ".alpha.1", then make another commit with the message
51
51
  "Beginning development on next version".
52
- 1. Push the changes to the main repository (`git push origin master`).
52
+ 1. Push the changes to the main repository (`git push origin dev`).
53
53
  1. Add a description to the [GitHub Releases](https://github.com/opentok/opentok-ruby-sdk/releases) page
54
54
  with any notable changes. Upload the built gem as an attachment.
55
55
 
@@ -66,11 +66,12 @@ from 1.
66
66
 
67
67
  ### Branches
68
68
 
69
- * `master` - the main development branch.
69
+ * `dev` - the main development branch.
70
+ * `master` - reflects the latest stable release.
70
71
  * `feat.foo` - feature branches. these are used for longer running tasks that cannot be accomplished in one commit.
71
- once merged into master, these branches should be deleted.
72
- * `vx.x.x` - if development for a future version/milestone has begun while master is working towards a sooner
73
- release, this is the naming scheme for that branch. once merged into master, these branches should be deleted.
72
+ once merged into dev, these branches should be deleted.
73
+ * `vx.x.x` - if development for a future version/milestone has begun while dev is working towards a sooner
74
+ release, this is the naming scheme for that branch. once merged into dev, these branches should be deleted.
74
75
 
75
76
  ### Tags
76
77
 
data/README.md CHANGED
@@ -17,7 +17,7 @@ Bundler helps manage dependencies for Ruby projects. Find more info here: <http:
17
17
  Add this gem to your `Gemfile`:
18
18
 
19
19
  ```ruby
20
- gem "opentok", "~> 2.4"
20
+ gem "opentok", "~> 2.4.1"
21
21
  ```
22
22
 
23
23
  Allow bundler to install the change.
@@ -29,7 +29,7 @@ $ bundle install
29
29
  ## RubyGems:
30
30
 
31
31
  ```
32
- $ gem install opentok -v 2.4.0
32
+ $ gem install opentok
33
33
  ```
34
34
 
35
35
  # Usage
@@ -77,7 +77,8 @@ Once a Session is created, you can start generating Tokens for clients to use wh
77
77
  You can generate a token either by calling the `opentok.generate_token(session_id, options)` method,
78
78
  or by calling the `Session#generate_token(options)` method on the instance after creating it. The
79
79
  `options` parameter is an optional Hash used to set the role, expire time, and connection data of
80
- the Token.
80
+ the Token. For layout control in archives and broadcasts, the initial layout class list of streams
81
+ published from connections using this token can be set as well.
81
82
 
82
83
  ```ruby
83
84
  # Generate a Token from just a session_id (fetched from a database)
@@ -90,7 +91,8 @@ token = session.generate_token
90
91
  token = session.generate_token({
91
92
  :role => :moderator,
92
93
  :expire_time => Time.now.to_i+(7 * 24 * 60 * 60), # in one week
93
- :data => 'name=Johnny'
94
+ :data => 'name=Johnny',
95
+ :initial_layout_class_list => ['focus', 'inactive']
94
96
  });
95
97
  ```
96
98
 
@@ -81,6 +81,15 @@ module OpenTok
81
81
  end
82
82
  data_params[:connection_data] = data
83
83
  end
84
+
85
+ if opts[:initial_layout_class_list]
86
+ if opts[:initial_layout_class_list].is_a?(Array)
87
+ data_params[:initial_layout_class_list] = opts[:initial_layout_class_list].join(' ')
88
+ else
89
+ data_params[:initial_layout_class_list] = opts[:initial_layout_class_list].to_s
90
+ end
91
+ end
92
+
84
93
  digest = OpenSSL::Digest.new('sha1')
85
94
  data_string = Addressable::URI.form_encode data_params
86
95
  meta_string = Addressable::URI.form_encode({
@@ -1,4 +1,4 @@
1
1
  module OpenTok
2
2
  # @private
3
- VERSION = '2.4.0'
3
+ VERSION = '2.4.1'
4
4
  end
@@ -2,7 +2,7 @@ var session = OT.initSession(apiKey, sessionId),
2
2
  publisher = OT.initPublisher('publisher'),
3
3
  archiveID = null;
4
4
 
5
- session.connect(token, function(error, info) {
5
+ session.connect(token, function(error) {
6
6
  if (error) {
7
7
  console.error('Failed to connect', error);
8
8
  } else {
@@ -1,7 +1,7 @@
1
1
  var session = OT.initSession(apiKey, sessionId),
2
2
  publisher = OT.initPublisher('publisher');
3
3
 
4
- session.connect(token, function(error, info) {
4
+ session.connect(token, function(error) {
5
5
  if (error) {
6
6
  console.error('Failed to connect', error);
7
7
  } else {
@@ -7,7 +7,8 @@ require "addressable/uri"
7
7
  RSpec::Matchers.define :carry_token_data do |input_data|
8
8
  option_to_token_key = {
9
9
  :api_key => :partner_id,
10
- :data => :connection_data
10
+ :data => :connection_data,
11
+ :initial_layout_class_list => :initial_layout_class_list
11
12
  }
12
13
  match do |token|
13
14
  decoded_token = Base64.decode64(token[4..token.length])
@@ -73,6 +73,31 @@ shared_examples "opentok generates tokens" do
73
73
  expect(data_bearing_token).to carry_valid_token_signature api_secret
74
74
  end
75
75
 
76
+ it "generates tokens with initial layout classes" do
77
+ layout_classes = ["focus", "small"]
78
+ layout_class_bearing_token = opentok.generate_token session_id, :initial_layout_class_list => layout_classes
79
+ expect(layout_class_bearing_token).to be_an_instance_of String
80
+ expect(layout_class_bearing_token).to carry_token_data :session_id => session_id
81
+ expect(layout_class_bearing_token).to carry_token_data :api_key => api_key
82
+ expect(layout_class_bearing_token).to carry_token_data :role => default_role
83
+ expect(layout_class_bearing_token).to carry_token_data :initial_layout_class_list => layout_classes.join(' ')
84
+ expect(layout_class_bearing_token).to carry_token_data [:nonce, :create_time]
85
+ expect(layout_class_bearing_token).to carry_valid_token_signature api_secret
86
+ end
87
+
88
+ it "generates tokens with one initial layout class" do
89
+ layout_class = "focus"
90
+ layout_class_bearing_token = opentok.generate_token session_id, :initial_layout_class_list => layout_class
91
+ expect(layout_class_bearing_token).to be_an_instance_of String
92
+ expect(layout_class_bearing_token).to carry_token_data :session_id => session_id
93
+ expect(layout_class_bearing_token).to carry_token_data :api_key => api_key
94
+ expect(layout_class_bearing_token).to carry_token_data :role => default_role
95
+ expect(layout_class_bearing_token).to carry_token_data :initial_layout_class_list => layout_class
96
+ expect(layout_class_bearing_token).to carry_token_data [:nonce, :create_time]
97
+ expect(layout_class_bearing_token).to carry_valid_token_signature api_secret
98
+ end
99
+
100
+
76
101
  # TODO a context about using a bad session_id
77
102
  end
78
103
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opentok
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stijn Mathysen
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2017-06-09 00:00:00.000000000 Z
15
+ date: 2017-07-04 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: bundler
@@ -262,7 +262,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
262
262
  version: '0'
263
263
  requirements: []
264
264
  rubyforge_project:
265
- rubygems_version: 2.6.12
265
+ rubygems_version: 2.6.11
266
266
  signing_key:
267
267
  specification_version: 4
268
268
  summary: Ruby gem for the OpenTok API