zendesk_api 0.3.13 → 0.3.14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3df6204f705806ba35d7d3451bba45e49f4fb2a2
4
+ data.tar.gz: 073424301ccf21fc222609f3781cf52f839bfbb1
5
+ SHA512:
6
+ metadata.gz: fbf6ddb8cece3d90b54d9d76c6bc9c2473464e3eb3f79fc1ae28130e6a6c559ccbe4c5e6a307696817d2c714fe6ca1332fca80f1f1389c19f85ee1a3b3dd3a02
7
+ data.tar.gz: c009ed313a58a4586a3cd140a6bc7c783e6ac701d4a99d5ff6d21d1551c7bb632bf5ab8c78812798513ce7b25a1cd03d8433f8ad96cc065ba6029090c17ae3e4
data/Gemfile.lock CHANGED
@@ -7,7 +7,7 @@ GIT
7
7
  PATH
8
8
  remote: .
9
9
  specs:
10
- zendesk_api (0.3.13)
10
+ zendesk_api (0.3.14)
11
11
  faraday (>= 0.8.0)
12
12
  faraday_middleware (>= 0.8.7)
13
13
  hashie (>= 1.2)
@@ -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
@@ -1,3 +1,3 @@
1
1
  module ZendeskAPI
2
- VERSION = "0.3.13"
2
+ VERSION = "0.3.14"
3
3
  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,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zendesk_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.13
5
- prerelease:
4
+ version: 0.3.14
6
5
  platform: ruby
7
6
  authors:
8
7
  - Steven Davidovitz
@@ -10,214 +9,188 @@ authors:
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2013-08-01 00:00:00.000000000 Z
12
+ date: 2014-04-22 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: bump
17
16
  requirement: !ruby/object:Gem::Requirement
18
- none: false
19
17
  requirements:
20
- - - ! '>='
18
+ - - ">="
21
19
  - !ruby/object:Gem::Version
22
20
  version: '0'
23
21
  type: :development
24
22
  prerelease: false
25
23
  version_requirements: !ruby/object:Gem::Requirement
26
- none: false
27
24
  requirements:
28
- - - ! '>='
25
+ - - ">="
29
26
  - !ruby/object:Gem::Version
30
27
  version: '0'
31
28
  - !ruby/object:Gem::Dependency
32
29
  name: rake
33
30
  requirement: !ruby/object:Gem::Requirement
34
- none: false
35
31
  requirements:
36
- - - ! '>='
32
+ - - ">="
37
33
  - !ruby/object:Gem::Version
38
34
  version: '0'
39
35
  type: :development
40
36
  prerelease: false
41
37
  version_requirements: !ruby/object:Gem::Requirement
42
- none: false
43
38
  requirements:
44
- - - ! '>='
39
+ - - ">="
45
40
  - !ruby/object:Gem::Version
46
41
  version: '0'
47
42
  - !ruby/object:Gem::Dependency
48
43
  name: rspec
49
44
  requirement: !ruby/object:Gem::Requirement
50
- none: false
51
45
  requirements:
52
- - - ! '>='
46
+ - - ">="
53
47
  - !ruby/object:Gem::Version
54
48
  version: '0'
55
49
  type: :development
56
50
  prerelease: false
57
51
  version_requirements: !ruby/object:Gem::Requirement
58
- none: false
59
52
  requirements:
60
- - - ! '>='
53
+ - - ">="
61
54
  - !ruby/object:Gem::Version
62
55
  version: '0'
63
56
  - !ruby/object:Gem::Dependency
64
57
  name: vcr
65
58
  requirement: !ruby/object:Gem::Requirement
66
- none: false
67
59
  requirements:
68
- - - ! '>='
60
+ - - ">="
69
61
  - !ruby/object:Gem::Version
70
62
  version: '0'
71
63
  type: :development
72
64
  prerelease: false
73
65
  version_requirements: !ruby/object:Gem::Requirement
74
- none: false
75
66
  requirements:
76
- - - ! '>='
67
+ - - ">="
77
68
  - !ruby/object:Gem::Version
78
69
  version: '0'
79
70
  - !ruby/object:Gem::Dependency
80
71
  name: webmock
81
72
  requirement: !ruby/object:Gem::Requirement
82
- none: false
83
73
  requirements:
84
- - - ~>
74
+ - - "~>"
85
75
  - !ruby/object:Gem::Version
86
76
  version: 1.9.0
87
77
  type: :development
88
78
  prerelease: false
89
79
  version_requirements: !ruby/object:Gem::Requirement
90
- none: false
91
80
  requirements:
92
- - - ~>
81
+ - - "~>"
93
82
  - !ruby/object:Gem::Version
94
83
  version: 1.9.0
95
84
  - !ruby/object:Gem::Dependency
96
85
  name: yard
97
86
  requirement: !ruby/object:Gem::Requirement
98
- none: false
99
87
  requirements:
100
- - - ! '>='
88
+ - - ">="
101
89
  - !ruby/object:Gem::Version
102
90
  version: '0'
103
91
  type: :development
104
92
  prerelease: false
105
93
  version_requirements: !ruby/object:Gem::Requirement
106
- none: false
107
94
  requirements:
108
- - - ! '>='
95
+ - - ">="
109
96
  - !ruby/object:Gem::Version
110
97
  version: '0'
111
98
  - !ruby/object:Gem::Dependency
112
99
  name: faraday
113
100
  requirement: !ruby/object:Gem::Requirement
114
- none: false
115
101
  requirements:
116
- - - ! '>='
102
+ - - ">="
117
103
  - !ruby/object:Gem::Version
118
104
  version: 0.8.0
119
105
  type: :runtime
120
106
  prerelease: false
121
107
  version_requirements: !ruby/object:Gem::Requirement
122
- none: false
123
108
  requirements:
124
- - - ! '>='
109
+ - - ">="
125
110
  - !ruby/object:Gem::Version
126
111
  version: 0.8.0
127
112
  - !ruby/object:Gem::Dependency
128
113
  name: faraday_middleware
129
114
  requirement: !ruby/object:Gem::Requirement
130
- none: false
131
115
  requirements:
132
- - - ! '>='
116
+ - - ">="
133
117
  - !ruby/object:Gem::Version
134
118
  version: 0.8.7
135
119
  type: :runtime
136
120
  prerelease: false
137
121
  version_requirements: !ruby/object:Gem::Requirement
138
- none: false
139
122
  requirements:
140
- - - ! '>='
123
+ - - ">="
141
124
  - !ruby/object:Gem::Version
142
125
  version: 0.8.7
143
126
  - !ruby/object:Gem::Dependency
144
127
  name: hashie
145
128
  requirement: !ruby/object:Gem::Requirement
146
- none: false
147
129
  requirements:
148
- - - ! '>='
130
+ - - ">="
149
131
  - !ruby/object:Gem::Version
150
132
  version: '1.2'
151
133
  type: :runtime
152
134
  prerelease: false
153
135
  version_requirements: !ruby/object:Gem::Requirement
154
- none: false
155
136
  requirements:
156
- - - ! '>='
137
+ - - ">="
157
138
  - !ruby/object:Gem::Version
158
139
  version: '1.2'
159
140
  - !ruby/object:Gem::Dependency
160
141
  name: inflection
161
142
  requirement: !ruby/object:Gem::Requirement
162
- none: false
163
143
  requirements:
164
- - - ! '>='
144
+ - - ">="
165
145
  - !ruby/object:Gem::Version
166
146
  version: '0'
167
147
  type: :runtime
168
148
  prerelease: false
169
149
  version_requirements: !ruby/object:Gem::Requirement
170
- none: false
171
150
  requirements:
172
- - - ! '>='
151
+ - - ">="
173
152
  - !ruby/object:Gem::Version
174
153
  version: '0'
175
154
  - !ruby/object:Gem::Dependency
176
155
  name: json
177
156
  requirement: !ruby/object:Gem::Requirement
178
- none: false
179
157
  requirements:
180
- - - ! '>='
158
+ - - ">="
181
159
  - !ruby/object:Gem::Version
182
160
  version: '0'
183
161
  type: :runtime
184
162
  prerelease: false
185
163
  version_requirements: !ruby/object:Gem::Requirement
186
- none: false
187
164
  requirements:
188
- - - ! '>='
165
+ - - ">="
189
166
  - !ruby/object:Gem::Version
190
167
  version: '0'
191
168
  - !ruby/object:Gem::Dependency
192
169
  name: mime-types
193
170
  requirement: !ruby/object:Gem::Requirement
194
- none: false
195
171
  requirements:
196
- - - ! '>='
172
+ - - ">="
197
173
  - !ruby/object:Gem::Version
198
174
  version: '0'
199
175
  type: :runtime
200
176
  prerelease: false
201
177
  version_requirements: !ruby/object:Gem::Requirement
202
- none: false
203
178
  requirements:
204
- - - ! '>='
179
+ - - ">="
205
180
  - !ruby/object:Gem::Version
206
181
  version: '0'
207
182
  - !ruby/object:Gem::Dependency
208
183
  name: multipart-post
209
184
  requirement: !ruby/object:Gem::Requirement
210
- none: false
211
185
  requirements:
212
- - - ! '>='
186
+ - - ">="
213
187
  - !ruby/object:Gem::Version
214
188
  version: '0'
215
189
  type: :runtime
216
190
  prerelease: false
217
191
  version_requirements: !ruby/object:Gem::Requirement
218
- none: false
219
192
  requirements:
220
- - - ! '>='
193
+ - - ">="
221
194
  - !ruby/object:Gem::Version
222
195
  version: '0'
223
196
  description: Ruby wrapper for the REST API at http://www.zendesk.com. Documentation
@@ -228,10 +201,10 @@ executables: []
228
201
  extensions: []
229
202
  extra_rdoc_files: []
230
203
  files:
231
- - .gitignore
232
- - .rspec
233
- - .travis.yml
234
- - .yardopts
204
+ - ".gitignore"
205
+ - ".rspec"
206
+ - ".travis.yml"
207
+ - ".yardopts"
235
208
  - Gemfile
236
209
  - Gemfile.lock
237
210
  - LICENSE
@@ -509,27 +482,26 @@ files:
509
482
  homepage: http://developer.zendesk.com
510
483
  licenses:
511
484
  - Apache License Version 2.0
485
+ metadata: {}
512
486
  post_install_message:
513
487
  rdoc_options: []
514
488
  require_paths:
515
489
  - lib
516
490
  required_ruby_version: !ruby/object:Gem::Requirement
517
- none: false
518
491
  requirements:
519
- - - ! '>='
492
+ - - ">="
520
493
  - !ruby/object:Gem::Version
521
494
  version: 1.8.7
522
495
  required_rubygems_version: !ruby/object:Gem::Requirement
523
- none: false
524
496
  requirements:
525
- - - ! '>='
497
+ - - ">="
526
498
  - !ruby/object:Gem::Version
527
499
  version: 1.3.6
528
500
  requirements: []
529
501
  rubyforge_project:
530
- rubygems_version: 1.8.25
502
+ rubygems_version: 2.2.2
531
503
  signing_key:
532
- specification_version: 3
504
+ specification_version: 4
533
505
  summary: Zendesk REST API Client
534
506
  test_files:
535
507
  - spec/core/association_spec.rb