legacy_data 0.1.12 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. data/.rvmrc +1 -0
  2. data/History.txt +2 -2
  3. data/README.md +6 -4
  4. data/Rakefile +9 -11
  5. data/VERSION +1 -1
  6. data/examples/generated/blog_mysql/factories.rb +3 -3
  7. data/examples/generated/blog_sqlite3/factories.rb +4 -4
  8. data/examples/generated/drupal_mysql/factories.rb +321 -321
  9. data/examples/generated/j2ee_petstore_mysql/factories.rb +39 -39
  10. data/examples/generated/j2ee_petstore_oracle/factories.rb +36 -36
  11. data/examples/generated/j2ee_petstore_sqlite3/factories.rb +39 -39
  12. data/legacy_data.gemspec +4 -3
  13. data/lib/{active_record/connection_adapters/oracleenhanced_adapter.rb → foreigner/connection_adapters/oracle_enhanced_adapter.rb} +0 -0
  14. data/lib/generators/models_from_tables/USAGE +12 -0
  15. data/lib/generators/models_from_tables/models_from_tables_generator.rb +70 -0
  16. data/lib/generators/models_from_tables/templates/model.rb +11 -0
  17. data/lib/legacy_data.rb +6 -7
  18. data/lib/legacy_data/schema.rb +1 -0
  19. data/lib/legacy_data/table_class_name_mapper.rb +4 -2
  20. data/lib/legacy_data/table_definition.rb +1 -2
  21. data/spec/functional/blog_adapterspec.rb +13 -13
  22. data/spec/functional/drupal_adapterspec.rb +14 -12
  23. data/spec/functional/functional_spec_helper.rb +3 -5
  24. data/spec/functional/j2ee_petstore_adapterspec.rb +14 -14
  25. data/spec/generators/models_from_tables/expected/factories.rb +5 -0
  26. data/spec/{expected → generators/models_from_tables/expected}/post.rb +0 -0
  27. data/spec/{models_from_tables_generator_spec.rb → generators/models_from_tables/models_from_tables_generator_spec.rb} +28 -28
  28. data/spec/legacy_data/schema_spec.rb +0 -1
  29. data/spec/legacy_data/table_class_name_mapper_spec.rb +1 -4
  30. data/spec/spec_helper.rb +46 -28
  31. metadata +66 -49
  32. data/generators/models_from_tables/USAGE +0 -6
  33. data/generators/models_from_tables/models_from_tables_generator.rb +0 -78
  34. data/generators/models_from_tables/templates/model.rb +0 -11
  35. data/spec/expected/factories.rb +0 -5
@@ -15,7 +15,6 @@ module LegacyData
15
15
  end
16
16
 
17
17
  def unconventional_primary_key?
18
- puts self.inspect if primary_key.nil?
19
18
  primary_key != 'id'
20
19
  end
21
20
 
@@ -31,7 +30,7 @@ module LegacyData
31
30
  class_for_table = TableDefinition.class_name_for(table_name)
32
31
  association_name = class_for_table.underscore
33
32
  association_name = association_name.pluralize unless is_singular_association
34
- needs_class_name = (ActiveRecord::Base.class_name(association_name.pluralize) != class_for_table)
33
+ needs_class_name = (LegacyData.conventional_class_name(association_name) != class_for_table)
35
34
  options[:class_name] = class_for_table if needs_class_name
36
35
 
37
36
  spaces = association_with_longest_name.size - association_name.size
@@ -1,7 +1,9 @@
1
1
  require File.expand_path(File.dirname(__FILE__) + '/functional_spec_helper')
2
2
 
3
3
 
4
- describe "Generating models from a blog #{ENV['ADAPTER']} database" do
4
+ describe ModelsFromTablesGenerator, "Generating models from a blog #{ENV['ADAPTER']} database" do
5
+ include GeneratorSpecHelper
6
+
5
7
  before :all do
6
8
  @adapter = ENV['ADAPTER']
7
9
  @example = :blog
