schema_monkey 2.1.4 → 2.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/schema_monkey.rb +0 -1
- data/lib/schema_monkey/client.rb +3 -3
- data/lib/schema_monkey/module.rb +1 -1
- data/lib/schema_monkey/monkey.rb +1 -1
- data/lib/schema_monkey/version.rb +1 -1
- data/schema_monkey.gemspec +1 -1
- data/spec/spec_helper.rb +1 -0
- metadata +16 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d28d272416cca652ecf6e80328729dd7873c543
|
4
|
+
data.tar.gz: da46678264386222e26a2e55d6f229123f536179
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5eab33e39224ee8d9cf95cdba11d2395029f69ec750bc850f03f0129f1f4a37cbc90dbccb9113d957632addb936fdaa62318e357913acdaa6673a707ccec2319
|
7
|
+
data.tar.gz: 32195d3c462db3b25235eab9e9a7be5fa075430d739a0c5c4ee48f37d7302bec56863d2df77de505e756c0eeed2d3f77d0df001c74bd841c6584aac7ee9cd92f
|
data/README.md
CHANGED
@@ -234,6 +234,7 @@ SchemaMonkey is tested on:
|
|
234
234
|
<!-- SCHEMA_DEV: MATRIX - end -->
|
235
235
|
|
236
236
|
## Release Notes
|
237
|
+
* 2.1.5 -- Remove dependency on its-it :( #12
|
237
238
|
* 2.1.4 -- Loosen dependency to allow AR 5.0, and include it in the test matrix
|
238
239
|
* 2.1.3 -- Guard against multiple insertion of modules.
|
239
240
|
* 2.1.2 -- Insert self earlier; don't wait for connection adapter to be instantiated. Fixes #6 re `db:schema:load`
|
data/lib/schema_monkey.rb
CHANGED
data/lib/schema_monkey/client.rb
CHANGED
@@ -35,7 +35,7 @@ module SchemaMonkey
|
|
35
35
|
path = mod.to_s.sub(/^#{@root}::#{base}::/, '')
|
36
36
|
if dbm
|
37
37
|
path = path.split('::')
|
38
|
-
if (i = path.find_index
|
38
|
+
if (i = path.find_index { |it| it =~ /\b#{dbm}\b/i }) # delete first occurence
|
39
39
|
path.delete_at i
|
40
40
|
end
|
41
41
|
path = path.join('::').gsub(/#{dbm}/i, dbm.to_s) # canonicalize case for things like PostgreSQLAdapter
|
@@ -56,8 +56,8 @@ module SchemaMonkey
|
|
56
56
|
|
57
57
|
modules = []
|
58
58
|
modules += Module.descendants(container, can_load: accept)
|
59
|
-
modules.select!
|
60
|
-
modules.reject!
|
59
|
+
modules.select! { |it| it.to_s =~ accept } if accept
|
60
|
+
modules.reject! { |it| it.to_s =~ reject } if reject
|
61
61
|
modules
|
62
62
|
end
|
63
63
|
|
data/lib/schema_monkey/module.rb
CHANGED
@@ -27,7 +27,7 @@ module SchemaMonkey
|
|
27
27
|
def descendants(mod, can_load: nil)
|
28
28
|
consts, auto = mod.constants.group_by{|c| !!mod.autoload?(c)}.values_at(false, true)
|
29
29
|
consts ||= []
|
30
|
-
consts += auto.select
|
30
|
+
consts += auto.select { |it| it.to_s =~ can_load } if can_load and auto
|
31
31
|
children = consts.map{|c| mod.const_get(c) }.select { |obj|
|
32
32
|
obj.is_a?(::Module) rescue nil
|
33
33
|
}
|
data/lib/schema_monkey/monkey.rb
CHANGED
@@ -21,7 +21,7 @@ module SchemaMonkey
|
|
21
21
|
|
22
22
|
def insert(dbm: nil)
|
23
23
|
insert if dbm and not @inserted # first do all non-dbm-specific insertions
|
24
|
-
@client_map.values.each
|
24
|
+
@client_map.values.each { |it| it.insert(dbm: dbm) }
|
25
25
|
@inserted = true
|
26
26
|
@inserted_dbm = dbm if dbm
|
27
27
|
end
|
data/schema_monkey.gemspec
CHANGED
@@ -20,13 +20,13 @@ Gem::Specification.new do |spec|
|
|
20
20
|
|
21
21
|
spec.required_ruby_version = ">= 2.1.0"
|
22
22
|
spec.add_dependency "activerecord", ">= 4.2"
|
23
|
-
spec.add_dependency "its-it"
|
24
23
|
spec.add_dependency "modware", "~> 0.1"
|
25
24
|
|
26
25
|
spec.add_development_dependency "bundler", "~> 1.7"
|
27
26
|
spec.add_development_dependency "rake", "~> 10.0"
|
28
27
|
spec.add_development_dependency "rspec", "~> 3.0"
|
29
28
|
spec.add_development_dependency "rspec-given", "~> 3.6"
|
29
|
+
spec.add_development_dependency "its-it"
|
30
30
|
spec.add_development_dependency "schema_dev", "~> 3.7"
|
31
31
|
spec.add_development_dependency "simplecov"
|
32
32
|
spec.add_development_dependency "simplecov-gem-profile"
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: schema_monkey
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ronen barzel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-06-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -24,20 +24,6 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '4.2'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: its-it
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: modware
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -108,6 +94,20 @@ dependencies:
|
|
108
94
|
- - "~>"
|
109
95
|
- !ruby/object:Gem::Version
|
110
96
|
version: '3.6'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: its-it
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: schema_dev
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|