Permalink
Browse files

ignore Rack env gems for default gems

  • Loading branch information...
1 parent 66d3909 commit 06b52898e7b6f4772430934022b0ea46e251bb8b @hsbt hsbt committed Aug 12, 2012
Showing with 79 additions and 105 deletions.
  1. +19 −23 Gemfile
  2. +4 −23 Gemfile.lock
  3. +21 −20 config.ru
  4. +1 −2 tdiary/tasks/assets.rake
  5. +34 −37 tdiary/tasks/db.rake
View
@@ -9,41 +9,37 @@ gem 'omniauth'
gem 'omniauth-twitter'
gem 'omniauth-github'
+# To use memcached for CacheIO
+# gem 'dalli'
+
platforms :mri do
# To use CoffeeScript
- gem 'coffee-script'
-
- # If you need javascript engine
+ # gem 'coffee-script'
# gem 'therubyracer'
- # To use GFM style
+ # To use GFM style or To covert tDiary document.
gem 'redcarpet'
gem 'pygments.rb'
gem 'rubypython', '0.5.1'
-end
-
-# Use tDiary in PaaS
-group :production do
- gem 'sequel'
- # Use memcached addon
- # gem 'dalli'
+ # To use rack based application server
+ gem 'thin', :require => false
+ # gem 'unicorn', :require => false
- platforms :mri do
- gem 'thin', :require => false
- # gem 'unicorn', :require => false
+ # To use RdbIO
+ # gem 'sequel'
+ # gem 'pg'
- gem 'pg'
- # gem 'mysql'
- # gem 'sqlite3'
- end
-
- # platforms :jruby do
- # gem 'trinidad', :require => false
- # gem 'jdbc-postgres', :require => 'jdbc/postgres'
- # end
+ # If you use other database adapter
+ # gem 'mysql'
+ # gem 'sqlite3'
end
+# platforms :jruby do
+# gem 'trinidad', :require => false
+# gem 'jdbc-postgres', :require => 'jdbc/postgres'
+# end
+
group :development do
gem 'capistrano', :require => false
gem 'capistrano_colors', :require => false
View
@@ -1,7 +1,7 @@
GEM
remote: http://rubygems.org/
specs:
- addressable (2.2.8)
+ addressable (2.3.2)
blankslate (2.1.2.4)
builder (3.0.0)
capistrano (2.12.0)
@@ -22,31 +22,20 @@ GEM
ffi (~> 1.0, >= 1.0.6)
ci_reporter (1.7.0)
builder (>= 2.1.2)
- coffee-script (2.2.0)
- coffee-script-source
- execjs
- coffee-script-source (1.3.3)
daemons (1.1.9)
diff-lcs (1.1.3)
eventmachine (0.12.10)
- execjs (1.4.0)
- multi_json (~> 1.0)
faraday (0.8.1)
multipart-post (~> 1.1)
ffi (1.0.11)
- ffi (1.0.11-java)
hashie (1.2.0)
highline (1.6.13)
hike (1.2.1)
httpauth (0.1)
jwt (0.1.5)
multi_json (>= 1.0)
- launchy (2.1.0)
- addressable (~> 2.2.6)
- launchy (2.1.0-java)
- addressable (~> 2.2.6)
- ffi (~> 1.0.9)
- spoon (~> 0.0.1)
+ launchy (2.1.2)
+ addressable (~> 2.3)
libwebsocket (0.1.5)
addressable
mime-types (1.19)
@@ -60,7 +49,6 @@ GEM
net-ssh-gateway (1.1.0)
net-ssh (>= 1.99.1)
nokogiri (1.5.5)
- nokogiri (1.5.5-java)
oauth (0.4.6)
oauth2 (0.8.0)
faraday (~> 0.8)
@@ -83,7 +71,6 @@ GEM
omniauth-twitter (0.0.12)
multi_json (~> 1.3)
omniauth-oauth (~> 1.0)
- pg (0.14.0)
pit (0.0.6)
pygments.rb (0.2.3)
rubypython (>= 0.5.1)
@@ -103,7 +90,7 @@ GEM
rspec-core (2.11.1)
rspec-expectations (2.11.2)
diff-lcs (~> 1.1.3)
- rspec-mocks (2.11.1)
+ rspec-mocks (2.11.2)
rubypython (0.5.1)
blankslate (>= 2.1.2.3)
ffi (~> 1.0.7)
@@ -113,14 +100,12 @@ GEM
libwebsocket (~> 0.1.3)
multi_json (~> 1.0)
rubyzip
- sequel (3.38.0)
simplecov (0.6.4)
multi_json (~> 1.0)
simplecov-html (~> 0.5.3)
simplecov-html (0.5.3)
simplecov-rcov (0.2.3)
simplecov (>= 0.4.1)
- spoon (0.0.1)
sprockets (2.4.5)
hike (~> 1.2)
multi_json (~> 1.0)
@@ -139,20 +124,17 @@ GEM
nokogiri (~> 1.3)
PLATFORMS
- java
ruby
DEPENDENCIES
capistrano
capistrano_colors
capybara
ci_reporter
- coffee-script
launchy
omniauth
omniauth-github
omniauth-twitter
- pg
pit
pygments.rb
rack
@@ -162,7 +144,6 @@ DEPENDENCIES
redcarpet
rspec
rubypython (= 0.5.1)
- sequel
simplecov
simplecov-rcov
sprockets
View
@@ -5,50 +5,51 @@ require 'tdiary/rack/valid_request_path'
require 'tdiary/rack/auth/basic'
require 'omniauth'
require 'tdiary/rack/auth/omniauth'
-require 'tdiary/rack/assets/precompile'
use Rack::Reloader
base_dir = ''
-# OmniAuth settings
-use Rack::Session::Pool, :expire_after => 2592000
-use OmniAuth::Builder do
- configure {|conf| conf.path_prefix = "#{base_dir}/auth" }
- # provider :twitter, ENV['TWITTER_KEY'], ENV['TWITTER_SECRET']
- # provider :github, ENV['GITHUB_KEY'], ENV['GITHUB_SECRET']
-end
-map "#{base_dir}/auth" do
- run TDiary::Rack::Auth::OmniAuth::CallbackHandler.new
+map "#{base_dir}/" do
+ use TDiary::Rack::HtmlAnchor
+ use TDiary::Rack::ValidRequestPath
+ run Rack::Cascade.new([
+ Rack::File.new("./public/"),
+ TDiary::Application.new(:index)
+ ])
end
map "#{base_dir}/assets" do
environment = Sprockets::Environment.new
%w(js theme).each {|path| environment.append_path path }
# if you need to auto compilation for CoffeeScript
+ # require 'tdiary/rack/assets/precompile'
# use TDiary::Rack::Assets::Precompile, environment
run environment
end
-map "#{base_dir}/" do
- use TDiary::Rack::HtmlAnchor
- use TDiary::Rack::ValidRequestPath
- run Rack::Cascade.new([
- Rack::File.new("./public/"),
- TDiary::Application.new(:index)
- ])
+# OmniAuth settings
+use Rack::Session::Pool, :expire_after => 2592000
+use OmniAuth::Builder do
+ configure {|conf| conf.path_prefix = "#{base_dir}/auth" }
+ # provider :twitter, ENV['TWITTER_KEY'], ENV['TWITTER_SECRET']
+ # provider :github, ENV['GITHUB_KEY'], ENV['GITHUB_SECRET']
+end
+map "#{base_dir}/auth" do
+ run TDiary::Rack::Auth::OmniAuth::CallbackHandler.new
end
map "#{base_dir}/update.rb" do
+ # Basic Auth
use TDiary::Rack::Auth::Basic, '.htpasswd'
- # use Rack::Auth::Basic do |user, pass|
- # user == 'user' && pass == 'pass'
- # end
+
+ # OAuth
# use TDiary::Rack::Auth::OmniAuth, :twitter do |auth|
# auth.info.nickname == 'your_twitter_screen_name'
# end
+
run TDiary::Application.new(:update)
end
@@ -1,7 +1,6 @@
namespace :assets do
desc "compile coffeescript"
task :compile do
- require 'coffee-script'
FileList['js/**/*.coffee'].each do |coffee|
File.open(coffee.sub(/\.coffee\z/, '.js'), 'w') do |js|
js.write CoffeeScript.compile(File.read(coffee))
@@ -19,4 +18,4 @@ namespace :assets do
FileUtils.cp_r(file, "#{assets_path}/#{Pathname.new(file).basename}")
end
end
-end
+end if defined?(CoffeeScript)
View
@@ -1,44 +1,41 @@
-if ENV['DATABASE_URL']
- desc "create database"
- namespace :db do
- task :create do
- require 'sequel'
- Sequel.connect(ENV['DATABASE_URL']) do |db|
- db.create_table :diaries do
- String :diary_id, :size => 8
- String :year, :size => 4
- String :month, :size => 2
- String :day, :size => 2
- String :title, :text => true
- String :body, :text => true
- String :style, :text => true
- Fixnum :last_modified
- TrueClass :visible
- primary_key :diary_id
- end
+namespace :db do
+ desc "create database"
+ task :create do
+ Sequel.connect(ENV['DATABASE_URL']) do |db|
+ db.create_table :diaries do
+ String :diary_id, :size => 8
+ String :year, :size => 4
+ String :month, :size => 2
+ String :day, :size => 2
+ String :title, :text => true
+ String :body, :text => true
+ String :style, :text => true
+ Fixnum :last_modified
+ TrueClass :visible
+ primary_key :diary_id
+ end
- db.create_table :comments do
- String :diary_id, :size => 8
- Fixnum :no
- String :name, :text => true
- String :mail, :text => true
- String :comment, :text => true
- Fixnum :last_modified
- TrueClass :visible
- primary_key [:diary_id, :no]
- end
+ db.create_table :comments do
+ String :diary_id, :size => 8
+ Fixnum :no
+ String :name, :text => true
+ String :mail, :text => true
+ String :comment, :text => true
+ Fixnum :last_modified
+ TrueClass :visible
+ primary_key [:diary_id, :no]
+ end
- db.create_table :conf do
- String :body, :text => true
- end
+ db.create_table :conf do
+ String :body, :text => true
end
end
+ end
- task :drop do
- require 'sequel'
- Sequel.connect(ENV['DATABASE_URL']) do |db|
- db.drop_table :diaries, :comments, :conf
- end
+ desc "drop database"
+ task :drop do
+ Sequel.connect(ENV['DATABASE_URL']) do |db|
+ db.drop_table :diaries, :comments, :conf
end
end
-end
+end if defined?(Sequel)

0 comments on commit 06b5289

Please sign in to comment.