apidae 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/apidae/import_controller.rb +19 -12
- data/app/models/apidae/export.rb +1 -0
- data/lib/apidae/version.rb +1 -1
- metadata +45 -45
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92ec7ce5a586513ed8c0ba161d3d9484555f9668
|
4
|
+
data.tar.gz: f000d972759069c7c6a1ad8eb6a7048c728212f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea85265ae673330192ee48320ceb138831144be753063290280ee37f2dd87435c09485a21c62fff2977c3e091a376e265e8ed5be2f4a8af4969d3048e960e4f9
|
7
|
+
data.tar.gz: f235d3f3cae3c8f1cfffc09bedae71e7592849baccc240077bd033633453e43d19f6797f356bf646344d5afcb78b4fe562000949aef9937160dbcdea533c31ff
|
@@ -33,20 +33,27 @@ module Apidae
|
|
33
33
|
def run
|
34
34
|
success = true
|
35
35
|
Export.pending.each do |e|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
36
|
+
begin
|
37
|
+
open(e.file_url) do |f|
|
38
|
+
begin
|
39
|
+
FileImport.import(f)
|
40
|
+
uri = URI(e.confirm_url)
|
41
|
+
req = Net::HTTP::Post.new(uri)
|
42
|
+
Net::HTTP.start(uri.hostname, uri.port) do |http|
|
43
|
+
http.request(req)
|
44
|
+
end
|
45
|
+
e.update(status: Export::COMPLETE)
|
46
|
+
rescue Exception => ex
|
47
|
+
logger.error("Failed to import export file : #{e.file_url}")
|
48
|
+
logger.error("Error is : #{ex}")
|
49
|
+
success = false
|
43
50
|
end
|
44
|
-
e.update(status: Export::COMPLETE)
|
45
|
-
rescue Exception => ex
|
46
|
-
logger.error("Failed to retrieve export file : #{ex.file_url}")
|
47
|
-
logger.error("Error is : #{ex}")
|
48
|
-
success = false
|
49
51
|
end
|
52
|
+
rescue OpenURI::HTTPError => err
|
53
|
+
logger.error("Failed to download export file : #{e.file_url}")
|
54
|
+
logger.error("Error is : #{err}")
|
55
|
+
success = false
|
56
|
+
e.update(status: Export::CANCELLED)
|
50
57
|
end
|
51
58
|
end
|
52
59
|
render nothing: true, status: (success ? :ok : :internal_server_error)
|
data/app/models/apidae/export.rb
CHANGED
data/lib/apidae/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apidae
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jean-Baptiste Vilain
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -206,70 +206,70 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
206
206
|
version: '0'
|
207
207
|
requirements: []
|
208
208
|
rubyforge_project:
|
209
|
-
rubygems_version: 2.
|
209
|
+
rubygems_version: 2.6.13
|
210
210
|
signing_key:
|
211
211
|
specification_version: 4
|
212
212
|
summary: A Ruby on Rails engine for projects that involve Apidae data
|
213
213
|
test_files:
|
214
|
-
- test/
|
215
|
-
- test/
|
216
|
-
- test/controllers/apidae/import_controller_test.rb
|
217
|
-
- test/controllers/apidae/objects_controller_test.rb
|
218
|
-
- test/controllers/apidae/selections_controller_test.rb
|
219
|
-
- test/data/delete_selections.json
|
220
|
-
- test/data/deletion.json
|
221
|
-
- test/data/json_export.zip
|
222
|
-
- test/data/selections.json
|
223
|
-
- test/data/structure.json
|
224
|
-
- test/data/update_selections.json
|
214
|
+
- test/dummy/app/controllers/application_controller.rb
|
215
|
+
- test/dummy/app/views/layouts/application.html.erb
|
225
216
|
- test/dummy/app/assets/javascripts/application.js
|
226
217
|
- test/dummy/app/assets/stylesheets/application.css
|
227
|
-
- test/dummy/app/controllers/application_controller.rb
|
228
218
|
- test/dummy/app/helpers/application_helper.rb
|
229
|
-
- test/dummy/app/views/layouts/application.html.erb
|
230
|
-
- test/dummy/bin/bundle
|
231
|
-
- test/dummy/bin/rails
|
232
219
|
- test/dummy/bin/rake
|
233
220
|
- test/dummy/bin/setup
|
234
|
-
- test/dummy/
|
235
|
-
- test/dummy/
|
236
|
-
- test/dummy/config/
|
237
|
-
- test/dummy/config/
|
238
|
-
- test/dummy/config/
|
221
|
+
- test/dummy/bin/bundle
|
222
|
+
- test/dummy/bin/rails
|
223
|
+
- test/dummy/config/secrets.yml
|
224
|
+
- test/dummy/config/routes.rb
|
225
|
+
- test/dummy/config/locales/en.yml
|
239
226
|
- test/dummy/config/environments/production.rb
|
227
|
+
- test/dummy/config/environments/development.rb
|
240
228
|
- test/dummy/config/environments/test.rb
|
241
|
-
- test/dummy/config/
|
229
|
+
- test/dummy/config/environment.rb
|
230
|
+
- test/dummy/config/application.rb
|
231
|
+
- test/dummy/config/database.yml
|
232
|
+
- test/dummy/config/boot.rb
|
242
233
|
- test/dummy/config/initializers/backtrace_silencers.rb
|
243
|
-
- test/dummy/config/initializers/cookies_serializer.rb
|
244
|
-
- test/dummy/config/initializers/filter_parameter_logging.rb
|
245
|
-
- test/dummy/config/initializers/inflections.rb
|
246
234
|
- test/dummy/config/initializers/mime_types.rb
|
235
|
+
- test/dummy/config/initializers/filter_parameter_logging.rb
|
247
236
|
- test/dummy/config/initializers/session_store.rb
|
248
|
-
- test/dummy/config/initializers/to_time_preserves_timezone.rb
|
249
237
|
- test/dummy/config/initializers/wrap_parameters.rb
|
250
|
-
- test/dummy/config/
|
251
|
-
- test/dummy/config/
|
252
|
-
- test/dummy/config/
|
238
|
+
- test/dummy/config/initializers/assets.rb
|
239
|
+
- test/dummy/config/initializers/cookies_serializer.rb
|
240
|
+
- test/dummy/config/initializers/to_time_preserves_timezone.rb
|
241
|
+
- test/dummy/config/initializers/inflections.rb
|
253
242
|
- test/dummy/config.ru
|
254
|
-
- test/dummy/
|
255
|
-
- test/dummy/
|
256
|
-
- test/dummy/log/test.log
|
257
|
-
- test/dummy/public/404.html
|
243
|
+
- test/dummy/Rakefile
|
244
|
+
- test/dummy/public/favicon.ico
|
258
245
|
- test/dummy/public/422.html
|
259
246
|
- test/dummy/public/500.html
|
260
|
-
- test/dummy/public/
|
261
|
-
- test/dummy/
|
247
|
+
- test/dummy/public/404.html
|
248
|
+
- test/dummy/db/schema.rb
|
249
|
+
- test/dummy/log/test.log
|
250
|
+
- test/dummy/log/development.log
|
262
251
|
- test/dummy/README.rdoc
|
263
|
-
- test/fixtures/apidae/attached_files.yml
|
264
|
-
- test/fixtures/apidae/exports.yml
|
265
|
-
- test/fixtures/apidae/objects.yml
|
266
|
-
- test/fixtures/apidae/selections.yml
|
267
|
-
- test/fixtures/apidae/towns.yml
|
268
252
|
- test/integration/navigation_test.rb
|
269
|
-
- test/models/apidae/attached_file_test.rb
|
270
|
-
- test/models/apidae/export_test.rb
|
271
|
-
- test/models/apidae/file_import_test.rb
|
272
253
|
- test/models/apidae/object_test.rb
|
273
254
|
- test/models/apidae/selection_test.rb
|
255
|
+
- test/models/apidae/file_import_test.rb
|
256
|
+
- test/models/apidae/export_test.rb
|
257
|
+
- test/models/apidae/attached_file_test.rb
|
274
258
|
- test/models/apidae/town_test.rb
|
259
|
+
- test/fixtures/apidae/towns.yml
|
260
|
+
- test/fixtures/apidae/objects.yml
|
261
|
+
- test/fixtures/apidae/selections.yml
|
262
|
+
- test/fixtures/apidae/attached_files.yml
|
263
|
+
- test/fixtures/apidae/exports.yml
|
275
264
|
- test/test_helper.rb
|
265
|
+
- test/apidae_test.rb
|
266
|
+
- test/controllers/apidae/selections_controller_test.rb
|
267
|
+
- test/controllers/apidae/objects_controller_test.rb
|
268
|
+
- test/controllers/apidae/dashboard_controller_test.rb
|
269
|
+
- test/controllers/apidae/import_controller_test.rb
|
270
|
+
- test/data/update_selections.json
|
271
|
+
- test/data/json_export.zip
|
272
|
+
- test/data/delete_selections.json
|
273
|
+
- test/data/structure.json
|
274
|
+
- test/data/deletion.json
|
275
|
+
- test/data/selections.json
|