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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 456b761581b8d51f94fbdf6579ffa33c2d20409c
4
- data.tar.gz: 98e36c06af46526235073984496c6590b83bd8a4
3
+ metadata.gz: f9dc54bc65945640f1328b3cf1c5dc96dd62c0d4
4
+ data.tar.gz: a1feb61d9b24b2c5da5e079659340a2b6d89f887
5
5
  SHA512:
6
- metadata.gz: 77578fa5641ba20d8c391cd10b4582c41a940a6c5b9061a6e24495f4a35873a944778ffc89cb35651370e165dba6d90decd6b9008a6c7359d3b782e12c03e4a6
7
- data.tar.gz: a691abf3485f5be697a004c18cdb8c09ec6b06865deaa70039363607f9779438f2ec1e211201b9d0b1bc03374a7f183f4e9e5fbd699e77f6eb9b7ce133ad17d2
6
+ metadata.gz: ee57d3f328fbd4f05f8e4b57bdac4aacc8034c8fe862d7a6b15f327a35c4a0f60b4aed1bc41be666e59580d35414ce1636d7d4ac8ea7ec0786bd30e8b5294b4c
7
+ data.tar.gz: 165dd7d3d43f84bdaf685826b634157c1a00d226a5c69ea5b34d4e1ee184a8bb635378a63c1ef5d5094116706188e200d24f965f91a9aed8191797a2b4fee68c
@@ -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 config.key? :ignore_tables
39
- ignore_tables.concat config[:ignore_tables]
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
@@ -7,7 +7,7 @@ class Cutest
7
7
  autoload :Database, 'cutest/database'
8
8
 
9
9
  unless defined?(VERSION)
10
- VERSION = "1.6.0"
10
+ VERSION = "1.6.1"
11
11
  FILTER = %r[/(ruby|jruby|rbx)[-/]([0-9\.])+]
12
12
  CACHE = Hash.new { |h, k| h[k] = File.readlines(k) }
13
13
  end
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.0
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-24 00:00:00.000000000 Z
13
+ date: 2014-07-28 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: pry