seeding_utils 0.0.1 → 0.0.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: 01a703ee260dde1c9a61e85b2120628812041361
4
- data.tar.gz: 9fc2986bd93be82be7fb7da99cef1932d43ec107
3
+ metadata.gz: 1632bb5e3f79c6ce545c09e2582ee1375b83f955
4
+ data.tar.gz: a28eb9d72d4fa1b427349abf969f7c773f61cc38
5
5
  SHA512:
6
- metadata.gz: 15e476c55dec624377745ad0a3a14e274812f349a7a464b16eb1746b0da50f9f0833f26dd08d471737fd027235208b797f053261309106c88673cf8962c4360b
7
- data.tar.gz: 47d6cfb73b7ab92867b3d288908718a18d5f0d2e74f332e313eff06dd311480ac57b9c76f73699a793c68baa03bbeab1904745aea45dbe0f469f16e5be33b652
6
+ metadata.gz: 81a9708709fe316ef4369a03746a1fc87407c1b1b19b6cb7b1ab908b661e355622d8b88f1aab58f28f6cba07bea6ec458c20849a95e15ef424a046beeafba4ae
7
+ data.tar.gz: 0a17c42831976d762de43f5fe4ac4b45b5bfb2d71598dafb092819786b154a0c48e4c2e7ff017e9ac61ebf5a0dfb030e1143f7fda98c938f46debb50dddbf280
@@ -22,19 +22,20 @@ module SeedingUtils
22
22
 
23
23
  class Table
24
24
 
25
- attr_accessor :name, :quoted_name
25
+ attr_accessor :name, :quoted_name, :prefix
26
26
 
27
- def initialize(name)
27
+ def initialize(name, prefix = ' ->')
28
28
  @conn = SeedingUtils.connection
29
29
  self.name = name
30
30
  self.quoted_name = PG::Connection.quote_ident(name)
31
+ self.prefix = prefix
31
32
  end
32
33
 
33
34
  def seed(cache_file = nil, &block)
34
35
  path = Pathname(cache_file.to_s)
35
36
  return seed_uncached(&block) if cache_file.nil?
36
37
  if path.file?
37
- puts %{-- Loading #{name} seeds from cache}
38
+ puts %{#{prefix} loading #{name} seeds from cache}
38
39
  @conn.exec %{DELETE FROM #{quoted_name}}
39
40
  load path.open 'r:binary'
40
41
  elsif block_given?
@@ -46,7 +47,7 @@ module SeedingUtils
46
47
  end
47
48
 
48
49
  def seed_uncached(&block)
49
- puts %{-- Loading #{name} seeds without cache}
50
+ puts %{#{prefix} loading #{name} seeds without cache}
50
51
  yield
51
52
  end
52
53
 
@@ -1,3 +1,3 @@
1
1
  module SeedingUtils
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: seeding_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Norman Clarke