Skip to content

Commit

Permalink
rails3 update
Browse files Browse the repository at this point in the history
  • Loading branch information
mjankowski committed Jul 1, 2010
1 parent 81c45ab commit 4cd379c
Show file tree
Hide file tree
Showing 37 changed files with 402 additions and 201 deletions.
34 changes: 3 additions & 31 deletions README.textile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ Basic, default styles for rails applications

h2. Installation

Flutie is a Rails engine. It works with versions of Rails greater than 2.3.
Flutie is a Rails engine. It works with versions of Rails greater than 3.0.

Flutie is recommended to be run as a plugin so that the automatic installer is run.
Flutie is recommended to be run as a gem and included in your Gemfile.

$ ruby script/plugin install -f git@github.com:thoughtbot/flutie.git
$ rake flutie:install

The installer will copy the Flutie stylesheets into public/flutie/stylesheets

Expand Down Expand Up @@ -45,34 +45,6 @@ bc.. <div class="pagination">
<a href="#next">Next</a>
</div>

h2. Gem Installation

You can also install Flutie as a gem, but then you'll need to run the install task manually.

In config/environment.rb:

<pre>
config.gem "thoughtbot-flutie",
:lib => 'flutie',
:source => 'http://gems.github.com',
:version => '1.0.0'
</pre>

Vendor the gem:

<pre>
rake gems:install
rake gems:unpack
</pre>

Run the installer:

<pre>
ruby vendor/gems/thoughtbot-flutie-1.0.0/install.rb
</pre>

h2.

h2. Authors

Flutie was written by thoughtbot, inc.
Expand Down
18 changes: 0 additions & 18 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,3 @@ Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_files.include('README')
rdoc.rdoc_files.include('lib/**/*.rb')
end

gem_spec = Gem::Specification.new do |gem_spec|
gem_spec.name = "flutie"
gem_spec.version = "1.0"
gem_spec.summary = "style defaults"
gem_spec.email = "support@thoughtbot.com"
gem_spec.homepage = "http://github.com/thoughtbot/flutie"
gem_spec.description = "Rails authentication with email & password."
gem_spec.authors = ["thoughtbot"]
gem_spec.files = FileList["[A-Z]*", "{app,config,lib,rails}/**/*"]
end

desc "Generate a gemspec file"
task :gemspec do
File.open("#{gem_spec.name}.gemspec", 'w') do |f|
f.write gem_spec.to_yaml
end
end
34 changes: 19 additions & 15 deletions app/controllers/flutie/styleguides_controller.rb
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
class Flutie::StyleguidesController < ApplicationController
module Flutie

unloadable
class StyleguidesController < ApplicationController

def show
@styleguides = styleguides
render :layout => "flutie" if params[:flutie] == "true"
end
unloadable

def show
@styleguides = styleguides
render :layout => "flutie" if params[:flutie] == "true"
end

private
private

def styleguides
all_styleguide_partials = ActionController::Base.view_paths.map do |view_path|
styleguide_path = File.join(view_path, 'styleguides')
if File.exists?(styleguide_path)
Dir.glob(styleguide_path + '/_*.*')
else
nil
def styleguides
all_styleguide_partials = ActionController::Base.view_paths.map do |view_path|
styleguide_path = File.join(view_path.to_s, 'styleguides')
if File.exists?(styleguide_path)
Dir.glob(styleguide_path + '/_*.*')
else
nil
end
end
all_styleguide_partials.flatten.compact
end
all_styleguide_partials.flatten.compact
end

end
7 changes: 0 additions & 7 deletions config/flutie_routes.rb

This file was deleted.

File renamed without changes.
5 changes: 5 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Rails.application.routes.draw do |map|

resource :styleguides, :as => :styleguide, :controller => 'flutie/styleguides', :only => [:show]

end
80 changes: 11 additions & 69 deletions flutie.gemspec
Original file line number Diff line number Diff line change
@@ -1,69 +1,11 @@
--- !ruby/object:Gem::Specification
name: flutie
version: !ruby/object:Gem::Version
version: 0.6.9
platform: ruby
authors:
- thoughtbot
autorequire:
bindir: bin
cert_chain: []

date: 2009-07-24 00:00:00 -04:00
default_executable:
dependencies: []

description: Default application styles
email: support@thoughtbot.com
executables: []

extensions: []

extra_rdoc_files: []

files:
- LICENSE
- Rakefile
- README.textile
- app/controllers
- app/controllers/flutie
- app/controllers/flutie/styleguides_controller.rb
- app/views
- app/views/styleguides
- app/views/styleguides/show.html.erb
- config/flutie_routes.rb
- lib/flutie
- lib/flutie/extensions
- lib/flutie/extensions/routes.rb
- lib/flutier.rb
- rails/init.rb
has_rdoc: true
homepage: http://github.com/thoughtbot/flutie
licenses: []

post_install_message:
rdoc_options: []

require_paths:
- lib
required_ruby_version: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
version: "0"
version:
required_rubygems_version: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
version: "0"
version:
requirements: []

