procore 0.6.8 → 0.6.9
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 +6 -0
- data/README.md +7 -5
- data/lib/procore/client.rb +1 -1
- data/lib/procore/requestable.rb +30 -2
- data/lib/procore/version.rb +1 -1
- data/procore.gemspec +1 -1
- metadata +5 -5
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 5a122d8e74f07636c87c3db3bfedb0836f813e31c1e8a3b6df25f84da131f06a
         | 
| 4 | 
            +
              data.tar.gz: 58b335464bf7b9c1bc7284e1651fc05d08796d348da464d6d327d8c0b8243a2a
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 825662dbe28de8510a825cfd7e512050b7bf09da321a952587d8c243e05d71ba7b61af0fbc668334696ea0a61ddf065174055b6df38875e51c2b7735ac498110
         | 
| 7 | 
            +
              data.tar.gz: f329ffd5f5cb34aa5571fc1f79b4a24b13a1c5ec25f981bef7d4be7e2e45fecf789792d971c00c287f534dea30cdcfadbe7d4689fe49d277752aa8a22b3bd692
         | 
    
        data/CHANGELOG.md
    CHANGED
    
    
    
        data/README.md
    CHANGED
    
    | @@ -21,11 +21,13 @@ Stores automatically manage tokens for you - refreshing, revoking and storage | |
| 21 21 | 
             
            are abstracted away to make your code as simple as possible. There are several
         | 
| 22 22 | 
             
            different [types of stores](#stores) available to you.
         | 
| 23 23 |  | 
| 24 | 
            -
            The  | 
| 24 | 
            +
            The Client class exposes `#get`, `#post`, `#put`, `#patch` and `#delete` methods
         | 
| 25 | 
            +
            to you.
         | 
| 25 26 |  | 
| 26 27 | 
             
            ```ruby
         | 
| 27 28 | 
             
            get(path, query = {})
         | 
| 28 29 | 
             
            post(path, body = {}, options = {})
         | 
| 30 | 
            +
            put(path, body = {}, options = {})
         | 
| 29 31 | 
             
            patch(path, body = {}, options = {})
         | 
| 30 32 | 
             
            delete(path, query = {})
         | 
| 31 33 | 
             
            ```
         | 
| @@ -104,7 +106,7 @@ begin | |
| 104 106 | 
             
              client.get("projects")
         | 
| 105 107 |  | 
| 106 108 | 
             
            rescue Procore::RateLimitError => e
         | 
| 107 | 
            -
              # Raised when a token reaches  | 
| 109 | 
            +
              # Raised when a token reaches its request limit for the current time period.
         | 
| 108 110 | 
             
              # If you are receiving this error then you are making too many requests
         | 
| 109 111 | 
             
              # against the Procore API.
         | 
| 110 112 |  | 
| @@ -112,7 +114,7 @@ rescue Procore::NotFoundError => e | |
| 112 114 | 
             
              # Raised when the request 404's
         | 
| 113 115 |  | 
| 114 116 | 
             
            rescue Procore::InvalidRequestError => e
         | 
| 115 | 
            -
              # Raised when the request is incorrectly  | 
| 117 | 
            +
              # Raised when the request is incorrectly formatted. Possible causes: missing
         | 
| 116 118 | 
             
              # required parameters or sending a request to access a non-existent resource.
         | 
| 117 119 |  | 
| 118 120 | 
             
            rescue Procore::OAuthError => e
         | 
| @@ -128,7 +130,7 @@ rescue Procore::APIConnectionError => e | |
| 128 130 | 
             
              # Procore is down or the network is doing something funny.
         | 
| 129 131 |  | 
| 130 132 | 
             
            rescue Procore::ServerError => e
         | 
| 131 | 
            -
              # Raised when a Procore endpoint returns a  | 
| 133 | 
            +
              # Raised when a Procore endpoint returns a 5xx response code.
         | 
| 132 134 |  | 
| 133 135 | 
             
            rescue Procore::Error => e
         | 
| 134 136 | 
             
              # Generic catch all error.
         | 
| @@ -300,7 +302,7 @@ Options: `key`: Unique identifier to an access token | |
| 300 302 | 
             
            For applications which want to store access tokens in Redis. There's two
         | 
| 301 303 | 
             
            required options, `redis` which is an instance of a Redis connection, and `key`
         | 
| 302 304 | 
             
            which is a unique key which will be used to save / retrieve an access token.
         | 
| 303 | 
            -
             | 
| 305 | 
            +
            The key will usually be the id of the current user.
         | 
| 304 306 |  | 
| 305 307 | 
             
            ```ruby
         | 
| 306 308 | 
             
            store = Procore::Auth::Stores::Redis.new(redis: Redis.new, key: current_user.id)
         | 
    
        data/lib/procore/client.rb
    CHANGED
    
    | @@ -3,7 +3,7 @@ require "procore/requestable" | |
| 3 3 | 
             
            module Procore
         | 
| 4 4 | 
             
              # Main class end users interact with. An instance of a client can call out
         | 
| 5 5 | 
             
              # the Procore API using methods matching standard HTTP verbs #get, #post,
         | 
| 6 | 
            -
              # #patch, #delete.
         | 
| 6 | 
            +
              # #put, #patch, #delete.
         | 
| 7 7 | 
             
              #
         | 
| 8 8 | 
             
              # @example Creating a new client:
         | 
| 9 9 | 
             
              #   store = Procore::Auth::Stores::Session.new(session: session)
         | 
    
        data/lib/procore/requestable.rb
    CHANGED
    
    | @@ -1,8 +1,8 @@ | |
| 1 1 | 
             
            require "httparty"
         | 
| 2 2 |  | 
| 3 3 | 
             
            module Procore
         | 
| 4 | 
            -
              # Module which defines HTTP verbs GET, POST, PATCH and DELETE. Is | 
| 5 | 
            -
              # Client. Has support for Idempotency Tokens on POST and PATCH.
         | 
| 4 | 
            +
              # Module which defines HTTP verbs GET, POST, PUT, PATCH and DELETE. Is
         | 
| 5 | 
            +
              # included in Client. Has support for Idempotency Tokens on POST and PATCH.
         | 
| 6 6 | 
             
              #
         | 
| 7 7 | 
             
              # @example Using #get:
         | 
| 8 8 | 
             
              #   client.get("my_open_items", per_page: 5)
         | 
| @@ -63,12 +63,40 @@ module Procore | |
| 63 63 | 
             
                  end
         | 
| 64 64 | 
             
                end
         | 
| 65 65 |  | 
| 66 | 
            +
                # @param path [String] URL path
         | 
| 67 | 
            +
                # @param body [Hash] Body parameters to send with the request
         | 
| 68 | 
            +
                # @param options [Hash} Extra request options
         | 
| 69 | 
            +
                # TODO Add description for idempotency key
         | 
| 70 | 
            +
                #
         | 
| 71 | 
            +
                # @example Usage
         | 
| 72 | 
            +
                #   client.put("dashboards/1/users", [1,2,3])
         | 
| 73 | 
            +
                #
         | 
| 74 | 
            +
                # @return [Response]
         | 
| 75 | 
            +
                def put(path, body = {}, options = {})
         | 
| 76 | 
            +
                  Util.log_info(
         | 
| 77 | 
            +
                    "API Request Initiated",
         | 
| 78 | 
            +
                    path: "#{base_api_path}/#{path}",
         | 
| 79 | 
            +
                    method: "PUT",
         | 
| 80 | 
            +
                    body: body.to_s,
         | 
| 81 | 
            +
                  )
         | 
| 82 | 
            +
             | 
| 83 | 
            +
                  with_response_handling do
         | 
| 84 | 
            +
                    HTTParty.put(
         | 
| 85 | 
            +
                      "#{base_api_path}/#{path}",
         | 
| 86 | 
            +
                      body: body.to_json,
         | 
| 87 | 
            +
                      headers: headers(options),
         | 
| 88 | 
            +
                      timeout: Procore.configuration.timeout,
         | 
| 89 | 
            +
                    )
         | 
| 90 | 
            +
                  end
         | 
| 91 | 
            +
                end
         | 
| 92 | 
            +
             | 
| 66 93 | 
             
                # @param path [String] URL path
         | 
| 67 94 | 
             
                # @param body [Hash] Body parameters to send with the request
         | 
| 68 95 | 
             
                # @param options [Hash} Extra request options
         | 
| 69 96 | 
             
                # TODO Add description for idempotency token
         | 
| 70 97 | 
             
                # @option options [String] :idempotency_token
         | 
| 71 98 | 
             
                #
         | 
| 99 | 
            +
                # @example Usage
         | 
| 72 100 | 
             
                #   client.patch("users/1", { name: "Updated" }, { idempotency_token: "key" })
         | 
| 73 101 | 
             
                #
         | 
| 74 102 | 
             
                # @return [Response]
         | 
    
        data/lib/procore/version.rb
    CHANGED
    
    
    
        data/procore.gemspec
    CHANGED
    
    | @@ -34,6 +34,6 @@ Gem::Specification.new do |spec| | |
| 34 34 | 
             
              spec.add_development_dependency "sqlite3"
         | 
| 35 35 | 
             
              spec.add_development_dependency "webmock"
         | 
| 36 36 |  | 
| 37 | 
            -
              spec.add_dependency "httparty", "~> 0. | 
| 37 | 
            +
              spec.add_dependency "httparty", "~> 0.16"
         | 
| 38 38 | 
             
              spec.add_dependency "oauth2", "~> 1.4"
         | 
| 39 39 | 
             
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: procore
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.6. | 
| 4 | 
            +
              version: 0.6.9
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Procore Engineering
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: exe
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2018- | 
| 11 | 
            +
            date: 2018-02-16 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: actionpack
         | 
| @@ -170,14 +170,14 @@ dependencies: | |
| 170 170 | 
             
                requirements:
         | 
| 171 171 | 
             
                - - "~>"
         | 
| 172 172 | 
             
                  - !ruby/object:Gem::Version
         | 
| 173 | 
            -
                    version: '0. | 
| 173 | 
            +
                    version: '0.16'
         | 
| 174 174 | 
             
              type: :runtime
         | 
| 175 175 | 
             
              prerelease: false
         | 
| 176 176 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 177 177 | 
             
                requirements:
         | 
| 178 178 | 
             
                - - "~>"
         | 
| 179 179 | 
             
                  - !ruby/object:Gem::Version
         | 
| 180 | 
            -
                    version: '0. | 
| 180 | 
            +
                    version: '0.16'
         | 
| 181 181 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 182 182 | 
             
              name: oauth2
         | 
| 183 183 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -247,7 +247,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 247 247 | 
             
                  version: '0'
         | 
| 248 248 | 
             
            requirements: []
         | 
| 249 249 | 
             
            rubyforge_project: 
         | 
| 250 | 
            -
            rubygems_version: 2.7. | 
| 250 | 
            +
            rubygems_version: 2.7.5
         | 
| 251 251 | 
             
            signing_key: 
         | 
| 252 252 | 
             
            specification_version: 4
         | 
| 253 253 | 
             
            summary: Procore Ruby Gem
         |