batman-rails 0.16.0 → 0.16.1

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 (65) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/lib/batman-rails/version.rb +1 -1
  4. data/lib/generators/batman/app_generator.rb +1 -1
  5. data/lib/templates/rails/controller.rb +1 -1
  6. data/test/define_view_helper_test.rb +1 -1
  7. data/test/sample/.gitignore +16 -5
  8. data/test/sample/Gemfile +30 -20
  9. data/test/sample/README.rdoc +28 -0
  10. data/test/sample/Rakefile +1 -2
  11. data/test/sample/app/{mailers/.gitkeep → assets/images/.keep} +0 -0
  12. data/test/sample/app/assets/javascripts/application.js +11 -4
  13. data/test/sample/app/assets/stylesheets/application.css +13 -5
  14. data/test/sample/app/controllers/application_controller.rb +3 -1
  15. data/test/sample/app/{models/.gitkeep → controllers/concerns/.keep} +0 -0
  16. data/test/sample/{lib/assets/.gitkeep → app/mailers/.keep} +0 -0
  17. data/test/sample/{lib/tasks/.gitkeep → app/models/.keep} +0 -0
  18. data/test/sample/{log/.gitkeep → app/models/concerns/.keep} +0 -0
  19. data/test/sample/app/views/layouts/application.html.erb +2 -2
  20. data/test/sample/bin/bundle +3 -0
  21. data/test/sample/bin/rails +8 -0
  22. data/test/sample/bin/rake +8 -0
  23. data/test/sample/bin/spring +18 -0
  24. data/test/sample/config.ru +1 -1
  25. data/test/sample/config/application.rb +3 -28
  26. data/test/sample/config/boot.rb +1 -3
  27. data/test/sample/config/database.yml +8 -8
  28. data/test/sample/config/environment.rb +3 -3
  29. data/test/sample/config/environments/development.rb +21 -14
  30. data/test/sample/config/environments/production.rb +48 -25
  31. data/test/sample/config/environments/test.rb +18 -21
  32. data/test/sample/config/initializers/cookies_serializer.rb +3 -0
  33. data/test/sample/config/initializers/filter_parameter_logging.rb +4 -0
  34. data/test/sample/config/initializers/inflections.rb +9 -3
  35. data/test/sample/config/initializers/mime_types.rb +0 -1
  36. data/test/sample/config/initializers/session_store.rb +1 -6
  37. data/test/sample/config/initializers/wrap_parameters.rb +6 -6
  38. data/test/sample/config/locales/en.yml +20 -2
  39. data/test/sample/config/routes.rb +23 -25
  40. data/test/sample/config/secrets.yml +22 -0
  41. data/test/sample/db/seeds.rb +2 -2
  42. data/test/sample/{test/fixtures/.gitkeep → lib/assets/.keep} +0 -0
  43. data/test/sample/{test/functional/.gitkeep → lib/tasks/.keep} +0 -0
  44. data/test/sample/{test/integration/.gitkeep → log/.keep} +0 -0
  45. data/test/sample/public/404.html +54 -13
  46. data/test/sample/public/422.html +54 -13
  47. data/test/sample/public/500.html +53 -13
  48. data/test/sample/public/robots.txt +2 -2
  49. data/test/sample/test/{unit/.gitkeep → controllers/.keep} +0 -0
  50. data/test/sample/{vendor/assets/stylesheets/.gitkeep → test/fixtures/.keep} +0 -0
  51. data/test/sample/{vendor/plugins/.gitkeep → test/helpers/.keep} +0 -0
  52. data/test/sample/test/integration/.keep +0 -0
  53. data/test/sample/test/mailers/.keep +0 -0
  54. data/test/sample/test/models/.keep +0 -0
  55. data/test/sample/test/test_helper.rb +2 -2
  56. data/test/sample/vendor/assets/javascripts/.keep +0 -0
  57. data/test/sample/vendor/assets/stylesheets/.keep +0 -0
  58. metadata +64 -52
  59. data/test/sample/README +0 -261
  60. data/test/sample/app/assets/images/rails.png +0 -0
  61. data/test/sample/config/initializers/secret_token.rb +0 -7
  62. data/test/sample/doc/README_FOR_APP +0 -2
  63. data/test/sample/public/index.html +0 -241
  64. data/test/sample/script/rails +0 -6
  65. data/test/sample/test/performance/browsing_test.rb +0 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9c8deae7a6dad1d59f1cb67e92a798e50414598d
