ar_default_values 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +25 -48
  3. data/.rspec +2 -0
  4. data/.rubocop.yml +13 -0
  5. data/.travis.yml +6 -4
  6. data/Gemfile +1 -11
  7. data/Guardfile +32 -0
  8. data/Rakefile +9 -17
  9. data/ar_default_values.gemspec +23 -13
  10. data/lib/ar_default_values/railtie.rb +9 -0
  11. data/lib/ar_default_values/version.rb +1 -1
  12. data/lib/ar_default_values.rb +3 -6
  13. data/spec/ar_default_values_spec.rb +42 -49
  14. data/spec/dummy/README.rdoc +28 -0
  15. data/spec/dummy/Rakefile +6 -0
  16. data/spec/dummy/app/assets/images/.keep +0 -0
  17. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  18. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  19. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  20. data/spec/dummy/app/controllers/concerns/.keep +0 -0
  21. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  22. data/spec/dummy/app/mailers/.keep +0 -0
  23. data/spec/dummy/app/models/.keep +0 -0
  24. data/spec/dummy/app/models/book.rb +2 -0
  25. data/spec/dummy/app/models/concerns/.keep +0 -0
  26. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  27. data/spec/dummy/bin/bundle +3 -0
  28. data/spec/dummy/bin/rails +4 -0
  29. data/spec/dummy/bin/rake +4 -0
  30. data/spec/dummy/config/application.rb +22 -0
  31. data/spec/dummy/config/boot.rb +5 -0
  32. data/spec/dummy/config/database.yml +25 -0
  33. data/spec/dummy/config/environment.rb +5 -0
  34. data/spec/dummy/config/environments/development.rb +37 -0
  35. data/spec/dummy/config/environments/production.rb +78 -0
  36. data/spec/dummy/config/environments/test.rb +39 -0
  37. data/spec/dummy/config/initializers/assets.rb +8 -0
  38. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  39. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  40. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  41. data/spec/dummy/config/initializers/inflections.rb +16 -0
  42. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  43. data/spec/dummy/config/initializers/session_store.rb +3 -0
  44. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  45. data/spec/dummy/config/locales/en.yml +23 -0
  46. data/spec/dummy/config/routes.rb +56 -0
  47. data/spec/dummy/config/secrets.yml +22 -0
  48. data/spec/dummy/config.ru +4 -0
  49. data/spec/dummy/db/migrate/20141010061040_create_books.rb +11 -0
  50. data/spec/dummy/db/schema.rb +25 -0
  51. data/spec/dummy/lib/assets/.keep +0 -0
  52. data/spec/dummy/log/.keep +0 -0
  53. data/spec/dummy/public/404.html +67 -0
  54. data/spec/dummy/public/422.html +67 -0
  55. data/spec/dummy/public/500.html +66 -0
  56. data/spec/dummy/public/favicon.ico +0 -0
  57. data/spec/rails_helper.rb +17 -0
  58. data/spec/spec_helper.rb +84 -12
  59. metadata +257 -27
  60. data/spec/test.sqlite3 +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5e377838e48ccad8237c57909a67c15cc5e43223
4
- data.tar.gz: 8ac4024d5e11a96f357f4ba25c20f4b071338bbf
3
+ metadata.gz: 8cf0954f72cbdb345ce93476ca29c5fd82268ddc
4
+ data.tar.gz: 527a4418a22a85e0950bb744c22771f0f1c4b2e4
5
5
  SHA512:
