hashie 3.5.7 → 5.0.0
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 +5 -5
- data/CHANGELOG.md +281 -195
- data/CONTRIBUTING.md +13 -6
- data/LICENSE +1 -1
- data/README.md +320 -60
- data/Rakefile +2 -2
- data/UPGRADING.md +121 -7
- data/hashie.gemspec +13 -7
- data/lib/hashie/clash.rb +12 -1
- data/lib/hashie/dash.rb +56 -35
- data/lib/hashie/extensions/active_support/core_ext/hash.rb +14 -0
- data/lib/hashie/extensions/coercion.rb +26 -19
- data/lib/hashie/extensions/dash/indifferent_access.rb +29 -1
- data/lib/hashie/extensions/dash/predefined_values.rb +88 -0
- data/lib/hashie/extensions/dash/property_translation.rb +59 -28
- data/lib/hashie/extensions/deep_fetch.rb +5 -3
- data/lib/hashie/extensions/deep_find.rb +14 -5
- data/lib/hashie/extensions/deep_locate.rb +22 -8
- data/lib/hashie/extensions/deep_merge.rb +26 -10
- data/lib/hashie/extensions/ignore_undeclared.rb +4 -5
- data/lib/hashie/extensions/indifferent_access.rb +43 -10
- data/lib/hashie/extensions/key_conflict_warning.rb +55 -0
- data/lib/hashie/extensions/mash/define_accessors.rb +90 -0
- data/lib/hashie/extensions/mash/keep_original_keys.rb +4 -5
- data/lib/hashie/extensions/mash/permissive_respond_to.rb +61 -0
- data/lib/hashie/extensions/mash/safe_assignment.rb +3 -1
- data/lib/hashie/extensions/mash/symbolize_keys.rb +6 -6
- data/lib/hashie/extensions/method_access.rb +47 -14
- data/lib/hashie/extensions/parsers/yaml_erb_parser.rb +28 -4
- data/lib/hashie/extensions/ruby_version_check.rb +5 -1
- data/lib/hashie/extensions/strict_key_access.rb +16 -13
- data/lib/hashie/extensions/stringify_keys.rb +1 -1
- data/lib/hashie/extensions/symbolize_keys.rb +13 -2
- data/lib/hashie/hash.rb +18 -11
- data/lib/hashie/mash.rb +147 -81
- data/lib/hashie/railtie.rb +7 -0
- data/lib/hashie/rash.rb +6 -6
- data/lib/hashie/utils.rb +28 -0
- data/lib/hashie/version.rb +1 -1
- data/lib/hashie.rb +22 -19
- metadata +23 -131
- data/spec/hashie/array_spec.rb +0 -29
- data/spec/hashie/clash_spec.rb +0 -70
- data/spec/hashie/dash_spec.rb +0 -573
- data/spec/hashie/extensions/autoload_spec.rb +0 -24
- data/spec/hashie/extensions/coercion_spec.rb +0 -631
- data/spec/hashie/extensions/dash/coercion_spec.rb +0 -13
- data/spec/hashie/extensions/dash/indifferent_access_spec.rb +0 -84
- data/spec/hashie/extensions/deep_fetch_spec.rb +0 -97
- data/spec/hashie/extensions/deep_find_spec.rb +0 -138
- data/spec/hashie/extensions/deep_locate_spec.rb +0 -137
- data/spec/hashie/extensions/deep_merge_spec.rb +0 -70
- data/spec/hashie/extensions/ignore_undeclared_spec.rb +0 -47
- data/spec/hashie/extensions/indifferent_access_spec.rb +0 -282
- data/spec/hashie/extensions/indifferent_access_with_rails_hwia_spec.rb +0 -208
- data/spec/hashie/extensions/key_conversion_spec.rb +0 -12
- data/spec/hashie/extensions/mash/keep_original_keys_spec.rb +0 -46
- data/spec/hashie/extensions/mash/safe_assignment_spec.rb +0 -50
- data/spec/hashie/extensions/mash/symbolize_keys_spec.rb +0 -39
- data/spec/hashie/extensions/merge_initializer_spec.rb +0 -23
- data/spec/hashie/extensions/method_access_spec.rb +0 -188
- data/spec/hashie/extensions/strict_key_access_spec.rb +0 -110
- data/spec/hashie/extensions/stringify_keys_spec.rb +0 -124
- data/spec/hashie/extensions/symbolize_keys_spec.rb +0 -129
- data/spec/hashie/hash_spec.rb +0 -84
- data/spec/hashie/mash_spec.rb +0 -763
- data/spec/hashie/parsers/yaml_erb_parser_spec.rb +0 -46
- data/spec/hashie/rash_spec.rb +0 -83
- data/spec/hashie/trash_spec.rb +0 -268
- data/spec/hashie/utils_spec.rb +0 -25
- data/spec/hashie/version_spec.rb +0 -7
- data/spec/hashie_spec.rb +0 -13
- data/spec/integration/omniauth/app.rb +0 -11
- data/spec/integration/omniauth/integration_spec.rb +0 -38
- data/spec/integration/omniauth-oauth2/app.rb +0 -53
- data/spec/integration/omniauth-oauth2/integration_spec.rb +0 -26
- data/spec/integration/omniauth-oauth2/some_site.rb +0 -38
- data/spec/integration/rails/app.rb +0 -48
- data/spec/integration/rails/integration_spec.rb +0 -26
- data/spec/integration/rails-without-dependency/integration_spec.rb +0 -15
- data/spec/spec_helper.rb +0 -23
- data/spec/support/integration_specs.rb +0 -36
- data/spec/support/logger.rb +0 -24
- data/spec/support/module_context.rb +0 -11
- data/spec/support/ruby_version_check.rb +0 -6
@@ -1,15 +0,0 @@
|
|
1
|
-
require 'rspec/core'
|
2
|
-
|
3
|
-
RSpec.describe 'partial-rails' do
|
4
|
-
context 'when Rails constant is present but the railties are not' do
|
5
|
-
before(:all) do
|
6
|
-
class Rails
|
7
|
-
# A class about railways
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
it 'does not raise an exception when we require hashie' do
|
12
|
-
expect { require 'hashie' }.not_to raise_error
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
data/spec/spec_helper.rb
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
if ENV['CI']
|
2
|
-
require 'simplecov'
|
3
|
-
SimpleCov.start
|
4
|
-
end
|
5
|
-
|
6
|
-
require 'pry'
|
7
|
-
|
8
|
-
require 'rspec'
|
9
|
-
require 'hashie'
|
10
|
-
require 'rspec/pending_for'
|
11
|
-
require './spec/support/ruby_version_check'
|
12
|
-
require './spec/support/logger'
|
13
|
-
|
14
|
-
require 'active_support'
|
15
|
-
require 'active_support/core_ext'
|
16
|
-
|
17
|
-
RSpec.configure do |config|
|
18
|
-
config.extend RubyVersionCheck
|
19
|
-
config.expect_with :rspec do |expect|
|
20
|
-
expect.syntax = :expect
|
21
|
-
end
|
22
|
-
config.warnings = true
|
23
|
-
end
|
@@ -1,36 +0,0 @@
|
|
1
|
-
# Generates the bundle command for running an integration test
|
2
|
-
#
|
3
|
-
# @param [String] integration the integration folder to run
|
4
|
-
# @param [String] command the command to run
|
5
|
-
# @return [String]
|
6
|
-
def integration_command(integration, command)
|
7
|
-
"#{integration_gemfile(integration)} #{command}"
|
8
|
-
end
|
9
|
-
|
10
|
-
# Generates the Gemfile for an integration
|
11
|
-
#
|
12
|
-
# @param [String] integration the integration test name
|
13
|
-
# @return [String]
|
14
|
-
def integration_gemfile(integration)
|
15
|
-
"BUNDLE_GEMFILE=#{integration_path(integration)}/Gemfile"
|
16
|
-
end
|
17
|
-
|
18
|
-
# Generates the path to the integration
|
19
|
-
#
|
20
|
-
# @param [String] integration the integration test name
|
21
|
-
# @return [String]
|
22
|
-
def integration_path(integration)
|
23
|
-
"spec/integration/#{integration}"
|
24
|
-
end
|
25
|
-
|
26
|
-
# Runs all integration specs in their own environment
|
27
|
-
def run_all_integration_specs(handler: ->(_code) {}, logger: ->(_msg) {})
|
28
|
-
Dir['spec/integration/*']
|
29
|
-
.map { |directory| directory.split('/').last }
|
30
|
-
.each do |integration|
|
31
|
-
logger.call(%(Running "#{integration}" integration spec))
|
32
|
-
system(integration_command(integration, 'bundle --quiet'))
|
33
|
-
system(integration_command(integration, "bundle exec rspec #{integration_path(integration)}"))
|
34
|
-
handler.call($CHILD_STATUS.exitstatus)
|
35
|
-
end
|
36
|
-
end
|
data/spec/support/logger.rb
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
# A shared context that allows you to check the output of Hashie's logger.
|
2
|
-
#
|
3
|
-
# @example
|
4
|
-
# include_context 'with a logger'
|
5
|
-
#
|
6
|
-
# it 'logs info message' do
|
7
|
-
# Hashie.logger.info 'What is happening in here?!'
|
8
|
-
#
|
9
|
-
# expect(logger_output).to match('What is happening in here?!')
|
10
|
-
# end
|
11
|
-
RSpec.shared_context 'with a logger' do
|
12
|
-
# @private
|
13
|
-
let(:log) { StringIO.new }
|
14
|
-
|
15
|
-
# The output string from the logger
|
16
|
-
let(:logger_output) { log.rewind && log.string }
|
17
|
-
|
18
|
-
around(:each) do |example|
|
19
|
-
original_logger = Hashie.logger
|
20
|
-
Hashie.logger = Logger.new(log)
|
21
|
-
example.run
|
22
|
-
Hashie.logger = original_logger
|
23
|
-
end
|
24
|
-
end
|