webflow-ruby 1.1.0 → 1.2.0

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
  SHA256:
3
- metadata.gz: ec3eb0466136191f723a1714584f052984a86a27fc73850646566c1f2bb63652
4
- data.tar.gz: 2c6a7c5206ba2917036cf5d3b5a48665d07bc755d7a7330ccb67b2522dd98300
3
+ metadata.gz: 5dc83a952ee2114334ea80a157dc735172ab6deb2ab6a56cae055285c3add9ce
4
+ data.tar.gz: a8879e57eb4526330df870b12bf0c72f5260e835b942350cc8277a5d36583976
5
5
  SHA512:
6
- metadata.gz: be6e8dc8f380bd15362efbaf1fbb26e2ae05fc43fded354ddb71738a0975a6dda1d83904d6d00199491d8e6000f8e9e02eac5d6a4dab7f487af40b72d8a512dc
7
- data.tar.gz: ae3fe066e832f4a0eb5b44be996a405e3fe705219c8102b5f4c06db2f150babbcc216860178b24db9d6d4591e8595c4ba98bc358afc5b042858c054e85f47064
6
+ metadata.gz: 2cd7ad0daf03fb0e99c5cbd874e47bfe036df62b2f53987d0c955f220064f05617ee0a4423db10ee9c70e89a0d5c05970499300230ade6cfe95fb8168fbbd77a
7
+ data.tar.gz: 1a0030e92317b9253e9d1387dcf4aa1c22cb74890088dcf7af4ca7961730f9640ae8b81a38549c95398516c95a14601b891f7f0eca028615f34d14046865bcac
@@ -1 +1 @@
1
- 2.6.4
1
+ 2.7.1
@@ -1,3 +1,6 @@
1
+ ## 1.2.0
2
+ * [FEATURE] Add patch support for updating items https://github.com/penseo/webflow-ruby/issues/10 😍 @ukd1
3
+
1
4
  ## 1.1.0
2
5
 
3
6
  * [FEATURE] Allow passing a block to `items` that yields the results by page https://github.com/penseo/webflow-ruby/issues/9 😍 @emilesilvis
@@ -1,38 +1,43 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- webflow-ruby (1.0.0)
4
+ webflow-ruby (1.2.0)
5
5
  http
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- addressable (2.6.0)
11
- public_suffix (>= 2.0.2, < 4.0)
12
- byebug (11.0.1)
10
+ addressable (2.7.0)
11
+ public_suffix (>= 2.0.2, < 5.0)
12
+ byebug (11.1.1)
13
13
  crack (0.4.3)
14
14
  safe_yaml (~> 1.0.0)
15
15
  domain_name (0.5.20190701)
16
16
  unf (>= 0.0.5, < 1.0.0)
17
- hashdiff (1.0.0)
18
- http (4.1.1)
17
+ ffi (1.12.2)
18
+ ffi-compiler (1.0.1)
19
+ ffi (>= 1.0.0)
20
+ rake
21
+ hashdiff (1.0.1)
22
+ http (4.4.1)
19
23
  addressable (~> 2.3)
20
24
  http-cookie (~> 1.0)
21
- http-form_data (~> 2.0)
22
- http_parser.rb (~> 0.6.0)
25
+ http-form_data (~> 2.2)
26
+ http-parser (~> 1.2.0)
23
27
  http-cookie (1.0.3)
24
28
  domain_name (~> 0.5)
25
- http-form_data (2.1.1)
26
- http_parser.rb (0.6.0)
27
- minitest (5.11.3)
28
- public_suffix (3.1.1)
29
- rake (12.3.3)
29
+ http-form_data (2.3.0)
30
+ http-parser (1.2.1)
31
+ ffi-compiler (>= 1.0, < 2.0)
32
+ minitest (5.14.0)
33
+ public_suffix (4.0.4)
34
+ rake (13.0.1)
30
35
  safe_yaml (1.0.5)
31
36
  unf (0.1.4)
32
37
  unf_ext
33
- unf_ext (0.0.7.6)
34
- vcr (5.0.0)
35
- webmock (3.6.0)
38
+ unf_ext (0.0.7.7)
39
+ vcr (5.1.0)
40
+ webmock (3.8.3)
36
41
  addressable (>= 2.3.6)
