buttercms-ruby 1.1.2 → 1.1.3

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: a08c03f736a26ea67182f4c26a75e24956205029
4
- data.tar.gz: 9676e9dcf0b6bc8340aeff3d0d2ab2a8b069f539
3
+ metadata.gz: fd0cec560c6a8cbc301cb66c4c7c7ce08dd7fbc5
4
+ data.tar.gz: c338d395d4ca2f4e7dfaa0ba2d64f7aab01f2571
5
5
  SHA512:
6
- metadata.gz: df289c70a10a0bea0cc8590fddfd60d39c2647693c22aeb6fef9b9c20c5240b5fe26685688d16b0f7eb6688031cfee31f234094cdbbce369d35ec15a2e9ecf56
7
- data.tar.gz: 6f0271691a45ccc111d87e42b856b0e7a6988ee2e27ef835d373b75ea271f364625375e903893515d009a69fd4282b66d3b14ad5042830eeb83814ac224e0b5e
6
+ metadata.gz: 6337314aac5222e1e5c34b1aa4559c53b2bfd63ac59c91e332a39e8d0b7174824a4f790369e1a54a7e198ec373463c177c9028e2f165437c307bf9f606b40eb0
7
+ data.tar.gz: f697193937a8942f1487e0c374869cf610959521912c62bb492c046c5720212a5cb080fd1fcbb717670d3498499255cdec81dcaf2225b668be8a0840c1d6be75
data/README.md CHANGED
@@ -57,6 +57,14 @@ content = ButterCMS::Content.fetch([
57
57
  ])
58
58
  ```
59
59
 
60
+ ## Localization
61
+
62
+ Setup locales in the ButterCMS dashboard and fetch localized content using the `locale` option:
63
+
64
+ ```ruby
65
+ ButterCMS::Content.fetch(['landing_pages'], locale: :es)
66
+ ```
67
+
60
68
  ## Fallback Data Store
61
69
 
62
70
  This client supports automatic fallback to a data store when API requests fail. When a data store is set, on every successful API request the response is written to the data store. When a subsequent API request fails, the client attempts to fallback to the value in the data store. Currently, Redis and YAML Store are supported.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.2
1
+ 1.1.3
@@ -70,7 +70,6 @@ module ButterCMS
70
70
  base_options[:test] = 1
71
71
  end
72
72
 
73
-
74
73
  response = HTTParty.get(
75
74
  @api_url + path,
76
75
  headers: {"User-Agent" => "ButterCMS/#{ButterCMS::VERSION}"},
@@ -12,8 +12,10 @@ module ButterCMS
12
12
  "#<#{self.class}:0x#{self.object_id.to_s(16)}#{id_string}> JSON: " + JSON.pretty_generate(@json)
13
13
  end
14
14
 
15
- def self.fetch(keys = [])
16
- response = ButterCMS.request("/content", {keys: keys.join(',')})
15
+ def self.fetch(keys = [], options = {})
16
+ params = {keys: keys.join(',')}.merge(options)
17
+
18
+ response = ButterCMS.request("/content", params)
17
19
 
18
20
  self.new(response)
19
21
  end
@@ -1,3 +1,3 @@
1
1
  module ButterCMS
2
- VERSION = '1.1.2'
2
+ VERSION = '1.1.3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: buttercms-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - ButterCMS
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-17 00:00:00.000000000 Z
11
+ date: 2017-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -134,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
134
  version: '0'
135
135
  requirements: []
136
136
  rubyforge_project:
137
- rubygems_version: 2.2.3
137
+ rubygems_version: 2.4.5.1
138
138
  signing_key:
139
139
  specification_version: 4
140
140
  summary: A simple Ruby client for the buttercms.com REST API