flattendb 0.1.2 → 0.1.3

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.
data/README CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  == VERSION
4
4
 
5
- This documentation refers to flattendb version 0.1.2
5
+ This documentation refers to flattendb version 0.1.3
6
6
 
7
7
 
8
8
  == DESCRIPTION
data/bin/flattendb CHANGED
@@ -1,4 +1,4 @@
1
- #! /usr/bin/ruby
1
+ #! /usr/bin/env ruby
2
2
 
3
3
  #--
4
4
  ###############################################################################
data/bin/flattendb.mdb CHANGED
@@ -1,4 +1,4 @@
1
- #! /usr/bin/ruby
1
+ #! /usr/bin/env ruby
2
2
 
3
3
  $flattendb = (ext = File.extname(__FILE__)).sub(/\A\./, '')
4
4
  load __FILE__.sub(/#{Regexp.escape(ext)}\z/, '')
data/bin/flattendb.mysql CHANGED
@@ -1,4 +1,4 @@
1
- #! /usr/bin/ruby
1
+ #! /usr/bin/env ruby
2
2
 
3
3
  $flattendb = (ext = File.extname(__FILE__)).sub(/\A\./, '')
4
4
  load __FILE__.sub(/#{Regexp.escape(ext)}\z/, '')
@@ -111,11 +111,15 @@ module FlattenDB
111
111
  columns[table] << $1 if table
112
112
  when /\A\).*;\Z/
113
113
  table = nil
114
- when /\AINSERT\s+INTO\s+`(.+?)`\s+VALUES\s*(.*);\Z/i
115
- _columns = columns[_table = $1]
114
+ when /\AINSERT\s+INTO\s+`(.+?)`\s+(?:\((.+?)\)\s+)?VALUES\s*(.*);\Z/i
115
+ _table, _columns, _values = $1, $2, $3
116
+
117
+ _columns = _columns.nil? ? columns[_table] :
118
+ _columns.split(/\s*,\s*/).each { |column| column.delete!('`') }
119
+
116
120
  next if _columns.empty?
117
121
 
118
- parser.parse($2) { |row|
122
+ parser.parse(_values) { |row|
119
123
  fields = {}
120
124
 
121
125
  row.each_with_index { |value, index|
@@ -4,7 +4,7 @@ module FlattenDB
4
4
 
5
5
  MAJOR = 0
6
6
  MINOR = 1
7
- TINY = 2
7
+ TINY = 3
8
8
 
9
9
  class << self
10
10
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flattendb
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 2
10
- version: 0.1.2
9
+ - 3
10
+ version: 0.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jens Wille
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-07-18 00:00:00 Z
18
+ date: 2011-08-16 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: libxml-ruby
@@ -113,14 +113,14 @@ licenses: []
113
113
 
114
114
  post_install_message:
115
115
  rdoc_options:
116
- - --charset
117
- - UTF-8
118
116
  - --main
119
117
  - README
118
+ - --all
119
+ - --charset
120
+ - UTF-8
120
121
  - --title
121
- - flattendb Application documentation (v0.1.2)
122
+ - flattendb Application documentation (v0.1.3)
122
123
  - --line-numbers
123
- - --all
124
124
  require_paths:
125
125
  - lib
126
126
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -144,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
144
  requirements: []
145
145
 
146
146
  rubyforge_project: prometheus
147
- rubygems_version: 1.8.5
147
+ rubygems_version: 1.8.8
148
148
  signing_key:
149
149
  specification_version: 3
150
150
  summary: Flatten relational databases.