zendesk_api 0.1.10 → 0.1.11
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.
- data/Gemfile +1 -0
- data/Gemfile.lock +9 -3
- data/Readme.md +1 -1
- data/lib/zendesk_api/actions.rb +2 -1
- data/lib/zendesk_api/middleware/response/gzip.rb +2 -0
- data/lib/zendesk_api/resources.rb +5 -1
- data/lib/zendesk_api/version.rb +1 -1
- data/spec/resource_spec.rb +2 -2
- metadata +2 -2
    
        data/Gemfile
    CHANGED
    
    | @@ -3,5 +3,6 @@ source 'https://rubygems.org' | |
| 3 3 | 
             
            gem "simplecov", :platforms => :ruby_19, :group => :development
         | 
| 4 4 | 
             
            gem "jruby-openssl", :platforms => :jruby
         | 
| 5 5 | 
             
            gem "hashie", :git => "git://github.com/intridea/hashie.git"
         | 
| 6 | 
            +
            gem "multipart-post", :git => "git://github.com/steved555/multipart-post.git"
         | 
| 6 7 |  | 
| 7 8 | 
             
            gemspec
         | 
    
        data/Gemfile.lock
    CHANGED
    
    | @@ -4,10 +4,16 @@ GIT | |
| 4 4 | 
             
              specs:
         | 
| 5 5 | 
             
                hashie (2.0.0.beta)
         | 
| 6 6 |  | 
| 7 | 
            +
            GIT
         | 
| 8 | 
            +
              remote: git://github.com/steved555/multipart-post.git
         | 
| 9 | 
            +
              revision: f5bc9450fad3895542a7cf18dbdd9af4ba5ab031
         | 
| 10 | 
            +
              specs:
         | 
| 11 | 
            +
                multipart-post (1.1.5)
         | 
| 12 | 
            +
             | 
| 7 13 | 
             
            PATH
         | 
| 8 14 | 
             
              remote: .
         | 
| 9 15 | 
             
              specs:
         | 