@@ -13,32 +15,30 @@ describe "Generating models from a blog #{ENV['ADAPTER']} database" do
13
15
  require File.expand_path(File.dirname(__FILE__) + '/../../examples/blog_migration')
14
16
  create_blog_tables
15
17
 
16
- silence_warnings { RAILS_ROOT = File.expand_path("#{File.dirname(__FILE__)}/../../output/functional/#{@example}_#{@adapter}") }
17
- FileUtils.mkdir_p(RAILS_ROOT + '/app/models')
18
- FileUtils.mkdir_p(RAILS_ROOT + '/spec')
18
+ self.destination_root = File.expand_path("#{File.dirname(__FILE__)}/../../output/functional/#{@example}_#{@adapter}")
19
+ FileUtils.mkdir_p(destination_root + '/app/models')
20
+ FileUtils.mkdir_p(destination_root + '/spec')
19
21
 
20
- LegacyData::Schema.stub!(:log)
21
-
22
22
  @expected_directory = File.expand_path("#{File.dirname(__FILE__)}/../../examples/generated/#{@example}_#{@adapter}")
23
23
  end
24
- after :all do
25
- Object.send(:remove_const, :RAILS_ROOT)
26
- end
27
24
 
28
25
  before :each do #
29
26
  pending("oracle does not yet work with t.foreign_key table creation") if @adapter == 'oracle'
30
- FileUtils.rm(RAILS_ROOT + '/spec/factories.rb', :force => true)
31
- invoke_generator('models_from_tables', ["--with-factories"], :create)
27
+
28
+ Rails.stub!(:root).and_return(destination_root)
29
+
30
+ FileUtils.rm(destination_root + '/spec/factories.rb', :force => true)
31
+ run_generator []
32
32
  end
33
33
 
34
34
  %w( post comment tag ).each do |model|
35
35
  it "should generate the expected #{model} model" do
36
- File.read(RAILS_ROOT + "/app/models/#{model}.rb").should == File.read("#{@expected_directory}/#{model}.rb")
36
+ File.read(destination_root + "/app/models/#{model}.rb").should == File.read("#{@expected_directory}/#{model}.rb")
37
37
  end
38
38
  end
39
39
 
40
40
  it "should generated the expected factories" do
41
- File.read(RAILS_ROOT + '/spec/factories.rb').should == File.read("#{@expected_directory}/factories.rb")
41
+ File.read(destination_root + '/spec/factories.rb' ).should == File.read("#{@expected_directory}/factories.rb")
42
42
  end
43
43
 
44
44
  end
@@ -6,7 +6,9 @@ if ENV['ADAPTER'] == 'mysql'
6
6
  execute_sql_script(File.expand_path(File.dirname(__FILE__) + '/../../examples/drupal_6_14.sql'))
7
7
  end
8
8
 
9
- describe "Generating models from a drupal 6.14 #{ENV['ADAPTER']} database" do
9
+ describe ModelsFromTablesGenerator, "Generating models from a drupal 6.14 #{ENV['ADAPTER']} database" do
10
+ include GeneratorSpecHelper
11
+
10
12
  before :all do
11
13
  @adapter = ENV['ADAPTER']
12
14
  @example = :drupal
@@ -16,9 +18,9 @@ if ENV['ADAPTER'] == 'mysql'
16
18
  initialize_connection connection_info
17
19
  create_drupal_schema
18
20
 
19
- silence_warnings { RAILS_ROOT = File.expand_path("#{File.dirname(__FILE__)}/../../output/functional/#{@example}_#{@adapter}") }
20
- FileUtils.mkdir_p(RAILS_ROOT + '/app/models')
21
- FileUtils.mkdir_p(RAILS_ROOT + '/spec')
21
+ self.destination_root = File.expand_path("#{File.dirname(__FILE__)}/../../output/functional/#{@example}_#{@adapter}")
22
+ FileUtils.mkdir_p(destination_root + '/app/models')
23
+ FileUtils.mkdir_p(destination_root + '/spec')
22
24
 
23
25
  LegacyData::Schema.stub!(:log)
