dry-types-rails 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -0
- data/README.md +1 -1
- data/dry-types-rails.gemspec +0 -1
- data/lib/dry/types/rails/railtie.rb +6 -2
- data/lib/dry/types/rails/version.rb +1 -1
- metadata +3 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2f7dcadf25bd08e62e39a8597cd6e74e785043c
|
4
|
+
data.tar.gz: 622397673e0c62e4611172304b2c2950c96effc3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14cda55f0e5b8c9373e3635ffa9701bbf9a0779f7f3522a30f858822d2c427487577bfa635f1640a4ecd903d2e7d3dc2a07282735fd462e2d3ea2c24545776c2
|
7
|
+
data.tar.gz: b72bb689d02f0723be0b0901b18be7dbba5d4216ef92e4b3b6c79c237c63613434cb51d4683c70c1ec29aa07a2fe58542c4c40b7d115aa612bd990c66d7831c2
|
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Dry::Types::Rails
|
1
|
+
# Dry::Types::Rails [![Build Status](https://travis-ci.org/jeromegn/dry-types-rails.svg?branch=master)](https://travis-ci.org/jeromegn/dry-types-rails)
|
2
2
|
|
3
3
|
Really simple gem that will help you work with the [`dry-types`](https://github.com/dryrb/dry-types) gem in development.
|
4
4
|
|
data/dry-types-rails.gemspec
CHANGED
@@ -27,7 +27,6 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
28
28
|
spec.require_paths = ["lib"]
|
29
29
|
|
30
|
-
spec.add_development_dependency "bundler", "~> 1.11"
|
31
30
|
spec.add_development_dependency "rake", "~> 10.0"
|
32
31
|
spec.add_development_dependency 'combustion', '~> 0.5.4'
|
33
32
|
spec.add_development_dependency 'rspec-rails', '~> 3.4.0'
|
@@ -5,6 +5,8 @@ module Dry
|
|
5
5
|
REGISTERED_TYPES = Concurrent::Array.new
|
6
6
|
|
7
7
|
def register_class(klass, meth = :new)
|
8
|
+
return if TypesRegistration::REGISTERED_TYPES.include?(klass.to_s)
|
9
|
+
|
8
10
|
super.tap do
|
9
11
|
# Check to see if we need to remove the registered type
|
10
12
|
autoloaded = ActiveSupport::Dependencies.will_unload?(klass)
|
@@ -13,7 +15,7 @@ module Dry
|
|
13
15
|
# so we have to see if we're in the middle of loading a missing constants
|
14
16
|
autoloaded |= caller.any? { |line| line =~ /\:in.*?new_constants_in/ }
|
15
17
|
|
16
|
-
REGISTERED_TYPES << klass if autoloaded
|
18
|
+
TypesRegistration::REGISTERED_TYPES << klass.to_s if autoloaded
|
17
19
|
end
|
18
20
|
end
|
19
21
|
end
|
@@ -26,7 +28,9 @@ module Dry
|
|
26
28
|
|
27
29
|
class Railtie < ::Rails::Railtie
|
28
30
|
config.to_prepare do
|
29
|
-
TypesRegistration::REGISTERED_TYPES.
|
31
|
+
types = TypesRegistration::REGISTERED_TYPES.dup
|
32
|
+
types.each do |type|
|
33
|
+
TypesRegistration::REGISTERED_TYPES.delete(type)
|
30
34
|
type = Dry::Types.identifier(type)
|
31
35
|
Dry::Types.container._container.delete(type)
|
32
36
|
Dry::Types.type_map.delete(type)
|
metadata
CHANGED
@@ -1,29 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dry-types-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jerome Gravel-Niquet
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: bundler
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.11'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '1.11'
|
27
13
|
- !ruby/object:Gem::Dependency
|
28
14
|
name: rake
|
29
15
|
requirement: !ruby/object:Gem::Requirement
|
@@ -102,6 +88,7 @@ extensions: []
|
|
102
88
|
extra_rdoc_files: []
|
103
89
|
files:
|
104
90
|
- ".gitignore"
|
91
|
+
- ".travis.yml"
|
105
92
|
- CODE_OF_CONDUCT.md
|
106
93
|
- Gemfile
|
107
94
|
- LICENSE.txt
|