provider_taxonomy 0.1.5 → 0.1.6

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 58096fdfefc7baa7d84e2f6513ec5b8bbe3a6d2d
4
- data.tar.gz: e32de66693bd425c4402e3815009af1dab8e73c6
3
+ metadata.gz: 7610f3e5e70639bb36d4597fc6b9fe6b6899f978
4
+ data.tar.gz: 44cc5017ebc4849c99e8011aad9148f8fb1295b8
5
5
  SHA512:
6
- metadata.gz: 047084e29ad7584a5287a2221ec775d2d06d1e1d3748a9122a9b2f37d2a39c703a77a7541f9214bb662969afb38cf562811d46eea24ff5d93ac15ece701af343
7
- data.tar.gz: 2867e3c8a8bd3396b34d4fd271403dfb07395c8ddbdd924020b62a585d18eff5d9cbb0336f12a2cd9f6c73bfcae6d632fefe2866496032705b081c1107149a94
6
+ metadata.gz: c6348899337c5935e2384b45ff6817938a3a19b4211f8fef7c209ec92117f363e1e83c646a8c2a38b88e509fb6b284ce9f7dbe485e9e70ac32fc99bd0c3e5733
7
+ data.tar.gz: d15ec63c032245a29dfc3eb6174a811ad3b3a26db7d22c506909062008618ab019cf785bfb580b6ff7d7466a308fa94679e0637b265836b146d9deec09ea0ead
data/Rakefile CHANGED
@@ -9,15 +9,15 @@ load 'rails/tasks/engine.rake'
9
9
 
10
10
  Bundler::GemHelper.install_tasks
11
11
 
12
- Dir[File.join(File.dirname(__FILE__), 'tasks/**/*.rake')].each {|f| load f }
12
+ Dir[File.join(File.dirname(__FILE__), 'tasks/**/*.rake')].each { |f| load f }
13
13
 
14
14
  require 'rspec/core'
15
15
  require 'rspec/core/rake_task'
16
16
 
17
17
  desc "Run all specs in spec directory (excluding plugin specs)"
18
- RSpec::Core::RakeTask.new(:spec => 'app:db:test:prepare')
18
+ RSpec::Core::RakeTask.new(spec: 'app:db:test:prepare')
19
19
 
20
- task :default => :spec
20
+ task default: :spec
21
21
 
22
22
  require 'rdoc/task'
23
23
 
@@ -29,10 +29,6 @@ RDoc::Task.new(:rdoc) do |rdoc|
29
29
  rdoc.rdoc_files.include('lib/**/*.rb')
30
30
  end
31
31
 
32
-
33
-
34
32
  load 'rails/tasks/statistics.rake'
35
33
 
36
-
37
-
38
34
  require 'bundler/gem_tasks'
@@ -1,3 +1,3 @@
1
1
  module ProviderTaxonomy
2
- VERSION = '0.1.5'
2
+ VERSION = '0.1.6'.freeze
3
3
  end
@@ -11,7 +11,20 @@ namespace :provider_taxonomy do
11
11
 
12
12
  def download(url, dest)
13
13
  open(url) do |u|
14
- File.open(dest, 'wb') { |f| f.write(u.read) }
14
+ f = File.open(dest, 'wb')
15
+ f.write(u.read)
16
+ f.close
17
+ end
18
+
19
+ if File.exist?(dest)
20
+ puts "Taxonomy file downloaded from: #{url}"
21
+ else
22
+ sleep(1.0)
23
+ if File.exist?(dest)
24
+ puts "Taxonomy file downloaded from: #{url}"
25
+ else
26
+ puts "Taxonomy file FAILED TO DOWNLOAD from: #{url}"
27
+ end
15
28
  end
16
29
  end
17
30
 
@@ -37,16 +50,12 @@ namespace :provider_taxonomy do
37
50
  FileUtils.mkdir_p 'db/provider_taxonomy'
38
51
  end
39
52
  taxonomy_file = "db/provider_taxonomy/nucc_taxonomy_#{current_version}.csv"
40
- download("http://nucc.org/images/stories/CSV/nucc_taxonomy_#{current_version}.csv", taxonomy_file)
41
- if File.exist?(taxonomy_file)
42
- puts "Taxonomy file downloaded: Version #{current_version}."
43
- end
53
+ download_file = "http://nucc.org/images/stories/CSV/nucc_taxonomy_#{current_version}.csv"
54
+ download(download_file, taxonomy_file)
44
55
  rescue OpenURI::HTTPError
45
56
  taxonomy_file = "db/rawdata/CMS_Taxonomy_Hierarchy/nucc_taxonomy_#{previous_version}.csv"
46
- download("http://nucc.org/images/stories/CSV/nucc_taxonomy_#{previous_version}.csv", taxonomy_file)
47
- if File.exist?(taxonomy_file)
48
- puts "Taxonomy file downloaded: Version #{previous_version}."
49
- end
57
+ download_file = "http://nucc.org/images/stories/CSV/nucc_taxonomy_#{previous_version}.csv"
58
+ download(download_file, taxonomy_file)
50
59
  end
