systematize 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +69 -0
  3. data/lib/systematize/railtie.rb +11 -0
  4. data/lib/systematize/runner.rb +30 -0
  5. data/lib/systematize/version.rb +3 -0
  6. data/lib/systematize.rb +4 -0
  7. data/lib/tasks/migrations.rake +27 -0
  8. data/spec/spec_helper.rb +9 -0
  9. data/spec/support/db/data/20161117152453_mark_deleted_posts_with_timestamp.rb +15 -0
  10. data/spec/support/db/migrate/20161117151622_create_posts_table.rb +12 -0
  11. data/spec/support/db/migrate/20161117152138_add_deleted_at_timestamp.rb +9 -0
  12. data/spec/support/db/migrate/20161117152655_remove_deleted_column.rb +9 -0
  13. data/spec/systematize/runner_spec.rb +60 -0
  14. data/spec/testapp/Gemfile +41 -0
  15. data/spec/testapp/Gemfile.lock +128 -0
  16. data/spec/testapp/README.rdoc +261 -0
  17. data/spec/testapp/Rakefile +7 -0
  18. data/spec/testapp/app/assets/images/rails.png +0 -0
  19. data/spec/testapp/app/assets/javascripts/application.js +15 -0
  20. data/spec/testapp/app/assets/stylesheets/application.css +13 -0
  21. data/spec/testapp/app/controllers/application_controller.rb +3 -0
  22. data/spec/testapp/app/helpers/application_helper.rb +2 -0
  23. data/spec/testapp/app/models/post.rb +4 -0
  24. data/spec/testapp/app/views/layouts/application.html.erb +14 -0
  25. data/spec/testapp/config/application.rb +59 -0
  26. data/spec/testapp/config/boot.rb +6 -0
  27. data/spec/testapp/config/database.yml +25 -0
  28. data/spec/testapp/config/environment.rb +5 -0
  29. data/spec/testapp/config/environments/development.rb +37 -0
  30. data/spec/testapp/config/environments/production.rb +67 -0
  31. data/spec/testapp/config/environments/test.rb +37 -0
  32. data/spec/testapp/config/initializers/backtrace_silencers.rb +7 -0
  33. data/spec/testapp/config/initializers/inflections.rb +15 -0
  34. data/spec/testapp/config/initializers/mime_types.rb +5 -0
  35. data/spec/testapp/config/initializers/secret_token.rb +7 -0
  36. data/spec/testapp/config/initializers/session_store.rb +8 -0
  37. data/spec/testapp/config/initializers/wrap_parameters.rb +14 -0
  38. data/spec/testapp/config/locales/en.yml +5 -0
  39. data/spec/testapp/config/routes.rb +58 -0
  40. data/spec/testapp/config.ru +4 -0
  41. data/spec/testapp/db/data/20161117152453_mark_deleted_posts_with_timestamp.rb +15 -0
  42. data/spec/testapp/db/development.sqlite3 +0 -0
  43. data/spec/testapp/db/migrate/20161117151622_create_posts_table.rb +12 -0
  44. data/spec/testapp/db/migrate/20161117152138_add_deleted_at_timestamp.rb +9 -0
  45. data/spec/testapp/db/migrate/20161117152655_remove_deleted_column.rb +9 -0
  46. data/spec/testapp/db/seeds.rb +7 -0
  47. data/spec/testapp/db/test.sqlite3 +0 -0
  48. data/spec/testapp/doc/README_FOR_APP +2 -0
  49. data/spec/testapp/log/development.log +953 -0
  50. data/spec/testapp/public/404.html +26 -0
  51. data/spec/testapp/public/422.html +26 -0
  52. data/spec/testapp/public/500.html +25 -0
  53. data/spec/testapp/public/favicon.ico +0 -0
  54. data/spec/testapp/public/index.html +241 -0
  55. data/spec/testapp/public/robots.txt +5 -0
  56. data/spec/testapp/script/rails +6 -0
  57. data/spec/testapp/test/performance/browsing_test.rb +12 -0
  58. data/spec/testapp/test/test_helper.rb +13 -0
  59. metadata +209 -0
@@ -0,0 +1,58 @@
1
+ Testapp::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 Testapp::Application
@@ -0,0 +1,15 @@
1
+ class MarkDeletedPostsWithTimestamp < ActiveRecord::Migration
2
+ def up
3
+ Post.where(deleted: true).each do |post|
4
+ post.deleted_at = Time.now
5
+ post.save
6
+ end
7
+ end
8
+
9
+ def down
10
+ Post.where("deleted_at != ?", nil).each do |post|
11
+ post.deleted = true
12
+ post.save
13
+ end
14
+ end
15
+ end
Binary file
@@ -0,0 +1,12 @@
1
+ class CreatePostsTable < ActiveRecord::Migration
2
+ def change
3
+ create_table :posts do |p|
4
+ p.string :title
5
+ p.string :description
6
+ p.integer :owner_id
7
+ p.boolean :deleted
8
+
9
+ p.timestamps
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,9 @@
1
+ class AddDeletedAtTimestamp < ActiveRecord::Migration
2
+ def up
3
+ add_column :posts, :deleted_at, :time
4
+ end
5
+
6
+ def down
7
+ remove_column :posts, :deleted_at
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ class RemoveDeletedColumn < ActiveRecord::Migration
2
+ def up
3
+ remove_column :posts, :deleted
4
+ end
5
+
6
+ def down
7
+ add_column :posts, :deleted, :boolean
8
+ end
9
+ end
@@ -0,0 +1,7 @@
1
+ # This file should contain all the record creation needed to seed the database with its default values.
2
+ # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
3
+ #
4
+ # Examples:
5
+ #
6
+ # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
7
+ # Mayor.create(name: 'Emanuel', city: cities.first)
File without changes
@@ -0,0 +1,2 @@
1
+ Use this README file to introduce your application and point to useful places in the API for learning more.
2
+ Run "rake doc:app" to generate API documentation for your models, controllers, helpers, and libraries.