whisk-rails 0.2.0 → 0.3.0

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: 04e262794922e151102b03b3b07b8673a689f328
4
- data.tar.gz: 779bc4493a2ce0b26d0af9adec5b4882f242e6eb
3
+ metadata.gz: ba5f1b022f3d278a5f22778fe6f6311242c97e0f
4
+ data.tar.gz: d58d595789093a379333ea4c96881a9002c06464
5
5
  SHA512:
6
- metadata.gz: 0d6aa683654d7b8dbbb73218a9f014826c988207ac6bda9f547e01db5d6ba533fbc952a793029c8819c8d3f0bc5f69e59c5d0030adb35387f5c3239919daa209
7
- data.tar.gz: 703b09af92aa960f5198cdc0cdda1e9b4731780856b0a0df1a9d97e842cf65347927dce4f6eaa1fde12a8a22c3db73a8ad3a2f643dabf5e488bdfda2ff2d4494
6
+ metadata.gz: 383e5945ce883f0370ef2b1be80da8e27710ff73def13adda0cd4692840b9180b0710086d4ceaff30556bb24f6221fd36525304ee629d618dbf1167bbd09e57b
7
+ data.tar.gz: 88dcae5495864be37ee175ef14dc637bf66930da17c0ad9c130fd96456e214d20a69ed1e23fc792eebe902899cc2e75a1dda0b673f686e8270b11cf5ea320cd9
data/README.md CHANGED
@@ -8,6 +8,8 @@
8
8
 
9
9
  Welcome to whisk.
10
10
 
11
+ A gem we use @[Hoppinger](www.hoppinger.com) in order to scramble our data. whisk-rails uses the faker gem in order to generate random data to be used whilst scrambling.
12
+
11
13
  ## Installation
12
14
 
13
15
  Add this line to your application's Gemfile:
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- whisk-rails (0.2.0)
4
+ whisk-rails (0.3.0)
5
5
  faker (~> 1.6.3)
6
6
  mime-types (< 3.0)
7
7
  thor (~> 0.19.1)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../
3
3
  specs:
4
- whisk-rails (0.2.0)
4
+ whisk-rails (0.3.0)
5
5
  faker (~> 1.6.3)
6
6
  mime-types (< 3.0)
7
7
  thor (~> 0.19.1)
@@ -0,0 +1,19 @@
1
+ module Whisk
2
+ module Logger
3
+ class << self
4
+ attr_writer :logger
5
+ end
6
+
7
+ def log(message)
8
+ logger.info("[whisk-rails] #{message}") if logging?
9
+ end
10
+
11
+ def logger
12
+ @logger ||= options[:logger] || ::Logger.new(STDOUT)
13
+ end
14
+
15
+ def logging?
16
+ options[:log]
17
+ end
18
+ end
19
+ end
data/lib/whisk/odinson.rb CHANGED
@@ -31,7 +31,7 @@ module Whisk
31
31
  end
32
32
 
33
33
  def conf
34
- YAML.load_file("#{ENV['RAILS_ENV'] == 'test' ? 'spec/fixtures/' : '' }.whisk.yml")
34
+ YAML.load_file("#{ENV['RAILS_ENV'] == 'test' ? 'spec/fixtures/' : ''}.whisk.yml")
35
35
  rescue
36
36
  raise Errno::ENOENT, '.whisk.yml not found'
37
37
  end
data/lib/whisk/rails.rb CHANGED
@@ -19,6 +19,7 @@ module Whisk
19
19
  end
20
20
  val = faker_klass.send(field[:method])
21
21
  object.update_column(field[:field], val)
22
+ Whisk.log "Updated #{object.class} #{object.id} with #{val}"
22
23
  end
23
24
  end
24
25
  end
data/lib/whisk/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Whisk
2
- VERSION = '0.2.0'
2
+ VERSION = '0.3.0'
3
3
  end
data/lib/whisk.rb CHANGED
@@ -1,7 +1,21 @@
1
1
  require 'faker'
2
+ require 'logger'
2
3
 
3
4
  require 'whisk/rails'
4
5
  require 'whisk/version'
6
+ require 'whisk/logger'
5
7
 
6
8
  module Whisk
9
+ extend Logger
10
+
11
+ class << self
12
+ attr_writer :logger
13
+ end
14
+
15
+ def self.options
16
+ @options ||= {
17
+ log: true,
18
+ logger: nil
19
+ }
20
+ end
7
21
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: whisk-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dunya Kirkali
@@ -151,6 +151,7 @@ files:
151
151
  - gemfiles/rails4.0.gemfile
152
152
  - gemfiles/rails4.0.gemfile.lock
153
153
  - lib/whisk.rb
154
+ - lib/whisk/logger.rb
154
155
  - lib/whisk/odinson.rb
155
156
  - lib/whisk/rails.rb
156
157
  - lib/whisk/rails/railtie.rb