livefyre 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/livefyre/core.rb +5 -5
- data/lib/livefyre/version.rb +1 -1
- data/livefyre.gemspec +1 -0
- data/spec/livefyre/core_spec.rb +13 -0
- metadata +22 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MjBlODNiYWZhMWJhOTgxNDljYzJkOWZlNDVmZThhNTg1YWQ4ZjI2Yg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NWEzYTU3MTRmNjg1YWMwMDQzYWM5MWIzZmU4YTY1ZWE1MTNjOTVjZg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NTIzZTM1YTIzZTM0NDcxM2U3Y2YzMmQxMzcxZTU1OTc3NTJjNGI2ZDIzOWUy
|
10
|
+
ZTVhYTkzOTcyMWRmOGU3NDc0ZjQ0YWNlNmVmYjcwM2M5ZmM1ZTI2ZmNiYzQw
|
11
|
+
OGQxMTRiNjM3NGQwNWVjOGQ2ZDQ2ODNhMDJkMGY2Y2I1MzBjYmI=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YTM2NDYzODM3OTNiMWY3MWFhNzZiMjdiODZkNDZhMWUwYTA0Yzg5YzA3NTY4
|
14
|
+
OGNiYTZkMjkyNWQ2NmQ1ZDY5ZjU1ODYzOGZjZDA1MTNhNjNmZjcwZTUxMDUx
|
15
|
+
Njk0OTdmN2JiMzRmN2E2YTM5NTEzNzAwOTFiMWJmOTQ0NmE0MjM=
|
data/lib/livefyre/core.rb
CHANGED
@@ -3,7 +3,7 @@ require 'digest'
|
|
3
3
|
require 'json'
|
4
4
|
require 'jwt'
|
5
5
|
require 'rest-client'
|
6
|
-
require 'uri'
|
6
|
+
require 'addressable/uri'
|
7
7
|
|
8
8
|
module Livefyre
|
9
9
|
class Network
|
@@ -111,11 +111,11 @@ module Livefyre
|
|
111
111
|
end
|
112
112
|
|
113
113
|
def uri?(string)
|
114
|
-
uri = URI.parse(string)
|
115
|
-
%w( http https ).include?(uri.scheme)
|
116
|
-
rescue URI::BadURIError
|
114
|
+
uri = Addressable::URI.parse(string)
|
115
|
+
%w( ftp ftps http https ).include?(uri.scheme)
|
116
|
+
rescue Addressable::URI::BadURIError
|
117
117
|
false
|
118
|
-
rescue URI::InvalidURIError
|
118
|
+
rescue Addressable::URI::InvalidURIError
|
119
119
|
false
|
120
120
|
end
|
121
121
|
end
|
data/lib/livefyre/version.rb
CHANGED
data/livefyre.gemspec
CHANGED
@@ -26,4 +26,5 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.add_development_dependency "rest-client", '~> 1.6', ">= 1.6.7"
|
27
27
|
spec.add_development_dependency "jwt", '~> 0.1', ">= 0.1.11"
|
28
28
|
spec.add_development_dependency "rspec", '~> 2.14', ">= 2.14.1"
|
29
|
+
spec.add_development_dependency "addressable", '~> 2.3', ">= 2.3.6"
|
29
30
|
end
|
data/spec/livefyre/core_spec.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
1
3
|
require 'livefyre'
|
2
4
|
|
3
5
|
describe Livefyre::Network do
|
@@ -46,4 +48,15 @@ describe Livefyre::Network::Site do
|
|
46
48
|
it 'should return a valid checksum' do
|
47
49
|
expect(@site.build_checksum('title', 'https://www.url.com', 'tags')).to eq('6e2e4faf7b95f896260fe695eafb34ba')
|
48
50
|
end
|
51
|
+
|
52
|
+
it 'should check for valid and invalid urls' do
|
53
|
+
expect{ @site.build_checksum('', 'test.com', '') }.to raise_error(ArgumentError)
|
54
|
+
|
55
|
+
@site.build_checksum('', 'http://localhost:8000', '')
|
56
|
+
@site.build_checksum('', 'http://清华大学.cn', '')
|
57
|
+
@site.build_checksum('', 'http://www.mysite.com/myresumé.html', '')
|
58
|
+
@site.build_checksum('', 'https://test.com/', '')
|
59
|
+
@site.build_checksum('', 'ftp://test.com/', '')
|
60
|
+
@site.build_checksum('', "https://test.com/path/test.-_~!$&'()*+,;=:@/dash", '')
|
61
|
+
end
|
49
62
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: livefyre
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Livefyre
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -98,6 +98,26 @@ dependencies:
|
|
98
98
|
- - ! '>='
|
99
99
|
- !ruby/object:Gem::Version
|
100
100
|
version: 2.14.1
|
101
|
+
- !ruby/object:Gem::Dependency
|
102
|
+
name: addressable
|
103
|
+
requirement: !ruby/object:Gem::Requirement
|
104
|
+
requirements:
|
105
|
+
- - ~>
|
106
|
+
- !ruby/object:Gem::Version
|
107
|
+
version: '2.3'
|
108
|
+
- - ! '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 2.3.6
|
111
|
+
type: :development
|
112
|
+
prerelease: false
|
113
|
+
version_requirements: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ~>
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '2.3'
|
118
|
+
- - ! '>='
|
119
|
+
- !ruby/object:Gem::Version
|
120
|
+
version: 2.3.6
|
101
121
|
description: Livefyre Ruby utility classes
|
102
122
|
email:
|
103
123
|
- tools@livefyre.com
|