Skip to content

Commit

Permalink
Rearranged support for Radiant. Closes #21
Browse files Browse the repository at this point in the history
  • Loading branch information
philnash committed May 26, 2011
1 parent b00d9aa commit 5854f32
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions bin/powder
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ module Powder
def is_powable?
if File.exists?('config.ru') || File.exists?('public/index.html')
true
elsif is_rails2_app?
say "This appears to be a Rails 2 applicaton. You need a config.ru file."
if yes? "Do you want to autogenerate a basic config.ru for Rails 2?"
elsif legacy = (is_rails2_app? || is_radiant_app?)
say "This appears to be a #{legacy} applicaton. You need a config.ru file."
if yes? "Do you want to autogenerate a basic config.ru for #{legacy}?"
uri = URI.parse("https://gist.github.com/909308.txt")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
Expand All @@ -149,8 +149,12 @@ module Powder

def is_rails2_app?
File.exists?('config/environment.rb') &&
(!`grep RAILS_GEM_VERSION config/environment.rb`.empty? ||
!`grep Radiant::Initializer config/environment.rb`.empty?)
!`grep RAILS_GEM_VERSION config/environment.rb`.empty? ? 'Rails 2' : nil
end

def is_radiant_app?
File.exists?('config/environment.rb') &&
!`grep Radiant::Initializer config/environment.rb`.empty? ? 'Radiant' : nil
end

def domain
Expand Down

0 comments on commit 5854f32

Please sign in to comment.