Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 8 commits
  • 11 files changed
  • 0 commit comments
  • 1 contributor
View
12 Gemfile
@@ -1,14 +1,22 @@
source 'http://rubygems.org'
-gem 'rails', '3.0.6'
+gem 'rails', "3.1.0.rc1"
+gem 'rake', '~> 0.8.7'
+
+# Asset template engines
+gem 'sass'
+gem 'coffee-script'
+gem 'uglifier'
+
+gem 'jquery-rails'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
-gem 'mysql2'
# gem 'sqlite3-ruby', :require => 'sqlite3'
# gem 'moneta'
+gem 'mysql2'
gem 'yajl-ruby', :require => 'yajl'
gem 'nokogiri'
View
4 README
@@ -1,10 +1,10 @@
# Installation
- git clone git://github.com/weijen/rails3-app-template.git
+ git clone git://github.com/weijen/rails3_1-template.git
# Usage
- rails new your_project_name -TJ -d mysql -m rails3-app-template/rails3.rb
+ rails new your_project_name -TJ -d mysql -m rails3_1-template/rails3.rb
# License
View
1  devise.rb
@@ -1,4 +1,5 @@
generate 'devise:install'
+say "現在設定devise Model: #{@user_model_name}"
if @user_model_name
generate "devise #{@user_model_name.capitalize}"
append_to_file "db/seeds.rb" do
View
32 handicraft-theme.rb
@@ -1,15 +1,39 @@
if File.directory?(File.dirname(__FILE__) + "/handicraft-theme")
+ # for layout
run "rm app/views/layouts/application.html.erb"
run "cp #{File.dirname(__FILE__)}/handicraft-theme/layouts/application.html.erb app/views/layouts/application.html.erb"
+ # for navigator
run "mkdir app/views/common"
run "cp #{File.dirname(__FILE__)}/handicraft-theme/menu/_main_navigation.html.erb app/views/common/_main_navigation.html.erb"
run "cp #{File.dirname(__FILE__)}/handicraft-theme/menu/_user_navigation.html.erb app/views/common/_user_navigation.html.erb"
- run "cp #{File.dirname(__FILE__)}/handicraft-theme/stylesheets/stickie.css public/stylesheets/"
- run "cp #{File.dirname(__FILE__)}/handicraft-theme/stylesheets/simple_form.css public/stylesheets/"
- run "mkdir public/stylesheets/handicraft/"
- run "cp -R #{File.dirname(__FILE__)}/handicraft-theme/stylesheets/handicraft/* public/stylesheets/handicraft/"
+ # for css
+ run "cp #{File.dirname(__FILE__)}/handicraft-theme/stylesheets/stickie.css app/assets/stylesheets/"
+ run "cp #{File.dirname(__FILE__)}/handicraft-theme/stylesheets/simple_form.css app/assets/stylesheets/"
+
+ # handicraft-theme required
+ run "mkdir app/assets/stylesheets/handicraft/"
+ run "cp -R #{File.dirname(__FILE__)}/handicraft-theme/stylesheets/handicraft/* app/assets/stylesheets/handicraft/"
+
+ #select a handicraft-theme
+ theme = ask("選擇您要使用的theme:\n 1. aqua\n 2. blue\n 3. gray\n 4. red\n", :green)
+
+ case theme
+ when "1"
+ run "cp -R #{File.dirname(__FILE__)}/handicraft-theme/stylesheets/themes/aqua.css app/assets/stylesheets/handicraft/"
+ when "2"
+ run "cp -R #{File.dirname(__FILE__)}/handicraft-theme/stylesheets/themes/blue.css app/assets/stylesheets/handicraft/"
+ when "3"
+ run "cp -R #{File.dirname(__FILE__)}/handicraft-theme/stylesheets/themes/gray.css app/assets/stylesheets/handicraft/"
+ when "4"
+ run "cp -R #{File.dirname(__FILE__)}/handicraft-theme/stylesheets/themes/red.css app/assets/stylesheets/handicraft/"
+ else
+ run "cp -R #{File.dirname(__FILE__)}/handicraft-theme/stylesheets/themes/blue.css app/assets/stylesheets/handicraft/"
+ end
+ run "cp -R #{File.dirname(__FILE__)}/handicraft-theme/stylesheets/themes/core.css app/assets/stylesheets/handicraft/"
+
+ # helper
run "cp #{File.dirname(__FILE__)}/handicraft-theme/handicraft_helper.rb app/helpers/"
#copy scaffold template
View
16 handicraft-theme/layouts/application.html.erb
@@ -3,15 +3,7 @@
<head>
<meta charset="UTF-8">
<%= render_page_title %>
- <%= stylesheet_link_tag 'handicraft/reset',
- 'handicraft/text',
- 'handicraft/960',
- 'handicraft/form',
- 'handicraft/handicraft',
- 'stickie',
- 'simple_form',
- 'handicraft/themes/default/core',
- 'handicraft/themes/default/blue' %>
+ <%= stylesheet_link_tag 'application' %>
<link rel="shortcut icon" href="/favicon.ico">
</head>
<%= render_body_tag %>
@@ -29,13 +21,11 @@
<div id="stickies">
<div class="container_16 clearfix">
<div class="grid_16">
- <% flash.each do |type, messages| %>
- <% messages.to_a.each do |message| %>
+ <% flash.each do |type, message| %>
<div class="<%= type %>_stickie">
<%= message %>
<span class="stickies_close_area"><a href="javascript:;">Close</a></span>
</div>
- <% end %>
<% end %>
</div>
</div>
@@ -65,7 +55,7 @@
</div>
</div>
</div>
- <%= javascript_include_tag :defaults%>
+ <%= javascript_include_tag "application" %>
<%= yield :page_specific_javascript %>
</body>
</html>
View
0  ...me/stylesheets/handicraft/themes/default/aqua.css → handicraft-theme/stylesheets/themes/aqua.css
File renamed without changes
View
0  ...me/stylesheets/handicraft/themes/default/blue.css → handicraft-theme/stylesheets/themes/blue.css
File renamed without changes
View
0  ...me/stylesheets/handicraft/themes/default/core.css → handicraft-theme/stylesheets/themes/core.css
File renamed without changes
View
0  ...me/stylesheets/handicraft/themes/default/gray.css → handicraft-theme/stylesheets/themes/gray.css
File renamed without changes
View
0  ...eme/stylesheets/handicraft/themes/default/red.css → handicraft-theme/stylesheets/themes/red.css
File renamed without changes
View
40 rails3.rb
@@ -2,10 +2,9 @@
# remove files
run "rm README"
run "rm public/index.html"
-run "rm public/images/rails.png"
+run "rm app/assets/images/rails.png"
run "cp config/database.yml config/database.yml.example"
-say "database: #{options[:database]}", :red
# use rvm
if yes?("Use rvm?", question_color)
apply File.join(File.dirname(__FILE__), "rvm_setting.rb")
@@ -13,7 +12,7 @@
# i18n for Tranditional Chinese
append_to_file "config/locales/en.yml", " sitename: #{app_name}"
-if yes?("default language is Tranditional Chinese?", :green)
+if yes?("default language is Tranditional Chinese?", question_color)
run "cp #{(File.dirname(__FILE__))}/locale/zh-TW.yml config/locales/"
append_to_file "config/locales/zh-TW.yml", " sitename: #{app_name}"
end
@@ -21,37 +20,14 @@
# set development database.yml
case options[:database]
when "mysql"
- gem "mysql2"
template "#{(File.dirname(__FILE__))}/database/mysql.tt", "config/database.yml"
when "sqlite3"
- gem 'sqlite3-ruby', :require => 'sqlite3'
end
# install gems
run "rm Gemfile"
file 'Gemfile', File.read("#{File.dirname(rails_template)}/Gemfile")
-# set Devise
-if yes?("Use Devise?", question_color)
- devise = true
- gem "devise"
- if yes?("Do you want to input your first user model name?")
- @user_model_name = ask("model name => ")
- end
-end
-
-# bundle install
-begin
- run "gem install rails --no-ri --no-rdoc"
- run "gem install bundler --no-ri --no-rdoc"
-rescue
- raise "Can't install bundler"
-end
-
-run "bundle install"
-
-### after bundle install ###
-
# copy files from handicraft-theme
if yes?("Use Handicraft Themes?", question_color)
apply File.join(File.dirname(__FILE__), "handicraft-theme.rb")
@@ -61,11 +37,6 @@
generate :controller, "Welcome index"
route "root :to => 'welcome#index'"
-# generate devise
-if devise
- apply File.join(File.dirname(__FILE__), "devise.rb")
-end
-
# generate simple_form
generate "simple_form:install"
@@ -85,13 +56,6 @@
require 'action_mailer/railtie'
CODE
-# install jquery
-run "curl -L http://code.jquery.com/jquery.min.js > public/javascripts/jquery.js"
-run "curl -L http://github.com/rails/jquery-ujs/raw/master/src/rails.js > public/javascripts/rails.js"
-
-gsub_file 'config/application.rb', /(config.action_view.javascript_expansions.*)/,
- "config.action_view.javascript_expansions[:defaults] = %w(jquery rails)"
-
# add time format
environment 'Time::DATE_FORMATS.merge!(:default => "%Y/%m/%d %I:%M %p", :ymd => "%Y/%m/%d")'

No commit comments for this range

Something went wrong with that request. Please try again.