Skip to content

Commit

Permalink
Merge pull request #309 from jrgriffiniii/fix-generator
Browse files Browse the repository at this point in the history
Handle cases where the BrowseEverything configuration is not in place with a warning and empty configuration values
  • Loading branch information
randalldfloyd authored Nov 1, 2019
2 parents 5492f20 + 95fb4bd commit 7870650
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
5 changes: 3 additions & 2 deletions browse-everything.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ Gem::Specification.new do |spec|
spec.add_dependency 'google_drive', '~> 2.1'
spec.add_dependency 'googleauth', '0.6.6'
spec.add_dependency 'puma', '~> 3.11'
spec.add_dependency 'rails', '>= 4.2'
spec.add_dependency 'rails', '>= 4.2', '< 6.0'
spec.add_dependency 'ruby-box'
spec.add_dependency 'signet', '~> 0.8'
spec.add_dependency 'sprockets', '~> 3.7'
spec.add_dependency 'thor', '~> 0.19'
spec.add_dependency 'typhoeus'

spec.add_development_dependency 'bixby', '>= 1.0'
spec.add_development_dependency 'bundler', '>= 1.3'
spec.add_development_dependency 'capybara'
spec.add_development_dependency 'chromedriver-helper', '~> 2.1'
spec.add_development_dependency 'coveralls'
spec.add_development_dependency 'engine_cart', '~> 2.0'
spec.add_development_dependency 'factory_bot_rails'
Expand All @@ -51,5 +51,6 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'selenium-webdriver'
spec.add_development_dependency 'simplecov'
spec.add_development_dependency 'sqlite3'
spec.add_development_dependency 'webdrivers'
spec.add_development_dependency 'webmock'
end
3 changes: 2 additions & 1 deletion lib/browse_everything.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ def configure(value)
@config = ActiveSupport::HashWithIndifferentAccess.new config_values
@config.deep_symbolize_keys
rescue Errno::ENOENT
raise ConfigurationError, 'Missing browse_everything_providers.yml configuration file'
Rails.logger.warn 'Missing browse_everything_providers.yml configuration file'
@config = ActiveSupport::HashWithIndifferentAccess.new({})
end
else
raise InitializationError, "Unrecognized configuration: #{value.inspect}"
Expand Down
2 changes: 1 addition & 1 deletion lib/browse_everything/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module BrowseEverything
VERSION = '1.0.1'
VERSION = '1.0.2'
end
8 changes: 7 additions & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def coverage_needed?
require 'rspec'
require 'rspec/rails'
require 'rspec/its'
require 'chromedriver-helper'
require 'webdrivers'

# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Expand All @@ -46,6 +46,12 @@ def coverage_needed?
WebMock.disable_net_connect!(allow_localhost: true)

RSpec.configure do |config|
config.before(:each, type: :feature) { WebMock.disable! }
config.after(:each, type: :feature) do
WebMock.enable!
WebMock.disable_net_connect!(allow_localhost: true)
end

config.expect_with :rspec do |c|
c.syntax = %i[should expect]
end
Expand Down

0 comments on commit 7870650

Please sign in to comment.