6
- metadata.gz: 1ebfcad27fdbf3b80067629dc4ab04c54bf59ab5167b1a8755356e67ebf17ebc9b3b8053a827258f929fbb06cbc4e90ec5393f750bba8c46db1cc0d3945ba607
7
- data.tar.gz: a8d0969fee54980e33627d707b577c70ca0fe10ff2e619012b40a7ae084fe2e8f0c9ba3afd82f16ffce1dd7686f587c6b29269d36d3d32a4bafcc7894e04a09e
6
+ metadata.gz: 42d44a47af13abb6001f6a8f6d89e758b752e45052d42c7dcc73d01b98636466a353b9c77717c2f2baac561d866e811d992ed65211554025cb422db498195e4d
7
+ data.tar.gz: 9c98c48769645af886388cc014d1a96e4c571874bd9f09a84737b8a61b7ecb38b6e4c73748356291c0d145562a7651c6b2dd640e232eb6acbd29a126c4ec213c
data/.gitignore CHANGED
@@ -1,51 +1,28 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
1
6
  Gemfile.lock
2
-
3
- # rcov generated
7
+ InstalledFiles
8
+ _yardoc
4
9
  coverage
5
- coverage.data
6
-
7
- # rdoc generated
8
- rdoc
9
-
10
- # yard generated
11
- doc
12
- .yardoc
13
-
14
- # bundler
15
- .bundle
16
-
17
- # jeweler generated
10
+ doc/
11
+ lib/bundler/man
18
12
  pkg
19
-
20
- # Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
21
- #
22
- # * Create a file at ~/.gitignore
23
- # * Include files you want ignored
24
- # * Run: git config --global core.excludesfile ~/.gitignore
25
- #
26
- # After doing this, these files will be ignored in all your git projects,
27
- # saving you from having to 'pollute' every project you touch with them
28
- #
29
- # Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line)
30
- #
31
- # For MacOS:
32
- #
33
- #.DS_Store
34
-
35
- # For TextMate
36
- #*.tmproj
37
- #tmtags
38
-
39
- # For emacs:
40
- #*~
41
- #\#*
42
- #.\#*
43
-
44
- # For vim:
45
- #*.swp
46
-
47
- # For redcar:
48
- #.redcar
49
-
50
- # For rubinius:
51
- #*.rbc
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ *.bundle
19
+ *.so
20
+ *.o
21
+ *.a
22
+ mkmf.log
23
+ log/*.log
24
+ spec/dummy/db/*.sqlite3
25
+ spec/dummy/db/*.sqlite3-journal
26
+ spec/dummy/log/*.log
27
+ spec/dummy/tmp/
28
+ spec/dummy/.sass-cache
data/.rspec CHANGED
@@ -1 +1,3 @@
1
1
  --color
2
+ --format doc
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,13 @@
1
+ AllCops:
2
+ RunRailsCops: true
3
+ Excludes:
4
+ - spec/dummy/db/schema.rb
5
+ - vendor/bundle/**/*
6
+ Metrics/LineLength:
7
+ Enabled: false
8
+ Style/Documentation:
9
+ Enabled: false
10
+ Style/FileName:
11
+ Enabled: false
12
+ Style/RegexpLiteral:
13
+ Enabled: false
data/.travis.yml CHANGED
@@ -1,6 +1,8 @@
1
1
  rvm:
2
- - 1.9.3
3
2
  - 2.0.0
4
- env:
5
- - rails='~> 3.2'
6
- - rails='~> 4.0'
3
+ - 2.1.3
4
+ before_script:
5
+ - bundle exec rake db:migrate
6
+ script:
7
+ - bundle exec rake spec
8
+ - bundle exec rubocop
data/Gemfile CHANGED
@@ -1,13 +1,3 @@
1
- source "http://rubygems.org"
1
+ source 'http://rubygems.org'
2
2
 
3
3
  gemspec