4
- data.tar.gz: a7b266ed03e94f18b5db5b585e4de18138e9510a
3
+ metadata.gz: 6d95974e3e6ae159f3b780ca698ea0473346a0b0
4
+ data.tar.gz: 5ab81ea8164ea4a6738d6a3c492d603ea848b1b8
5
5
  SHA512:
6
- metadata.gz: a69ac93e5f28fc771eae9177305d3cc7c821d8a8f15a01220785b1562930f16b0577187f62c54185739cbf82af8ce27b435bc381eee4d795a18c136f276e896e
7
- data.tar.gz: 2bd249704f4a95b3dc1bf3fc4acf8e94a7d09788cf362ff4b01b833a4924a4b0cec9883d16707fa134c972226732413609077ae29d682da5ea2bee6e282f0991
6
+ metadata.gz: 774f27302a95f49b0fd2f2b66154d3d337651b01537f9f908c1626dc306987158adc4a43e4dec4c8a94356e3411ee6817238d56dc38feac0820bd56b3f274a19
7
+ data.tar.gz: 158bd2974c5803f1003ecd7ebb88c2f12b1472a87ff3494cc6d55f8d9099dff51d951e6e5356daea0012b7b2d6a0b39823d70d9068ea9a719a98becb20f37bd5
data/.gitignore CHANGED
@@ -3,3 +3,4 @@
3
3
  Gemfile.lock
4
4
  pkg/*
5
5
  tmp/**/*
6
+ **/.DS_Store
@@ -1,6 +1,6 @@
1
1
  module Batman
2
2
  module Rails
3
- VERSION = "0.16.0"
3
+ VERSION = "0.16.1"
4
4
  BATMAN_VERSION = "0.16.0"
5
5
  end
6
6
  end
@@ -23,7 +23,7 @@ module Batman
23
23
  template "rails/layout.html", "app/views/layouts/#{app_name}.html.erb"
24
24
 
25
25
  unless ENV["RAILS_ENV"] == "test"
26
- inject_into_file "config/routes.rb", :after => "#{js_application_name}::Application.routes.draw do\n" do
26
+ inject_into_file "config/routes.rb", :after => "Rails.application.routes.draw do\n" do
27
27
  route_catchall
28
28
  end
29
29
 
@@ -6,7 +6,7 @@ class <%= js_app_name %>Controller < ApplicationController
6
6
  path = request.path[prefix_length..-1]
7
7
  render :text => Rails.application.assets[path]
8
8
  else
9
- render nothing: true, layout: '<%= app_name %>'
9
+ render file: 'layouts/<%= app_name %>', layout: false
10
10
  end
11
11
  end
12
12
 
@@ -11,7 +11,7 @@ class DefineViewHelperTest < ActionView::TestCase
11
11
  end
12
12
 
13
13
  test "it can be given override path" do
14
- File.expects(:join).with("app/assets/batman/templates/", "**/*").returns("app/assets/batman/templates/**/*")
14
+ File.expects(:join).with("app/assets/batman/templates", "**/*").returns("app/assets/batman/templates/**/*")
15
15
  batman_define_views(path_to_html: "app/assets/batman/templates")
16
16
  end
17
17
 
