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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bbcc200ece0d181e053d3ecc49f95b1d88e4cb88
4
- data.tar.gz: 91696b0d86e3c94655a695ac9d70e2767f162839
3
+ metadata.gz: b2f7dcadf25bd08e62e39a8597cd6e74e785043c
4
+ data.tar.gz: 622397673e0c62e4611172304b2c2950c96effc3
5
5
  SHA512:
6
- metadata.gz: 54697556dd5580ef21b1866f27c30b758fcc73ab2447b9000b5b83bc6a1c76bd6911fe4a95b7e7417b021604c52690932383fa724440828a35d6ca06094e8984
7
- data.tar.gz: 8edd43b557a53a2d7d89246d6c45c258538d479c46f4ab19b94f594a159904642916d9c854c159cebb8d0c84159122795f30c6df03f95619de694d62665f266e
6
+ metadata.gz: 14cda55f0e5b8c9373e3635ffa9701bbf9a0779f7f3522a30f858822d2c427487577bfa635f1640a4ecd903d2e7d3dc2a07282735fd462e2d3ea2c24545776c2
7
+ data.tar.gz: b72bb689d02f0723be0b0901b18be7dbba5d4216ef92e4b3b6c79c237c63613434cb51d4683c70c1ec29aa07a2fe58542c4c40b7d115aa612bd990c66d7831c2
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2
4
+ script: bundle exec rspec
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
 
@@ -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.each do |type|
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)
@@ -1,7 +1,7 @@
1
1
  module Dry
2
2
  module Types
3
3
  module Rails
4
- VERSION = "0.3.1"
4
+ VERSION = "0.3.2"
5
5
  end
6
6
  end
7
7
  end
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.1
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-08 00:00:00.000000000 Z
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