nice 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +20 -0
- data/README.md +115 -0
- data/Rakefile +38 -0
- data/lib/assets/javascripts/event_dispatcher.coffee +34 -0
- data/lib/assets/javascripts/nice_imp_jquery.js.coffee +40 -0
- data/lib/assets/javascripts/nice_jquery.js +15 -0
- data/lib/nice.rb +5 -0
- data/lib/nice/engine.rb +4 -0
- data/lib/nice/html_parser.rb +126 -0
- data/lib/nice/js/caller.rb +29 -0
- data/lib/nice/logic.rb +61 -0
- data/lib/nice/middleware.rb +84 -0
- data/lib/nice/version.rb +3 -0
- data/lib/tasks/nice_tasks.rake +4 -0
- data/test/dummy/README.rdoc +261 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/assets/javascripts/application.js +15 -0
- data/test/dummy/app/assets/stylesheets/application.css +13 -0
- data/test/dummy/app/controllers/application_controller.rb +3 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +56 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/database.yml +25 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +37 -0
- data/test/dummy/config/environments/production.rb +67 -0
- data/test/dummy/config/environments/test.rb +37 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/inflections.rb +15 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/routes.rb +58 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/test.log +8 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +25 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +6 -0
- data/test/nice_test.rb +7 -0
- data/test/nizzaTestApp/Gemfile +45 -0
- data/test/nizzaTestApp/Gemfile.lock +130 -0
- data/test/nizzaTestApp/README.rdoc +261 -0
- data/test/nizzaTestApp/Rakefile +7 -0
- data/test/nizzaTestApp/app/assets/images/rails.png +0 -0
- data/test/nizzaTestApp/app/assets/javascripts/application.js +16 -0
- data/test/nizzaTestApp/app/assets/javascripts/books.js.coffee +3 -0
- data/test/nizzaTestApp/app/assets/javascripts/nice.js.coffee +3 -0
- data/test/nizzaTestApp/app/assets/stylesheets/application.css +23 -0
- data/test/nizzaTestApp/app/assets/stylesheets/books.css.scss +3 -0
- data/test/nizzaTestApp/app/assets/stylesheets/nice.css.scss +34 -0
- data/test/nizzaTestApp/app/assets/stylesheets/scaffolds.css.scss +46 -0
- data/test/nizzaTestApp/app/controllers/application_controller.rb +3 -0
- data/test/nizzaTestApp/app/controllers/books_controller.rb +83 -0
- data/test/nizzaTestApp/app/controllers/nice_controller.rb +9 -0
- data/test/nizzaTestApp/app/helpers/application_helper.rb +2 -0
- data/test/nizzaTestApp/app/helpers/books_helper.rb +2 -0
- data/test/nizzaTestApp/app/helpers/nice_helper.rb +2 -0
- data/test/nizzaTestApp/app/models/book.rb +3 -0
- data/test/nizzaTestApp/app/views/books/_form.html.erb +26 -0
- data/test/nizzaTestApp/app/views/books/edit.html.erb +4 -0
- data/test/nizzaTestApp/app/views/books/index.html.erb +38 -0
- data/test/nizzaTestApp/app/views/books/new.html.erb +4 -0
- data/test/nizzaTestApp/app/views/books/show.html.erb +27 -0
- data/test/nizzaTestApp/app/views/layouts/application.html.haml +11 -0
- data/test/nizzaTestApp/app/views/layouts/nice.html.haml +16 -0
- data/test/nizzaTestApp/app/views/nice/many.html.haml +6 -0
- data/test/nizzaTestApp/app/views/nice/simple.html.haml +7 -0
- data/test/nizzaTestApp/config.ru +4 -0
- data/test/nizzaTestApp/config/application.rb +65 -0
- data/test/nizzaTestApp/config/boot.rb +6 -0
- data/test/nizzaTestApp/config/database.yml +25 -0
- data/test/nizzaTestApp/config/environment.rb +5 -0
- data/test/nizzaTestApp/config/environments/development.rb +37 -0
- data/test/nizzaTestApp/config/environments/production.rb +67 -0
- data/test/nizzaTestApp/config/environments/test.rb +37 -0
- data/test/nizzaTestApp/config/initializers/backtrace_silencers.rb +7 -0
- data/test/nizzaTestApp/config/initializers/inflections.rb +15 -0
- data/test/nizzaTestApp/config/initializers/mime_types.rb +5 -0
- data/test/nizzaTestApp/config/initializers/secret_token.rb +7 -0
- data/test/nizzaTestApp/config/initializers/session_store.rb +8 -0
- data/test/nizzaTestApp/config/initializers/wrap_parameters.rb +14 -0
- data/test/nizzaTestApp/config/locales/en.yml +5 -0
- data/test/nizzaTestApp/config/routes.rb +64 -0
- data/test/nizzaTestApp/db/development.sqlite3 +0 -0
- data/test/nizzaTestApp/db/migrate/20120424181757_create_books.rb +11 -0
- data/test/nizzaTestApp/db/schema.rb +24 -0
- data/test/nizzaTestApp/db/seeds.rb +7 -0
- data/test/nizzaTestApp/doc/README_FOR_APP +2 -0
- data/test/nizzaTestApp/log/development.log +18129 -0
- data/test/nizzaTestApp/public/404.html +26 -0
- data/test/nizzaTestApp/public/422.html +26 -0
- data/test/nizzaTestApp/public/500.html +25 -0
- data/test/nizzaTestApp/public/favicon.ico +0 -0
- data/test/nizzaTestApp/public/html_a.html +19 -0
- data/test/nizzaTestApp/public/robots.txt +5 -0
- data/test/nizzaTestApp/script/rails +6 -0
- data/test/nizzaTestApp/test/fixtures/books.yml +11 -0
- data/test/nizzaTestApp/test/functional/books_controller_test.rb +49 -0
- data/test/nizzaTestApp/test/functional/nice_controller_test.rb +14 -0
- data/test/nizzaTestApp/test/performance/browsing_test.rb +12 -0
- data/test/nizzaTestApp/test/test_helper.rb +13 -0
- data/test/nizzaTestApp/test/unit/book_test.rb +7 -0
- data/test/nizzaTestApp/test/unit/helpers/books_helper_test.rb +4 -0
- data/test/nizzaTestApp/test/unit/helpers/nice_helper_test.rb +4 -0
- data/test/nizzaTestApp/tmp/cache/assets/C0B/BC0/sprockets%2F101e06a7a14c184823c19103629096d2 +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/C1E/9B0/sprockets%2F7b5417470164315b3893a6761f235fd1 +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/C46/5D0/sprockets%2F41a35570f1490d1582cf6349724a611c +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/C53/A30/sprockets%2F54110227445e976ce96491b91152ad5f +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/C7B/CC0/sprockets%2F85d74df12791bf3446221275a72ac812 +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/C7F/E00/sprockets%2Ff0913862ad164458ad09cf05236f2286 +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/CA1/570/sprockets%2F96de018b14a15866fd23113417cbc730 +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/CA9/020/sprockets%2F9c6b44b42095db99107072f3023c45dd +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/CAC/730/sprockets%2F892c8ec11684bd01347124824bf35af5 +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/CBF/5E0/sprockets%2F68c66e476c73987d8b6f2ae8160102e2 +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/CD3/460/sprockets%2Fd584d62c054619a28c1c0cff1910521f +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/CD7/6F0/sprockets%2Fbd3936370d0f952ada5774e2230046ed +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/CDB/590/sprockets%2Ff3a3730475dbf19c4a286b5a4f772161 +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/CDD/0B0/sprockets%2Fb351b5f1236c183f9961725ca13ec3e9 +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/CE3/600/sprockets%2F683a4e08e292483284fad185a85e4a3a +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/CE4/FC0/sprockets%2F919f9138b534aa39c3fa50c87e8420a6 +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/CE6/960/sprockets%2F7555284c4d8a6b95e4d2c10e7d02684e +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/CEF/1E0/sprockets%2Fc4f9a95bee5399474db38395336d10d2 +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/CF0/DA0/sprockets%2Fd7d5b37686831d37c4dd75e645f5e016 +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/CF4/140/sprockets%2F22a3157d204c1f8e417a25f01a2dbe45 +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/CF6/C20/sprockets%2F7847096fc8a875a9b941beb70e91284d +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/D05/840/sprockets%2F0ac43b191b0098c9942ebe5e47406ea2 +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/D0B/710/sprockets%2F66190523b03af056e8dca69cd9fd2242 +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/D0E/F80/sprockets%2F8c2b061e379a23e7c4d207adcf992462 +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/D0F/3E0/sprockets%2F6654975eaa53a225d976278fcb6baa00 +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/D10/A10/sprockets%2F9fe3a3308aaa4e98688d77b9b22111a4 +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/D1A/E10/sprockets%2Ff2d34568efb5305d6990b1502d8c6ff7 +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/D1C/C90/sprockets%2F8eb2c6f59556a9aa92dbf132856910c9 +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/D2C/6F0/sprockets%2F1852beb3a2ad67b2cc634f05e142435e +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/D2D/200/sprockets%2F164554b0cd8a0c5bbc610521a87cf19e +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/D2D/D50/sprockets%2Fd585a06e2ee6203ccb04c8b84150d14d +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/D30/9B0/sprockets%2Fa365b8a67c4a6a210d178c2c7dc812f0 +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/D39/F10/sprockets%2F04aab6c01e8d12d151f54e8c6ee79715 +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/D3B/B40/sprockets%2Fd50a18a28a8aefa85142997ae7a22f24 +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/D3C/990/sprockets%2F47cc6b7ccafd54046c3881f18a16e162 +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/D3D/DC0/sprockets%2F24a8e58314bc87244de540eee302f3ef +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/D46/330/sprockets%2F50ff63775b3d84d16b93348bedd0d5d4 +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/D51/0C0/sprockets%2F7ae1c78c809fa25eef9e8f5052a99332 +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/D55/F00/sprockets%2F3df7a51021aa28af9f436ab24dc2c430 +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/D58/170/sprockets%2F1d1519f0daa88f114d10945d0a0ee5bb +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/D71/EB0/sprockets%2F9a57785b6dbd04ace339105c79ca5ad6 +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/D73/4C0/sprockets%2Fac8c9d97edb15b84cb35a184822952da +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/D76/710/sprockets%2Ff9dabce89a305adf72963094731ef53a +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/D78/6E0/sprockets%2F66c9f9ea0228a2bad83467d8a416fe4f +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/D7B/A50/sprockets%2Fb1b95d84f048a6e4ce984cd1e29f50d6 +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/DB7/CB0/sprockets%2F2402f5cbeb259c1b7a03f6a0ff074adb +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/DDE/620/sprockets%2Ff6f9a7fedaea753da63ea72347d8c385 +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/E07/B70/sprockets%2Fd8c8bcaa8828e657a5fd4b9cacb92a17 +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/E19/2A0/sprockets%2F10fcfbe6ebae11a40c8eac41939a1b9a +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/E25/4C0/sprockets%2Fde2fd9fd11c04a582cdbbe3d84a35ae6 +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/E5F/FD0/sprockets%2F43fe06bae4e63b9cecaf84e1d8b0cdf7 +0 -0
- data/test/nizzaTestApp/tmp/cache/assets/E64/EC0/sprockets%2Fea602649ea9f2e7adceb8c2f7d3cc5fc +0 -0
- data/test/nizzaTestApp/tmp/cache/sass/279c98e2d4f2491dbaea6ced015d162cb89b00e3/books.css.scssc +0 -0
- data/test/nizzaTestApp/tmp/cache/sass/279c98e2d4f2491dbaea6ced015d162cb89b00e3/scaffolds.css.scssc +0 -0
- data/test/nizzaTestApp/tmp/cache/sass/40d1259310c37828c7b403e05d7a941ef3d84db5/nice.css.scssc +0 -0
- data/test/nizzaTestApp/tmp/cache/sass/40d1259310c37828c7b403e05d7a941ef3d84db5/scaffolds.css.scssc +0 -0
- data/test/nizzaTestApp/tmp/cache/sass/fa4fcc5ec3c4b006233db2677ec61c27ca744dda/nice.css.scssc +0 -0
- data/test/test_helper.rb +15 -0
- metadata +433 -0
@@ -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
|
+
development:
|
7
|
+
adapter: sqlite3
|
8
|
+
database: db/development.sqlite3
|
9
|
+
pool: 5
|
10
|
+
timeout: 5000
|
11
|
+
|
12
|
+
# Warning: The database defined as "test" will be erased and
|
13
|
+
# re-generated from your development database when you run "rake".
|
14
|
+
# Do not set this db to the same as development or production.
|
15
|
+
test:
|
16
|
+
adapter: sqlite3
|
17
|
+
database: db/test.sqlite3
|
18
|
+
pool: 5
|
19
|
+
timeout: 5000
|
20
|
+
|
21
|
+
production:
|
22
|
+
adapter: sqlite3
|
23
|
+
database: db/production.sqlite3
|
24
|
+
pool: 5
|
25
|
+
timeout: 5000
|
@@ -0,0 +1,37 @@
|
|
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 web server 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_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
|
+
# Only use best-standards-support built into browsers
|
23
|
+
config.action_dispatch.best_standards_support = :builtin
|
24
|
+
|
25
|
+
# Raise exception on mass assignment protection for Active Record models
|
26
|
+
config.active_record.mass_assignment_sanitizer = :strict
|
27
|
+
|
28
|
+
# Log the query plan for queries taking more than this (works
|
29
|
+
# with SQLite, MySQL, and PostgreSQL)
|
30
|
+
config.active_record.auto_explain_threshold_in_seconds = 0.5
|
31
|
+
|
32
|
+
# Do not compress assets
|
33
|
+
config.assets.compress = false
|
34
|
+
|
35
|
+
# Expands the lines which load the assets
|
36
|
+
config.assets.debug = true
|
37
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
Dummy::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
|
+
# Full error reports are disabled and caching is turned on
|
8
|
+
config.consider_all_requests_local = false
|
9
|
+
config.action_controller.perform_caching = true
|
10
|
+
|
11
|
+
# Disable Rails's static asset server (Apache or nginx will already do this)
|
12
|
+
config.serve_static_assets = false
|
13
|
+
|
14
|
+
# Compress JavaScripts and CSS
|
15
|
+
config.assets.compress = true
|
16
|
+
|
17
|
+
# Don't fallback to assets pipeline if a precompiled asset is missed
|
18
|
+
config.assets.compile = false
|
19
|
+
|
20
|
+
# Generate digests for assets URLs
|
21
|
+
config.assets.digest = true
|
22
|
+
|
23
|
+
# Defaults to Rails.root.join("public/assets")
|
24
|
+
# config.assets.manifest = YOUR_PATH
|
25
|
+
|
26
|
+
# Specifies the header that your server uses for sending files
|
27
|
+
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
|
28
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
|
29
|
+
|
30
|
+
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
31
|
+
# config.force_ssl = true
|
32
|
+
|
33
|
+
# See everything in the log (default is :info)
|
34
|
+
# config.log_level = :debug
|
35
|
+
|
36
|
+
# Prepend all log lines with the following tags
|
37
|
+
# config.log_tags = [ :subdomain, :uuid ]
|
38
|
+
|
39
|
+
# Use a different logger for distributed setups
|
40
|
+
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
41
|
+
|
42
|
+
# Use a different cache store in production
|
43
|
+
# config.cache_store = :mem_cache_store
|
44
|
+
|
45
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server
|
46
|
+
# config.action_controller.asset_host = "http://assets.example.com"
|
47
|
+
|
48
|
+
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
|
49
|
+
# config.assets.precompile += %w( search.js )
|
50
|
+
|
51
|
+
# Disable delivery errors, bad email addresses will be ignored
|
52
|
+
# config.action_mailer.raise_delivery_errors = false
|
53
|
+
|
54
|
+
# Enable threaded mode
|
55
|
+
# config.threadsafe!
|
56
|
+
|
57
|
+
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
58
|
+
# the I18n.default_locale when a translation can not be found)
|
59
|
+
config.i18n.fallbacks = true
|
60
|
+
|
61
|
+
# Send deprecation notices to registered listeners
|
62
|
+
config.active_support.deprecation = :notify
|
63
|
+
|
64
|
+
# Log the query plan for queries taking more than this (works
|
65
|
+
# with SQLite, MySQL, and PostgreSQL)
|
66
|
+
# config.active_record.auto_explain_threshold_in_seconds = 0.5
|
67
|
+
end
|
@@ -0,0 +1,37 @@
|
|
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
|
+
# Raise exception on mass assignment protection for Active Record models
|
33
|
+
config.active_record.mass_assignment_sanitizer = :strict
|
34
|
+
|
35
|
+
# Print deprecation notices to the stderr
|
36
|
+
config.active_support.deprecation = :stderr
|
37
|
+
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,15 @@
|
|
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
|
11
|
+
#
|
12
|
+
# These inflection rules are supported but not enabled by default:
|
13
|
+
# ActiveSupport::Inflector.inflections do |inflect|
|
14
|
+
# inflect.acronym 'RESTful'
|
15
|
+
# end
|
@@ -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 = 'b2eaba4b93a52edbcd453f8aa195efb40f4cacac80236079eea5fc14b746c4f481e74e8528307993913a3c116234e3510dccd05e4f8f229f7483e948cc98b2ca'
|
@@ -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,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,8 @@
|
|
1
|
+
[1m[36m (0.4ms)[0m [1mbegin transaction[0m
|
2
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
3
|
+
[1m[36m (0.3ms)[0m [1mbegin transaction[0m
|
4
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
5
|
+
[1m[36m (0.4ms)[0m [1mbegin transaction[0m
|
6
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
7
|
+
[1m[36m (0.3ms)[0m [1mbegin transaction[0m
|
8
|
+
[1m[35m (0.0ms)[0m rollback transaction
|
@@ -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,25 @@
|
|
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
|
+
</div>
|
24
|
+
</body>
|
25
|
+
</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'
|
data/test/nice_test.rb
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
source 'http://rubygems.org'
|
2
|
+
|
3
|
+
gem 'rails', '3.2.3'
|
4
|
+
|
5
|
+
# Bundle edge Rails instead:
|
6
|
+
# gem 'rails', :git => 'git://github.com/rails/rails.git'
|
7
|
+
|
8
|
+
gem 'sqlite3'
|
9
|
+
|
10
|
+
gem 'nice', :path => '../../'
|
11
|
+
|
12
|
+
# eyes - friendly
|
13
|
+
#gem "twitter-bootstrap-rails", :git => "git://github.com/elchbenny/twitter-bootstrap-rails.git", :branch => "static"
|
14
|
+
|
15
|
+
gem 'haml-rails'
|
16
|
+
|
17
|
+
#gem "therubyracer", :platform => :ruby
|
18
|
+
# Gems used only for assets and not required
|
19
|
+
# in production environments by default.
|
20
|
+
group :assets do
|
21
|
+
gem 'sass-rails', '~> 3.2.3'
|
22
|
+
gem 'coffee-rails', '~> 3.2.1'
|
23
|
+
|
24
|
+
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
|
25
|
+
# gem 'therubyracer', :platform => :ruby
|
26
|
+
|
27
|
+
gem 'uglifier', '>= 1.0.3'
|
28
|
+
end
|
29
|
+
|
30
|
+
gem 'jquery-rails'
|
31
|
+
|
32
|
+
# To use ActiveModel has_secure_password
|
33
|
+
# gem 'bcrypt-ruby', '~> 3.0.0'
|
34
|
+
|
35
|
+
# To use Jbuilder templates for JSON
|
36
|
+
# gem 'jbuilder'
|
37
|
+
|
38
|
+
# Use unicorn as the app server
|
39
|
+
# gem 'unicorn'
|
40
|
+
|
41
|
+
# Deploy with Capistrano
|
42
|
+
# gem 'capistrano'
|
43
|
+
|
44
|
+
# To use debugger
|
45
|
+
# gem 'ruby-debug19', :require => 'ruby-debug'
|