rubyforge_project:
rubygems_version: 1.3.4
signing_key:
specification_version: 3
summary: Default application styles
test_files: []

Gem::Specification.new do |s|
s.name = 'flutie'
s.version = '1.0.0'
s.date = %q{2010-04-06}
s.email = 'support@thoughtbot.com'
s.homepage = 'http://github.com/thoughtbot/flutie'
s.summary = 'Flutie adds default stylesheets to web apps'
s.description = 'Flutie is a starting point for personal discovery'
s.files = ["app/controllers", "app/controllers/flutie", "app/controllers/flutie/styleguides_controller.rb", "app/views", "app/views/flutie", "app/views/flutie/styleguides", "app/views/flutie/styleguides/show.erb", "app/views/layouts", "app/views/layouts/flutie.erb", "config/initializers", "config/initializers/expansion.rb", "config/routes.rb", "lib/flutie", "lib/flutie/engine.rb", "lib/flutie.rb", "lib/tasks", "lib/tasks/flutie.rake", "README.textile"]
s.authors = ['Chad Pytel', 'Kevin Burg', 'Matt Jankowski', 'Mike Burns', 'Fred Yates']
end
1 change: 0 additions & 1 deletion init.rb

This file was deleted.

19 changes: 0 additions & 19 deletions install.rb

This file was deleted.

3 changes: 1 addition & 2 deletions lib/flutie.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
module Flutie
require 'flutie/engine' if defined?(Rails)
end

require 'flutie/extensions/routes'
6 changes: 6 additions & 0 deletions lib/flutie/engine.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module Flutie

class Engine < Rails::Engine
end

end
14 changes: 0 additions & 14 deletions lib/flutie/extensions/routes.rb

This file was deleted.

17 changes: 17 additions & 0 deletions lib/tasks/flutie.rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
require 'fileutils'

def copy_files(source_path, destination_path, directory)
source, destination = File.join(directory, source_path), File.join(Rails.root, destination_path)
FileUtils.mkdir_p(destination, :verbose => true) unless File.exist?(destination)
FileUtils.cp_r(source, destination, :verbose => true)
end

directory = File.dirname(__FILE__)

namespace :flutie do
desc 'install flutie stylesheets into public/ directory'
task :install => :environment do
# Copy the flutie stylesheets into rails_root/public/flutie
copy_files("../../public/stylesheets", "/public/flutie", directory)
end
end
1 change: 0 additions & 1 deletion rails/init.rb

This file was deleted.

4 changes: 4 additions & 0 deletions test/dummy/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.bundle
db/*.sqlite3
log/*.log
tmp/**/*
10 changes: 10 additions & 0 deletions test/dummy/Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# 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'
require 'rake/testtask'
require 'rake/rdoctask'

Rails::Application.load_tasks
3 changes: 3 additions & 0 deletions test/dummy/app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class ApplicationController < ActionController::Base
protect_from_forgery
end
2 changes: 2 additions & 0 deletions test/dummy/app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module ApplicationHelper
end
4 changes: 4 additions & 0 deletions test/dummy/config.ru
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# This file is used by Rack-based servers to start the application.

require ::File.expand_path('../config/environment', __FILE__)
run Dummy::Application
45 changes: 45 additions & 0 deletions test/dummy/config/application.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
require File.expand_path('../boot', __FILE__)

require 'rails/all'

# 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)

require 'flutie'

module Dummy
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.

# Add additional load paths for your own custom dirs
# config.load_paths += %W( #{config.root}/extras )

# Only load the plugins named here, in the order given (default is alphabetical).
# :all can be used as a placeholder for all plugins not explicitly named
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]

# Activate observers that should always be running
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer

# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'

# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
# config.i18n.default_locale = :de

# Configure generators values. Many other options are available, be sure to check the documentation.
# config.generators do |g|
# g.orm :active_record
# g.template_engine :erb
# g.test_framework :test_unit, :fixture => true
# end

# Configure sensitive parameters which will be filtered from the log file.
config.filter_parameters << :password
end
end
14 changes: 14 additions & 0 deletions test/dummy/config/boot.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Use locked gems if present.
begin
require File.expand_path('../../.bundle/environment', __FILE__)

rescue LoadError
# Otherwise, use RubyGems.
require 'rubygems'

# And set up the gems listed in the Gemfile.
if File.exist?(File.expand_path('../../Gemfile', __FILE__))
require 'bundler'
Bundler.setup
end
end
22 changes: 22 additions & 0 deletions test/dummy/config/database.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# SQLite version 3.x
# gem install sqlite3-ruby (not necessary on OS X Leopard)
development:
adapter: sqlite3
database: db/development.sqlite3
pool: 5
timeout: 5000

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: sqlite3
database: db/test.sqlite3
pool: 5
timeout: 5000

production:
adapter: sqlite3
database: db/production.sqlite3
pool: 5
timeout: 5000
5 changes: 5 additions & 0 deletions test/dummy/config/environment.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Load the rails application
require File.expand_path('../application', __FILE__)

# Initialize the rails application
Dummy::Application.initialize!
Loading

0 comments on commit 4cd379c

Please sign in to comment.