seed_loader 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. data/.gitignore +4 -0
  2. data/Gemfile +8 -0
  3. data/MIT-LICENSE +21 -0
  4. data/README +0 -0
  5. data/README.rdoc +55 -0
  6. data/Rakefile +30 -0
  7. data/lib/seed_loader/active_record_methods.rb +49 -0
  8. data/lib/seed_loader/loader.rb +76 -0
  9. data/lib/seed_loader/version.rb +3 -0
  10. data/lib/seed_loader.rb +5 -0
  11. data/seed_loader.gemspec +26 -0
  12. data/test/dummy/Gemfile +7 -0
  13. data/test/dummy/Rakefile +7 -0
  14. data/test/dummy/app/assets/javascripts/application.js +9 -0
  15. data/test/dummy/app/assets/stylesheets/application.css +7 -0
  16. data/test/dummy/app/controllers/application_controller.rb +3 -0
  17. data/test/dummy/app/helpers/application_helper.rb +2 -0
  18. data/test/dummy/app/mailers/.gitkeep +0 -0
  19. data/test/dummy/app/models/.gitkeep +0 -0
  20. data/test/dummy/app/models/dummy_table.rb +5 -0
  21. data/test/dummy/app/models/dummy_user.rb +2 -0
  22. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  23. data/test/dummy/config/application.rb +45 -0
  24. data/test/dummy/config/boot.rb +10 -0
  25. data/test/dummy/config/database.yml +13 -0
  26. data/test/dummy/config/environment.rb +5 -0
  27. data/test/dummy/config/environments/development.rb +30 -0
  28. data/test/dummy/config/environments/production.rb +60 -0
  29. data/test/dummy/config/environments/test.rb +39 -0
  30. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  31. data/test/dummy/config/initializers/inflections.rb +10 -0
  32. data/test/dummy/config/initializers/mime_types.rb +5 -0
  33. data/test/dummy/config/initializers/secret_token.rb +7 -0
  34. data/test/dummy/config/initializers/session_store.rb +8 -0
  35. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  36. data/test/dummy/config/locales/en.yml +5 -0
  37. data/test/dummy/config/routes.rb +58 -0
  38. data/test/dummy/config.ru +4 -0
  39. data/test/dummy/db/.DS_Store +0 -0
  40. data/test/dummy/db/migrate/.DS_Store +0 -0
  41. data/test/dummy/db/migrate/20111027142111_create_dummy_tables.rb +11 -0
  42. data/test/dummy/db/migrate/20111027142236_create_dummy_users.rb +9 -0
  43. data/test/dummy/db/schema.rb +29 -0
  44. data/test/dummy/db/seeds/dummy_tables.yml +12 -0
  45. data/test/dummy/db/seeds/dummy_users.yml +10 -0
  46. data/test/dummy/dummy_development +0 -0
  47. data/test/dummy/dummy_test +0 -0
  48. data/test/dummy/lib/assets/.gitkeep +0 -0
  49. data/test/dummy/log/.gitkeep +0 -0
  50. data/test/dummy/log/development.log +37 -0
  51. data/test/dummy/log/test.log +2025 -0
  52. data/test/dummy/public/404.html +26 -0
  53. data/test/dummy/public/422.html +26 -0
  54. data/test/dummy/public/500.html +26 -0
  55. data/test/dummy/public/favicon.ico +0 -0
  56. data/test/dummy/script/rails +6 -0
  57. data/test/dummy/test/fixtures/dummy_tables.yml +11 -0
  58. data/test/dummy/test/fixtures/dummy_users.yml +7 -0
  59. data/test/dummy/test/fixtures/positions.yml +9 -0
  60. data/test/dummy/test/unit/dummy_table_test.rb +7 -0
  61. data/test/dummy/test/unit/dummy_user_test.rb +7 -0
  62. data/test/dummy/test/unit/position_test.rb +7 -0
  63. data/test/seed_loader_test.rb +99 -0
  64. data/test/seeds/dummy_tables.yml +12 -0
  65. data/test/seeds/dummy_users.yml +10 -0
  66. data/test/test_helper.rb +10 -0
  67. metadata +242 -0