51
60
 
52
61
  csv_text = File.read(taxonomy_file).scrub
@@ -12,4 +12,3 @@ module Dummy
12
12
  # -- all .rb files in that directory are automatically loaded.
13
13
  end
14
14
  end
15
-
@@ -47,7 +47,7 @@ Rails.application.configure do
47
47
  config.log_level = :debug
48
48
 
49
49
  # Prepend all log lines with the following tags.
50
- config.log_tags = [ :request_id ]
50
+ config.log_tags = [:request_id]
51
51
 
52
52
  # Use a different cache store in production.
53
53
  # config.cache_store = :mem_cache_store
@@ -10,13 +10,12 @@
10
10
  #
11
11
  # It's strongly recommended that you check this file into your version control system.
12
12
 
13
- ActiveRecord::Schema.define(version: 20160909180325) do
14
-
13
+ ActiveRecord::Schema.define(version: 20_160_909_180_325) do
15
14
  # These are extensions that must be enabled in order to support this database
16
15
  enable_extension "plpgsql"
17
16
 
18
17
  create_table "taxonomy_items", force: :cascade do |t|
19
- t.string "name", null: false
18
+ t.string "name", null: false
20
19
  t.integer "parent_id"
21
20
  t.integer "depth"
22
21
  t.string "category"
@@ -26,5 +25,4 @@ ActiveRecord::Schema.define(version: 20160909180325) do
26
25
  t.string "notes"
27
26
  t.index ["parent_id"], name: "index_taxonomy_items_on_parent_id", using: :btree
28
27
  end
29
-
30
28
  end
data/spec/spec_helper.rb CHANGED
@@ -46,54 +46,4 @@ RSpec.configure do |config|
46
46
  # inherited by the metadata hash of host groups and examples, rather than
47
47
  # triggering implicit auto-inclusion in groups with matching metadata.
48
48
  config.shared_context_metadata_behavior = :apply_to_host_groups
49
-
50
- # The settings below are suggested to provide a good initial experience
51
- # with RSpec, but feel free to customize to your heart's content.
52
- =begin
53
- # This allows you to limit a spec run to individual examples or groups
54
- # you care about by tagging them with `:focus` metadata. When nothing
55
- # is tagged with `:focus`, all examples get run. RSpec also provides
56
- # aliases for `it`, `describe`, and `context` that include `:focus`
57
- # metadata: `fit`, `fdescribe` and `fcontext`, respectively.
58
- config.filter_run_when_matching :focus
59
-
60
- # Allows RSpec to persist some state between runs in order to support
61
- # the `--only-failures` and `--next-failure` CLI options. We recommend
62
- # you configure your source control system to ignore this file.
63
- config.example_status_persistence_file_path = "spec/examples.txt"
64
-
65
- # Limits the available syntax to the non-monkey patched syntax that is
66
- # recommended. For more details, see:
67
- # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
68
- # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
69
- # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
70
- config.disable_monkey_patching!
71
-
72
- # Many RSpec users commonly either run the entire suite or an individual
73
- # file, and it's useful to allow more verbose output when running an
74
- # individual spec file.
75
- if config.files_to_run.one?
76
- # Use the documentation formatter for detailed output,
77
- # unless a formatter has already been configured
78
- # (e.g. via a command-line flag).
79
- config.default_formatter = 'doc'
80
- end
81
-
82
- # Print the 10 slowest examples and example groups at the
83
- # end of the spec run, to help surface which specs are running
84
- # particularly slow.
85
- config.profile_examples = 10
86
-
87
- # Run specs in random order to surface order dependencies. If you find an
88
- # order dependency and want to debug it, you can fix the order by providing
89
- # the seed, which is printed after each run.
90
- # --seed 1234
91
- config.order = :random
92
-
93
- # Seed global randomization in this process using the `--seed` CLI option.
94
- # Setting this allows you to use `--seed` to deterministically reproduce
95
- # test failures related to randomization by passing the same `--seed` value
96
- # as the one that triggered the failure.
97
- Kernel.srand config.seed
98
- =end
99
49
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: provider_taxonomy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - ClydeDroid
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-12 00:00:00.000000000 Z
11
+ date: 2016-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -101,8 +101,6 @@ files:
101
101
  - spec/dummy/config/secrets.yml
102
102
  - spec/dummy/config/spring.rb
103
103
  - spec/dummy/db/schema.rb
104
- - spec/dummy/log/development.log
105
- - spec/dummy/log/test.log
106
104
  - spec/dummy/public/404.html
107
105
  - spec/dummy/public/422.html
108
106
  - spec/dummy/public/500.html
@@ -177,8 +175,6 @@ test_files:
177
175
  - spec/dummy/app/mailers/application_mailer.rb
178
176
  - spec/dummy/app/controllers/application_controller.rb
179
177
  - spec/dummy/config.ru
180
- - spec/dummy/log/test.log
181
- - spec/dummy/log/development.log
182
178
  - spec/dummy/bin/rails
183
179
  - spec/dummy/bin/bundle
184
180
  - spec/dummy/bin/update