acts_as_mt_object 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. data/.gitignore +8 -0
  2. data/Gemfile +19 -0
  3. data/MIT-LICENSE +20 -0
  4. data/README.rdoc +56 -0
  5. data/Rakefile +49 -0
  6. data/acts_as_mt_object.gemspec +25 -0
  7. data/db/mysql.dump +2238 -0
  8. data/lib/acts_as_mt_object.rb +145 -0
  9. data/lib/acts_as_mt_object/version.rb +3 -0
  10. data/lib/tasks/acts_as_mt_object_tasks.rake +4 -0
  11. data/test/acts_as_mt_object_test.rb +38 -0
  12. data/test/dummy/Rakefile +7 -0
  13. data/test/dummy/app/assets/javascripts/application.js +9 -0
  14. data/test/dummy/app/assets/stylesheets/application.css +7 -0
  15. data/test/dummy/app/controllers/application_controller.rb +3 -0
  16. data/test/dummy/app/helpers/application_helper.rb +2 -0
  17. data/test/dummy/app/mailers/.gitkeep +0 -0
  18. data/test/dummy/app/models/.gitkeep +0 -0
  19. data/test/dummy/app/models/mt/entry.rb +6 -0
  20. data/test/dummy/app/models/plan.rb +4 -0
  21. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  22. data/test/dummy/config.ru +4 -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 +52 -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/lib/assets/.gitkeep +0 -0
  39. data/test/dummy/lib/tasks/mt.rake +49 -0
  40. data/test/dummy/log/.gitkeep +0 -0
  41. data/test/dummy/public/404.html +26 -0
  42. data/test/dummy/public/422.html +26 -0
  43. data/test/dummy/public/500.html +26 -0
  44. data/test/dummy/public/favicon.ico +0 -0
  45. data/test/dummy/script/rails +6 -0
  46. data/test/test_helper.rb +10 -0
  47. metadata +161 -0