24
26
 
@@ -26,13 +28,13 @@ if ENV['ADAPTER'] == 'mysql'
26
28
 
27
29
  LegacyData::TableClassNameMapper.dictionary['files'] = 'UploadedFiles' #to avoid collision with Ruby File class
28
30
  LegacyData::TableClassNameMapper.dictionary['cache'] = 'Cache' #don't strip the e to make it cach
29
-
30
- FileUtils.rm(RAILS_ROOT + '/spec/factories.rb', :force => true)
31
- invoke_generator('models_from_tables', ["--with-factories"], :create)
32
-
33
31
  end
34
- after :all do
35
- Object.send(:remove_const, :RAILS_ROOT)
32
+
33
+ before :each do
34
+ Rails.stub!(:root).and_return(destination_root)
35
+
36
+ FileUtils.rm(destination_root + '/spec/factories.rb', :force => true)
37
+ run_generator []
36
38
  end
37
39
 
38
40
  %w( access action actions_aid authmap batch block blocks_role
@@ -43,12 +45,12 @@ if ENV['ADAPTER'] == 'mysql'
43
45
  term_node term_relation term_synonym uploaded_files url_alias user users_role
44
46
  variable vocabulary vocabulary_node_type watchdog ).each do |model|
45
47
  it "should generate the expected #{model} model" do
46
- File.read(RAILS_ROOT + "/app/models/#{model}.rb").should == File.read("#{@expected_directory}/#{model}.rb")
48
+ File.read(destination_root + "/app/models/#{model}.rb").should == File.read("#{@expected_directory}/#{model}.rb")
47
49
  end
48
50
  end
49
51
 
50
52
  it "should generated the expected factories" do
51
- File.read(RAILS_ROOT + '/spec/factories.rb').should == File.read("#{@expected_directory}/factories.rb")
53
+ File.read(destination_root + '/spec/factories.rb').should == File.read("#{@expected_directory}/factories.rb")
52
54
  end
53
55
  end
54
56
  end
@@ -2,15 +2,13 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
2
2
 
3
3
  ADAPTER = ENV['ADAPTER']
4
4
 
5
+ require 'generators/models_from_tables/models_from_tables_generator'
5
6
 
6
7
  def initialize_connection connection_info
7
8
  ActiveRecord::Base.establish_connection(connection_info)
8
9
 
9
- begin
10
- require "foreigner/connection_adapters/#{ActiveRecord::Base.connection.adapter_name.downcase}_adapter"
11
- rescue LoadError
12
- #foreigner does not support all adapters (i.e. sqlite3)
13
- end
10
+ # tell foreigner to reload the adapter
11
+ Foreigner.load_adapter!
14
12
  end
15
13
 
16
14
 
@@ -5,7 +5,9 @@ def create_j2ee_petstore_schema
5
5
  execute_sql_script(File.expand_path(File.dirname(__FILE__) + '/../../examples/create_j2ee_petstore.sql') )
6
6
  end
7
7
 
8
- describe "Generating models from j2ee petstore #{ENV['ADAPTER']} database" do
8
+ describe ModelsFromTablesGenerator, "Generating models from j2ee petstore #{ENV['ADAPTER']} database" do
9
+ include GeneratorSpecHelper
10
+
9
11
  before :all do
10
12
  @adapter = ENV['ADAPTER']
11
13
  @example = :j2ee_petstore
@@ -15,25 +17,23 @@ describe "Generating models from j2ee petstore #{ENV['ADAPTER']} database" do
15
17
  initialize_connection connection_info
16
18
  create_j2ee_petstore_schema
17
19
 
18
- silence_warnings { RAILS_ROOT = File.expand_path("#{File.dirname(__FILE__)}/../../output/functional/#{@example}_#{@adapter}") }
19
- FileUtils.mkdir_p(RAILS_ROOT + '/app/models')
20
- FileUtils.mkdir_p(RAILS_ROOT + '/spec')
20
+ self.destination_root = File.expand_path("#{File.dirname(__FILE__)}/../../output/functional/#{@example}_#{@adapter}")
21
+ FileUtils.mkdir_p(destination_root + '/app/models')
22
+ FileUtils.mkdir_p(destination_root + '/spec')
21
23
 
