acts_as_hashable 1.2.0.pre.alpha → 1.2.0.pre.alpha.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: efc9586f91e07aee23e59bc2f3fbe3d0d5c1f8e7586ee2a172dcfec3b3c36ca0
4
- data.tar.gz: 1f1e8850279c8a82cbad3ed60d23415a1e1a012526ec6854113d2dc714e6e781
3
+ metadata.gz: c0dede2b7914dcb91cd030c65e5385220553d7cd523172e40c5390a644598cb5
4
+ data.tar.gz: 47a708a122c7c12d80fa9932b24c2d5cbe4ab8cab97264afb818c0a0781ac308
5
5
  SHA512:
6
- metadata.gz: 67c2547b85e3f13b68ad0f6085cf9bbb1e914fe99138a5f324cbd4e1c962dc2c8285f4fc65c2a67d2ac17ab4b0ac92542407311eca33cdf3082e8c457ab59de8
7
- data.tar.gz: 52e1dfc7fe3ae98932ce7040e79961134ec8d783e7d909e98378f87f3cdf888622d5667a1c468471de03e5d7eaeddd43658aee421b25eeced0b1606f0894a07f
6
+ metadata.gz: 1720b09fddd1101546b452bde063e5d7a516d5883ce75cd4a5bca09726cf6d97ad7e28a7ca1dee4966fa926ffddc7a293b1dc7bc5e19888b420525ea156e4037
7
+ data.tar.gz: 69d1012dddafed50c20503cb27049d4df950182587f7d911f658b0fb239e36f103a62d70a6a5d3a35bc2ed535c28ef8cd309726ec18dd98825d1e1d2fcd7e169
data/Rakefile CHANGED
@@ -2,7 +2,9 @@
2
2
 
3
3
  require 'bundler/gem_tasks'
4
4
  require 'rspec/core/rake_task'
5
+ require 'rubocop/rake_task'
5
6
 
6
7
  RSpec::Core::RakeTask.new(:spec)
8
+ RuboCop::RakeTask.new
7
9
 
8
- task default: :spec
10
+ task default: %i[rubocop spec]
@@ -36,11 +36,16 @@ module ActsAsHashable
36
36
  type = config[type_key].to_s.to_sym
37
37
  object_class = registry[type]
38
38
 
39
- raise ArgumentError, "cannot find section from type: #{type}" unless object_class
39
+ raise ArgumentError, "cannot find registration for: '#{type}'" unless object_class
40
40
 
41
41
  config_without_type = config.reject { |k| k == type_key }
42
42
 
43
- object_class.new(config_without_type)
43
+ # We want to defer to the classes proper maker if it exists.
44
+ # Technically, this factory should only make classes that include Hashable, but just to be
45
+ # sure we do not break any existing compatibility, lets make it work for both.
46
+ method_name = object_class.respond_to?(:make) ? :make : :new
47
+
48
+ object_class.send(method_name, config_without_type)
44
49
  end
45
50
  end
46
51
  end
@@ -8,5 +8,5 @@
8
8
  #
9
9
 
10
10
  module ActsAsHashable
11
- VERSION = '1.2.0-alpha'
11
+ VERSION = '1.2.0-alpha.1'
12
12
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_as_hashable
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0.pre.alpha
4
+ version: 1.2.0.pre.alpha.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Ruggio