data_resurrection 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -31,6 +31,7 @@ module DataResurrection
31
31
  table.columns.map {|c| generated_field_name(c.name.downcase, reserved_words) })
32
32
  replace_table_name(schema, table_name)
33
33
  replace_types(schema, field_types) if field_types
34
+ no_id(schema)
34
35
  eval(schema)
35
36
  end
36
37
 
@@ -100,6 +101,13 @@ module DataResurrection
100
101
  end
101
102
  end
102
103
 
104
+ def no_id(schema)
105
+ schema =~ /create_table "(.+)"/
106
+ table_name = $1
107
+ schema['create_table "%s"' % table_name] =
108
+ 'create_table "%s", :id => false' % table_name
109
+ end
110
+
103
111
  def all_valid?(string)
104
112
  string.chars.all? {|c| VALID_CHARS.include? c }
105
113
  end
@@ -139,6 +139,7 @@ HANDLER
139
139
  HAVING
140
140
  HOLD
141
141
  HOUR
142
+ ID
142
143
  IDENTITY
143
144
  IF
144
145
  IMMEDIATE
@@ -335,4 +336,5 @@ WITHOUT
335
336
  WORK
336
337
  WRITE
337
338
  YEAR
338
- ZONE
339
+ ZONE
340
+
@@ -1,3 +1,4 @@
1
+ require 'active_record'
1
2
  data_resurrection_folder = File.join(File.dirname(__FILE__), 'data_resurrection', '*.rb')
2
3
  Dir.glob(data_resurrection_folder).each {|f| require f }
3
4
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: data_resurrection
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,12 +9,12 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-08-30 00:00:00.000000000 -03:00
12
+ date: 2011-09-02 00:00:00.000000000 -03:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord
17
- requirement: &7166360 !ruby/object:Gem::Requirement
17
+ requirement: &10113780 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ~>
@@ -22,21 +22,21 @@ dependencies:
22
22
  version: 3.0.0
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *7166360
25
+ version_requirements: *10113780
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: dbf
28
- requirement: &7165900 !ruby/object:Gem::Requirement
28
+ requirement: &10113320 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ~>
32
32
  - !ruby/object:Gem::Version
33
- version: 1.5.0
33
+ version: 1.6.0
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *7165900
36
+ version_requirements: *10113320
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: sqlite3
39
- requirement: &7205600 !ruby/object:Gem::Requirement
39
+ requirement: &10112860 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ~>
@@ -44,10 +44,10 @@ dependencies:
44
44
  version: 1.3.0
45
45
  type: :development
46
46
  prerelease: false
47
- version_requirements: *7205600
47
+ version_requirements: *10112860
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: rspec
50
- requirement: &7205140 !ruby/object:Gem::Requirement
50
+ requirement: &10112400 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ~>
@@ -55,7 +55,7 @@ dependencies:
55
55
  version: 2.6.0
56
56
  type: :development
57
57
  prerelease: false
58
- version_requirements: *7205140
58
+ version_requirements: *10112400
59
59
  description: Converts DBF to modern formats.
60
60
  email: rmanhaes@gmail.com
61
61
  executables: []