Skip to content

Commit

Permalink
Merge branch 'release/v0.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve England committed Oct 28, 2011
2 parents c7f90ad + a0dde36 commit ff4dc42
Show file tree
Hide file tree
Showing 24 changed files with 277 additions and 182 deletions.
Empty file modified bin/noodall 100644 → 100755
Empty file.
11 changes: 6 additions & 5 deletions lib/noodall/templates/Gemfile
@@ -1,27 +1,28 @@
source 'http://rubygems.org'
source 'http://gems.github.com'

gem 'rails', '> 3.0'
gem 'noodall-ui'
gem 'rails', '~> 3.1.0'
gem 'mm-versionable', '0.2.5'
gem 'noodall-ui', '~> 0.5.0'
gem 'noodall-devise'
gem 'bson_ext'
gem 'dragonfly'
gem 'rack-contrib', :require => 'rack/contrib'

group :production, :staging do
gem 'dalli'
gem 'rack-cache', '~> 1.0.0', :require => 'rack/cache'
end

<%= assets_gemfile_entry %>
<%= javascript_gemfile_entry %>

group :development, :test do
gem 'capybara'
gem 'database_cleaner'
gem 'cucumber-rails'
gem 'cucumber'
gem 'rspec-rails'
gem 'spork'
gem 'launchy' # So you can do Then show me the page
gem 'factory_girl_rails'
gem 'fakerama'
end

21 changes: 13 additions & 8 deletions lib/noodall/templates/README
Expand Up @@ -91,7 +91,7 @@ mode. With gems, use <tt>sudo gem install ruby-debug</tt>. Example:

class WeblogController < ActionController::Base
def index
@posts = Post.find(:all)
@posts = Post.all
debugger
end
end
Expand Down Expand Up @@ -139,7 +139,7 @@ To reload your controllers and models after launching the console run
<tt>reload!</tt>

More information about irb can be found at:
link:http://www.rubycentral.com/pickaxe/irb.html
link:http://www.rubycentral.org/pickaxe/irb.html


== dbconsole
Expand All @@ -156,8 +156,13 @@ PostgreSQL and SQLite 3.
The default directory structure of a generated Ruby on Rails application:

|-- app
| |-- assets
| |-- images
| |-- javascripts
| `-- stylesheets
| |-- controllers
| |-- helpers
| |-- mailers
| |-- models
| `-- views
| `-- layouts
Expand All @@ -171,11 +176,7 @@ The default directory structure of a generated Ruby on Rails application:
| `-- tasks
|-- log
|-- public
| |-- images
| |-- javascripts
| `-- stylesheets
|-- script
| `-- performance
|-- test
| |-- fixtures
| |-- functional
Expand All @@ -188,11 +189,16 @@ The default directory structure of a generated Ruby on Rails application:
| |-- sessions
| `-- sockets
`-- vendor
|-- assets
`-- stylesheets
`-- plugins

app
Holds all the code that's specific to this particular application.

app/assets
Contains subdirectories for images, stylesheets, and JavaScript files.

app/controllers
Holds controllers that should be named like weblogs_controller.rb for
automated URL mapping. All controllers should descend from
Expand Down Expand Up @@ -237,8 +243,7 @@ lib
the load path.

public
The directory available for the web server. Contains subdirectories for
images, stylesheets, and javascripts. Also contains the dispatchers and the
The directory available for the web server. Also contains the dispatchers and the
default HTML files. This should be set as the DOCUMENT_ROOT of your web
server.

Expand Down
2 changes: 1 addition & 1 deletion lib/noodall/templates/Rakefile 100644 → 100755
@@ -1,7 +1,7 @@
#!/usr/bin/env rake
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

require File.expand_path('../config/application', __FILE__)
require 'rake'

<%= app_const %>.load_tasks
Binary file added lib/noodall/templates/app/assets/images/rails.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions lib/noodall/templates/app/assets/javascripts/application.js.tt
@@ -0,0 +1,17 @@
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
// GO AFTER THE REQUIRES BELOW.
//
<% unless options[:skip_javascript] -%>
//= require <%= options[:javascript] %>
//= require <%= options[:javascript] %>_ujs
<% end -%>
//= require_tree .
13 changes: 13 additions & 0 deletions lib/noodall/templates/app/assets/stylesheets/application.css
@@ -0,0 +1,13 @@
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the top of the
* compiled file, but it's generally better to create a new file per style scope.
*
*= require_self
*= require_tree .
*/
10 changes: 3 additions & 7 deletions lib/noodall/templates/app/views/layouts/application.html.erb.tt
Expand Up @@ -2,13 +2,9 @@
<html>
<head>
<title><%%= page_title %> | <%= app_const_base %></title>
<%%= stylesheet_link_tag :all %>
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script type="text/javascript">
google.load("jquery", "1.4");
</script>
<%%= javascript_include_tag :defaults %>
<%%= csrf_meta_tag %>
<%%= stylesheet_link_tag "application" %>
<%%= javascript_include_tag "application" %>
<%%= csrf_meta_tags %>
</head>
<body>
<%%= form_tag(noodall_search_path, :method => :get, :class => 'search') do %>
Expand Down
24 changes: 15 additions & 9 deletions lib/noodall/templates/config/application.rb
@@ -1,15 +1,16 @@
require File.expand_path('../boot', __FILE__)