@@ -0,0 +1,39 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # Configure static asset server for tests with Cache-Control for performance
11
+ config.serve_static_assets = true
12
+ config.static_cache_control = "public, max-age=3600"
13
+
14
+ # Log error messages when you accidentally call methods on nil
15
+ config.whiny_nils = true
16
+
17
+ # Show full error reports and disable caching
18
+ config.consider_all_requests_local = true
19
+ config.action_controller.perform_caching = false
20
+
21
+ # Raise exceptions instead of rendering exception templates
22
+ config.action_dispatch.show_exceptions = false
23
+
24
+ # Disable request forgery protection in test environment
25
+ config.action_controller.allow_forgery_protection = false
26
+
27
+ # Tell Action Mailer not to deliver emails to the real world.
28
+ # The :test delivery method accumulates sent emails in the
29
+ # ActionMailer::Base.deliveries array.
30
+ config.action_mailer.delivery_method = :test
31
+
32
+ # Use SQL instead of Active Record's schema dumper when creating the test database.
33
+ # This is necessary if your schema can't be completely dumped by the schema dumper,
34
+ # like if you have constraints or database-specific column types
35
+ # config.active_record.schema_format = :sql
36
+
37
+ # Print deprecation notices to the stderr
38
+ config.active_support.deprecation = :stderr
39
+ end
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,10 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format
4
+ # (all these examples are active by default):
5
+ # ActiveSupport::Inflector.inflections do |inflect|
6
+ # inflect.plural /^(ox)$/i, '\1en'
7
+ # inflect.singular /^(ox)en/i, '\1'
8
+ # inflect.irregular 'person', 'people'
9
+ # inflect.uncountable %w( fish sheep )
10
+ # end
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
5
+ # Mime::Type.register_alias "text/html", :iphone
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+ # Make sure the secret is at least 30 characters and all random,
6
+ # no regular words or you'll be exposed to dictionary attacks.
7
+ Dummy::Application.config.secret_token = 'd44ad7ea25b5191db97e8bc58255cb96755678b58388958baf12531bd649059591ee91a2442b4fca4a95916f166a404b5c6fda139204baa5676655a3219ffe9c'
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
4
+
5
+ # Use the database for sessions instead of the cookie-based default,
6
+ # which shouldn't be used to store highly confidential information
7
+ # (create the session table with "rails generate session_migration")
8
+ # Dummy::Application.config.session_store :active_record_store
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+ #
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters format: [:json]
9
+ end
10
+
11
+ # Disable root element in JSON by default.
12
+ ActiveSupport.on_load(:active_record) do
13
+ self.include_root_in_json = false
14
+ end
@@ -0,0 +1,5 @@
1
+ # Sample localization file for English. Add more files in this directory for other locales.
2
+ # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
+
4
+ en:
5
+ hello: "Hello world"
@@ -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
File without changes
@@ -0,0 +1,49 @@
1
+ namespace 'mt:db' do
2
+
3
+ def load_data_inner
4
+ config = ActiveRecord::Base.configurations['test_mt']
5
+
6
+ ActiveRecord::Base.establish_connection(config)
7
+ connection = ActiveRecord::Base.connection
8
+ if ENV['DUMP_FILE'].blank?
9
+ raise 'The environment variable "DUMP_FILE" is required'
10
+ end
11
+ open(ENV['DUMP_FILE']).read.split(/;$/).each do |line|
12
+ connection.execute line
13
+ end
14
+ end
15
+
16
+ def load_data
17
+ load_data_inner
18
+ rescue
19
+ # retry
20
+ load_data_inner
21
+ end
22
+
23
+ desc "Create Movable Type Database"
24
+ task :create => :environment do
25
+ config = ActiveRecord::Base.configurations['test_mt']
26
+ begin
27
+ ActiveRecord::Base.establish_connection(config)
28
+ ActiveRecord::Base.connection
29
+ rescue
30
+ case config['adapter']
31
+ when /mysql/
32
+ ActiveRecord::Base.establish_connection(config.merge('database' => nil))
33
+ ActiveRecord::Base.connection.
34
+ create_database(config['database'], config)
35
+ end
36
+ end
37
+ end
38
+
39
+ desc "Load Movable Type Data"
40
+ task :load => :create do
41
+ load_data
42
+ end
43
+
44
+ desc "Reload Movable Type Data"
45
+ task :reload => :environment do
46
+ load_data
47
+ end
48
+
49
+ end
File without changes
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/404.html -->
21
+ <div class="dialog">
22
+ <h1>The page you were looking for doesn't exist.</h1>
23
+ <p>You may have mistyped the address or the page may have moved.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/422.html -->
21
+ <div class="dialog">
22
+ <h1>The change you wanted was rejected.</h1>
23
+ <p>Maybe you tried to change something you didn't have access to.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/500.html -->
21
+ <div class="dialog">
22
+ <h1>We're sorry, but something went wrong.</h1>
23
+ <p>We've been notified about this issue and we'll take a look at it shortly.</p>
24
+ </div>
25
+ </body>
26
+ </html>
File without changes
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
+
4
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
5
+ require File.expand_path('../../config/boot', __FILE__)
6
+ require 'rails/commands'
@@ -0,0 +1,10 @@
1
+ # Configure Rails Environment
2
+ ENV["RAILS_ENV"] = "test"
3
+
4
+ require File.expand_path("../dummy/config/environment.rb", __FILE__)
5
+ require "rails/test_help"
6
+
7
+ Rails.backtrace_cleaner.remove_silencers!
8
+
9
+ # Load support files
10
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
metadata ADDED
@@ -0,0 +1,161 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: acts_as_mt_object
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.0.1
6
+ platform: ruby
7
+ authors:
8
+ - Taku AMANO
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2012-02-07 00:00:00 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: rails
17
+ prerelease: false
18
+ requirement: &id001 !ruby/object:Gem::Requirement
19
+ none: false
20
+ requirements:
21
+ - - ~>
22
+ - !ruby/object:Gem::Version
23
+ version: 3.1.3
24
+ type: :development
25
+ version_requirements: *id001
26
+ - !ruby/object:Gem::Dependency
27
+ name: mysql2
28
+ prerelease: false
29
+ requirement: &id002 !ruby/object:Gem::Requirement
30
+ none: false
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: "0"
35
+ type: :runtime
36
+ version_requirements: *id002
37
+ description: The active record's adapter to the database created by Movable Type
38
+ email:
39
+ - taku@toi-planning.net
40
+ executables: []
41
+
42
+ extensions: []
43
+
44
+ extra_rdoc_files:
45
+ - README.rdoc
46
+ files:
47
+ - .gitignore
48
+ - Gemfile
49
+ - MIT-LICENSE
50
+ - README.rdoc
51
+ - Rakefile
52
+ - acts_as_mt_object.gemspec
53
+ - db/mysql.dump
54
+ - lib/acts_as_mt_object.rb
55
+ - lib/acts_as_mt_object/version.rb
56
+ - lib/tasks/acts_as_mt_object_tasks.rake
57
+ - test/acts_as_mt_object_test.rb
58
+ - test/dummy/Rakefile
59
+ - test/dummy/app/assets/javascripts/application.js
60
+ - test/dummy/app/assets/stylesheets/application.css
61
+ - test/dummy/app/controllers/application_controller.rb
62
+ - test/dummy/app/helpers/application_helper.rb
63
+ - test/dummy/app/mailers/.gitkeep
64
+ - test/dummy/app/models/.gitkeep
65
+ - test/dummy/app/models/mt/entry.rb
66
+ - test/dummy/app/models/plan.rb
67
+ - test/dummy/app/views/layouts/application.html.erb
68
+ - test/dummy/config.ru
69
+ - test/dummy/config/application.rb
70
+ - test/dummy/config/boot.rb
71
+ - test/dummy/config/database.yml
72
+ - test/dummy/config/environment.rb
73
+ - test/dummy/config/environments/development.rb
74
+ - test/dummy/config/environments/production.rb
75
+ - test/dummy/config/environments/test.rb
76
+ - test/dummy/config/initializers/backtrace_silencers.rb
77
+ - test/dummy/config/initializers/inflections.rb
78
+ - test/dummy/config/initializers/mime_types.rb
79
+ - test/dummy/config/initializers/secret_token.rb
80
+ - test/dummy/config/initializers/session_store.rb
81
+ - test/dummy/config/initializers/wrap_parameters.rb
82
+ - test/dummy/config/locales/en.yml
83
+ - test/dummy/config/routes.rb
84
+ - test/dummy/lib/assets/.gitkeep
85
+ - test/dummy/lib/tasks/mt.rake
86
+ - test/dummy/log/.gitkeep
87
+ - test/dummy/public/404.html
88
+ - test/dummy/public/422.html
89
+ - test/dummy/public/500.html
90
+ - test/dummy/public/favicon.ico
91
+ - test/dummy/script/rails
92
+ - test/test_helper.rb
93
+ - test/dummy/db/mt.sqlite3
94
+ - test/dummy/db/test.sqlite3
95
+ - test/dummy/log/development.log
96
+ - test/dummy/log/test.log
97
+ homepage: https://github.com/usualoma/acts_as_mt_object
98
+ licenses: []
99
+
100
+ post_install_message:
101
+ rdoc_options: []
102
+
103
+ require_paths:
104
+ - lib
105
+ required_ruby_version: !ruby/object:Gem::Requirement
106
+ none: false
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: "0"
111
+ required_rubygems_version: !ruby/object:Gem::Requirement
112
+ none: false
113
+ requirements:
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ version: "0"
117
+ requirements: []
118
+
119
+ rubyforge_project:
120
+ rubygems_version: 1.8.12
121
+ signing_key:
122
+ specification_version: 3
123
+ summary: Acts as Movable Type's object.
124
+ test_files:
125
+ - test/acts_as_mt_object_test.rb
126
+ - test/dummy/app/assets/javascripts/application.js
127
+ - test/dummy/app/assets/stylesheets/application.css
128
+ - test/dummy/app/controllers/application_controller.rb
129
+ - test/dummy/app/helpers/application_helper.rb
130
+ - test/dummy/app/models/mt/entry.rb
131
+ - test/dummy/app/models/plan.rb
132
+ - test/dummy/app/views/layouts/application.html.erb
133
+ - test/dummy/config/application.rb
134
+ - test/dummy/config/boot.rb
135
+ - test/dummy/config/database.yml
136
+ - test/dummy/config/environment.rb
137
+ - test/dummy/config/environments/development.rb
138
+ - test/dummy/config/environments/production.rb
139
+ - test/dummy/config/environments/test.rb
140
+ - test/dummy/config/initializers/backtrace_silencers.rb
141
+ - test/dummy/config/initializers/inflections.rb
142
+ - test/dummy/config/initializers/mime_types.rb
143
+ - test/dummy/config/initializers/secret_token.rb
144
+ - test/dummy/config/initializers/session_store.rb
145
+ - test/dummy/config/initializers/wrap_parameters.rb
146
+ - test/dummy/config/locales/en.yml
147
+ - test/dummy/config/routes.rb
148
+ - test/dummy/config.ru
149
+ - test/dummy/db/mt.sqlite3
150
+ - test/dummy/db/test.sqlite3
151
+ - test/dummy/lib/tasks/mt.rake
152
+ - test/dummy/log/development.log
153
+ - test/dummy/log/test.log
154
+ - test/dummy/public/404.html
155
+ - test/dummy/public/422.html
156
+ - test/dummy/public/500.html
157
+ - test/dummy/public/favicon.ico
158
+ - test/dummy/Rakefile
159
+ - test/dummy/script/rails
160
+ - test/test_helper.rb
161
+ has_rdoc: