model_mill 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. data/.document +5 -0
  2. data/.rspec +1 -0
  3. data/Gemfile +18 -0
  4. data/Gemfile.lock +129 -0
  5. data/LICENSE.txt +20 -0
  6. data/README.rdoc +23 -0
  7. data/Rakefile +50 -0
  8. data/VERSION +1 -0
  9. data/lib/generators/model_mill/models/models_generator.rb +47 -0
  10. data/lib/generators/model_mill/models/templates/base.rb +5 -0
  11. data/lib/generators/model_mill/models/templates/model.rb +3 -0
  12. data/lib/model_mill.rb +2 -0
  13. data/model_mill.gemspec +144 -0
  14. data/spec/dummy/Rakefile +7 -0
  15. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  16. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  17. data/spec/dummy/app/models/schema_migration.rb +3 -0
  18. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  19. data/spec/dummy/config/application.rb +45 -0
  20. data/spec/dummy/config/boot.rb +10 -0
  21. data/spec/dummy/config/environment.rb +5 -0
  22. data/spec/dummy/config/environments/development.rb +26 -0
  23. data/spec/dummy/config/environments/production.rb +49 -0
  24. data/spec/dummy/config/environments/test.rb +35 -0
  25. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  26. data/spec/dummy/config/initializers/inflections.rb +10 -0
  27. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  28. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  29. data/spec/dummy/config/initializers/session_store.rb +8 -0
  30. data/spec/dummy/config/locales/en.yml +5 -0
  31. data/spec/dummy/config/routes.rb +58 -0
  32. data/spec/dummy/config.ru +4 -0
  33. data/spec/dummy/db/migrate/20110125024703_create_some_tables.rb +21 -0
  34. data/spec/dummy/db/schema.rb +30 -0
  35. data/spec/dummy/public/404.html +26 -0
  36. data/spec/dummy/public/422.html +26 -0
  37. data/spec/dummy/public/500.html +26 -0
  38. data/spec/dummy/public/favicon.ico +0 -0
  39. data/spec/dummy/public/javascripts/application.js +2 -0
  40. data/spec/dummy/public/javascripts/controls.js +965 -0
  41. data/spec/dummy/public/javascripts/dragdrop.js +974 -0
  42. data/spec/dummy/public/javascripts/effects.js +1123 -0
  43. data/spec/dummy/public/javascripts/prototype.js +6001 -0
  44. data/spec/dummy/public/javascripts/rails.js +175 -0
  45. data/spec/dummy/public/stylesheets/.gitkeep +0 -0
  46. data/spec/dummy/script/rails +6 -0
  47. data/spec/generator_spec_helper.rb +149 -0
  48. data/spec/generators/model_generator_spec.rb +87 -0
  49. data/spec/integration/navigation_spec.rb +9 -0
  50. data/spec/matchers/all.rb +9 -0
  51. data/spec/matchers/generate_file.rb +42 -0
  52. data/spec/matchers/generate_migration.rb +44 -0
  53. data/spec/matchers/have_class_method.rb +42 -0
  54. data/spec/matchers/have_method.rb +46 -0
  55. data/spec/model_mill_spec.rb +7 -0
  56. data/spec/spec_helper.rb +35 -0
  57. metadata +285 -0
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ lib/**/*.rb
2
+ bin/*
3
+ -
4
+ features/**/*.feature
5
+ LICENSE.txt
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color
data/Gemfile ADDED
@@ -0,0 +1,18 @@
1
+ source "http://rubygems.org"
2
+
3
+ group :development do
4
+ gem "rails", "3.0.3"
5
+ gem "capybara", ">= 0.4.0"
6
+ gem "sqlite3-ruby", :require => "sqlite3"
7
+ gem "rspec-rails", ">= 2.0.0.beta"
8
+ gem "bundler", "~> 1.0.0"
9
+ gem "jeweler", "~> 1.5.2"
10
+ gem "rcov", ">= 0"
11
+ gem "awesome_print"
12
+ gem "mysql2"
13
+ end
14
+
15
+
16
+ # To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+)
17
+ # gem 'ruby-debug'
18
+ # gem 'ruby-debug19'
data/Gemfile.lock ADDED
@@ -0,0 +1,129 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ abstract (1.0.0)
5
+ actionmailer (3.0.3)
6
+ actionpack (= 3.0.3)
7
+ mail (~> 2.2.9)
8
+ actionpack (3.0.3)
9
+ activemodel (= 3.0.3)
10
+ activesupport (= 3.0.3)
11
+ builder (~> 2.1.2)
12
+ erubis (~> 2.6.6)
13
+ i18n (~> 0.4)
14
+ rack (~> 1.2.1)
15
+ rack-mount (~> 0.6.13)
16
+ rack-test (~> 0.5.6)
17
+ tzinfo (~> 0.3.23)
18
+ activemodel (3.0.3)
19
+ activesupport (= 3.0.3)
20
+ builder (~> 2.1.2)
21
+ i18n (~> 0.4)
22
+ activerecord (3.0.3)
23
+ activemodel (= 3.0.3)
24
+ activesupport (= 3.0.3)
25
+ arel (~> 2.0.2)
26
+ tzinfo (~> 0.3.23)
27
+ activeresource (3.0.3)
28
+ activemodel (= 3.0.3)
29
+ activesupport (= 3.0.3)
30
+ activesupport (3.0.3)
31
+ arel (2.0.7)
32
+ awesome_print (0.3.1)
33
+ builder (2.1.2)
34
+ capybara (0.4.1.1)
35
+ celerity (>= 0.7.9)
36
+ culerity (>= 0.2.4)
37
+ mime-types (>= 1.16)
38
+ nokogiri (>= 1.3.3)
39
+ rack (>= 1.0.0)
40
+ rack-test (>= 0.5.4)
41
+ selenium-webdriver (>= 0.0.27)
42
+ xpath (~> 0.1.3)
43
+ celerity (0.8.7)
44
+ childprocess (0.1.6)
45
+ ffi (~> 0.6.3)
46
+ culerity (0.2.15)
47
+ diff-lcs (1.1.2)
48
+ erubis (2.6.6)
49
+ abstract (>= 1.0.0)
50
+ ffi (0.6.3)
51
+ rake (>= 0.8.7)
52
+ git (1.2.5)
53
+ i18n (0.5.0)
54
+ jeweler (1.5.2)
55
+ bundler (~> 1.0.0)
56
+ git (>= 1.2.5)
57
+ rake
58
+ json_pure (1.5.0)
59
+ mail (2.2.14)
60
+ activesupport (>= 2.3.6)
61
+ i18n (>= 0.4.0)
62
+ mime-types (~> 1.16)
63
+ treetop (~> 1.4.8)
64
+ mime-types (1.16)
65
+ mysql2 (0.2.6)
66
+ nokogiri (1.4.4)
67
+ polyglot (0.3.1)
68
+ rack (1.2.1)
69
+ rack-mount (0.6.13)
70
+ rack (>= 1.0.0)
71
+ rack-test (0.5.7)
72
+ rack (>= 1.0)
73
+ rails (3.0.3)
74
+ actionmailer (= 3.0.3)
75
+ actionpack (= 3.0.3)
76
+ activerecord (= 3.0.3)
77
+ activeresource (= 3.0.3)
78
+ activesupport (= 3.0.3)
79
+ bundler (~> 1.0)
80
+ railties (= 3.0.3)
81
+ railties (3.0.3)
82
+ actionpack (= 3.0.3)
83
+ activesupport (= 3.0.3)
84
+ rake (>= 0.8.7)
85
+ thor (~> 0.14.4)
86
+ rake (0.8.7)
87
+ rcov (0.9.9)
88
+ rspec (2.4.0)
89
+ rspec-core (~> 2.4.0)
90
+ rspec-expectations (~> 2.4.0)
91
+ rspec-mocks (~> 2.4.0)
92
+ rspec-core (2.4.0)
93
+ rspec-expectations (2.4.0)
94
+ diff-lcs (~> 1.1.2)
95
+ rspec-mocks (2.4.0)
96
+ rspec-rails (2.4.1)
97
+ actionpack (~> 3.0)
98
+ activesupport (~> 3.0)
99
+ railties (~> 3.0)
100
+ rspec (~> 2.4.0)
101
+ rubyzip (0.9.4)
102
+ selenium-webdriver (0.1.2)
103
+ childprocess (~> 0.1.5)
104
+ ffi (~> 0.6.3)
105
+ json_pure
106
+ rubyzip
107
+ sqlite3 (1.3.3)
108
+ sqlite3-ruby (1.3.3)
109
+ sqlite3 (>= 1.3.3)
110
+ thor (0.14.6)
111
+ treetop (1.4.9)
112
+ polyglot (>= 0.3.1)
113
+ tzinfo (0.3.24)
114
+ xpath (0.1.3)
115
+ nokogiri (~> 1.3)
116
+
117
+ PLATFORMS
118
+ ruby
119
+
120
+ DEPENDENCIES
121
+ awesome_print
122
+ bundler (~> 1.0.0)
123
+ capybara (>= 0.4.0)
124
+ jeweler (~> 1.5.2)
125
+ mysql2
126
+ rails (= 3.0.3)
127
+ rcov
128
+ rspec-rails (>= 2.0.0.beta)
129
+ sqlite3-ruby
data/LICENSE.txt ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2011 Joe Martinez
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,23 @@
1
+ = model_mill
2
+
3
+ == What it Does
4
+
5
+ This bad boy will crank out models based on tables in an existing database.
6
+
7
+ If you provide the namespace option, it will generate models in that namespace that inherit from a common base class. What's more, that base class will get it's connection information from the namespace name in database.yml. This means you can connect to both database at once to migrate data from one to the other.
8
+
9
+ == Contributing to model_mill
10
+
11
+ * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
12
+ * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
13
+ * Fork the project
14
+ * Start a feature/bugfix branch
15
+ * Commit and push until you are happy with your contribution
16
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
17
+ * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
18
+
19
+ == Copyright
20
+
21
+ Copyright (c) 2011 Joe Martinez. See LICENSE.txt for
22
+ further details.
23
+
data/Rakefile ADDED
@@ -0,0 +1,50 @@
1
+ require 'rubygems'
2
+ require 'bundler'
3
+ begin
4
+ Bundler.setup(:default, :development)
5
+ rescue Bundler::BundlerError => e
6
+ $stderr.puts e.message
7
+ $stderr.puts "Run `bundle install` to install missing gems"
8
+ exit e.status_code
9
+ end
10
+ require 'rake'
11
+
12
+ require 'jeweler'
13
+ Jeweler::Tasks.new do |gem|
14
+ # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
15
+ gem.name = "model_mill"
16
+ gem.homepage = "http://github.com/capitalist/model_mill"
17
+ gem.license = "MIT"
18
+ gem.summary = %Q{Generates ActiveRecord models from existing database tables.}
19
+ gem.description = %Q{Generates bare model files that can be used for a migration of legacy data to new models or to get a jump on development for an existing database}
20
+ gem.email = "joe@joemartinez.name"
21
+ gem.authors = ["Joe Martinez"]
22
+ # Include your dependencies below. Runtime dependencies are required when using your gem,
23
+ # and development dependencies are only needed for development (ie running rake tasks, tests, etc)
24
+ # gem.add_runtime_dependency 'jabber4r', '> 0.1'
25
+ # gem.add_development_dependency 'rspec', '> 1.2.3'
26
+ end
27
+ Jeweler::RubygemsDotOrgTasks.new
28
+
29
+ require 'rspec/core'
30
+ require 'rspec/core/rake_task'
31
+ RSpec::Core::RakeTask.new(:spec) do |spec|
32
+ spec.pattern = FileList['spec/**/*_spec.rb']
33
+ end
34
+
35
+ RSpec::Core::RakeTask.new(:rcov) do |spec|
36
+ spec.pattern = 'spec/**/*_spec.rb'
37
+ spec.rcov = true
38
+ end
39
+
40
+ task :default => :spec
41
+
42
+ require 'rake/rdoctask'
43
+ Rake::RDocTask.new do |rdoc|
44
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
45
+
46
+ rdoc.rdoc_dir = 'rdoc'
47
+ rdoc.title = "model_mill #{version}"
48
+ rdoc.rdoc_files.include('README*')
49
+ rdoc.rdoc_files.include('lib/**/*.rb')
50
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.0
@@ -0,0 +1,47 @@
1
+ module ModelMill
2
+ module Generators
3
+ class ModelsGenerator < Rails::Generators::Base
4
+ source_root File.expand_path('../templates', __FILE__)
5
+
6
+ argument :namespace, :type => :string, :required => false, :default => nil
7
+
8
+ def generate_models
9
+ if namespace
10
+ empty_directory("app/models/#{namespace.downcase}")
11
+ generate_base_namespaced_model
12
+ end
13
+ discovered_tables.each do |table_name|
14
+ @model_name = model_name_from_table_name table_name
15
+ @model_file_name = model_file_name_from_table_name table_name
16
+ template 'model.rb', "app/models/#{namespace ? namespace+'/' : ''}#{@model_file_name}.rb"
17
+ end
18
+ puts %Q(config.autoload_paths += %W(\#{config.root}/app/models/#{namespace.downcase})) if namespace
19
+ end
20
+
21
+ private
22
+ def connection
23
+ @conn ||= namespace ? Kernel.const_get(namespace.camelize)::Base.connection : ActiveRecord::Base.connection
24
+ end
25
+
26
+ def connection_info
27
+ YAML.load(ERB.new(File.read(File.expand_path(File.join("config","database.yml")))))[namespace.downcase]
28
+ end
29
+
30
+ def generate_base_namespaced_model
31
+ template 'base.rb', "app/models/#{namespace}/base.rb"
32
+ end
33
+
34
+ def discovered_tables
35
+ connection.tables.sort
36
+ end
37
+
38
+ def model_name_from_table_name tn
39
+ tn.singularize.camelize
40
+ end
41
+
42
+ def model_file_name_from_table_name tn
43
+ tn.singularize.underscore
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,5 @@
1
+ class <%= namespace.camelize %>::Base < ActiveRecord::Base
2
+ self.abstract_class = true
3
+ establish_connection "<%= namespace %>"
4
+ end
5
+
@@ -0,0 +1,3 @@
1
+ class <%= namespace ? namespace.camelize + '::' : '' %><%= @model_name %> < <%= namespace ? namespace.camelize : 'ActiveRecord' %>::Base
2
+ end
3
+
data/lib/model_mill.rb ADDED
@@ -0,0 +1,2 @@
1
+ module ModelMill
2
+ end
@@ -0,0 +1,144 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{model_mill}
8
+ s.version = "0.1.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Joe Martinez"]
12
+ s.date = %q{2011-01-24}
13
+ s.description = %q{Generates bare model files that can be used for a migration of legacy data to new models or to get a jump on development for an existing database}
14
+ s.email = %q{joe@joemartinez.name}
15
+ s.extra_rdoc_files = [
16
+ "LICENSE.txt",
17
+ "README.rdoc"
18
+ ]
19
+ s.files = [
20
+ ".document",
21
+ ".rspec",
22
+ "Gemfile",
23
+ "Gemfile.lock",
24
+ "LICENSE.txt",
25
+ "README.rdoc",
26
+ "Rakefile",
27
+ "VERSION",
28
+ "lib/generators/model_mill/models/models_generator.rb",
29
+ "lib/generators/model_mill/models/templates/base.rb",
30
+ "lib/generators/model_mill/models/templates/model.rb",
31
+ "lib/model_mill.rb",
32
+ "model_mill.gemspec",
33
+ "spec/dummy/Rakefile",
34
+ "spec/dummy/app/controllers/application_controller.rb",
35
+ "spec/dummy/app/helpers/application_helper.rb",
36
+ "spec/dummy/app/models/schema_migration.rb",
37
+ "spec/dummy/app/views/layouts/application.html.erb",
38
+ "spec/dummy/config.ru",
39
+ "spec/dummy/config/application.rb",
40
+ "spec/dummy/config/boot.rb",
41
+ "spec/dummy/config/environment.rb",
42
+ "spec/dummy/config/environments/development.rb",
43
+ "spec/dummy/config/environments/production.rb",
44
+ "spec/dummy/config/environments/test.rb",
45
+ "spec/dummy/config/initializers/backtrace_silencers.rb",
46
+ "spec/dummy/config/initializers/inflections.rb",
47
+ "spec/dummy/config/initializers/mime_types.rb",
48
+ "spec/dummy/config/initializers/secret_token.rb",
49
+ "spec/dummy/config/initializers/session_store.rb",
50
+ "spec/dummy/config/locales/en.yml",
51
+ "spec/dummy/config/routes.rb",
52
+ "spec/dummy/db/migrate/20110125024703_create_some_tables.rb",
53
+ "spec/dummy/db/schema.rb",
54
+ "spec/dummy/public/404.html",
55
+ "spec/dummy/public/422.html",
56
+ "spec/dummy/public/500.html",
57
+ "spec/dummy/public/favicon.ico",
58
+ "spec/dummy/public/javascripts/application.js",
59
+ "spec/dummy/public/javascripts/controls.js",
60
+ "spec/dummy/public/javascripts/dragdrop.js",
61
+ "spec/dummy/public/javascripts/effects.js",
62
+ "spec/dummy/public/javascripts/prototype.js",
63
+ "spec/dummy/public/javascripts/rails.js",
64
+ "spec/dummy/public/stylesheets/.gitkeep",
65
+ "spec/dummy/script/rails",
66
+ "spec/generator_spec_helper.rb",
67
+ "spec/generators/model_generator_spec.rb",
68
+ "spec/integration/navigation_spec.rb",
69
+ "spec/model_mill_spec.rb",
70
+ "spec/spec_helper.rb"
71
+ ]
72
+ s.homepage = %q{http://github.com/capitalist/model_mill}
73
+ s.licenses = ["MIT"]
74
+ s.require_paths = ["lib"]
75
+ s.rubygems_version = %q{1.3.7}
76
+ s.summary = %q{Generates ActiveRecord models from existing database tables.}
77
+ s.test_files = [
78
+ "spec/dummy/app/controllers/application_controller.rb",
79
+ "spec/dummy/app/helpers/application_helper.rb",
80
+ "spec/dummy/app/models/schema_migration.rb",
81
+ "spec/dummy/config/application.rb",
82
+ "spec/dummy/config/boot.rb",
83
+ "spec/dummy/config/environment.rb",
84
+ "spec/dummy/config/environments/development.rb",
85
+ "spec/dummy/config/environments/production.rb",
86
+ "spec/dummy/config/environments/test.rb",
87
+ "spec/dummy/config/initializers/backtrace_silencers.rb",
88
+ "spec/dummy/config/initializers/inflections.rb",
89
+ "spec/dummy/config/initializers/mime_types.rb",
90
+ "spec/dummy/config/initializers/secret_token.rb",
91
+ "spec/dummy/config/initializers/session_store.rb",
92
+ "spec/dummy/config/routes.rb",
93
+ "spec/dummy/db/migrate/20110125024703_create_some_tables.rb",
94
+ "spec/dummy/db/schema.rb",
95
+ "spec/generator_spec_helper.rb",
96
+ "spec/generators/model_generator_spec.rb",
97
+ "spec/integration/navigation_spec.rb",
98
+ "spec/matchers/all.rb",
99
+ "spec/matchers/generate_file.rb",
100
+ "spec/matchers/generate_migration.rb",
101
+ "spec/matchers/have_class_method.rb",
102
+ "spec/matchers/have_method.rb",
103
+ "spec/model_mill_spec.rb",
104
+ "spec/spec_helper.rb"
105
+ ]
106
+
107
+ if s.respond_to? :specification_version then
108
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
109
+ s.specification_version = 3
110
+
111
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
112
+ s.add_development_dependency(%q<rails>, ["= 3.0.3"])
113
+ s.add_development_dependency(%q<capybara>, [">= 0.4.0"])
114
+ s.add_development_dependency(%q<sqlite3-ruby>, [">= 0"])
115
+ s.add_development_dependency(%q<rspec-rails>, [">= 2.0.0.beta"])
116
+ s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
117
+ s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
118
+ s.add_development_dependency(%q<rcov>, [">= 0"])
119
+ s.add_development_dependency(%q<awesome_print>, [">= 0"])
120
+ s.add_development_dependency(%q<mysql2>, [">= 0"])
121
+ else
122
+ s.add_dependency(%q<rails>, ["= 3.0.3"])
123
+ s.add_dependency(%q<capybara>, [">= 0.4.0"])
124
+ s.add_dependency(%q<sqlite3-ruby>, [">= 0"])
125
+ s.add_dependency(%q<rspec-rails>, [">= 2.0.0.beta"])
126
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
127
+ s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
128
+ s.add_dependency(%q<rcov>, [">= 0"])
129
+ s.add_dependency(%q<awesome_print>, [">= 0"])
130
+ s.add_dependency(%q<mysql2>, [">= 0"])
131
+ end
132
+ else
133
+ s.add_dependency(%q<rails>, ["= 3.0.3"])
134
+ s.add_dependency(%q<capybara>, [">= 0.4.0"])
135
+ s.add_dependency(%q<sqlite3-ruby>, [">= 0"])
136
+ s.add_dependency(%q<rspec-rails>, [">= 2.0.0.beta"])
137
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
138
+ s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
139
+ s.add_dependency(%q<rcov>, [">= 0"])
140
+ s.add_dependency(%q<awesome_print>, [">= 0"])
141
+ s.add_dependency(%q<mysql2>, [">= 0"])
142
+ end
143
+ end
144
+
@@ -0,0 +1,7 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require File.expand_path('../config/application', __FILE__)
5
+ require 'rake'
6
+
7
+ Dummy::Application.load_tasks
@@ -0,0 +1,3 @@
1
+ class ApplicationController < ActionController::Base
2
+ protect_from_forgery
3
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,3 @@
1
+ class SchemaMigration < ActiveRecord::Base
2
+ end
3
+
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <%= stylesheet_link_tag :all %>
6
+ <%= javascript_include_tag :defaults %>
7
+ <%= csrf_meta_tag %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1,45 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require "active_model/railtie"
4
+ require "active_record/railtie"
5
+ require "action_controller/railtie"
6
+ require "action_view/railtie"
7
+ require "action_mailer/railtie"
8
+
9
+ Bundler.require
10
+ require "model_mill"
11
+
12
+ module Dummy
13
+ class Application < Rails::Application
14
+ # Settings in config/environments/* take precedence over those specified here.
15
+ # Application configuration should go into files in config/initializers
16
+ # -- all .rb files in that directory are automatically loaded.
17
+
18
+ # Custom directories with classes and modules you want to be autoloadable.
19
+ # config.autoload_paths += %W(#{config.root}/extras)
20
+
21
+ # Only load the plugins named here, in the order given (default is alphabetical).
22
+ # :all can be used as a placeholder for all plugins not explicitly named.
23
+ # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
24
+
25
+ # Activate observers that should always be running.
26
+ # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
27
+
28
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
29
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
30
+ # config.time_zone = 'Central Time (US & Canada)'
31
+
32
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
33
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
34
+ # config.i18n.default_locale = :de
35
+
36
+ # JavaScript files you want as :defaults (application.js is always included).
37
+ # config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
38
+
39
+ # Configure the default encoding used in templates for Ruby 1.9.
40
+ config.encoding = "utf-8"
41
+
42
+ # Configure sensitive parameters which will be filtered from the log file.
43
+ config.filter_parameters += [:password]
44
+ end
45
+ end
@@ -0,0 +1,10 @@
1
+ require 'rubygems'
2
+ gemfile = File.expand_path('../../../../Gemfile', __FILE__)
3
+
4
+ if File.exist?(gemfile)
5
+ ENV['BUNDLE_GEMFILE'] = gemfile
6
+ require 'bundler'
7
+ Bundler.setup
8
+ end
9
+
10
+ $:.unshift File.expand_path('../../../../lib', __FILE__)
@@ -0,0 +1,5 @@
1
+ # Load the rails application
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the rails application
5
+ Dummy::Application.initialize!
@@ -0,0 +1,26 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # In the development environment your application's code is reloaded on
5
+ # every request. This slows down response time but is perfect for development
6
+ # since you don't have to restart the webserver when you make code changes.
7
+ config.cache_classes = false
8
+
9
+ # Log error messages when you accidentally call methods on nil.
10
+ config.whiny_nils = true
11
+
12
+ # Show full error reports and disable caching
13
+ config.consider_all_requests_local = true
14
+ config.action_view.debug_rjs = true
15
+ config.action_controller.perform_caching = false
16
+
17
+ # Don't care if the mailer can't send
18
+ config.action_mailer.raise_delivery_errors = false
19
+
20
+ # Print deprecation notices to the Rails logger
21
+ config.active_support.deprecation = :log
22
+
23
+ # Only use best-standards-support built into browsers
24
+ config.action_dispatch.best_standards_support = :builtin
25
+ end
26
+
@@ -0,0 +1,49 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # The production environment is meant for finished, "live" apps.
5
+ # Code is not reloaded between requests
6
+ config.cache_classes = true
7
+
8
+ # Full error reports are disabled and caching is turned on
9
+ config.consider_all_requests_local = false
10
+ config.action_controller.perform_caching = true
11
+
12
+ # Specifies the header that your server uses for sending files
13
+ config.action_dispatch.x_sendfile_header = "X-Sendfile"
14
+
15
+ # For nginx:
16
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
17
+
18
+ # If you have no front-end server that supports something like X-Sendfile,
19
+ # just comment this out and Rails will serve the files
20
+
21
+ # See everything in the log (default is :info)
22
+ # config.log_level = :debug
23
+
24
+ # Use a different logger for distributed setups
25
+ # config.logger = SyslogLogger.new
26
+
27
+ # Use a different cache store in production
28
+ # config.cache_store = :mem_cache_store
29
+
30
+ # Disable Rails's static asset server
31
+ # In production, Apache or nginx will already do this
32
+ config.serve_static_assets = false
33
+
34
+ # Enable serving of images, stylesheets, and javascripts from an asset server
35
+ # config.action_controller.asset_host = "http://assets.example.com"
36
+
37
+ # Disable delivery errors, bad email addresses will be ignored
38
+ # config.action_mailer.raise_delivery_errors = false
39
+
40
+ # Enable threaded mode
41
+ # config.threadsafe!
42
+
43
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
44
+ # the I18n.default_locale when a translation can not be found)
45
+ config.i18n.fallbacks = true
46
+
47
+ # Send deprecation notices to registered listeners
48
+ config.active_support.deprecation = :notify
49
+ end