cutest-cj 1.6.0 → 1.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cutest/database.rb +9 -9
- data/lib/cutest.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9dc54bc65945640f1328b3cf1c5dc96dd62c0d4
|
4
|
+
data.tar.gz: a1feb61d9b24b2c5da5e079659340a2b6d89f887
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee57d3f328fbd4f05f8e4b57bdac4aacc8034c8fe862d7a6b15f327a35c4a0f60b4aed1bc41be666e59580d35414ce1636d7d4ac8ea7ec0786bd30e8b5294b4c
|
7
|
+
data.tar.gz: 165dd7d3d43f84bdaf685826b634157c1a00d226a5c69ea5b34d4e1ee184a8bb635378a63c1ef5d5094116706188e200d24f965f91a9aed8191797a2b4fee68c
|
data/lib/cutest/database.rb
CHANGED
@@ -30,13 +30,15 @@ class Cutest
|
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
|
-
def reset
|
34
|
-
connect
|
33
|
+
def reset database = false, options = {}
|
34
|
+
connect database
|
35
|
+
|
36
|
+
c = config.merge options
|
35
37
|
|
36
38
|
ignore_tables = %w(schema_migrations)
|
37
39
|
|
38
|
-
if
|
39
|
-
ignore_tables.concat
|
40
|
+
if c.key? :ignore_tables
|
41
|
+
ignore_tables.concat c[:ignore_tables]
|
40
42
|
end
|
41
43
|
|
42
44
|
conn = ActiveRecord::Base.connection
|
@@ -51,12 +53,10 @@ class Cutest
|
|
51
53
|
end
|
52
54
|
end
|
53
55
|
|
54
|
-
def connect
|
55
|
-
return if ActiveRecord::Base.connected?
|
56
|
-
|
56
|
+
def connect database = false
|
57
57
|
ActiveRecord::Base.default_timezone = Time.zone
|
58
58
|
|
59
|
-
db = URI.parse config[:url]
|
59
|
+
db = URI.parse database || config[:url]
|
60
60
|
|
61
61
|
ActiveRecord::Base.establish_connection(
|
62
62
|
adapter: db.scheme == 'postgres' ? 'postgresql' : db.scheme,
|
@@ -71,7 +71,7 @@ class Cutest
|
|
71
71
|
end
|
72
72
|
|
73
73
|
def config
|
74
|
-
Cutest.config.database
|
74
|
+
Cutest.config.database.clone
|
75
75
|
end
|
76
76
|
end
|
77
77
|
end
|
data/lib/cutest.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cutest-cj
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Damian Janowski
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-07-
|
13
|
+
date: 2014-07-28 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: pry
|