ydd 0.0.8 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,7 +22,7 @@ Note that this creates a `schema.rb` and a `data.yml` in the data dump directory
22
22
 
23
23
  ## Credits
24
24
 
25
- This gem is maintained by Darcy Laycock.
25
+ This gem is maintained by Darcy Laycock and Dirk Kelly.
26
26
 
27
27
  Created by Orion Henry and Adam Wiggins. Major updates by Ricardo Chimal, Jr.
28
28
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.8
1
+ 0.0.9
data/lib/ydd.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'yaml'
2
2
  require 'active_support'
3
+ require 'active_support/core_ext/module/attribute_accessors'
3
4
  require 'active_record'
4
5
  require 'fileutils'
5
6
 
@@ -59,6 +59,7 @@ module YDD
59
59
  columns = column_names.map{ |cn| YDD.connection.columns(table).detect{ |c| c.name == cn } }
60
60
  quoted_column_names = column_names.map { |column| YDD.connection.quote_column_name(column) }.join(',')
61
61
  quoted_table_name = SerializationHelper::Utils.quote_table(table)
62
+ records.sort_by! { |r| r['id'].to_i } if column_names.include? 'id'
62
63
  records.each do |record|
63
64
  quoted_values = record.zip(columns).map{|c| YDD.connection.quote(c.first, c.last)}.join(',')
64
65
  YDD.connection.execute("INSERT INTO #{quoted_table_name} (#{quoted_column_names}) VALUES (#{quoted_values})")
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ydd}
8
- s.version = "0.0.8"
8
+ s.version = "0.0.9"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Adam Wiggins", "Orion Henry", "Darcy Laycock"]
12
- s.date = %q{2010-11-08}
12
+ s.date = %q{2010-11-30}
13
13
  s.default_executable = %q{ydd}
14
14
  s.description = %q{
15
15
  YDD is a tool (a fork of yaml_db really) to make it generally easy
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ydd
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 8
10
- version: 0.0.8
9
+ - 9
10
+ version: 0.0.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Adam Wiggins
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2010-11-08 00:00:00 +08:00
20
+ date: 2010-11-30 00:00:00 +08:00
21
21
  default_executable: ydd
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency