pragmatic_context 0.1.4 → 0.1.5
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88a0b60c96eb500404496ea8345b60e3918fe061
|
4
|
+
data.tar.gz: 2a48a6692c6b7858c3643be1321b048f5d45452b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83308f03bc29e1fb0fd0ca5ddbd345b04481e425bd3290e8bdaa730e4918a0f99f4564cd2de6a231200fed23a414ac49cdf67dac789ea20d297a3bb2da6e2e62
|
7
|
+
data.tar.gz: fbb646247db59280a8060aea232186a24188fea46d3d283de8659621cdcf675d37a7e90f35167b0c2ccee28bed9332c261d296c420e5e332a2edd289d7a19e3b
|
@@ -16,11 +16,12 @@ module PragmaticContext
|
|
16
16
|
|
17
17
|
def contextualize(field, params)
|
18
18
|
setup_default_contextualizer
|
19
|
+
params.each { |k, v| params[k] = v.to_s }
|
19
20
|
self.contextualizer.add_term(field, params)
|
20
21
|
end
|
21
22
|
|
22
23
|
def contextualize_as_type(type)
|
23
|
-
self.contextualized_type = type
|
24
|
+
self.contextualized_type = type.nil? ? type : type.to_s
|
24
25
|
end
|
25
26
|
|
26
27
|
private
|
@@ -43,6 +43,13 @@ describe PragmaticContext::Contextualizable do
|
|
43
43
|
|
44
44
|
subject.contextualize :bacon, :as => 'http://bacon.yum'
|
45
45
|
end
|
46
|
+
|
47
|
+
it 'should coerce the param values to string' do
|
48
|
+
contextualizer = double('contextualizer')
|
49
|
+
contextualizer.should_receive(:add_term).with(:bacon, { :as => 'http://bacon.yum' })
|
50
|
+
PragmaticContext::DefaultContextualizer.stub(:new) { contextualizer }
|
51
|
+
subject.contextualize :bacon, :as => double(to_s: 'http://bacon.yum')
|
52
|
+
end
|
46
53
|
end
|
47
54
|
|
48
55
|
describe 'contextualize_as_type' do
|
@@ -50,6 +57,10 @@ describe PragmaticContext::Contextualizable do
|
|
50
57
|
subject.contextualize_as_type 'bacon'
|
51
58
|
subject.contextualized_type.should eq 'bacon'
|
52
59
|
end
|
60
|
+
it 'should coerce the type to string' do
|
61
|
+
subject.contextualize_as_type double(to_s: "http://schema.org/Person")
|
62
|
+
subject.contextualized_type.should eq "http://schema.org/Person"
|
63
|
+
end
|
53
64
|
end
|
54
65
|
end
|
55
66
|
|
metadata
CHANGED
@@ -1,97 +1,97 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pragmatic_context
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mat Trudel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-05-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.5'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.5'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '2.6'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - ~>
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '2.6'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: guard-rspec
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: activesupport
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: activemodel
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0'
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
description: A library to declaratively add JSON-LD support to your ActiveModel models
|
@@ -101,8 +101,8 @@ executables: []
|
|
101
101
|
extensions: []
|
102
102
|
extra_rdoc_files: []
|
103
103
|
files:
|
104
|
-
- .gitignore
|
105
|
-
- .rspec
|
104
|
+
- ".gitignore"
|
105
|
+
- ".rspec"
|
106
106
|
- Gemfile
|
107
107
|
- Guardfile
|
108
108
|
- LICENSE.txt
|
@@ -125,12 +125,12 @@ require_paths:
|
|
125
125
|
- lib
|
126
126
|
required_ruby_version: !ruby/object:Gem::Requirement
|
127
127
|
requirements:
|
128
|
-
- -
|
128
|
+
- - ">="
|
129
129
|
- !ruby/object:Gem::Version
|
130
130
|
version: '0'
|
131
131
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
132
132
|
requirements:
|
133
|
-
- -
|
133
|
+
- - ">="
|
134
134
|
- !ruby/object:Gem::Version
|
135
135
|
version: '0'
|
136
136
|
requirements: []
|