@@ -0,0 +1,58 @@
1
+ Dummy::Application.routes.draw do
2
+ # The priority is based upon order of creation:
3
+ # first created -> highest priority.
4
+
5
+ # Sample of regular route:
6
+ # match 'products/:id' => 'catalog#view'
7
+ # Keep in mind you can assign values other than :controller and :action
8
+
9
+ # Sample of named route:
10
+ # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
11
+ # This route can be invoked with purchase_url(:id => product.id)
12
+
13
+ # Sample resource route (maps HTTP verbs to controller actions automatically):
14
+ # resources :products
15
+
16
+ # Sample resource route with options:
17
+ # resources :products do
18
+ # member do
19
+ # get 'short'
20
+ # post 'toggle'
21
+ # end
22
+ #
23
+ # collection do
24
+ # get 'sold'
25
+ # end
26
+ # end
27
+
28
+ # Sample resource route with sub-resources:
29
+ # resources :products do
30
+ # resources :comments, :sales
31
+ # resource :seller
32
+ # end
33
+
34
+ # Sample resource route with more complex sub-resources
35
+ # resources :products do
36
+ # resources :comments
37
+ # resources :sales do
38
+ # get 'recent', :on => :collection
39
+ # end
40
+ # end
41
+
42
+ # Sample resource route within a namespace:
43
+ # namespace :admin do
44
+ # # Directs /admin/products/* to Admin::ProductsController
45
+ # # (app/controllers/admin/products_controller.rb)
46
+ # resources :products
47
+ # end
48
+
49
+ # You can have the root of your site routed with "root"
50
+ # just remember to delete public/index.html.
51
+ # root :to => 'welcome#index'
52
+
53
+ # See how all your routes lay out with "rake routes"
54
+
55
+ # This is a legacy wild controller route that's not recommended for RESTful applications.
56
+ # Note: This route will make all actions in every controller accessible via GET requests.
57
+ # match ':controller(/:action(/:id(.:format)))'
58
+ end
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Dummy::Application
Binary file
Binary file
@@ -0,0 +1,11 @@
1
+ class CreateDummyTables < ActiveRecord::Migration
2
+ def change
3
+ create_table :dummy_tables do |t|
4
+ t.string :field1
5
+ t.integer :field2
6
+ t.integer :dummy_user_id
7
+
8
+ t.timestamps
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,9 @@
1
+ class CreateDummyUsers < ActiveRecord::Migration
2
+ def change
3
+ create_table :dummy_users do |t|
4
+ t.string :name
5
+
6
+ t.timestamps
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,29 @@
1
+ # This file is auto-generated from the current state of the database. Instead
2
+ # of editing this file, please use the migrations feature of Active Record to
3
+ # incrementally modify your database, and then regenerate this schema definition.
4
+ #
5
+ # Note that this schema.rb definition is the authoritative source for your
6
+ # database schema. If you need to create the application database on another
7
+ # system, you should be using db:schema:load, not running all the migrations
8
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
9
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
10
+ #
11
+ # It's strongly recommended to check this file into your version control system.
12
+
13
+ ActiveRecord::Schema.define(:version => 20111027142236) do
14
+
15
+ create_table "dummy_tables", :force => true do |t|
16
+ t.string "field1"
17
+ t.integer "field2"
18
+ t.integer "dummy_user_id"
19
+ t.datetime "created_at"
20
+ t.datetime "updated_at"
21
+ end
22
+
23
+ create_table "dummy_users", :force => true do |t|
24
+ t.string "name"
25
+ t.datetime "created_at"
26
+ t.datetime "updated_at"
27
+ end
28
+
29
+ end
@@ -0,0 +1,12 @@
1
+ dm_one:
2
+ field1: A
3
+ field2: 1
4
+ dummy_user: user1
5
+ dm_two:
6
+ field1: B
7
+ field2: <%= 3 + 5 %>
8
+ dummy_user: user1
9
+ dm_three:
10
+ field1: C
11
+ field2: 3
12
+ dummy_user: user1
@@ -0,0 +1,10 @@
1
+ user1:
2
+ name: "User1"
3
+
4
+ user2:
5
+ name: <%= "User" + "23" %>
6
+
7
+ user3:
8
+ name: "User3"
9
+
10
+
Binary file
Binary file
File without changes
File without changes
@@ -0,0 +1,37 @@
1
+  (0.1ms) select sqlite_version(*)
2
+  (2.7ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
3
+  (0.1ms) PRAGMA index_list("schema_migrations")
4
+  (1.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
5
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
6
+ Migrating to CreateDummyTables (20111027142111)
7
+  (0.4ms) CREATE TABLE "dummy_tables" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "field1" varchar(255), "field2" integer, "dummy_user_id" integer, "created_at" datetime, "updated_at" datetime)
8
+  (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES ('20111027142111')
9
+  (0.1ms) select sqlite_version(*)
10
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
11
+  (0.1ms) PRAGMA index_list("dummy_tables")
12
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
13
+ Migrating to CreateDummyTables (20111027142111)
14
+  (0.1ms) select sqlite_version(*)
15
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
16
+  (0.0ms) PRAGMA index_list("dummy_tables")
17
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
18
+ Migrating to CreateDummyTables (20111027142111)
19
+ Migrating to CreateDummyUsers (20111027142236)
20
+  (0.0ms) select sqlite_version(*)
21
+  (0.4ms) CREATE TABLE "dummy_users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime) 
22
+  (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20111027142236')
23
+  (0.1ms) select sqlite_version(*)
24
+  (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
25
+  (0.0ms) PRAGMA index_list("dummy_tables")
26
+  (0.0ms) PRAGMA index_list("dummy_users")
27
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
28
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
29
+  (0.1ms) select sqlite_version(*)
30
+  (12.8ms) CREATE TABLE "dummy_tables" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "field1" varchar(255), "field2" integer, "dummy_user_id" integer, "created_at" datetime, "updated_at" datetime) 
31
+  (1.2ms) CREATE TABLE "dummy_users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "created_at" datetime, "updated_at" datetime)
32
+  (1.1ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
33
+  (0.0ms) PRAGMA index_list("schema_migrations")
34
+  (1.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
35
+  (0.1ms) SELECT version FROM "schema_migrations"
36
+  (1.3ms) INSERT INTO "schema_migrations" (version) VALUES ('20111027142236')
37
+  (1.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20111027142111')