| 10 | 
            -
                zendesk_api (0.1. | 
| 16 | 
            +
                zendesk_api (0.1.11)
         | 
| 11 17 | 
             
                  faraday (>= 0.8.0)
         | 
| 12 18 | 
             
                  faraday_middleware (>= 0.8.7)
         | 
| 13 19 | 
             
                  hashie
         | 
| @@ -25,13 +31,12 @@ GEM | |
| 25 31 | 
             
                diff-lcs (1.1.3)
         | 
| 26 32 | 
             
                faraday (0.8.4)
         | 
| 27 33 | 
             
                  multipart-post (~> 1.1)
         | 
| 28 | 
            -
                faraday_middleware (0. | 
| 34 | 
            +
                faraday_middleware (0.9.0)
         | 
| 29 35 | 
             
                  faraday (>= 0.7.4, < 0.9)
         | 
| 30 36 | 
             
                inflection (1.0.0)
         | 
| 31 37 | 
             
                json (1.7.5)
         | 
| 32 38 | 
             
                mime-types (1.19)
         | 
| 33 39 | 
             
                multi_json (1.3.6)
         | 
| 34 | 
            -
                multipart-post (1.1.5)
         | 
| 35 40 | 
             
                rake (0.9.2.2)
         | 
| 36 41 | 
             
                rspec (2.11.0)
         | 
| 37 42 | 
             
                  rspec-core (~> 2.11.0)
         | 
| @@ -58,6 +63,7 @@ DEPENDENCIES | |
| 58 63 | 
             
              bump
         | 
| 59 64 | 
             
              hashie!
         | 
| 60 65 | 
             
              jruby-openssl
         | 
| 66 | 
            +
              multipart-post!
         | 
| 61 67 | 
             
              rake
         | 
| 62 68 | 
             
              rspec
         | 
| 63 69 | 
             
              simplecov
         | 
    
        data/Readme.md
    CHANGED
    
    | @@ -187,7 +187,7 @@ ticket.requester # => #<ZendeskAPI::User id=...> | |
| 187 187 | 
             
            ```
         | 
| 188 188 |  | 
| 189 189 | 
             
            Currently, this feature is limited to only a few resources and their associations.
         | 
| 190 | 
            -
            They are documented on [developer.zendesk.com](http://developer.zendesk.com/documentation/rest_api/introduction.html#side-loading).
         | 
| 190 | 
            +
            They are documented on [developer.zendesk.com](http://developer.zendesk.com/documentation/rest_api/introduction.html#side-loading-\(beta\)).
         | 
| 191 191 |  | 
| 192 192 | 
             
            ### Special case: Custom resources paths
         | 
| 193 193 |  | 
    
        data/lib/zendesk_api/actions.rb
    CHANGED
    
    | @@ -192,7 +192,8 @@ module ZendeskAPI | |
| 192 192 | 
             
                  # @param [Hash] attributes The attributes to update. Default to {} 
         | 
| 193 193 | 
             
                  def update(client, attributes = {})
         | 
| 194 194 | 
             
                    ZendeskAPI::Client.check_deprecated_namespace_usage attributes, singular_resource_name
         | 
| 195 | 
            -
                    resource = new(client, attributes)
         | 
| 195 | 
            +
                    resource = new(client, :id => attributes.delete(:id))
         | 
| 196 | 
            +
                    resource.attributes.merge!(attributes)
         | 
| 196 197 | 
             
                    resource.save
         | 
| 197 198 | 
             
                  end
         | 
| 198 199 |  | 
| @@ -198,7 +198,10 @@ module ZendeskAPI | |
| 198 198 | 
             
              end
         | 
| 199 199 |  | 
| 200 200 | 
             
              class Ticket < Resource
         | 
| 201 | 
            -
                class Audit < DataResource | 
| 201 | 
            +
                class Audit < DataResource
         | 
| 202 | 
            +
                  # need this to support SideLoading
         | 
| 203 | 
            +
                  has :author, :class => User
         | 
| 204 | 
            +
                end
         | 
| 202 205 |  | 
| 203 206 | 
             
                has :requester, :class => User, :inline => :create
         | 
| 204 207 | 
             
                has :submitter, :class => User
         | 
| @@ -260,6 +263,7 @@ module ZendeskAPI | |
| 260 263 | 
             
              end
         | 
| 261 264 |  | 
| 262 265 | 
             
              class View < ReadResource
         | 
| 266 | 
            +
                has_many :tickets, :class => Ticket
         | 
| 263 267 | 
             
                has_many :rows, :class => ViewRow, :path => "execute"
         | 
| 264 268 | 
             
                has :execution, :class => ViewExecution
         | 
| 265 269 |  | 
    
        data/lib/zendesk_api/version.rb
    CHANGED
    
    
    
        data/spec/resource_spec.rb
    CHANGED
    
    | @@ -7,11 +7,11 @@ describe ZendeskAPI::Resource do | |
| 7 7 | 
             
                  subject { ZendeskAPI::TestResource }
         | 
| 8 8 |  | 
| 9 9 | 
             
                  before(:each) do
         | 
| 10 | 
            -
                    stub_json_request(:put, %r{test_resources/#{id}})
         | 
| 10 | 
            +
                    stub_json_request(:put, %r{test_resources/#{id}}).with(:body => json({ :test_resource => { :test => :hello } }))
         | 
| 11 11 | 
             
                  end
         | 
| 12 12 |  | 
| 13 13 | 
             
                  it "should return instance of resource" do
         | 
| 14 | 
            -
                    subject.update(client, :id => id).should be_true
         | 
| 14 | 
            +
                    subject.update(client, :id => id, :test => :hello).should be_true
         | 
| 15 15 | 
             
                  end
         | 
| 16 16 |  | 
| 17 17 | 
             
                  context "with client error" do
         | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: zendesk_api
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.1. | 
| 4 | 
            +
              version: 0.1.11
         | 
| 5 5 | 
             
              prerelease: 
         | 
| 6 6 | 
             
            platform: ruby
         | 
| 7 7 | 
             
            authors:
         | 
| @@ -10,7 +10,7 @@ authors: | |
| 10 10 | 
             
            autorequire: 
         | 
| 11 11 | 
             
            bindir: bin
         | 
| 12 12 | 
             
            cert_chain: []
         | 
| 13 | 
            -
            date: 2012-11- | 
| 13 | 
            +
            date: 2012-11-09 00:00:00.000000000 Z
         | 
| 14 14 | 
             
            dependencies:
         | 
| 15 15 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 16 16 | 
             
              name: bump
         |