dibber 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,14 +1,14 @@
1
1
  == Dibber
2
2
 
3
- A set of tool to tidy up rails seeds.rb files.
3
+ A set of tools to tidy up rails seeds.rb files.
4
4
 
5
5
  Dibber has two compoments:
6
6
 
7
7
  === Seeder
8
- is designed to simplify the process of pulling attributes from
8
+ Seeder is designed to simplify the process of pulling attributes from
9
9
  YAML files, and populating ActiveRecord objects with those attributes.
10
10
 
11
11
  === ProcessLog
12
- provides Seeder with a simple before and after reporting tool.
12
+ ProcessLog provides Seeder with a simple before and after reporting tool.
13
13
 
14
- Have a look at the examples folder, for a guide to how Dibber is used.
14
+ Have a look at the lib/examples folder, for a guide to how Dibber is used.
@@ -8,7 +8,7 @@ module Dibber
8
8
 
9
9
  def self.start_process_log
10
10
  @process_log = ProcessLog.new
11
- @process_log.start :time, 'Time.now.to_s(:long_time)'
11
+ @process_log.start :time, 'Time.now.strftime("%Y-%b-%d %H:%M:%S.%3N %z")'
12
12
  return @process_log
13
13
  end
14
14
 
@@ -1,3 +1,3 @@
1
1
  module Dibber
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -1,4 +1,4 @@
1
- require_relative 'process_log'
1
+ require 'process_log'
2
2
 
3
3
  process_log = ProcessLog.new
4
4
  process_log.start :time_one, 'Time.now'
@@ -1,4 +1,4 @@
1
- Seeder = Dibble::Seeder
1
+ Seeder = Dibber::Seeder
2
2
 
3
3
  # Set up the path to seed YAML files
4
4
  Seeder.seeds_path = "#{Rails.root}/db/seeds"
@@ -20,9 +20,9 @@ AdminUser.create!(
20
20
  :password_confirmation => password
21
21
  ) unless AdminUser.exists?(:email => admin_email)
22
22
 
23
- # Example 3. Seeder grabs the attributes from the YAML and build a
23
+ # Example 3. Seeder grabs the attributes from the YAML and builds a
24
24
  # set of Fee objects with those attributes (or updates them if
25
- # they already exist.
25
+ # they already exist).
26
26
  # Note that the build process requires the model to have a name field.
27
27
  Seeder.new(Fee, 'fees.yml').build
28
28
 
@@ -33,5 +33,8 @@ Seeder.new(Disclaimer::Document, 'disclaimer/documents.yml').build
33
33
  Seeder.new(Category, 'categories.yml', 'description').build
34
34
 
35
35
  # Output a report showing how the numbers of each type of object
36
- # have changed through the process.
37
- puts Seeder.report
36
+ # have changed through the process. Also has a log of start and end time.
37
+ puts Seeder.report
38
+
39
+ # You can also access Seeders attached process log, and set up a custom log
40
+ Seeder.process_log.start('First questionnaire questions', 'Questionnaire.count > 0 ? Questionnaire.first.questions.length : 0')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dibber
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-07 00:00:00.000000000 Z
12
+ date: 2012-11-19 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Packages up code needed to pull data from YAML files when seeding, and
15
15
  adds a process log.