myfdb_utilities 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -26,7 +26,13 @@ module Myfdb
26
26
  private
27
27
 
28
28
  def create_issue
29
- response = Net::HTTP.post_form(self.uri + '/upload/issues', {})
29
+ req = Net::HTTP::Post.new('/upload/issues')
30
+ req.add_field 'User-Agent', 'MyFDB API 1.0'
31
+ req.form_data = {}
32
+ req.basic_auth uri.user, uri.password
33
+
34
+ response = Net::HTTP.new(uri.host, uri.port).start { |http| http.request(req) }
35
+
30
36
  if response.code == '200'
31
37
  id = response.body.to_i
32
38
  File.open(File.join(directory, 'issue_id'), 'w') do |f|
@@ -32,11 +32,12 @@ module Batch
32
32
  begin
33
33
  uri_path = '/upload/tear_sheets'
34
34
  upload_io = UploadIO.new(image, 'image/jpeg')
35
- multipart = Net::HTTP::Post::Multipart.new(uri_path, 'issue_id' => id.to_s, 'tear_sheet[image]' => upload_io)
36
-
35
+ request = Net::HTTP::Post::Multipart.new(uri_path, 'issue_id' => id.to_s, 'tear_sheet[image]' => upload_io)
36
+ request.add_field 'User-Agent', 'MyFDB API 1.0'
37
+
37
38
  response = Net::HTTP.start(uri.host, uri.port) do |http|
38
- multipart.basic_auth uri.user, uri.password
39
- http.request multipart
39
+ request.basic_auth uri.user, uri.password
40
+ http.request request
40
41
  end
41
42
 
42
43
  if error = parse_response(response)
@@ -1,3 +1,3 @@
1
1
  module Myfdb
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,101 +1,134 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: myfdb_utilities
3
- version: !ruby/object:Gem::Version
4
- version: 0.0.3
3
+ version: !ruby/object:Gem::Version
4
+ hash: 23
5
5
  prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 4
10
+ version: 0.0.4
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Larry Sprock
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
- date: 2012-03-01 00:00:00.000000000Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: rspec
16
- requirement: &70337027703680 !ruby/object:Gem::Requirement
17
+
18
+ date: 2012-02-29 00:00:00 -08:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ version_requirements: &id001 !ruby/object:Gem::Requirement
17
23
  none: false
18
- requirements:
24
+ requirements:
19
25
  - - ~>
20
- - !ruby/object:Gem::Version
26
+ - !ruby/object:Gem::Version
27
+ hash: 23
28
+ segments:
29
+ - 2
30
+ - 6
31
+ - 0
21
32
  version: 2.6.0
22
- type: :development
33
+ requirement: *id001
23
34
  prerelease: false
24
- version_requirements: *70337027703680
25
- - !ruby/object:Gem::Dependency
26
- name: mocha
27
- requirement: &70337027702960 !ruby/object:Gem::Requirement
35
+ type: :development
36
+ name: rspec
37
+ - !ruby/object:Gem::Dependency
38
+ version_requirements: &id002 !ruby/object:Gem::Requirement
28
39
  none: false
29
- requirements:
40
+ requirements:
30
41
  - - ~>
31
- - !ruby/object:Gem::Version
32
- version: '0.9'
42
+ - !ruby/object:Gem::Version
43
+ hash: 25
44
+ segments:
45
+ - 0
46
+ - 9
47
+ version: "0.9"
48
+ requirement: *id002
49
+ prerelease: false
33
50
  type: :development
51
+ name: mocha
52
+ - !ruby/object:Gem::Dependency
53
+ version_requirements: &id003 !ruby/object:Gem::Requirement
54
+ none: false
55
+ requirements:
56
+ - - ">="
57
+ - !ruby/object:Gem::Version
58
+ hash: 3
59
+ segments:
60
+ - 0
61
+ version: "0"
62
+ requirement: *id003
34
63
  prerelease: false
35
- version_requirements: *70337027702960
36
- - !ruby/object:Gem::Dependency
64
+ type: :development
37
65
  name: fakeweb
38
- requirement: &70337027702380 !ruby/object:Gem::Requirement
66
+ - !ruby/object:Gem::Dependency
67
+ version_requirements: &id004 !ruby/object:Gem::Requirement
39
68
  none: false
40
- requirements:
41
- - - ! '>='
42
- - !ruby/object:Gem::Version
43
- version: '0'
44
- type: :development
69
+ requirements:
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ hash: 3
73
+ segments:
74
+ - 0
75
+ version: "0"
76
+ requirement: *id004
45
77
  prerelease: false
46
- version_requirements: *70337027702380
47
- - !ruby/object:Gem::Dependency
78
+ type: :development
48
79
  name: rake