@@ -1,5 +1,16 @@
1
- .bundle
2
- db/*.sqlite3
3
- log/*.log
4
- tmp/
5
- .sass-cache/
1
+ # See https://help.github.com/articles/ignoring-files for more about ignoring files.
2
+ #
3
+ # If you find yourself ignoring temporary files generated by your text editor
4
+ # or operating system, you probably want to add a global ignore instead:
5
+ # git config --global core.excludesfile '~/.gitignore_global'
6
+
7
+ # Ignore bundler config.
8
+ /.bundle
9
+
10
+ # Ignore the default SQLite database.
11
+ /db/*.sqlite3
12
+ /db/*.sqlite3-journal
13
+
14
+ # Ignore all logfiles and tempfiles.
15
+ /log/*.log
16
+ /tmp
@@ -1,30 +1,40 @@
1
- source 'http://rubygems.org'
1
+ source 'https://rubygems.org'
2
2
 
3
- gem 'rails', '3.1.0'
4
-
5
- # Bundle edge Rails instead:
6
- # gem 'rails', :git => 'git://github.com/rails/rails.git'
7
3
 
4
+ # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
5
+ gem 'rails', '4.1.1'
6
+ # Use sqlite3 as the database for Active Record
8
7
  gem 'sqlite3'
8
+ # Use SCSS for stylesheets
9
+ gem 'sass-rails', '~> 4.0.3'
10
+ # Use Uglifier as compressor for JavaScript assets
11
+ gem 'uglifier', '>= 1.3.0'
12
+ # Use CoffeeScript for .js.coffee assets and views
13
+ gem 'coffee-rails', '~> 4.0.0'
14
+ # See https://github.com/sstephenson/execjs#readme for more supported runtimes
15
+ # gem 'therubyracer', platforms: :ruby
16
+
17
+ # Use jquery as the JavaScript library
18
+ gem 'jquery-rails'
19
+ # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
20
+ gem 'turbolinks'
21
+ # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
22
+ gem 'jbuilder', '~> 2.0'
23
+ # bundle exec rake doc:rails generates the API under doc/api.
24
+ gem 'sdoc', '~> 0.4.0', group: :doc
9
25
 
10
- gem 'json'
11
-
12
- # Gems used only for assets and not required
13
- # in production environments by default.
14
- group :assets do
15
- gem 'sass-rails', " ~> 3.1.0"
16
- gem 'coffee-rails', "~> 3.1.0"
17
- gem 'uglifier'
18
- end
26
+ # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
27
+ gem 'spring', group: :development
19
28
 
20
- gem 'jquery-rails'
29
+ # Use ActiveModel has_secure_password
30
+ # gem 'bcrypt', '~> 3.1.7'
21
31
 
22
- # Use unicorn as the web server
32
+ # Use unicorn as the app server
23
33
  # gem 'unicorn'
24
34
 
25
- # Deploy with Capistrano
26
- # gem 'capistrano'
35
+ # Use Capistrano for deployment
36
+ # gem 'capistrano-rails', group: :development
27
37
 
28
- # To use debugger
29
- # gem 'ruby-debug'
38
+ # Use debugger
39
+ # gem 'debugger', group: [:development, :test]
30
40
 
@@ -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>.
@@ -1,7 +1,6 @@
1
- #!/usr/bin/env rake
2
1
  # Add your own tasks in files placed in lib/tasks ending in .rake,
3
2
  # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
4
3
 
5
4
  require File.expand_path('../config/application', __FILE__)
6
5
 
7
- Sample::Application.load_tasks
6
+ Rails.application.load_tasks
@@ -1,9 +1,16 @@
1
- // This is a manifest file that'll be compiled into including all the files listed below.
2
- // Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
3
- // be included in the compiled file accessible from http://example.com/assets/application.js
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
+ //
4
7
  // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
5
- // the compiled file.
8
+ // compiled file.
9
+ //
10
+ // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
11
+ // about supported directives.
6
12
  //
7
13
  //= require jquery
8
14
  //= require jquery_ujs
15
+ //= require turbolinks
9
16
  //= require_tree .
@@ -1,7 +1,15 @@
1
1
  /*
2
- * This is a manifest file that'll automatically include all the stylesheets available in this directory
3
- * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
4
- * the top of the compiled file, but it's generally better to create a new file per style scope.
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 .
5
14
  *= require_self
6
- *= require_tree .
7
- */
15
+ */
@@ -1,3 +1,5 @@
1
1
  class ApplicationController < ActionController::Base
2
- protect_from_forgery
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
3
5
  end
@@ -2,8 +2,8 @@
2
2
  <html>
3
3
  <head>
4
4
  <title>Sample</title>
5
- <%= stylesheet_link_tag "application" %>
6
- <%= javascript_include_tag "application" %>
5
+ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
6
+ <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
7
7
  <%= csrf_meta_tags %>
8
8
  </head>
9
9
  <body>
@@ -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,8 @@
1
+ #!/usr/bin/env ruby
2
+ begin
3
+ load File.expand_path("../spring", __FILE__)
4
+ rescue LoadError
5
+ end
6
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
7
+ require_relative '../config/boot'
8
+ require 'rails/commands'
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+ begin
3
+ load File.expand_path("../spring", __FILE__)
4
+ rescue LoadError
5
+ end
6
+ require_relative '../config/boot'
7
+ require 'rake'
8
+ Rake.application.run
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # This file loads spring without using Bundler, in order to be fast
4
+ # It gets overwritten when you run the `spring binstub` command
5
+
6
+ unless defined?(Spring)
7
+ require "rubygems"
8
+ require "bundler"
9
+
10
+ if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ spring \((.*?)\)$.*?^$/m)
11
+ ENV["GEM_PATH"] = ([Bundler.bundle_path.to_s] + Gem.path).join(File::PATH_SEPARATOR)
12
+ ENV["GEM_HOME"] = ""
13
+ Gem.paths = ENV
14
+
15
+ gem "spring", match[1]
16
+ require "spring/binstub"
17
+ end
18
+ end
@@ -1,4 +1,4 @@
1
1
  # This file is used by Rack-based servers to start the application.
2
2
 
