contentful 0.3.1 → 0.3.2

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.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ### 0.3.2
2
+ * add default property to locale, #23
3
+
1
4
  ### 0.3.1
2
5
  * return nil when a value is not supplied, fixes #18
3
6
  * do not parse empty responses
@@ -2,7 +2,7 @@
2
2
  # Contentful::Resource module.
3
3
  #
4
4
  # You can then define properties of the class. This will create a getter method
5
- # with this name You can optionally pass a type identifier (Symbol or Class).
5
+ # with this name. You can optionally pass a type identifier (Symbol or Class).
6
6
  #
7
7
  # Classes will be instantiated for the properties,
8
8
  # Symbols will be looked up in Contentful::Resource::COERCIONS
@@ -1,7 +1,7 @@
1
1
  # Using the :resource_mapping configuration, you can register your own classes to be used
2
2
  # for the results from contentful.
3
3
  #
4
- # The key of the array defines the resource type (object["sys"]["type"]) and the value is:
4
+ # The key of the resource_mapping hash defines the resource type (object["sys"]["type"]) and the value is:
5
5
  # - the Class to use
6
6
  # - a Proc, that returns the Class to use
7
7
  # - a Symbol for a method of the ResourceBuilder object
@@ -30,4 +30,4 @@ client = Contentful::Client.new(
30
30
 
31
31
  assets = client.assets
32
32
  p assets.class # => MyBetterArray
33
- p assets.last # => #<Contentful::Asset ...
33
+ p assets.last # => #<Contentful::Asset ...
@@ -8,5 +8,6 @@ module Contentful
8
8
 
9
9
  property :code, :string
10
10
  property :name, :string
11
+ property :default, :boolean
11
12
  end
12
13
  end
@@ -1,3 +1,3 @@
1
1
  module Contentful
2
- VERSION = '0.3.1'
2
+ VERSION = '0.3.2'
3
3
  end
data/spec/locale_spec.rb CHANGED
@@ -16,5 +16,9 @@ describe Contentful::Locale do
16
16
  it 'has #name' do
17
17
  expect( locale.name ).to eq "English"
18
18
  end
19
+
20
+ it 'has #default' do
21
+ expect( locale.default ).to eq true
22
+ end
19
23
  end
20
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contentful
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-07-16 00:00:00.000000000 Z
12
+ date: 2014-08-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: http
@@ -211,7 +211,6 @@ files:
211
211
  - lib/contentful/version.rb
212
212
  - lib/contentful.rb
213
213
  - LICENSE.txt
214
- - problem.rb
215
214
  - Rakefile
216
215
  - README.md
217
216
  - spec/array_spec.rb
@@ -289,7 +288,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
289
288
  version: '0'
290
289
  segments:
291
290
  - 0
292
- hash: -2280169027525600462
291
+ hash: -3768775141988377798
293
292
  required_rubygems_version: !ruby/object:Gem::Requirement
294
293
  none: false
295
294
  requirements:
@@ -298,10 +297,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
298
297
  version: '0'
299
298
  segments:
300
299
  - 0
301
- hash: -2280169027525600462
300
+ hash: -3768775141988377798
302
301
  requirements: []
303
302
  rubyforge_project:
304
- rubygems_version: 1.8.23.2
303
+ rubygems_version: 1.8.23
305
304
  signing_key:
306
305
  specification_version: 3
307
306
  summary: contentful
data/problem.rb DELETED
@@ -1,39 +0,0 @@
1
- require 'pry'
2
- module PlayboyContentful
3
- class ContentType < Contentful::ContentType
4
-
5
- def type_for_field_with_name(name)
6
- fields.each do |field|
7
- return field.type if field.id == name
8
- end
9
- return nil
10
- end
11
-
12
- # Depending on if the field supports full text search, the call needs may
13
- # or may not need to append [eq] to the "fields.<field_name>" filter
14
- def equality_string_for_field_with_name(name)
15
- field_type = type_for_field_with_name(name)
16
- raise "Could not build equality string for #{name} because field was not found." if field_type == nil
17
- return "fields.#{name}" if field_type == "Symbol"
18
- return "fields.#{name}[match]" if field_type == "Text"
19
- "fields.#{name}[eq]"
20
- end
21
-
22
- end
23
- end
24
-
25
- CONTENTFUL_ACCESS_TOKEN="9b3b92d9929dc96744809e3b290bd1c6e6d9f10f7e4e7217ed50524fc0d9728d"
26
- CONTENTFUL_SPACE="t8g5epyvf6nt"
27
-
28
- client = Contentful::Client.new(
29
- access_token: CONTENTFUL_ACCESS_TOKEN,
30
- space: CONTENTFUL_SPACE,
31
- dynamic_entries: :auto,
32
- resource_mapping: {
33
- 'ContentType' => PlayboyContentful::ContentType
34
- }
35
- )
36
-
37
- client.entry('2ks0eTNWoMw0026sUgsMWW')
38
-
39
- client.entries({"content_type"=>"3VZz9HnPy02usuACK08WUw", :limit=>1000})