Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

make it safe for windows

  • Loading branch information...
commit da34f4fd8f2194218b8bac2a4e2ab9ded5b388b2 1 parent 1b26ed8
@zapnap authored
Showing with 5 additions and 5 deletions.
  1. +1 −1  application.rb
  2. +1 −1  config.ru
  3. +3 −3 environment.rb
View
2  application.rb
@@ -3,7 +3,7 @@
require 'environment'
configure do
- set :views, "#{File.dirname(__FILE__)}/views"
+ set :views, File.join(File.dirname(__FILE__), 'views')
end
error do
View
2  config.ru
@@ -4,7 +4,7 @@ set :run, false
set :environment, :production
FileUtils.mkdir_p 'log' unless File.exists?('log')
-log = File.new("log/sinatra.log", "a")
+log = File.new(File.join('log', 'sinatra.log'), 'a')
$stdout.reopen(log)
$stderr.reopen(log)
View
6 environment.rb
@@ -17,11 +17,11 @@
:status_length => 20 # number of tweets to display
)
- DataMapper.setup(:default, "sqlite3:///#{File.expand_path(File.dirname(__FILE__))}/#{Sinatra::Base.environment}.db")
+ DataMapper.setup(:default, "sqlite3:///#{File.join(File.expand_path(File.dirname(__FILE__)), Sinatra::Base.environment.to_s)}.db")
# load models
- $LOAD_PATH.unshift("#{File.dirname(__FILE__)}/lib")
- Dir.glob("#{File.dirname(__FILE__)}/lib/*.rb") { |lib| require File.basename(lib, '.*') }
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), 'lib'))
+ Dir.glob(File.join(File.dirname(__FILE__), 'lib', '*.rb')) { |lib| require File.basename(lib, '.*') }
end
# prevent Object#id warnings
Please sign in to comment.
Something went wrong with that request. Please try again.