zendesk_api 1.3.2 → 1.3.4

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
  SHA1:
3
- metadata.gz: 4cde723abc0cc58787561891e1538dc454f0a4ea
4
- data.tar.gz: d8b0bfe0638257feb439ee6e9c2007797af5cc04
3
+ metadata.gz: f96cd9aa680347c9634cc608bc65f7affac55544
4
+ data.tar.gz: 0e5fafac15dbfe359c94b57ee2f124ae6795dd39
5
5
  SHA512:
6
- metadata.gz: 2d3dded2e4e03b69ddd6d582d602be3079d432ccbeeb2f8e78ab1a8807d509dbdf74b15a9dc1f59fdba129da188d1e2ee8c6d0559591af448a476734cd22d47e
7
- data.tar.gz: 6d647eae9f4b56ba947cb7c0a761f1d50cbd376c55865f5cbf31a0c00196649b166c476fa5e3e6a40cf8630034f754fedef44ff5ad67c3fdbe20de4cdbf4024e
6
+ metadata.gz: e0140e3e10c944a83b1edd18c2b11283d80dbbc23f6e45be3697d0cf480fd8bf8349b79e4394873091ae44e742436954817bba12c3ef41768d8b28a0c1371413
7
+ data.tar.gz: 9c32f20050b1d1d2b1531abb11cd52d9f197be15bd6a17c97598bd38721bbbce97faac675fa66cb233373ee6c672d4faea0a9fe19576f9655619ecb06025b4f9
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- zendesk_api (1.3.2)
4
+ zendesk_api (1.3.4)
5
5
  faraday (~> 0.9)
6
6
  hashie (>= 1.2)
7
7
  inflection
data/README.md CHANGED
@@ -344,12 +344,12 @@ ZendeskAPI::App.destroy!(client, :id => 123)
344
344
  #### Installing an App
345
345
 
346
346
  ```ruby
347
- install = ZendeskAPI::App::Installation.new(client, :app_id => 123)
347
+ install = ZendeskAPI::AppInstallation.new(client, :app_id => 123)
348
348
  install.save!
349
349
 
350
350
  client.apps.installations.create!(:app_id => 123)
351
351
 
352
- ZendeskAPI::App::Installation.create!(client, :app_id => 123)
352
+ ZendeskAPI::AppInstallation.create!(client, :app_id => 123)
353
353
  ```
354
354
 
355
355
  #### List Installations
@@ -364,11 +364,11 @@ apps.fetch!
364
364
  ```ruby
365
365
  client.app.installations.update!(:id => 123, :settings => { :title => "My New Name" })
366
366
 
367
- install = ZendeskAPI::App::Installation.new(client, :id => 123)
367
+ install = ZendeskAPI::AppInstallation.new(client, :id => 123)
368
368
  install.settings = { :title => "My New Name" }
369
369
  install.save!
370
370
 
371
- ZendeskAPI::App::Installation.update!(client, :id => 123, :settings => { :title => "My New Name" })
371
+ ZendeskAPI::AppInstallation.update!(client, :id => 123, :settings => { :title => "My New Name" })
372
372
  ```
373
373
 
374
374
  #### Delete Installation
