taxonomite 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Rakefile +30 -0
- data/lib/taxonomite.rb +6 -0
- data/lib/taxonomite/entity.rb +39 -0
- data/lib/taxonomite/exceptions.rb +7 -0
- data/lib/taxonomite/node.rb +158 -0
- data/lib/taxonomite/taxonomite_configuration.rb +17 -0
- data/lib/taxonomite/tree.rb +130 -0
- data/lib/taxonomite/version.rb +3 -0
- data/spec/controllers/taxonomite/taxonomite_controller_spec.rb +31 -0
- data/spec/dummy/README.rdoc +28 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/javascripts/application.js +13 -0
- data/spec/dummy/app/assets/stylesheets/application.css +19 -0
- data/spec/dummy/app/assets/stylesheets/scaffold.css +56 -0
- data/spec/dummy/app/controllers/application_controller.rb +5 -0
- data/spec/dummy/app/controllers/taxonomite_controller.rb +226 -0
- data/spec/dummy/app/helpers/application_helper.rb +13 -0
- data/spec/dummy/app/helpers/taxonomite_helper.rb +9 -0
- data/spec/dummy/app/views/layouts/application.html.erb +22 -0
- data/spec/dummy/app/views/shared/_error_messages.html.erb +14 -0
- data/spec/dummy/app/views/shared/_flash_messages.html.erb +9 -0
- data/spec/dummy/app/views/taxonomite/_node.html.erb +6 -0
- data/spec/dummy/app/views/taxonomite/edit.html.erb +49 -0
- data/spec/dummy/app/views/taxonomite/index.html.erb +9 -0
- data/spec/dummy/app/views/taxonomite/new.html.erb +16 -0
- data/spec/dummy/app/views/taxonomite/show.html.erb +28 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/setup +29 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +35 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +38 -0
- data/spec/dummy/config/environments/production.rb +76 -0
- data/spec/dummy/config/environments/test.rb +42 -0
- data/spec/dummy/config/initializers/assets.rb +11 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/mongoid.rb +8 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +10 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/mongoid.yml +103 -0
- data/spec/dummy/config/routes.rb +10 -0
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/lib/tasks/db_populate.rake +66 -0
- data/spec/dummy/lib/util.rb +28 -0
- data/spec/dummy/log/development.log +7169 -0
- data/spec/dummy/log/test.log +915 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/-rejHCRn0GBGCrHMyZAcq10cNOCXaG4dVN13pFMvLgA.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/1TWMTorbA_3E6hatKbP5T9n5oDSeVMk68LF8CRn1JjI.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/3B4hMNppXANClZ-lGO7Jps_MbXOz_GLxSqnastPo3Sg.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/8H7HwvVynNVZNgOjRJ5eAUqlWB8-oDl9VwBJlQSTBQw.cache +2 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/8y77NTXIYLg5cxm011nNxQAil9n5WVHkcp3HuxsFBMY.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/AmhMJ3oocG6mNJTk0T7UZTZNv6MhN1nj2WL-k__XZlI.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/CbVJZSB6kte1IYJqiASuO95NmINClhlHaFdLKMor0c0.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/D05VjCHQqo1_JqnZLVivHPybbW2MCDXAQTDeLMBqYIQ.cache +2 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/GalDJvDt8BphTIma_xp93plZ7ay3K9A9uJk3txZw_00.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/HMK_AuhVBxFLR6tGFGS75xvUQp8JlDZBwUddr14DleY.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Hac0rR46nAtlqEtr6S-s7g79TUGQAKO_jxYLbyARW4k.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/IygAr9Ty7v-NJrroesXGkla15XgRR3nUI7BVZaPZigk.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/K46UGuIKOnMfRnYBSmbjd8UJ9LfdCS5OBhkXG00GCvY.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/KVHAw7mbk0REIRf0Zrv40JhknZB1lVmcExhj4bfZduY.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/LhBEGJtsniGETE6aGB-IrzlM_CxS6iAfBviyrUM2AvA.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/PzbUQc7wYDmhK5RZzXNRAHPhpwryEK2aIRRUfbsFMjw.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Q2QIHypAobobCW8WZnDEKFQqFczCiXaPAf3Hgk9MA_o.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/RnBEbAuuDsDqp3JRLnX8pp-IHFk1d1rGbXxYy6DhkY4.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/TIm2-xmbi7CMNL3syzvG5LyRxJtycIGXtwz8Mco3sdA.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/U-xdOqbEKMZubNF_Mq_pBnN5uGgDj_w3I9193KH2XIE.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/ZEWFmXe3i1eUOHbMoM_K0-6G0ejgZCWT3qF9dyjYEzQ.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/_k3G10-SEe8_SHlmwYbslXN42uDRmFGK0Q7nR3VyH7s.cache +2 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/bkkgBW_hSRUeyxOZ8u-7Artvy3oCRMUtd0iTsd8wrtk.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/bpttkziOegeD-17ihmHMccaVxwU9_YMeXXsmFpQQh2E.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/c0embYAEeyo6qdjqQ-b8QNzuj70uZn-q1c-dhX4aeaQ.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/dbpC0p6RBdyEjXhOxUegedCy8aK12GwuakY1DqzSB1k.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/exOsm6yrmkOg_T82Brjsyr-e2U5HAJCqiPy1NJjPBJg.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/f7S__u6qEm3h40_nJwEAwibtxI3vV-uWkuJAdnyIEho.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/lEOEeQNsy0n89Y25rZEAe5P6zFLjkhRpxQ2ZEfi_giM.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/m_RzwKTs1azS37mZ7W1stXJCfGBM4xF-Pge7trJaXhY.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/nMQn6BRwxARa2nhmNQEdm_5xj6tr2XYpLzE_7Eac2h4.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/nl0sTVgLFpHD_1Q4c8NGcatzmud7AWL6yin3iSgziRc.cache +2 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/rKpLfQIjRPLcR43VeI7lwjxj1BWPcxjVoSyDmJru04o.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/rhofdc-dVgpC_YOqzpz2yMRHD9LW4sIGBcPdzR-uM6E.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/sjZWL1ZezAb-_PmJJS_5mi-Q9X1Jcic0D7F33sUC3vs.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/tLUV7eduShLmpqrXfsgemL-zKEBEQQDdqUw-MGoqMA0.cache +0 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/uYLC0l4_HXjqNdRF2mvEqpdcIsQgz0XVMe9YxQ3dnlc.cache +1 -0
- data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/voPvH6F_x-d5fK63I1IjMzEfTcybOHN-g9q3x4BIGGw.cache +1 -0
- data/spec/factories/entity.rb +13 -0
- data/spec/factories/taxonomy_taxon.rb +45 -0
- data/spec/models/taxonomite/entity_spec.rb +34 -0
- data/spec/models/taxonomite/hierarchy_spec.rb +34 -0
- data/spec/models/taxonomite/model_spec.rb +39 -0
- data/spec/models/taxonomite/taxonomite_spec.rb +11 -0
- data/spec/models/taxonomite/tree_spec.rb +56 -0
- data/spec/models/taxonomite/zoology.rb +119 -0
- data/spec/rails_helper.rb +53 -0
- data/spec/spec_helper.rb +32 -0
- data/spec/taxonomite_helper.rb +5 -0
- data/spec/views/taxonomite/taxonomite/index.html.erb_spec.rb +5 -0
- data/spec/views/taxonomite/taxonomite/show.html.erb_spec.rb +5 -0
- metadata +456 -0
@@ -0,0 +1,16 @@
|
|
1
|
+
<h1>Create a new node:</h1>
|
2
|
+
|
3
|
+
<%= form_for @node, :url => { :action => :create } do |f| %>
|
4
|
+
<%= render 'shared/error_messages' %>
|
5
|
+
|
6
|
+
<p>
|
7
|
+
<%= f.label :name %><br />
|
8
|
+
<%= f.text_field :name %>
|
9
|
+
</p>
|
10
|
+
<p>
|
11
|
+
<%= f.label :description %><br />
|
12
|
+
<%= f.text_field :description %>
|
13
|
+
</p>
|
14
|
+
|
15
|
+
<%= f.submit "Create" %>
|
16
|
+
<% end %>
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<h2> Info on a node</h2>
|
2
|
+
<% if @node %>
|
3
|
+
<ul>
|
4
|
+
|
5
|
+
<p>Name: <%= link_to @node.typeifiedname, taxonomite_path(@node) %></p>
|
6
|
+
<p>Type: <%= @node.entity_type %></p>
|
7
|
+
<p>Description: <%= @node.description %></p>
|
8
|
+
<p>Population: <%= @node.aggregate_leaves("countme") %>
|
9
|
+
|
10
|
+
<% if @node.parent %>
|
11
|
+
<h3>Parent:</h3>
|
12
|
+
<li><%= link_to @node.parent.name, taxonomite_path(@node.parent) %></li>
|
13
|
+
<% end %>
|
14
|
+
|
15
|
+
<% if @node.has_children? %>
|
16
|
+
<h3>Children:</h3>
|
17
|
+
<%= render partial: 'node', collection: @node.children, as: :node %>
|
18
|
+
<% end %>
|
19
|
+
|
20
|
+
</ul>
|
21
|
+
<% else %>
|
22
|
+
<p>Unable to find a Taxon.</p>
|
23
|
+
<% end %>
|
24
|
+
|
25
|
+
<br/>
|
26
|
+
<ul>
|
27
|
+
<li><%= link_to "Edit this node", edit_taxonomite_path(@node) %></li>
|
28
|
+
</ul>
|
data/spec/dummy/bin/rake
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'pathname'
|
3
|
+
|
4
|
+
# path to your application root.
|
5
|
+
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
|
6
|
+
|
7
|
+
Dir.chdir APP_ROOT do
|
8
|
+
# This script is a starting point to setup your application.
|
9
|
+
# Add necessary setup steps to this file:
|
10
|
+
|
11
|
+
puts "== Installing dependencies =="
|
12
|
+
system "gem install bundler --conservative"
|
13
|
+
system "bundle check || bundle install"
|
14
|
+
|
15
|
+
# puts "\n== Copying sample files =="
|
16
|
+
# unless File.exist?("config/database.yml")
|
17
|
+
# system "cp config/database.yml.sample config/database.yml"
|
18
|
+
# end
|
19
|
+
|
20
|
+
puts "\n== Preparing database =="
|
21
|
+
system "bin/rake db:setup"
|
22
|
+
|
23
|
+
puts "\n== Removing old logs and tempfiles =="
|
24
|
+
system "rm -f log/*"
|
25
|
+
system "rm -rf tmp/cache"
|
26
|
+
|
27
|
+
puts "\n== Restarting application server =="
|
28
|
+
system "touch tmp/restart.txt"
|
29
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
2
|
+
|
3
|
+
# Pick the frameworks you want:
|
4
|
+
# require "active_record/railtie"
|
5
|
+
require "active_model/railtie"
|
6
|
+
require "active_job/railtie"
|
7
|
+
require "action_controller/railtie"
|
8
|
+
require "action_mailer/railtie"
|
9
|
+
require "action_view/railtie"
|
10
|
+
require "sprockets/railtie"
|
11
|
+
require "mongoid"
|
12
|
+
require "factory_girl_rails"
|
13
|
+
# require "rails/test_unit/railtie"
|
14
|
+
|
15
|
+
Bundler.require(*Rails.groups)
|
16
|
+
require "taxonomite"
|
17
|
+
|
18
|
+
# I hate this as its a specified path; get all the factories
|
19
|
+
Dir["#{File.dirname(__FILE__)}/../../factories/*.rb"].each { |f| require f }
|
20
|
+
|
21
|
+
module Dummy
|
22
|
+
class Application < Rails::Application
|
23
|
+
# Settings in config/environments/* take precedence over those specified here.
|
24
|
+
# Application configuration should go into files in config/initializers
|
25
|
+
# -- all .rb files in that directory are automatically loaded.
|
26
|
+
|
27
|
+
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
28
|
+
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
29
|
+
# config.time_zone = 'Central Time (US & Canada)'
|
30
|
+
|
31
|
+
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
32
|
+
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
33
|
+
# config.i18n.default_locale = :de
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,38 @@
|
|
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
|
+
# Debug mode disables concatenation and preprocessing of assets.
|
23
|
+
# This option may cause significant delays in view rendering with a large
|
24
|
+
# number of complex assets.
|
25
|
+
config.assets.debug = true
|
26
|
+
|
27
|
+
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
|
28
|
+
# yet still be able to expire them through the digest params.
|
29
|
+
config.assets.digest = true
|
30
|
+
|
31
|
+
# Adds additional error checking when serving assets at runtime.
|
32
|
+
# Checks for improperly declared sprockets dependencies.
|
33
|
+
# Raises helpful error messages.
|
34
|
+
config.assets.raise_runtime_errors = true
|
35
|
+
|
36
|
+
# Raises error for missing translations
|
37
|
+
# config.action_view.raise_on_missing_translations = true
|
38
|
+
end
|
@@ -0,0 +1,76 @@
|
|
1
|
+
Rails.application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb.
|
3
|
+
|
4
|
+
# Code is not reloaded between requests.
|
5
|
+
config.cache_classes = true
|
6
|
+
|
7
|
+
# Eager load code on boot. This eager loads most of Rails and
|
8
|
+
# your application in memory, allowing both threaded web servers
|
9
|
+
# and those relying on copy on write to perform better.
|
10
|
+
# Rake tasks automatically ignore this option for performance.
|
11
|
+
config.eager_load = true
|
12
|
+
|
13
|
+
# Full error reports are disabled and caching is turned on.
|
14
|
+
config.consider_all_requests_local = false
|
15
|
+
config.action_controller.perform_caching = true
|
16
|
+
|
17
|
+
# Enable Rack::Cache to put a simple HTTP cache in front of your application
|
18
|
+
# Add `rack-cache` to your Gemfile before enabling this.
|
19
|
+
# For large-scale production use, consider using a caching reverse proxy like
|
20
|
+
# NGINX, varnish or squid.
|
21
|
+
# config.action_dispatch.rack_cache = true
|
22
|
+
|
23
|
+
# Disable serving static files from the `/public` folder by default since
|
24
|
+
# Apache or NGINX already handles this.
|
25
|
+
config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
|
26
|
+
|
27
|
+
# Compress JavaScripts and CSS.
|
28
|
+
config.assets.js_compressor = :uglifier
|
29
|
+
# config.assets.css_compressor = :sass
|
30
|
+
|
31
|
+
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
32
|
+
config.assets.compile = false
|
33
|
+
|
34
|
+
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
|
35
|
+
# yet still be able to expire them through the digest params.
|
36
|
+
config.assets.digest = true
|
37
|
+
|
38
|
+
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
|
39
|
+
|
40
|
+
# Specifies the header that your server uses for sending files.
|
41
|
+
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
|
42
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
|
43
|
+
|
44
|
+
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
45
|
+
# config.force_ssl = true
|
46
|
+
|
47
|
+
# Use the lowest log level to ensure availability of diagnostic information
|
48
|
+
# when problems arise.
|
49
|
+
config.log_level = :debug
|
50
|
+
|
51
|
+
# Prepend all log lines with the following tags.
|
52
|
+
# config.log_tags = [ :subdomain, :uuid ]
|
53
|
+
|
54
|
+
# Use a different logger for distributed setups.
|
55
|
+
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
56
|
+
|
57
|
+
# Use a different cache store in production.
|
58
|
+
# config.cache_store = :mem_cache_store
|
59
|
+
|
60
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
61
|
+
# config.action_controller.asset_host = 'http://assets.example.com'
|
62
|
+
|
63
|
+
# Ignore bad email addresses and do not raise email delivery errors.
|
64
|
+
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
65
|
+
# config.action_mailer.raise_delivery_errors = false
|
66
|
+
|
67
|
+
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
68
|
+
# the I18n.default_locale when a translation cannot be found).
|
69
|
+
config.i18n.fallbacks = true
|
70
|
+
|
71
|
+
# Send deprecation notices to registered listeners.
|
72
|
+
config.active_support.deprecation = :notify
|
73
|
+
|
74
|
+
# Use default logging formatter so that PID and timestamp are not suppressed.
|
75
|
+
config.log_formatter = ::Logger::Formatter.new
|
76
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
Rails.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
|
+
# Do not eager load code on boot. This avoids loading your whole application
|
11
|
+
# just for the purpose of running a single test. If you are using a tool that
|
12
|
+
# preloads Rails for running tests, you may have to set it to true.
|
13
|
+
config.eager_load = false
|
14
|
+
|
15
|
+
# Configure static file server for tests with Cache-Control for performance.
|
16
|
+
config.serve_static_files = true
|
17
|
+
config.static_cache_control = 'public, max-age=3600'
|
18
|
+
|
19
|
+
# Show full error reports and disable caching.
|
20
|
+
config.consider_all_requests_local = true
|
21
|
+
config.action_controller.perform_caching = false
|
22
|
+
|
23
|
+
# Raise exceptions instead of rendering exception templates.
|
24
|
+
config.action_dispatch.show_exceptions = false
|
25
|
+
|
26
|
+
# Disable request forgery protection in test environment.
|
27
|
+
config.action_controller.allow_forgery_protection = false
|
28
|
+
|
29
|
+
# Tell Action Mailer not to deliver emails to the real world.
|
30
|
+
# The :test delivery method accumulates sent emails in the
|
31
|
+
# ActionMailer::Base.deliveries array.
|
32
|
+
config.action_mailer.delivery_method = :test
|
33
|
+
|
34
|
+
# Randomize the order test cases are executed.
|
35
|
+
config.active_support.test_order = :random
|
36
|
+
|
37
|
+
# Print deprecation notices to the stderr.
|
38
|
+
config.active_support.deprecation = :stderr
|
39
|
+
|
40
|
+
# Raises error for missing translations
|
41
|
+
# config.action_view.raise_on_missing_translations = true
|
42
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Version of your assets, change this if you want to expire all your assets.
|
4
|
+
Rails.application.config.assets.version = '1.0'
|
5
|
+
|
6
|
+
# Add additional assets to the asset load path
|
7
|
+
# Rails.application.config.assets.paths << Emoji.images_path
|
8
|
+
|
9
|
+
# Precompile additional assets.
|
10
|
+
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
|
11
|
+
# Rails.application.config.assets.precompile += %w( search.js )
|
@@ -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,16 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Add new inflection rules using the following format. Inflections
|
4
|
+
# are locale specific, and you may define rules for as many different
|
5
|
+
# locales as you wish. All of these examples are active by default:
|
6
|
+
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
7
|
+
# inflect.plural /^(ox)$/i, '\1en'
|
8
|
+
# inflect.singular /^(ox)en/i, '\1'
|
9
|
+
# inflect.irregular 'person', 'people'
|
10
|
+
# inflect.uncountable %w( fish sheep )
|
11
|
+
# end
|
12
|
+
|
13
|
+
# These inflection rules are supported but not enabled by default:
|
14
|
+
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
15
|
+
# inflect.acronym 'RESTful'
|
16
|
+
# end
|
@@ -0,0 +1,10 @@
|
|
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] if respond_to?(:wrap_parameters)
|
9
|
+
end
|
10
|
+
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# Files in the config/locales directory are used for internationalization
|
2
|
+
# and are automatically loaded by Rails. If you want to use locales other
|
3
|
+
# than English, add the necessary files in this directory.
|
4
|
+
#
|
5
|
+
# To use the locales, use `I18n.t`:
|
6
|
+
#
|
7
|
+
# I18n.t 'hello'
|
8
|
+
#
|
9
|
+
# In views, this is aliased to just `t`:
|
10
|
+
#
|
11
|
+
# <%= t('hello') %>
|
12
|
+
#
|
13
|
+
# To use a different locale, set it with `I18n.locale`:
|
14
|
+
#
|
15
|
+
# I18n.locale = :es
|
16
|
+
#
|
17
|
+
# This would use the information in config/locales/es.yml.
|
18
|
+
#
|
19
|
+
# To learn more, please read the Rails Internationalization guide
|
20
|
+
# available at http://guides.rubyonrails.org/i18n.html.
|
21
|
+
|
22
|
+
en:
|
23
|
+
hello: "Hello world"
|
@@ -0,0 +1,103 @@
|
|
1
|
+
development:
|
2
|
+
# Configure available database sessions. (required)
|
3
|
+
sessions:
|
4
|
+
# Defines the default session. (required)
|
5
|
+
default:
|
6
|
+
# Defines the name of the default database that Mongoid can connect to.
|
7
|
+
# (required).
|
8
|
+
database: dummy_development
|
9
|
+
# Provides the hosts the default session can connect to. Must be an array
|
10
|
+
# of host:port pairs. (required)
|
11
|
+
hosts:
|
12
|
+
- localhost:27017
|
13
|
+
options:
|
14
|
+
# Change the default write concern. (default = { w: 1 })
|
15
|
+
# write:
|
16
|
+
# w: 1
|
17
|
+
|
18
|
+
# Change the default consistency model to primary, secondary.
|
19
|
+
# 'secondary' will send reads to secondaries, 'primary' sends everything
|
20
|
+
# to master. (default: primary)
|
21
|
+
# read: secondary_preferred
|
22
|
+
|
23
|
+
# How many times Moped should attempt to retry an operation after
|
24
|
+
# failure. (default: The number of nodes in the cluster)
|
25
|
+
# max_retries: 20
|
26
|
+
|
27
|
+
# The time in seconds that Moped should wait before retrying an
|
28
|
+
# operation on failure. (default: 0.25)
|
29
|
+
# retry_interval: 0.25
|
30
|
+
|
31
|
+
# The connection pool size per-node. This should match or exceed the
|
32
|
+
# number of threads for a multi-threaded application. (default: 5)
|
33
|
+
# pool_size: 5
|
34
|
+
|
35
|
+
# The time in seconds that Moped should wait for the pool to provide
|
36
|
+
# an available connection. This number should probably remain at the
|
37
|
+
# default, unless for some reason you absolutely need to limit the
|
38
|
+
# pool_size, as this wait is only used when the pool is saturated.
|
39
|
+
# (default: 0.5)
|
40
|
+
# pool_timeout: 0.5
|
41
|
+
|
42
|
+
# The time in seconds before Moped will timeout connection and node
|
43
|
+
# operations. (default: 5)
|
44
|
+
# timeout: 5
|
45
|
+
|
46
|
+
# The amount of time in seconds between forced refreshes of node
|
47
|
+
# information including the discovery of new peers. (default: 300)
|
48
|
+
# refresh_interval: 300
|
49
|
+
|
50
|
+
# The amount of time in seconds that a node will be flagged as down.
|
51
|
+
# (default: 30)
|
52
|
+
# down_interval: 30
|
53
|
+
|
54
|
+
# Whether connections should use SSL. (default: nil/false)
|
55
|
+
# ssl: false
|
56
|
+
|
57
|
+
# Whether Moped will use the existing seeds/nodes to find other peers.
|
58
|
+
# (default: true)
|
59
|
+
# auto_discover: true
|
60
|
+
|
61
|
+
|
62
|
+
# Configure Mongoid specific options. (optional)
|
63
|
+
options:
|
64
|
+
# Includes the root model name in json serialization. (default: false)
|
65
|
+
# include_root_in_json: false
|
66
|
+
|
67
|
+
# Include the _type field in serialization. (default: false)
|
68
|
+
# include_type_for_serialization: false
|
69
|
+
|
70
|
+
# Preload all models in development, needed when models use
|
71
|
+
# inheritance. (default: false)
|
72
|
+
# preload_models: false
|
73
|
+
|
74
|
+
# Protect id and type from mass assignment. (default: true)
|
75
|
+
# protect_sensitive_fields: true
|
76
|
+
|
77
|
+
# Raise an error when performing a #find and the document is not found.
|
78
|
+
# (default: true)
|
79
|
+
raise_not_found_error: false
|
80
|
+
|
81
|
+
# Raise an error when defining a scope with the same name as an
|
82
|
+
# existing method. (default: false)
|
83
|
+
# scope_overwrite_exception: false
|
84
|
+
|
85
|
+
# Use Active Support's time zone in conversions. (default: true)
|
86
|
+
# use_activesupport_time_zone: true
|
87
|
+
|
88
|
+
# Ensure all times are UTC in the app side. (default: false)
|
89
|
+
# use_utc: false
|
90
|
+
test:
|
91
|
+
sessions:
|
92
|
+
default:
|
93
|
+
database: dummy_test
|
94
|
+
hosts:
|
95
|
+
- localhost:27017
|
96
|
+
options:
|
97
|
+
read: primary
|
98
|
+
# In the test environment we lower the retries and retry interval to
|
99
|
+
# low amounts for fast failures.
|
100
|
+
max_retries: 1
|
101
|
+
retry_interval: 0
|
102
|
+
options:
|
103
|
+
raise_not_found_error: false
|