22
24
  LegacyData::Schema.stub!(:log)
23
25
 
24
26
  @expected_directory = File.expand_path("#{File.dirname(__FILE__)}/../../examples/generated/#{@example}_#{@adapter}")
25
27
 
28
+ end
29
+
30
+ before :each do
31
+ Rails.stub!(:root).and_return(destination_root)
26
32
  LegacyData::TableClassNameMapper.dictionary['files'] = 'UploadedFiles' #to avoid collision with Ruby File class
27
33
  LegacyData::TableClassNameMapper.dictionary['cache'] = 'Cache' #don't strip the e to make it cach
28
34
 
29
- FileUtils.rm(RAILS_ROOT + '/spec/factories.rb', :force => true)
30
- invoke_generator('models_from_tables', ["--with-factories"], :create)
31
-
32
- end
33
-
34
-
35
- after :all do
36
- Object.send(:remove_const, :RAILS_ROOT)
35
+ FileUtils.rm(destination_root + '/spec/factories.rb', :force => true)
36
+ run_generator []
37
37
  end
38
38
 
39
39
  models = %w( address category id_gen item
@@ -47,11 +47,11 @@ describe "Generating models from j2ee petstore #{ENV['ADAPTER']} database" do
47
47
 
48
48
  models.each do |model|
49
49
  it "should generate the expected #{model} model" do
50
- File.read(RAILS_ROOT + "/app/models/#{model}.rb").should == File.read("#{@expected_directory}/#{model}.rb")
50
+ File.read(destination_root + "/app/models/#{model}.rb").should == File.read("#{@expected_directory}/#{model}.rb")
51
51
  end
52
52
  end
53
53
 
54
54
  it "should generated the expected factories" do
55
- File.read(RAILS_ROOT + '/spec/factories.rb').should == File.read("#{@expected_directory}/factories.rb")
55
+ File.read(destination_root + '/spec/factories.rb').should == File.read("#{@expected_directory}/factories.rb")
56
56
  end
57
57
  end
@@ -0,0 +1,5 @@
1
+ Factory.define :post do |post|
2
+ post.title 'some string'
3
+ post.body 'some string'
4
+ end
5
+
@@ -1,17 +1,19 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
1
+ require File.expand_path(File.dirname(__FILE__) + '../../../spec_helper')
2
+
3
+ require 'generators/models_from_tables/models_from_tables_generator'
4
+
5
+ describe ModelsFromTablesGenerator do
6
+ include GeneratorSpecHelper
2
7
 
3
- describe 'Models From Tables generator' do
4
8
  before :all do
5
- silence_warnings { RAILS_ROOT = File.expand_path(File.dirname(__FILE__) + '/../output') }
6
- FileUtils.mkdir_p(RAILS_ROOT + '/app/models')
7
- FileUtils.mkdir_p(RAILS_ROOT + '/spec')
8
- end
9
- after :all do
10
- Object.send(:remove_const, :RAILS_ROOT)
9
+ self.destination_root = File.expand_path(File.dirname(__FILE__) + '/../output')
10
+ FileUtils.mkdir_p(destination_root + '/app/models')
11
+ FileUtils.mkdir_p(destination_root + '/spec')
11
12
  end
12
13
 
13
14
  before :each do
14
- FileUtils.rm(RAILS_ROOT + '/spec/factories.rb', :force => true)
15
+ Rails.stub!(:root).and_return(destination_root)
16
+ FileUtils.rm(destination_root + '/spec/factories.rb', :force => true)
15
17
 
16
18
  @posts = LegacyData::TableDefinition.new( :class_name => 'Posts',
17
19
  :table_name => 'posts',
@@ -32,33 +34,31 @@ describe 'Models From Tables generator' do
32
34
  )
33
35
 
34
36
 
35
- LegacyData::Schema.should_receive(:analyze).with(hash_including(:table_name=>'posts')).and_return([@posts])
36
37
  LegacyData::TableClassNameMapper.should_receive(:let_user_validate_dictionary)
37
38
  LegacyData::TableClassNameMapper.stub!(:class_name_for).with('posts' ).and_return('Post')
38
39
  LegacyData::TableClassNameMapper.stub!(:class_name_for).with('comments').and_return('Comment')
39
40
  end
40
41
 
41
- it 'should generate a posts model' do
42
- invoke_generator('models_from_tables', ["--table-name", "posts"], :create)
42
+ describe 'with factories' do
43
+ before :each do
44
+ LegacyData::Schema.should_receive(:analyze).with(hash_including(:table_name=>'posts')).and_return([@posts])
45
+ run_generator %w(posts)
46
+ end
43
47
 
44
- File.read(RAILS_ROOT + '/app/models/post.rb').should == File.read(File.expand_path(File.dirname(__FILE__) + '/expected/post.rb'))
48
+ it 'should generate a posts model' do
49
+ File.read(destination_root + '/app/models/post.rb').should == File.read(File.expand_path(File.dirname(__FILE__) + '/expected/post.rb'))
50
+ end
51
+ it 'should generate factories' do
52
+ File.read(destination_root + '/spec/factories.rb' ).should == File.read(File.expand_path(File.dirname(__FILE__) + '/expected/factories.rb'))
53
+ end
45
54
  end
46
55
 
47
- it 'should not generate factories by default' do
48
- generator = load_generator('models_from_tables', ["--table-name", "posts"])
49
- generator.should_not_receive(:add_factory_girl_factory)
50
-
51
- cmd = generator.command(:create)
52
- cmd.stub!(:logger).and_return(stub('stub').as_null_object)
53
- cmd.invoke!
56
+ it 'should not generate factories when asked not to' do
57
+ LegacyData::Schema.should_receive(:analyze).with(hash_including(:table_name=>'posts')).and_return([@posts])
58
+ gen = generator %w(posts), %w(--with-factories false)
59
+ gen.should_not_receive(:add_factory_girl_factory)
60
+ capture(:stdout) { gen.invoke_all }
54
61
  end
55
62
 
56
- it 'should generate factories when asked' do
57
- generator = load_generator('models_from_tables', ["--table-name", "posts", "--with-factories"])
58
- cmd = generator.command(:create)
59
- cmd.stub!(:logger).and_return(stub('stub').as_null_object)
60
- cmd.invoke!
61
-
62
- File.read(RAILS_ROOT + '/spec/factories.rb').should == File.read(File.expand_path(File.dirname(__FILE__) + '/expected/factories.rb'))
63
- end
64
63
  end
64
+
@@ -22,7 +22,6 @@ describe LegacyData::Schema do
22
22
  LegacyData::Schema.should_receive(:puts).with("Warning: Table 'specific_table' does not exist")
23
23
  LegacyData::Schema.stub!(:connection=>connection=mock)
24
24
  connection.should_receive(:table_exists?).with('specific_table').and_return(false)
25
-
26
25
  LegacyData::Schema.initialize_tables('specific_table')
27
26
 
28
27
  LegacyData::Schema.table_definitions.keys.should == []
@@ -59,12 +59,9 @@ describe LegacyData::TableClassNameMapper do
59
59
 
60
60
  describe 'persisting the dictionary' do
61
61
  before :each do
62
- silence_warnings { RAILS_ROOT = 'test_rails_root' }
62
+ Rails.stub!(:root).and_return('test/rails/root')
63
63
  @dictionary_file_name = LegacyData::TableClassNameMapper.dictionary_file_name
64
64
  end
65
- after :each do
66
- Object.send(:remove_const, :RAILS_ROOT) if RAILS_ROOT=='test_rails_root'
67
- end
68
65
 
69
66
  it 'should load the dictionary from a file' do
70
67
  File.should_receive(:exists? ).with(@dictionary_file_name).and_return(true)
@@ -1,8 +1,11 @@
1
1
  require 'rubygems'
2
- require 'active_record'
3
- # require 'active_record/connection_adapters/oracle_enhanced_adapter'
2
+ # gem 'rspec'
3
+ # require 'spec'
4
+ # require 'spec/autorun'
4
5
 
6
+ $:.unshift(File.dirname(__FILE__) + '/../lib')
5
7
 
8
+ require 'active_record'
6
9
  # Since Legacy Data depends on Foreigner we need to have an ActiveRecord connection established
7
10
  ActiveRecord::Base.establish_connection({:adapter=>'sqlite3', :database=> ":memory:"})
8
11
 
@@ -11,38 +14,53 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
11
14
  require 'legacy_data'
12
15
 
13
16
 
14
- require 'spec'
15
- require 'spec/autorun'
17
+ # require 'spec'
18
+ # require 'spec/autorun'
16
19
 
17
20
  ### Load the rails generator code
18
- require 'rails_generator'
19
- require 'rails_generator/scripts'
20
- require 'rails_generator/scripts/generate'
21
+ # require 'rails_generator'
22
+ # require 'rails_generator/scripts'
23
+ # require 'rails_generator/scripts/generate'
21
24
 
22
- Rails::Generator::Base.reset_sources
23
- def add_source(path)
24
- Rails::Generator::Base.append_sources(Rails::Generator::PathSource.new(:builtin, path))
25
- end
26
- add_source(File.dirname(__FILE__) + '/../generators')
25
+ require 'active_support'
26
+ require 'rails/generators'
27
27
 
28
28
 
29
29
 
30
- def load_generator(generator_name="models_from_tables", args=[])
31
- Rails::Generator::Base.instance(generator_name,
32
- (args.dup << '--quiet'),
33
- {:generator=>generator_name, :command=>:create, :destination=>RAILS_ROOT}
34
- )
35
- end
30
+ ## Can we turn this into an rspec-rails GeneratorExampleGroup ??????
31
+ module GeneratorSpecHelper
32
+ attr_accessor :destination_root
33
+ def generator_class
34
+ self.class.describes
35
+ end
36
36
 
37
- def command_for_generator(generator_name, args, the_command= :create)
38
- generator = load_generator(generator_name, args)
39
- LegacyData::TableClassNameMapper.stub!(:log)
40
- cmd = generator.command(the_command)
41
- cmd.stub!(:logger).and_return(stub('stub').as_null_object)
42
- cmd
43
- end
37
+ # You can provide a configuration hash as second argument. This method returns the output
38
+ # printed by the generator.
39
+ def generator(args=generator.default_arguments, options={}, config={})
40
+ generator_class.new(args, options, config.reverse_merge(:destination_root => destination_root))
41
+ end
42
+
43
+ def run_generator(args=generator.default_arguments, options={}, config={})
44
+ capture(:stdout) {
45
+ generator(args, options, config).invoke_all
46
+ }
47
+ end
48
+
49
+ # Captures the given stream and returns it:
50
+ #
51
+ # stream = capture(:stdout){ puts "Cool" }
52
+ # stream # => "Cool\n"
53
+ #
54
+ def capture(stream)
55
+ begin
56
+ stream = stream.to_s
57
+ eval "$#{stream} = StringIO.new"
58
+ yield
59
+ result = eval("$#{stream}").string
60
+ ensure
61
+ eval("$#{stream} = #{stream.upcase}")
62
+ end
44
63
 
45
- def invoke_generator(generator_name, args, the_command= :create)
46
- cmd = command_for_generator(generator_name, args, the_command)
47
- cmd.invoke!
64
+ result
65
+ end
48
66
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: legacy_data
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 1
9
- - 12
10
- version: 0.1.12
8
+ - 2
9
+ - 0
10
+ version: 0.2.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Alex Rothenberg
@@ -15,27 +15,59 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-18 00:00:00 -05:00
18
+ date: 2010-12-02 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
- version_requirements: &id001 !ruby/object:Gem::Requirement
22
+ requirement: &id001 !ruby/object:Gem::Requirement
23
23
  none: false
24
24
  requirements:
25
25
  - - ~>
26
26
  - !ruby/object:Gem::Version
27
- hash: 9
27
+ hash: 5
28
28
  segments:
29
- - 2
30
29
  - 3
31
- - 5
32
- version: 2.3.5
33
- requirement: *id001
30
+ - 0
31
+ - 1
32
+ version: 3.0.1
33
+ type: :runtime
34
+ name: railties
35
+ prerelease: false
36
+ version_requirements: *id001
37
+ - !ruby/object:Gem::Dependency
38
+ requirement: &id002 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ~>
42
+ - !ruby/object:Gem::Version
43
+ hash: 5
44
+ segments:
45
+ - 3
46
+ - 0
47
+ - 1
48
+ version: 3.0.1
34
49
  type: :runtime
35
50
  name: activerecord
36
51
  prerelease: false
52
+ version_requirements: *id002
53
+ - !ruby/object:Gem::Dependency
54
+ requirement: &id003 !ruby/object:Gem::Requirement
55
+ none: false
56
+ requirements:
57
+ - - ~>
58
+ - !ruby/object:Gem::Version
59
+ hash: 5
60
+ segments:
61
+ - 3
62
+ - 0
63
+ - 1
64
+ version: 3.0.1
65
+ type: :runtime
66
+ name: activesupport
67
+ prerelease: false
68
+ version_requirements: *id003
37
69
  - !ruby/object:Gem::Dependency
38
- version_requirements: &id002 !ruby/object:Gem::Requirement
70
+ requirement: &id004 !ruby/object:Gem::Requirement
39
71
  none: false
40
72
  requirements:
41
73
  - - ~>
@@ -46,12 +78,12 @@ dependencies:
46
78
  - 9
47
79
  - 1
48
80
  version: 0.9.1
49
- requirement: *id002
50
81
  type: :runtime
51
82
  name: foreigner
52
83
  prerelease: false
84
+ version_requirements: *id004
53
85
  - !ruby/object:Gem::Dependency
54
- version_requirements: &id003 !ruby/object:Gem::Requirement
86
+ requirement: &id005 !ruby/object:Gem::Requirement
55
87
  none: false
56
88
  requirements:
57
89
  - - ~>
@@ -62,28 +94,28 @@ dependencies:
62
94
  - 8
63
95
  - 7
64
96
  version: 0.8.7
65
- requirement: *id003
66
97
  type: :development
67
98
  name: rake
68
99
  prerelease: false
100
+ version_requirements: *id005
69
101
  - !ruby/object:Gem::Dependency
70
- version_requirements: &id004 !ruby/object:Gem::Requirement
102
+ requirement: &id006 !ruby/object:Gem::Requirement
71
103
  none: false
72
104
  requirements:
73
105
  - - ~>
74
106
  - !ruby/object:Gem::Version
75
- hash: 25
107
+ hash: 11
76
108
  segments:
109
+ - 2
77
110
  - 1
78
- - 3
79
- - 1
80
- version: 1.3.1
81
- requirement: *id004
111
+ - 0
112
+ version: 2.1.0
82
113
  type: :development
83
114
  name: rspec
84
115
  prerelease: false
116
+ version_requirements: *id006
85
117
  - !ruby/object:Gem::Dependency
86
- version_requirements: &id005 !ruby/object:Gem::Requirement
118
+ requirement: &id007 !ruby/object:Gem::Requirement
87
119
  none: false
88
120
  requirements:
89
121
  - - ~>
@@ -94,26 +126,10 @@ dependencies:
94
126
  - 3
95
127
  - 1
96
128
  version: 1.3.1
97
- requirement: *id005
98
129
  type: :development
99
130
  name: sqlite3-ruby
100
131
  prerelease: false
101
- - !ruby/object:Gem::Dependency
102
- version_requirements: &id006 !ruby/object:Gem::Requirement
103
- none: false
104
- requirements:
105
- - - ~>
106
- - !ruby/object:Gem::Version
107
- hash: 9
108
- segments:
109
- - 2
110
- - 3
111
- - 5
112
- version: 2.3.5
113
- requirement: *id006
114
- type: :development
115
- name: rails
116
- prerelease: false
132
+ version_requirements: *id007
117
133
  description: Create ActiveRecord models from an existing database
118
134
  email: alex@alexrothenberg.com
119
135
  executables: []
@@ -127,6 +143,7 @@ extra_rdoc_files:
127
143
  files:
128
144
  - .document
129
145
  - .gitignore
146
+ - .rvmrc
130
147
  - Gemfile
131
148
  - History.txt
132
149
  - LICENSE
@@ -222,26 +239,26 @@ files:
222
239
  - examples/generated/j2ee_petstore_sqlite3/tag.rb
223
240
  - examples/generated/j2ee_petstore_sqlite3/tag_item.rb
224
241
  - examples/generated/j2ee_petstore_sqlite3/ziplocation.rb
225
- - generators/models_from_tables/USAGE
226
- - generators/models_from_tables/models_from_tables_generator.rb
227
- - generators/models_from_tables/templates/model.rb
228
242
  - legacy_data.gemspec
229
- - lib/active_record/connection_adapters/oracleenhanced_adapter.rb
243
+ - lib/foreigner/connection_adapters/oracle_enhanced_adapter.rb
244
+ - lib/generators/models_from_tables/USAGE
245
+ - lib/generators/models_from_tables/models_from_tables_generator.rb
246
+ - lib/generators/models_from_tables/templates/model.rb
230
247
  - lib/legacy_data.rb
231
248
  - lib/legacy_data/schema.rb
232
249
  - lib/legacy_data/table_class_name_mapper.rb
233
250
  - lib/legacy_data/table_definition.rb
234
- - spec/expected/factories.rb
235
- - spec/expected/post.rb
236
251
  - spec/functional/blog_adapterspec.rb
237
252
  - spec/functional/database.yml
238
253
  - spec/functional/drupal_adapterspec.rb
239
254
  - spec/functional/functional_spec_helper.rb
240
255
  - spec/functional/j2ee_petstore_adapterspec.rb
256
+ - spec/generators/models_from_tables/expected/factories.rb
257
+ - spec/generators/models_from_tables/expected/post.rb
258
+ - spec/generators/models_from_tables/models_from_tables_generator_spec.rb
241
259
  - spec/legacy_data/schema_spec.rb
242
260
  - spec/legacy_data/table_class_name_mapper_spec.rb
243
261
  - spec/legacy_data/table_definition_spec.rb
244
- - spec/models_from_tables_generator_spec.rb
245
262
  - spec/spec_helper.rb
246
263
  has_rdoc: true
247
264
  homepage: http://github.com/alexrothenberg/legacy_data
@@ -362,15 +379,15 @@ test_files:
362
379
  - examples/generated/j2ee_petstore_sqlite3/tag.rb
363
380
  - examples/generated/j2ee_petstore_sqlite3/tag_item.rb
364
381
  - examples/generated/j2ee_petstore_sqlite3/ziplocation.rb
365
- - spec/expected/factories.rb
366
- - spec/expected/post.rb
367
382
  - spec/functional/blog_adapterspec.rb
368
383
  - spec/functional/database.yml
369
384
  - spec/functional/drupal_adapterspec.rb
370
385
  - spec/functional/functional_spec_helper.rb
371
386
  - spec/functional/j2ee_petstore_adapterspec.rb
387
+ - spec/generators/models_from_tables/expected/factories.rb
388
+ - spec/generators/models_from_tables/expected/post.rb
389
+ - spec/generators/models_from_tables/models_from_tables_generator_spec.rb
372
390
  - spec/legacy_data/schema_spec.rb
373
391
  - spec/legacy_data/table_class_name_mapper_spec.rb
374
392
  - spec/legacy_data/table_definition_spec.rb
375
- - spec/models_from_tables_generator_spec.rb
376
393
  - spec/spec_helper.rb