panda_doc 0.0.1 → 0.0.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -1
- data/README.md +10 -0
- data/lib/panda_doc/api_client.rb +3 -0
- data/lib/panda_doc/configuration.rb +1 -0
- data/lib/panda_doc/responses/error.rb +6 -1
- data/lib/panda_doc/version.rb +1 -1
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 4621a6a8a2efab6f5b41e286093f2012837c9b90
         | 
| 4 | 
            +
              data.tar.gz: 3dab341642f68b7992741d399ca47a1a429e41e1
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: f4501378b6c81768d70d80430ce558d41c2ee674200a7396560e60e5b1104d3608baf006962e1f022c06043927dd2f6db5f35596ac97b9205706e6366505bf03
         | 
| 7 | 
            +
              data.tar.gz: 592cb6a5b941e3e4a59e73c8a088cd0c28b210a9c91ab00da758e078c5706aa91fea3bd82d826ebbdd102f347f97d0e89aa98fbf854e36b9566f860f6ddf71aa
         | 
    
        data/CHANGELOG.md
    CHANGED
    
    | @@ -4,8 +4,25 @@ All notable changes to this project will be documented in this file. | |
| 4 4 |  | 
| 5 5 | 
             
            ## [Unreleased]
         | 
| 6 6 |  | 
| 7 | 
            +
            ## 0.0.2 (2016-02-13)
         | 
| 8 | 
            +
             | 
| 9 | 
            +
            New:
         | 
| 10 | 
            +
             | 
| 11 | 
            +
            - Introduce `logger` configuration's option to debug requests/responses.
         | 
| 12 | 
            +
             | 
| 13 | 
            +
              ```ruby
         | 
| 14 | 
            +
              PandaDoc.configure do |config|
         | 
| 15 | 
            +
                config.logger = Logger.new(STDOUT)
         | 
| 16 | 
            +
              end
         | 
| 17 | 
            +
              ```
         | 
| 18 | 
            +
             | 
| 19 | 
            +
            Fixes:
         | 
| 20 | 
            +
             | 
| 21 | 
            +
            - Add support for simple error structure.
         | 
| 22 | 
            +
             | 
| 7 23 | 
             
            ## 0.0.1 (2016-02-03)
         | 
| 8 24 |  | 
| 9 25 | 
             
            - Initial release
         | 
| 10 26 |  | 
| 11 | 
            -
            [Unreleased]: https://github.com/opti/panda_doc/compare/v0.0. | 
| 27 | 
            +
            [Unreleased]: https://github.com/opti/panda_doc/compare/v0.0.2...HEAD
         | 
| 28 | 
            +
            [0.0.2]: https://github.com/opti/panda_doc/compare/v0.0.1...v0.0.2
         | 
    
        data/README.md
    CHANGED
    
    | @@ -123,6 +123,16 @@ else | |
| 123 123 | 
             
            end
         | 
| 124 124 | 
             
            ```
         | 
| 125 125 |  | 
| 126 | 
            +
            #### Debuging
         | 
| 127 | 
            +
             | 
| 128 | 
            +
            You can configure a logger if you need to debug your requests/responses
         | 
| 129 | 
            +
             | 
| 130 | 
            +
            ```ruby
         | 
| 131 | 
            +
            PandaDoc.configure do |config|
         | 
| 132 | 
            +
              config.logger = Logger.new(STDOUT)
         | 
| 133 | 
            +
            end
         | 
| 134 | 
            +
            ```
         | 
| 135 | 
            +
             | 
| 126 136 | 
             
            ## Development
         | 
| 127 137 |  | 
| 128 138 | 
             
            After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
         | 
    
        data/lib/panda_doc/api_client.rb
    CHANGED
    
    | @@ -17,6 +17,9 @@ module PandaDoc | |
| 17 17 | 
             
                  @connection = Faraday.new(PandaDoc.configuration.endpoint) do |conn|
         | 
| 18 18 | 
             
                    conn.authorization :Bearer, PandaDoc.configuration.access_token
         | 
| 19 19 | 
             
                    conn.request       :json
         | 
| 20 | 
            +
                    if PandaDoc.configuration.logger
         | 
| 21 | 
            +
                      conn.response    :logger, PandaDoc.configuration.logger, bodies: true
         | 
| 22 | 
            +
                    end
         | 
| 20 23 | 
             
                    conn.response      :json, content_type: /\bjson$/
         | 
| 21 24 | 
             
                    conn.adapter       Faraday.default_adapter
         | 
| 22 25 | 
             
                  end
         | 
| @@ -5,7 +5,12 @@ module PandaDoc | |
| 5 5 |  | 
| 6 6 | 
             
                  property :type
         | 
| 7 7 |  | 
| 8 | 
            -
                   | 
| 8 | 
            +
                  property :message, as: :detail,
         | 
| 9 | 
            +
                    skip_parse: ->(doc:, **) { doc["detail"].is_a?(Hash) }
         | 
| 10 | 
            +
             | 
| 11 | 
            +
                  nested :detail, skip_parse: ->(doc:, **) {
         | 
| 12 | 
            +
                    doc["detail"].is_a?(String)
         | 
| 13 | 
            +
                  } do
         | 
| 9 14 | 
             
                    property :message
         | 
| 10 15 | 
             
                    property :code
         | 
| 11 16 | 
             
                  end
         | 
    
        data/lib/panda_doc/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: panda_doc
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.0. | 
| 4 | 
            +
              version: 0.0.2
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Igor Pstyga
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2016-02- | 
| 11 | 
            +
            date: 2016-02-14 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: faraday
         |