mida 0.3.6 → 0.3.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.rdoc +3 -0
- data/Gemfile.lock +4 -2
- data/lib/mida/datatype/url.rb +3 -0
- data/lib/mida/itemprop.rb +2 -0
- data/lib/mida/version.rb +1 -1
- data/mida.gemspec +1 -0
- data/spec/datatype/url_spec.rb +5 -2
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cde0c31ecf86cd045ae29de07cd82b579ee941a9
|
4
|
+
data.tar.gz: 2823a83ecb98f15bd20c429515985f293d512915
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33555423be24c0b7520449187cca5a1a52f7404cc20e7660b3c04c1be1c85136bda187e57a5cfaee36dea02aabb753ff21bcd3e86259b1cbab29888a07a15742
|
7
|
+
data.tar.gz: b9b04ca377acba4c9e7e5067c5b9db97bdba04eac474dac3f5a504dd158835a26aac7fd414c8d89305ba45f76558263b936fdefcd0f050d30d2cff31b87c5e20
|
data/CHANGELOG.rdoc
CHANGED
data/Gemfile.lock
CHANGED
@@ -2,16 +2,18 @@ PATH
|
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
4
|
mida (0.3.6)
|
5
|
+
addressable (~> 2.3.6)
|
5
6
|
blankslate (= 2.1.2.4)
|
6
7
|
nokogiri (>= 1.5)
|
7
8
|
|
8
9
|
GEM
|
9
10
|
remote: https://rubygems.org/
|
10
11
|
specs:
|
12
|
+
addressable (2.3.6)
|
11
13
|
blankslate (2.1.2.4)
|
12
14
|
diff-lcs (1.1.3)
|
13
|
-
mini_portile (0.5.
|
14
|
-
nokogiri (1.6.
|
15
|
+
mini_portile (0.5.3)
|
16
|
+
nokogiri (1.6.1)
|
15
17
|
mini_portile (~> 0.5.0)
|
16
18
|
rake (10.1.0)
|
17
19
|
rspec (2.10.0)
|
data/lib/mida/datatype/url.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
|
+
#encoding: utf-8
|
1
2
|
require 'mida/datatype/generic'
|
2
3
|
require 'uri'
|
4
|
+
require 'addressable/uri'
|
3
5
|
|
4
6
|
module Mida
|
5
7
|
module DataType
|
@@ -10,6 +12,7 @@ module Mida
|
|
10
12
|
|
11
13
|
# Raises +ArgumentError+ if value not valid url
|
12
14
|
def initialize(value)
|
15
|
+
value = ::Addressable::URI.encode(value)
|
13
16
|
raise ::ArgumentError unless value =~ ::URI::DEFAULT_PARSER.regexp[:ABS_URI]
|
14
17
|
@parsedValue = ::URI.parse(value)
|
15
18
|
end
|
data/lib/mida/itemprop.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'nokogiri'
|
2
2
|
require 'uri'
|
3
3
|
require 'mida/itemscope'
|
4
|
+
require 'addressable/uri'
|
4
5
|
|
5
6
|
module Mida
|
6
7
|
|
@@ -52,6 +53,7 @@ module Mida
|
|
52
53
|
# This returns an empty string if can't form a valid
|
53
54
|
# absolute url as per the Microdata spec.
|
54
55
|
def make_absolute_url(url)
|
56
|
+
url = ::Addressable::URI.encode(url)
|
55
57
|
return url unless URI.parse(url).relative?
|
56
58
|
begin
|
57
59
|
URI.parse(@page_url).merge(url).to_s
|
data/lib/mida/version.rb
CHANGED
data/mida.gemspec
CHANGED
@@ -20,6 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.rdoc_options << '--main' << 'README.rdoc'
|
21
21
|
spec.add_dependency('blankslate', '2.1.2.4')
|
22
22
|
spec.add_dependency('nokogiri', '>= 1.5')
|
23
|
+
spec.add_dependency('addressable', '~> 2.3.6')
|
23
24
|
spec.add_development_dependency "bundler", "~> 1.3"
|
24
25
|
spec.add_development_dependency "rake"
|
25
26
|
spec.add_development_dependency "rspec", "~> 2.10.0"
|
data/spec/datatype/url_spec.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
#encoding: utf-8
|
2
|
+
#
|
1
3
|
require 'mida/datatype'
|
2
4
|
require 'yaml'
|
3
5
|
|
@@ -20,8 +22,9 @@ describe Mida::DataType::URL do
|
|
20
22
|
end
|
21
23
|
|
22
24
|
|
23
|
-
it '#parse should accept a valid url' do
|
24
|
-
url_text = 'http://example.com
|
25
|
+
it '#parse should accept a valid url with special characters' do
|
26
|
+
url_text = 'http://example.com/übergangslösung'
|
25
27
|
url = Mida::DataType::URL.parse(url_text)
|
28
|
+
url.to_s.should == ::Addressable::URI.encode(url_text)
|
26
29
|
end
|
27
30
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mida
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lawrence Woodman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-06-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: blankslate
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '1.5'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: addressable
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 2.3.6
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 2.3.6
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: bundler
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -451,7 +465,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
451
465
|
version: '0'
|
452
466
|
requirements: []
|
453
467
|
rubyforge_project:
|
454
|
-
rubygems_version: 2.
|
468
|
+
rubygems_version: 2.2.2
|
455
469
|
signing_key:
|
456
470
|
specification_version: 4
|
457
471
|
summary: A Microdata parser/extractor library
|