webflow-ruby 1.1.0 → 1.2.0
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.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/CHANGELOG.md +3 -0
- data/Gemfile.lock +21 -19
- data/README.md +8 -10
- data/lib/webflow/client.rb +4 -6
- data/lib/webflow/version.rb +1 -1
- metadata +3 -3
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 5dc83a952ee2114334ea80a157dc735172ab6deb2ab6a56cae055285c3add9ce
         | 
| 4 | 
            +
              data.tar.gz: a8879e57eb4526330df870b12bf0c72f5260e835b942350cc8277a5d36583976
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 2cd7ad0daf03fb0e99c5cbd874e47bfe036df62b2f53987d0c955f220064f05617ee0a4423db10ee9c70e89a0d5c05970499300230ade6cfe95fb8168fbbd77a
         | 
| 7 | 
            +
              data.tar.gz: 1a0030e92317b9253e9d1387dcf4aa1c22cb74890088dcf7af4ca7961730f9640ae8b81a38549c95398516c95a14601b891f7f0eca028615f34d14046865bcac
         | 
    
        data/.ruby-version
    CHANGED
    
    | @@ -1 +1 @@ | |
| 1 | 
            -
            2. | 
| 1 | 
            +
            2.7.1
         | 
    
        data/CHANGELOG.md
    CHANGED
    
    | @@ -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
         | 
    
        data/Gemfile.lock
    CHANGED
    
    | @@ -1,38 +1,43 @@ | |
| 1 1 | 
             
            PATH
         | 
| 2 2 | 
             
              remote: .
         | 
| 3 3 | 
             
              specs:
         | 
| 4 | 
            -
                webflow-ruby (1. | 
| 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. | 
| 11 | 
            -
                  public_suffix (>= 2.0.2, <  | 
| 12 | 
            -
                byebug (11. | 
| 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 | 
            -
                 | 
| 18 | 
            -
                 | 
| 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. | 
| 22 | 
            -
                   | 
| 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. | 
| 26 | 
            -
                 | 
| 27 | 
            -
             | 
| 28 | 
            -
                 | 
| 29 | 
            -
                 | 
| 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. | 
| 34 | 
            -
                vcr (5. | 
| 35 | 
            -
                webmock (3. | 
| 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 [](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 | 
            -
             | 
| 12 | 
            +
            ```bash
         | 
| 13 | 
            +
            $ bundle
         | 
| 14 | 
            +
            ```
         | 
| 14 15 |  | 
| 15 16 | 
             
            Or install it yourself as:
         | 
| 16 17 |  | 
| 17 | 
            -
             | 
| 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 | 
            -
             | 
| 26 | 
            -
             | 
| 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).
         | 
    
        data/lib/webflow/client.rb
    CHANGED
    
    | @@ -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 | 
            -
                   | 
| 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  | 
| 116 | 
            +
                def patch(path, data, live: nil)
         | 
| 119 117 | 
             
                  params = { live: 'true' } if live
         | 
| 120 | 
            -
                  request(path, method: : | 
| 118 | 
            +
                  request(path, method: :patch, params: params, data: data)
         | 
| 121 119 | 
             
                end
         | 
| 122 120 |  | 
| 123 121 | 
             
                def delete(path)
         | 
    
        data/lib/webflow/version.rb
    CHANGED
    
    
    
        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. | 
| 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:  | 
| 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. | 
| 157 | 
            +
            rubygems_version: 3.1.2
         | 
| 158 158 | 
             
            signing_key: 
         | 
| 159 159 | 
             
            specification_version: 4
         | 
| 160 160 | 
             
            summary: Webflow API bindings for Ruby
         |