@@ -376,10 +376,10 @@ ZendeskAPI::App::Installation.update!(client, :id => 123, :settings => { :title
376
376
  ```ruby
377
377
  client.app.installations.destroy!(:id => 123)
378
378
 
379
- install = ZendeskAPI::App::Installation.new(client, :id => 123)
379
+ install = ZendeskAPI::AppInstallation.new(client, :id => 123)
380
380
  install.destroy!
381
381
 
382
- ZendeskAPI::App::Installation.destroy!(client, :id => 123)
382
+ ZendeskAPI::AppInstallation.destroy!(client, :id => 123)
383
383
  ```
384
384
 
385
385
 
@@ -38,6 +38,7 @@ module ZendeskAPI
38
38
  else
39
39
  if defined?(ActionDispatch) && file.is_a?(ActionDispatch::Http::UploadedFile)
40
40
  path = file.tempfile.path
41
+ mime_type = file.content_type
41
42
  else
42
43
  warn "WARNING: Passed invalid filename #{file} of type #{file.class} to upload"
43
44
  end
@@ -49,7 +50,7 @@ module ZendeskAPI
49
50
  hash = hash[key]
50
51
  end
51
52
 
52
- mime_type = MIME::Types.type_for(path).first || "application/octet-stream"
53
+ mime_type ||= MIME::Types.type_for(path).first || "application/octet-stream"
53
54
 
54
55
  hash[:filename] ||= if file.respond_to?(:original_filename)
55
56
  file.original_filename
@@ -543,6 +543,14 @@ module ZendeskAPI
543
543
  class PhoneNumber < Resource
544
544
  namespace "channels/voice"
545
545
  end
546
+
547
+ class Greeting < Resource
548
+ namespace "channels/voice"
549
+ end
550
+
551
+ class GreetingCategory < Resource
552
+ namespace "channels/voice"
553
+ end
546
554
  end
547
555
 
548
556
  class TicketForm < Resource
@@ -1,3 +1,3 @@
1
1
  module ZendeskAPI
2
- VERSION = "1.3.2"
2
+ VERSION = "1.3.4"
3
3
  end
@@ -240,7 +240,9 @@ describe ZendeskAPI::Client do
240
240
  end
241
241
 
242
242
  it "manages namespace correctly" do
243
- ZendeskAPI::Voice::PhoneNumber.new(subject, {}).path.should match(/channels\/voice\/phone_numbers/)
243
+ client.phone_numbers.path.should match(/channels\/voice\/phone_numbers/)
244
+ client.greetings.path.should match(/channels\/voice\/greetings/)
245
+ client.greeting_categories.path.should match(/channels\/voice\/greeting_categories/)
244
246
  end
245
247
  end
246
248
  end
@@ -10,7 +10,7 @@ describe ZendeskAPI::Middleware::Request::Upload do
10
10
  end
11
11
 
12
12
  it "should handle body with no file" do
13
- subject.call(:body => {})[:body].should == {}
13
+ subject.call(:body => {})[:body].should == {}
14
14
  end
15
15
 
16
16
  it "should handle invalid types" do
@@ -58,7 +58,7 @@ describe ZendeskAPI::Middleware::Request::Upload do
58
58
 
59
59
  context "with an ActionDispatch::Http::UploadedFile" do
60
60
  before(:each) do
61
- @upload = ActionDispatch::Http::UploadedFile.new(:filename => "hello", :tempfile => Tempfile.new(File.basename(filename)))
61
+ @upload = ActionDispatch::Http::UploadedFile.new(:filename => "hello.jpg", :tempfile => Tempfile.new(File.basename(filename)))
62
62
  @env = subject.call(:body => { :file => @upload })
63
63
  end
64
64
 
@@ -73,6 +73,14 @@ describe ZendeskAPI::Middleware::Request::Upload do
73
73
  it "should add filename if none exist" do
74
74
  @env[:body][:filename].should == "hello"
75
75
  end
76
+
77
+ context "when path does not resolve a mime_type" do
78
+ it "should use the content_type of ActionDispatch::Http::UploadedFile " do
79
+ @upload.tempfile.path = "XXX"
80
+ @env = subject.call(:body => { :file => @upload })
81
+ @env[:body][:uploaded_data][:content_type].should == "image/jpeg"
82
+ end
83
+ end
76
84
  end
77
85
  end
78
86
 
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: 1.3.2
4
+ version: 1.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Davidovitz
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-03-03 00:00:00.000000000 Z
12
+ date: 2014-03-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bump
@@ -511,7 +511,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
511
511
  version: 1.3.6
512
512
  requirements: []
513
513
  rubyforge_project:
514
- rubygems_version: 2.2.0.rc.1
514
+ rubygems_version: 2.2.2
515
515
  signing_key:
516
516
  specification_version: 4
517
517
  summary: Zendesk REST API Client