4
-
5
- ENV['rails'] ||= '~> 4.0'
6
- gem "rails", ENV['rails']
7
-
8
- group :development do
9
- gem "pry"
10
- gem "rspec"
11
- gem "rdoc"
12
- gem "sqlite3"
13
- end
data/Guardfile ADDED
@@ -0,0 +1,32 @@
1
+ guard :bundler do
2
+ watch('Gemfile')
3
+ # Uncomment next line if your Gemfile contains the `gemspec' command.
4
+ # watch(/^.+\.gemspec/)
5
+ end
6
+
7
+ guard :rspec, cmd: 'bundle exec rspec' do
8
+ watch(%r{^spec/.+_spec\.rb$})
9
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
10
+ watch('spec/spec_helper.rb') { 'spec' }
11
+
12
+ # Rails example
13
+ watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
14
+ watch(%r{^app/(.*)(\.erb|\.haml|\.slim)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
15
+ watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
16
+ watch(%r{^spec/support/(.+)\.rb$}) { 'spec' }
17
+ watch('config/routes.rb') { 'spec/routing' }
18
+ watch('app/controllers/application_controller.rb') { 'spec/controllers' }
19
+ watch('spec/rails_helper.rb') { 'spec' }
20
+
21
+ # Capybara features specs
22
+ watch(%r{^app/views/(.+)/.*\.(erb|haml|slim)$}) { |m| "spec/features/#{m[1]}_spec.rb" }
23
+
24
+ # Turnip features and steps
25
+ watch(%r{^spec/acceptance/(.+)\.feature$})
26
+ watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' }
27
+ end
28
+
29
+ guard :rubocop, cli: '--auto-correct' do
30
+ watch(%r{.+\.rb$})
31
+ watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
32
+ end
data/Rakefile CHANGED
@@ -1,23 +1,15 @@
1
- # encoding: utf-8
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
2
6
 
3
7
  require 'bundler/gem_tasks'
4
-
5
8
  require 'rspec/core/rake_task'
6
- RSpec::Core::RakeTask.new(:spec)
7
9
 
8
- RSpec::Core::RakeTask.new(:rcov) do |spec|
9
- spec.pattern = 'spec/**/*_spec.rb'
10
- spec.rcov = true
11
- end
10
+ APP_RAKEFILE = File.expand_path('../spec/dummy/Rakefile', __FILE__)
11
+ load 'rails/tasks/engine.rake'
12
12
 
13
- task :default => :spec
14
-
15
- require 'rdoc/task'
16
- Rake::RDocTask.new do |rdoc|
17
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
13
+ RSpec::Core::RakeTask.new(:spec)
18
14
 
19
- rdoc.rdoc_dir = 'rdoc'
20
- rdoc.title = "ar_default_values #{version}"
21
- rdoc.rdoc_files.include('README*')
22
- rdoc.rdoc_files.include('lib/**/*.rb')
23
- end
15
+ task default: :spec
@@ -4,22 +4,32 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require 'ar_default_values/version'
5
5
 
6
6
  Gem::Specification.new do |spec|
7
- spec.name = "ar_default_values"
7
+ spec.name = 'ar_default_values'
8
8
  spec.version = DefaultValues::VERSION
9
- spec.authors = ["masarakki"]
10
- spec.email = ["masaki@hisme.net"]
11
- spec.description = "ActiveRecord with default values"
12
- spec.summary = "ActiveRecord with default values"
13
- spec.homepage = "https://github.com/masarakki/ar_default_values"
14
- spec.license = "MIT"
9
+ spec.authors = ['masarakki']
10
+ spec.email = ['masaki@hisme.net']
11
+ spec.description = 'ActiveRecord with default values'
12
+ spec.summary = 'ActiveRecord with default values'
13
+ spec.homepage = 'https://github.com/masarakki/ar_default_values'
14
+ spec.license = 'MIT'
15
15
 
16
- spec.files = `git ls-files`.split($/)
16
+ spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
17
17
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
- spec.require_paths = ["lib"]
19
+ spec.require_paths = ['lib']
20
20
 
21
- spec.add_runtime_dependency "activerecord", ">= 3.2"
22
- spec.add_runtime_dependency "activesupport", ">= 3.2"
23
- spec.add_development_dependency "bundler", "~> 1.3"
24
- spec.add_development_dependency "rake"
21
+ spec.add_development_dependency 'bundler', '~> 1.6'
22
+ spec.add_dependency 'rails', '>= 3.2'
23
+ spec.add_development_dependency 'sqlite3'
24
+ spec.add_development_dependency 'rake'
25
+ spec.add_development_dependency 'rspec'
26
+ spec.add_development_dependency 'rspec-rails'
27
+ spec.add_development_dependency 'rspec-its'
28
+ spec.add_development_dependency 'pry'
29
+ spec.add_development_dependency 'pry-doc'
30
+ spec.add_development_dependency 'guard'
31
+ spec.add_development_dependency 'guard-rspec'
32
+ spec.add_development_dependency 'guard-bundler'
33
+ spec.add_development_dependency 'guard-rubocop'
34
+ spec.add_development_dependency 'rdoc'
25
35
  end
@@ -0,0 +1,9 @@
1
+ module DefaultValues
2
+ class Railtie < ::Rails::Railtie
3
+ initializer 'default_values.initialize' do
4
+ ActiveSupport.on_load :active_record do
5
+ include DefaultValues
6
+ end
7
+ end
8
+ end
9
+ end
@@ -1,3 +1,3 @@
1
1
  module DefaultValues
2
- VERSION = "0.4.0"
2
+ VERSION = '0.5.0'
3
3
  end
@@ -1,6 +1,5 @@
1
- require "ar_default_values/version"
2
- require 'active_support'
3
- require 'active_record'
1
+ require 'ar_default_values/version'
2
+ require 'ar_default_values/railtie' if defined?(Rails)
4
3
 
5
4
  #
6
5
  # = ActiveRecord::DefaultValue
@@ -44,7 +43,7 @@ module DefaultValues
44
43
  def default_values(defaults = {}, &block)
45
44
  define_method(:initialize_with_default_values) do |*attributes, &inner_block|
46
45
  defaults = defaults.merge(block.call) if block_given?
47
- defaults = Hash[defaults.each_pair.map{ |key, value| [key, value.kind_of?(Proc) ? value.call : value]}]
46
+ defaults = Hash[defaults.each_pair.map { |key, value| [key, value.is_a?(Proc) ? value.call : value] }]
48
47
 
49
48
  initialize_without_default_values(*attributes, &inner_block)
50
49
 
@@ -57,5 +56,3 @@ module DefaultValues
57
56
  end
58
57
  end
59
58
  end
60
-
61
- ActiveRecord::Base.send(:include, DefaultValues)
@@ -1,89 +1,82 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
1
+ require 'rails_helper'
2
2
 
3
- class Book < ActiveRecord::Base
3
+ class Book1 < Book
4
4
  attr_protected :edition if Rails.version.to_i < 4
5
5
 
6
- default_values price: 0, edition: 1, released_at: lambda { Time.now }
6
+ default_values price: 0, edition: 1, released_at: -> { Time.now }
7
7
  end
8
8
 
9
- class Book2 < ActiveRecord::Base
9
+ class Book2 < Book
10
10
  self.table_name = :books
11
11
  attr_protected :edition if Rails.version.to_i < 4
12
12
  default_values price: 0, edition: 1 do
13
13
  t = Time.now
14
- {:released_at => t }
14
+ { released_at: t }
15
15
  end
16
16
  end
17
17
 
18
- class Book3 < ActiveRecord::Base
18
+ class Book3 < Book
19
19
  self.table_name = :books
20
20
  attr_accessible :price if Rails.version.to_i < 4
21
21
  default_values price: 0, edition: 1, released_at: -> { Time.now }
22
22
  end
23
23
 
24
- describe "ArDefaultValues" do
24
+ describe DefaultValues do
25
25
  let!(:now) { Time.at(Time.now.to_i) }
26
26
 
27
27
  subject { @sample }
28
- describe :fixed_default_values do
29
- before { Time.stub(:now) { now } }
30
- context :without_attributes do
31
- before do
32
- @sample = Book.new
33
- end
34
- its(:title) { should be_nil }
35
- its(:price) { should == 0 }
36
- its(:edition) { should == 1 }
37
- its(:released_at) { should == now }
28
+ describe 'fixed default_values' do
29
+ before { allow(Time).to receive(:now).and_return(now) }
30
+ context 'without attributes' do
31
+ subject { Book1.new }
32
+ its(:title) { is_expected.to be_nil }
33
+ its(:price) { is_expected.to eq 0 }
34
+ its(:edition) { is_expected.to eq 1 }
35
+ its(:released_at) { is_expected.to eq now }
38
36
  end
39
- context :with_attributes do
40
- before do
41
- @sample = Book.new(:price => 100)
42
- end
43
- its(:title) { should be_nil }
44
- its(:price) { should == 100 }
45
- its(:edition) { should == 1 }
46
- its(:released_at) { should == now }
37
+
38
+ context 'with attributes' do
39
+ subject { Book1.new(price: 100) }
40
+ its(:title) { is_expected.to be_nil }
41
+ its(:price) { is_expected.to eq 100 }
42
+ its(:edition) { is_expected.to eq 1 }
43
+ its(:released_at) { is_expected.to eq now }
47
44
  end
48
- context :with_block do
49
- before do
50
- @sample = Book.new do |t|
45
+ context 'with block' do
46
+ subject do
47
+ Book1.new do |t|
51
48
  t.title = 'foo'
52
49
  end
53
50
  end
54
- its(:title) { should == 'foo' }
55
- its(:price) { should == 0 }
56
- its(:edition) { should == 1 }
57
- its(:released_at) { should == now }
51
+ its(:title) { is_expected.to eq 'foo' }
52
+ its(:price) { is_expected.to eq 0 }
53
+ its(:edition) { is_expected.to eq 1 }
54
+ its(:released_at) { is_expected.to eq now }
58
55
  end
59
56
 
60
57
  if Rails.version.to_i < 4
61
- context :consider_attr_protected do
62
- before do
63
- @sample = Book.new(:edition => 3)
64
- end
65
- its(:title) { should be_nil }
66
- its(:price) { should == 0 }
67
- its(:edition) { should == 1 }
68
- its(:released_at) { should == now }
58
+ describe 'consider attr_protected' do
59
+ subject { Book1.new(edition: 3) }
60
+ its(:title) { is_expected.to be_nil }
61
+ its(:price) { is_expected.to eq 0 }
62
+ its(:edition) { is_expected.to eq 1 }
63
+ its(:released_at) { is_expected.to eq now }
69
64
  end
70
65
  end
71
66
  end
72
67
 
73
- describe :instance_values_with_block do
68
+ describe 'instance values with block' do
69
+ subject { Book2.new }
74
70
  before do
75
- @sample = Book2.new
76
71
  sleep 1
77
72
  @target = Book2.new
78
73
  end
79
- its(:released_at) { should_not eq @target.released_at }
74
+ its(:released_at) { is_expected.not_to eq @target.released_at }
80
75
  end
81
76
 
82
- describe :both_attr_accessible_and_attr_protected do
83
- before do
84
- @sample = Book3.new(:price => 150)
85
- end
86
- its(:price) { should == 150 }
87
- its(:edition) { should == 1 }
77
+ context 'both attr_accessible and attr_protected' do
78
+ subject { Book3.new(price: 150) }
79
+ its(:price) { is_expected.to eq 150 }
80
+ its(:edition) { is_expected.to eq 1 }
88
81
  end
89
82
  end
@@ -0,0 +1,28 @@
1
+ == README
2
+
3
+ This README would normally document whatever steps are necessary to get the
4
+ application up and running.
5
+
6
+ Things you may want to cover:
7
+
8
+ * Ruby version
9
+
10
+ * System dependencies
11
+
12
+ * Configuration
13
+
14
+ * Database creation
15
+
16
+ * Database initialization
17
+
18
+ * How to run the test suite
19
+
20
+ * Services (job queues, cache servers, search engines, etc.)
21
+
22
+ * Deployment instructions
23
+
24
+ * ...
25
+
26
+
27
+ Please feel free to use a different markup language if you do not plan to run
28
+ <tt>rake doc:app</tt>.
@@ -0,0 +1,6 @@
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
+
6
+ Rails.application.load_tasks
File without changes
@@ -0,0 +1,13 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file.
9
+ //
10
+ // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require_tree .
@@ -0,0 +1,15 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any styles
10
+ * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11
+ * file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,5 @@
1
+ class ApplicationController < ActionController::Base
2
+ # Prevent CSRF attacks by raising an exception.
3
+ # For APIs, you may want to use :null_session instead.
4
+ protect_from_forgery with: :exception
5
+ end
File without changes
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
File without changes
File without changes
@@ -0,0 +1,2 @@
1
+ class Book < ActiveRecord::Base
2
+ end
File without changes
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
6
+ <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
+ load Gem.bin_path('bundler', 'bundle')
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
3
+ require_relative '../config/boot'
4
+ require 'rails/commands'
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative '../config/boot'
3
+ require 'rake'
4
+ Rake.application.run
@@ -0,0 +1,22 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require 'rails/all'
4
+
5
+ Bundler.require(*Rails.groups)
6
+ require 'ar_default_values'
7
+
8
+ module Dummy
9
+ class Application < Rails::Application
10
+ # Settings in config/environments/* take precedence over those specified here.
11
+ # Application configuration should go into files in config/initializers
12
+ # -- all .rb files in that directory are automatically loaded.
13
+
14
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
15
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
16
+ # config.time_zone = 'Central Time (US & Canada)'
17
+
18
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
19
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
20
+ # config.i18n.default_locale = :de
21
+ end
22
+ end
@@ -0,0 +1,5 @@
1
+ # Set up gems listed in the Gemfile.
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
3
+
4
+ require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
5
+ $LOAD_PATH.unshift File.expand_path('../../../../lib', __FILE__)
@@ -0,0 +1,25 @@
1
+ # SQLite version 3.x
2
+ # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem 'sqlite3'
6
+ #
7
+ default: &default
8
+ adapter: sqlite3
9
+ pool: 5
10
+ timeout: 5000
11
+
12
+ development:
13
+ <<: *default
14
+ database: db/development.sqlite3
15
+
16
+ # Warning: The database defined as "test" will be erased and
17
+ # re-generated from your development database when you run "rake".
18
+ # Do not set this db to the same as development or production.
19
+ test:
20
+ <<: *default
21
+ database: db/test.sqlite3
22
+
23
+ production:
24
+ <<: *default
25
+ database: db/production.sqlite3
@@ -0,0 +1,5 @@
1
+ # Load the Rails application.
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the Rails application.
5
+ Rails.application.initialize!
@@ -0,0 +1,37 @@
1
+ Rails.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 web server when you make code changes.
7
+ config.cache_classes = false
8
+
9
+ # Do not eager load code on boot.
10
+ config.eager_load = false
11
+
12
+ # Show full error reports and disable caching.
13
+ config.consider_all_requests_local = true
14
+ config.action_controller.perform_caching = false
15
+
16
+ # Don't care if the mailer can't send.
17
+ config.action_mailer.raise_delivery_errors = false
18
+
19
+ # Print deprecation notices to the Rails logger.
20
+ config.active_support.deprecation = :log
21
+
22
+ # Raise an error on page load if there are pending migrations.
23
+ config.active_record.migration_error = :page_load
24
+
25
+ # Debug mode disables concatenation and preprocessing of assets.
26
+ # This option may cause significant delays in view rendering with a large
27
+ # number of complex assets.
28
+ config.assets.debug = true
29
+
30
+ # Adds additional error checking when serving assets at runtime.
31
+ # Checks for improperly declared sprockets dependencies.
32
+ # Raises helpful error messages.
33
+ config.assets.raise_runtime_errors = true
34
+
35
+ # Raises error for missing translations
36
+ # config.action_view.raise_on_missing_translations = true
37
+ end