49
- requirement: &70337027701640 !ruby/object:Gem::Requirement
80
+ - !ruby/object:Gem::Dependency
81
+ version_requirements: &id005 !ruby/object:Gem::Requirement
50
82
  none: false
51
- requirements:
52
- - - ! '>='
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
- type: :development
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ hash: 3
87
+ segments:
88
+ - 0
89
+ version: "0"
90
+ requirement: *id005
56
91
  prerelease: false
57
- version_requirements: *70337027701640
58
- - !ruby/object:Gem::Dependency
92
+ type: :runtime
59
93
  name: multipart-post
60
- requirement: &70337027701080 !ruby/object:Gem::Requirement
94
+ - !ruby/object:Gem::Dependency
95
+ version_requirements: &id006 !ruby/object:Gem::Requirement
61
96
  none: false
62
- requirements:
63
- - - ! '>='
64
- - !ruby/object:Gem::Version
65
- version: '0'
66
- type: :runtime
97
+ requirements:
98
+ - - ">="
99
+ - !ruby/object:Gem::Version
100
+ hash: 3
101
+ segments:
102
+ - 0
103
+ version: "0"
104
+ requirement: *id006
67
105
  prerelease: false
68
- version_requirements: *70337027701080
69
- - !ruby/object:Gem::Dependency
106
+ type: :runtime
70
107
  name: commander
71
- requirement: &70337027700400 !ruby/object:Gem::Requirement
108
+ - !ruby/object:Gem::Dependency
109
+ version_requirements: &id007 !ruby/object:Gem::Requirement
72
110
  none: false
73
- requirements:
74
- - - ! '>='
75
- - !ruby/object:Gem::Version
76
- version: '0'
77
- type: :runtime
111
+ requirements:
112
+ - - ">="
113
+ - !ruby/object:Gem::Version
114
+ hash: 3
115
+ segments:
116
+ - 0
117
+ version: "0"
118
+ requirement: *id007
78
119
  prerelease: false
79
- version_requirements: *70337027700400
80
- - !ruby/object:Gem::Dependency
81
- name: cronedit
82
- requirement: &70337027699800 !ruby/object:Gem::Requirement
83
- none: false
84
- requirements:
85
- - - ! '>='
86
- - !ruby/object:Gem::Version
87
- version: '0'
88
120
  type: :runtime
89
- prerelease: false
90
- version_requirements: *70337027699800
121
+ name: cronedit
91
122
  description: A collection of purpose built utilities for doing tasks specific to MyFDB
92
- email:
123
+ email:
93
124
  - development@myfdb.com
94
- executables:
125
+ executables:
95
126
  - myfdb
96
127
  extensions: []
128
+
97
129
  extra_rdoc_files: []
98
- files:
130
+
131
+ files:
99
132
  - .gitignore
100
133
  - .rspec
101
134
  - Gemfile
@@ -129,31 +162,41 @@ files:
129
162
  - spec/myfdb/uploader_spec.rb
130
163
  - spec/spec_helper.rb
131
164
  - spec/support/fakeweb.rb
165
+ has_rdoc: true
132
166
  homepage: http://rubygems.org/gems/myfdb_utilities
133
167
  licenses: []
168
+
134
169
  post_install_message:
135
170
  rdoc_options: []
136
- require_paths:
171
+
172
+ require_paths:
137
173
  - lib
138
- required_ruby_version: !ruby/object:Gem::Requirement
174
+ required_ruby_version: !ruby/object:Gem::Requirement
139
175
  none: false
140
- requirements:
141
- - - ! '>='
142
- - !ruby/object:Gem::Version
143
- version: '0'
144
- segments:
176
+ requirements:
177
+ - - ">="
178
+ - !ruby/object:Gem::Version
179
+ hash: 3
180
+ segments:
145
181
  - 0
146
- hash: 635171229310315119
147
- required_rubygems_version: !ruby/object:Gem::Requirement
182
+ version: "0"
183
+ required_rubygems_version: !ruby/object:Gem::Requirement
148
184
  none: false
149
- requirements:
150
- - - ! '>='
151
- - !ruby/object:Gem::Version
185
+ requirements:
186
+ - - ">="
187
+ - !ruby/object:Gem::Version
188
+ hash: 23
189
+ segments:
190
+ - 1
191
+ - 3
192
+ - 6
152
193
  version: 1.3.6
153
194
  requirements: []
195
+
154
196
  rubyforge_project:
155
- rubygems_version: 1.8.10
197
+ rubygems_version: 1.6.2
156
198
  signing_key:
157
199
  specification_version: 3
158
200
  summary: Utilities gem for myfdb
159
201
  test_files: []
202
+