3
3
  require ::File.expand_path('../config/environment', __FILE__)
4
- run Sample::Application
4
+ run Rails.application
@@ -2,12 +2,9 @@ require File.expand_path('../boot', __FILE__)
2
2
 
3
3
  require 'rails/all'
4
4
 
5
- if defined?(Bundler)
6
- # If you precompile assets before deploying to production, use this line
7
- Bundler.require *Rails.groups(:assets => %w(development test))
8
- # If you want your assets lazily compiled in production, use this line
9
- # Bundler.require(:default, :assets, Rails.env)
10
- end
5
+ # Require the gems listed in Gemfile, including any gems
6
+ # you've limited to :test, :development, or :production.
7
+ Bundler.require(*Rails.groups)
11
8
 
12
9
  module Sample
13
10
  class Application < Rails::Application
@@ -15,16 +12,6 @@ module Sample
15
12
  # Application configuration should go into files in config/initializers
16
13
  # -- all .rb files in that directory are automatically loaded.
17
14
 
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
15
  # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
29
16
  # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
30
17
  # config.time_zone = 'Central Time (US & Canada)'
@@ -32,17 +19,5 @@ module Sample
32
19
  # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
33
20
  # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
34
21
  # config.i18n.default_locale = :de
35
-
36
- # Configure the default encoding used in templates for Ruby 1.9.
37
- config.encoding = "utf-8"
38
-
39
- # Configure sensitive parameters which will be filtered from the log file.
40
- config.filter_parameters += [:password]
41
-
42
- # Enable the asset pipeline
43
- config.assets.enabled = true
44
-
45
- # Version of your assets, change this if you want to expire all your assets
46
- config.assets.version = '1.0'
47
22
  end
48
23
  end
@@ -1,6 +1,4 @@
1
- require 'rubygems'
2
-
3
1
  # Set up gems listed in the Gemfile.
4
2
  ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
5
3
 
6
- require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
4
+ require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
@@ -3,23 +3,23 @@
3
3
  #
4
4
  # Ensure the SQLite 3 gem is defined in your Gemfile
5
5
  # gem 'sqlite3'
6
- development:
6
+ #
7
+ default: &default
7
8
  adapter: sqlite3
8
- database: db/development.sqlite3
9
9
  pool: 5
10
10
  timeout: 5000
11
11
 
12
+ development:
13
+ <<: *default
14
+ database: db/development.sqlite3
15
+
12
16
  # Warning: The database defined as "test" will be erased and
13
17
  # re-generated from your development database when you run "rake".
14
18
  # Do not set this db to the same as development or production.
15
19
  test:
16
- adapter: sqlite3
20
+ <<: *default
17
21
  database: db/test.sqlite3
18
- pool: 5
19
- timeout: 5000
20
22
 
21
23
  production:
22
- adapter: sqlite3
24
+ <<: *default
23
25
  database: db/production.sqlite3
24
- pool: 5
25
- timeout: 5000
@@ -1,5 +1,5 @@
1
- # Load the rails application
1
+ # Load the Rails application.
2
2
  require File.expand_path('../application', __FILE__)
3
3
 
4
- # Initialize the rails application
5
- Sample::Application.initialize!
4
+ # Initialize the Rails application.
5
+ Rails.application.initialize!
@@ -1,30 +1,37 @@
1
- Sample::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
3
 
4
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
5
+ # every request. This slows down response time but is perfect for development
6
6
  # since you don't have to restart the web server when you make code changes.
7
7
  config.cache_classes = false
8
8
 
9
- # Log error messages when you accidentally call methods on nil.
10
- config.whiny_nils = true
9
+ # Do not eager load code on boot.
10
+ config.eager_load = false
11
11
 
12
- # Show full error reports and disable caching
12
+ # Show full error reports and disable caching.
13
13
  config.consider_all_requests_local = true
14
14
  config.action_controller.perform_caching = false
15
15
 
16
- # Don't care if the mailer can't send
16
+ # Don't care if the mailer can't send.
17
17
  config.action_mailer.raise_delivery_errors = false
18
18
 
19
- # Print deprecation notices to the Rails logger
19
+ # Print deprecation notices to the Rails logger.
20
20
  config.active_support.deprecation = :log
21
21
 
22
- # Only use best-standards-support built into browsers
23
- config.action_dispatch.best_standards_support = :builtin
22
+ # Raise an error on page load if there are pending migrations.
23
+ config.active_record.migration_error = :page_load
24
24
 
25
- # Do not compress assets
26
- config.assets.compress = false
27
-
28
- # Expands the lines which load the assets
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.
29
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
30
37
  end