pragmatic_context 0.1.0 → 0.1.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: 40b3f7414a092b590f39f53530c841de2eb6856b
4
- data.tar.gz: c2690d5363e6ebe4f97d8ff1bf6f74eda15c9d0c
3
+ metadata.gz: e2ec6ccfc5c04da2f9decfe359fde2b08a056d84
4
+ data.tar.gz: 7497e0289cc5c38616f91ce6a2d6adcd8ee1eb31
5
5
  SHA512:
6
- metadata.gz: 4c73f9b9644b5cba0eec15b9057fa38d89a951cfbed66e1e20e6e87fbc3ab30140e1e7cf18930f780b2dd9dd320aaec424a941a23e99d3de6e6a3808b583e171
7
- data.tar.gz: fdd45f04bd8b81024c96dc441a2b8539d59c77ec32e4a9cbb296a7f3a80a8c21eb6944d7e05d577608f3de4ac88005634c98fbc1cd088ab989ed3d5b3a03681b
6
+ metadata.gz: 0bbe3d6badf4a09768da5ce2ae9d9cedf2e5c4a897904ef029535e980c1f9189bd9b7076578462998ec7994155097de7266fa02dcb3512e724733f481595e441
7
+ data.tar.gz: d4c27b700f9f4c88e3a66e6cd830dc878fdf4f61a9e103e8dac65905685f54d4bb211c7f1b0c9c61ba8eb87ce09132acecae3d93f753af17bf329e7c8bdf2470
data/README.md CHANGED
@@ -198,7 +198,7 @@ values, and for the resulting document to serialize out as something like:
198
198
  If you want to refer to your JSON-LD context by URI (see Example 4 in the [JSON
199
199
  spec](http://www.w3.org/TR/json-ld) for more info), or if you want to use your
200
200
  own serializer to customize the JSON-LD representaions you produce, you'll want
201
- to make use of the `Contextualizable` mixin's `context` method. `context`
201
+ to make use of the `Contextualizable` mixin's `jsonld_context` method. `jsonld_context`
202
202
  returns a Hash object ready to be serialized into the `@context` field of the
203
203
  output object. By wiring this up in whatever serializer your application uses,
204
204
  you can easily extend custom serializations to output
@@ -49,10 +49,10 @@ module PragmaticContext
49
49
  results[term] = json_results[term]
50
50
  end
51
51
  end
52
- results.merge("@context" => context)
52
+ results.merge("@context" => jsonld_context)
53
53
  end
54
54
 
55
- def context
55
+ def jsonld_context
56
56
  self.class.contextualizer.definitions_for_terms(terms)
57
57
  end
58
58
 
@@ -1,3 +1,3 @@
1
1
  module PragmaticContext
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -63,7 +63,7 @@ describe PragmaticContext::Contextualizable do
63
63
  end
64
64
  subject.bacon = 'crispy'
65
65
  subject.ham = 'honey'
66
- subject.as_jsonld.should == { "bacon" => "crispy", "@context" => subject.context }
66
+ subject.as_jsonld.should == { "bacon" => "crispy", "@context" => subject.jsonld_context }
67
67
  end
68
68
 
69
69
  it 'should recurse into Contextualizable subobjects' do
@@ -76,10 +76,10 @@ describe PragmaticContext::Contextualizable do
76
76
  subject.ham.bacon = 'nested bacon'
77
77
  subject.ham.ham = 'nested ham'
78
78
  subject.as_jsonld.should == {
79
- "@context" => subject.context,
79
+ "@context" => subject.jsonld_context,
80
80
  "bacon" => "crispy",
81
81
  "ham" => {
82
- "@context" => subject.ham.context,
82
+ "@context" => subject.ham.jsonld_context,
83
83
  "bacon" => "nested bacon",
84
84
  "ham" => "nested ham"
85
85
  }
@@ -94,7 +94,7 @@ describe PragmaticContext::Contextualizable do
94
94
  subject.bacon = 'crispy'
95
95
  subject.ham = { 'bacon' => 'nested bacon' }
96
96
  subject.as_jsonld.should == {
97
- "@context" => subject.context,
97
+ "@context" => subject.jsonld_context,
98
98
  "bacon" => "crispy",
99
99
  "ham:bacon" => "nested bacon"
100
100
  }
@@ -108,8 +108,8 @@ describe PragmaticContext::Contextualizable do
108
108
  end
109
109
  subject.bacon = 'crispy'
110
110
  subject.ham = 'honey'
111
- subject.context['bacon']['@id'].should == 'http://bacon.yum'
112
- subject.context['ham'].should == nil
111
+ subject.jsonld_context['bacon']['@id'].should == 'http://bacon.yum'
112
+ subject.jsonld_context['ham'].should == nil
113
113
  end
114
114
  end
115
115
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pragmatic_context
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mat Trudel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-10 00:00:00.000000000 Z
11
+ date: 2014-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -142,3 +142,4 @@ summary: JSON-LD from a JSON perspective
142
142
  test_files:
143
143
  - spec/lib/pragmatic_context/contextualizable_spec.rb
144
144
  - spec/lib/pragmatic_context/default_contextualizer_spec.rb
145
+ has_rdoc: