vidyo_io 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 73f98ae9c4659f88ccf4e201dbf59a1bf359bd52
4
+ data.tar.gz: 11c82fd2b48fa4fc43940ec0968c07748981850c
5
+ SHA512:
6
+ metadata.gz: dfcccee7b4158574577985aeb36c37c6fcb90473231ce22a0ea89a4e50adfd6eae47de0b53de959e88c050e38bdddcb02066b284dc02054da078c02dfd510172
7
+ data.tar.gz: 0971e2525b11dbda56c0d15252453518da01dba02cc86175a13491bf64c0e4f43326a3cf85a5071f79df31d30ba47d113bd8c168edb548723ccbd777d099b4c8
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2016 Marc Cámara
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile ADDED
@@ -0,0 +1,34 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'VidyoIo'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.rdoc')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+
18
+
19
+
20
+
21
+
22
+ Bundler::GemHelper.install_tasks
23
+
24
+ require 'rake/testtask'
25
+
26
+ Rake::TestTask.new(:test) do |t|
27
+ t.libs << 'lib'
28
+ t.libs << 'test'
29
+ t.pattern = 'test/**/*_test.rb'
30
+ t.verbose = false
31
+ end
32
+
33
+
34
+ task default: :test
@@ -0,0 +1,21 @@
1
+ require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")
2
+
3
+ describe VidyoIo::Configuration do
4
+ describe "returns configuration settings" do
5
+ it 'returns application_id' do
6
+ expect(VidyoIo::Configuration.application_id).to eq('integration_application_id')
7
+ end
8
+
9
+ it 'returns developer_key' do
10
+ expect(VidyoIo::Configuration.developer_key).to eq('integration_developer_key')
11
+ end
12
+ end
13
+
14
+ describe 'singleton instance' do
15
+ it 'cannot be instanciated' do
16
+ expect do
17
+ VidyoIo::Configuration.new
18
+ end.to raise_error(NoMethodError)
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,7 @@
1
+ describe VidyoIo::Util::BinASCII do
2
+ describe ".hexlify(data)" do
3
+ it 'must match the hexlified string' do
4
+ expect(VidyoIo::Util::BinASCII.hexlify('testing_text')).to eq('74657374696e675f74657874')
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,21 @@
1
+ require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper")
2
+
3
+ describe VidyoIo::Util::Token do
4
+ describe "self.generate" do
5
+ around do |example|
6
+ Timecop.freeze(Time.parse("2016-12-05 18:22:22 +0100")) do
7
+ example.run
8
+ end
9
+ end
10
+
11
+ it 'generates a token to last one hour' do
12
+ token = 'cHJvdmlzaW9uAHVzZXIxQGludGVncmF0aW9uX2FwcGxpY2F0aW9uX2lkADYzNjQ4MTgxMzQyAABlMjQ1ZjRjZjAyMjhkNTA0YjA4ZGRiMjQ4MDc4NWY0NWVjZmViN2Y4ZWViZWY4MGE5ZjVlYjdiOTczZWU0OGUxYzFkOGE3ZmM5ZmJjMTQ4M2QxNzRhNTFkMzMxMDY4MjQ='
13
+ expect(VidyoIo::Util::Token.generate(ttl: 3600)).to eq(token)
14
+ end
15
+
16
+ it 'generates a token to last one hour with an username' do
17
+ token = 'cHJvdmlzaW9uAHRlc3RfdXNlckBpbnRlZ3JhdGlvbl9hcHBsaWNhdGlvbl9pZAA2MzY0ODE4MTM0MgAAZTJiNGY5YzY5NzEwMWU0OWEyOThjYmViMWVmMDliMGRjNDVlYTg0OTdlYzAwMjcxYWE1NDI2MjliZWMxZDEzNmE3MDA2YzBlODNiM2EzMDAzM2NiM2EwZTBjNmRhNDRm'
18
+ expect(VidyoIo::Util::Token.generate(ttl: 3600, username: 'test_user')).to eq(token)
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,6 @@
1
+ $LOAD_PATH << File.join(File.dirname(__FILE__), '..', 'lib')
2
+ require 'timecop'
3
+ require 'vidyo_io'
4
+
5
+ VidyoIo::Configuration.application_id = "integration_application_id"
6
+ VidyoIo::Configuration.developer_key = "integration_developer_key"
data/vidyo_io.gemspec ADDED
@@ -0,0 +1,19 @@
1
+ $:.push File.expand_path("../lib", __FILE__)
2
+
3
+ # Maintain your gem's version:
4
+ require "vidyo_io/version"
5
+
6
+ # Describe your gem and declare its dependencies:
7
+ Gem::Specification.new do |s|
8
+ s.name = "vidyo_io"
9
+ s.version = VidyoIo::Version::String
10
+ s.authors = ["Marc Cámara"]
11
+ s.email = ["mcamara88@gmail.com"]
12
+ s.homepage = "http://mcamara.com"
13
+ s.summary = "VidyoIO API helper."
14
+ s.description = "Ruby library for integrating with VidyoIO API"
15
+ s.license = "MIT"
16
+
17
+ s.files = Dir["MIT-LICENSE", "Rakefile", "README.rdoc", "*.gemspec"]
18
+ s.test_files = Dir["spec/**/*"]
19
+ end
metadata ADDED
@@ -0,0 +1,55 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: vidyo_io
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Marc Cámara
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-12-05 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Ruby library for integrating with VidyoIO API
14
+ email:
15
+ - mcamara88@gmail.com
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - MIT-LICENSE
21
+ - Rakefile
22
+ - spec/lib/vidyo_io/configuration_spec.rb
23
+ - spec/lib/vidyo_io/util/binascii_spec.rb
24
+ - spec/lib/vidyo_io/util/token_spec.rb
25
+ - spec/spec_helper.rb
26
+ - vidyo_io.gemspec
27
+ homepage: http://mcamara.com
28
+ licenses:
29
+ - MIT
30
+ metadata: {}
31
+ post_install_message:
32
+ rdoc_options: []
33
+ require_paths:
34
+ - lib
35
+ required_ruby_version: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ required_rubygems_version: !ruby/object:Gem::Requirement
41
+ requirements:
42
+ - - ">="
43
+ - !ruby/object:Gem::Version
44
+ version: '0'
45
+ requirements: []
46
+ rubyforge_project:
47
+ rubygems_version: 2.5.1
48
+ signing_key:
49
+ specification_version: 4
50
+ summary: VidyoIO API helper.
51
+ test_files:
52
+ - spec/lib/vidyo_io/configuration_spec.rb
53
+ - spec/lib/vidyo_io/util/binascii_spec.rb
54
+ - spec/lib/vidyo_io/util/token_spec.rb
55
+ - spec/spec_helper.rb