37
42
  crack (>= 0.3.2)
38
43
  hashdiff (>= 0.4.0, < 2.0.0)
@@ -48,6 +53,3 @@ DEPENDENCIES
48
53
  vcr
49
54
  webflow-ruby!
50
55
  webmock
51
-
52
- BUNDLED WITH
53
- 1.17.2
data/README.md CHANGED
@@ -1,7 +1,6 @@
1
1
  # Webflow [![Build Status](https://travis-ci.org/penseo/webflow-ruby.svg?branch=master)](https://travis-ci.org/penseo/webflow-ruby)
2
2
 
3
3
  ## Installation
4
-
5
4
  Add this line to your application's Gemfile:
6
5
 
7
6
  ```ruby
@@ -10,32 +9,31 @@ gem 'webflow-ruby'
10
9
 
11
10
  And then execute:
12
11
 
13
- $ bundle
12
+ ```bash
13
+ $ bundle
14
+ ```
14
15
 
15
16
  Or install it yourself as:
16
17
 
17
- $ gem install webflow-ruby
18
+ ```bash
19
+ $ gem install webflow-ruby
20
+ ```
18
21
 
19
22
  ## Usage
20
-
21
23
  Have a look at the tests, seriously!
22
24
 
23
25
  ### Quick Start
24
26
  ```ruby
25
- client = Webflow::Client.new(WEBFLOW_API_TOKEN)
26
- sites = client.sites
27
+ client = Webflow::Client.new(WEBFLOW_API_TOKEN)
28
+ sites = client.sites
27
29
  ```
28
30
 
29
31
  ## Todo
30
-
31
32
  * Resource mapping, it's plain hashes for now
32
33
  * Proper docs (please look at the tests for now)
33
34
 
34
35
  ## Contributing
35
-
36
36
  Bug reports and pull requests are welcome on GitHub at https://github.com/penseo/webflow-ruby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
37
37
 
38
-
39
38
  ## License
40
-
41
39
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
@@ -39,7 +39,7 @@ module Webflow
39
39
 
40
40
  def publish(site_id, domain_names: nil)
41
41
  domain_names ||= domains(site_id).map { |domain| domain['name'] }
42
- post("/sites/#{site_id}/publish", domains: domain_names)
42
+ post("/sites/#{site_id}/publish", {domains: domain_names})
43
43
  end
44
44
 
45
45
  def collections(site_id)
@@ -95,9 +95,7 @@ module Webflow
95
95
  end
96
96
 
97
97
  def update_item(item, data, live: false)
98
- # FIXME: (PS) looks like the API does not have partial updates...
99
- base = item.reject {|key, _| ['_id', 'published-by', 'published-on', 'created-on', 'created-by', 'updated-by', 'updated-on', '_cid'].include?(key) }
100
- put("/collections/#{item['_cid']}/items/#{item['_id']}", {fields: base.merge(data)}, live: live)
98
+ patch("/collections/#{item['_cid']}/items/#{item['_id']}", {fields: data}, live: live)
101
99
  end
102
100
 
103
101
  def delete_item(item)
@@ -115,9 +113,9 @@ module Webflow
115
113
  request(path, method: :post, params: params, data: data)
116
114
  end
117
115
 
118
- def put(path, data, live: nil)
116
+ def patch(path, data, live: nil)
119
117
  params = { live: 'true' } if live
120
- request(path, method: :put, params: params, data: data)
118
+ request(path, method: :patch, params: params, data: data)
121
119
  end
122
120
 
123
121
  def delete(path)
@@ -1,3 +1,3 @@
1
1
  module Webflow
2
- VERSION = "1.1.0"
2
+ VERSION = "1.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webflow-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - phoet
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-12-09 00:00:00.000000000 Z
11
+ date: 2020-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http
@@ -154,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
154
  - !ruby/object:Gem::Version
155
155
  version: '0'
156
156
  requirements: []
157
- rubygems_version: 3.0.3
157
+ rubygems_version: 3.1.2
158
158
  signing_key:
159
159
  specification_version: 4
160
160
  summary: Webflow API bindings for Ruby