# Pick the frameworks you want:
# require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "active_resource/railtie"
require "rails/test_unit/railtie"
require "sprockets/railtie"

# If you have a Gemfile, require the gems listed there, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(:default, Rails.env) if defined?(Bundler)
if defined?(Bundler)
# If you precompile assets before deploying to production, use this line
Bundler.require(*Rails.groups(:assets => %w(development test)))
# If you want your assets lazily compiled in production, use this line
# Bundler.require(:default, :assets, Rails.env)
end

module <%= app_const_base %>
class Application < Rails::Application
Expand All @@ -35,15 +36,20 @@ class Application < Rails::Application
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de
# JavaScript files you want as :defaults (application.js is always included).
config.action_view.javascript_expansions[:defaults] = %w(rails)

# Configure the default encoding used in templates for Ruby 1.9.
config.encoding = "utf-8"
# Configure sensitive parameters which will be filtered from the log file.
config.filter_parameters += [:password]
<% unless options.skip_sprockets? -%>
# Enable the asset pipeline
config.assets.enabled = true

# Version of your assets, change this if you want to expire all your assets
config.assets.version = '1.0'
<% end -%>

config.middleware.insert 0, 'Dragonfly::Middleware', :noodall_assets
end
end
13 changes: 3 additions & 10 deletions lib/noodall/templates/config/boot.rb
@@ -1,13 +1,6 @@
require 'rubygems'

# Set up gems listed in the Gemfile.
gemfile = File.expand_path('../../Gemfile', __FILE__)
begin
ENV['BUNDLE_GEMFILE'] = gemfile
require 'bundler'
Bundler.setup
rescue Bundler::GemNotFound => e
STDERR.puts e.message
STDERR.puts "Try running `bundle install`."
exit!
end if File.exist?(gemfile)
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)

require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
19 changes: 8 additions & 11 deletions lib/noodall/templates/config/environments/development.rb.tt
@@ -1,33 +1,30 @@
<%= app_const %>.configure do
# Settings specified here will take precedence over those in config/environment.rb
# Settings specified here will take precedence over those in config/application.rb

# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the webserver when you make code changes.
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false

# Log error messages when you accidentally call methods on nil.
config.whiny_nils = true

# Show full error reports and disable caching
config.consider_all_requests_local = true
config.action_view.debug_rjs = true
config.action_controller.perform_caching = false

# Don't care if the mailer can't send
config.action_mailer.raise_delivery_errors = false
config.action_mailer.default_url_options = { :host => 'localhost:3000' }

# Print deprecation notices to the Rails logger
config.active_support.deprecation = :log

# Only use best-standards-support built into browsers
config.action_dispatch.best_standards_support = :builtin

# Remove Cache-Control header so app does not cache anything
config.middleware.insert_before ActionDispatch::Static, Rack::ResponseHeaders do |headers|
headers.delete('Last-Modified')
headers['Cache-Control'] = "private, max-age=0"
end
end
# Do not compress assets
config.assets.compress = false

# Expands the lines which load the assets
config.assets.debug = true
end
42 changes: 28 additions & 14 deletions lib/noodall/templates/config/environments/production.rb.tt
@@ -1,39 +1,53 @@
<%= app_const %>.configure do
# Settings specified here will take precedence over those in config/environment.rb
# Settings specified here will take precedence over those in config/application.rb

# The production environment is meant for finished, "live" apps.
# Code is not reloaded between requests
config.cache_classes = true

# Full error reports are disabled and caching is turned on
config.consider_all_requests_local = false
config.action_controller.perform_caching = true

# Specifies the header that your server uses for sending files
config.action_dispatch.x_sendfile_header = "X-Sendfile"
# Disable Rails's static asset server (Apache or nginx will already do this)
config.serve_static_assets = false

# Compress JavaScripts and CSS
config.assets.compress = true

# For nginx:
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
# Don't fallback to assets pipeline if a precompiled asset is missed
config.assets.compile = false

# If you have no front-end server that supports something like X-Sendfile,
# just comment this out and Rails will serve the files
# Generate digests for assets URLs
config.assets.digest = true

# Defaults to Rails.root.join("public/assets")
# config.assets.manifest = YOUR_PATH

# Specifies the header that your server uses for sending files
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx

# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
# config.force_ssl = true

# See everything in the log (default is :info)
# config.log_level = :debug

# Prepend all log lines with the following tags
# config.log_tags = [ :subdomain, :uuid ]

# Use a different logger for distributed setups
# config.logger = SyslogLogger.new
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)

# Use a different cache store in production
# config.cache_store = :mem_cache_store

# Disable Rails's static asset server
# In production, Apache or nginx will already do this
config.serve_static_assets = false

# Enable serving of images, stylesheets, and javascripts from an asset server
# Enable serving of images, stylesheets, and JavaScripts from an asset server
# config.action_controller.asset_host = "http://assets.example.com"

# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
# config.assets.precompile += %w( search.js )

# Disable delivery errors, bad email addresses will be ignored
# config.action_mailer.raise_delivery_errors = false
config.action_mailer.default_url_options = { :host => 'www.<%= app_name %>.com' }
Expand Down
50 changes: 0 additions & 50 deletions lib/noodall/templates/config/environments/staging.rb.tt

This file was deleted.

0 comments on commit ff4dc42

Please sign in to comment.