Skip to content

Commit

Permalink
Fix linting issues, Thanks Robocop 🚨
Browse files Browse the repository at this point in the history
  • Loading branch information
shanear committed Feb 9, 2016
1 parent 146744b commit 38d6476
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require "pathname"
require "fileutils"
require "rainbow"
require 'active_support/inflector'
require "active_support/inflector"

# path to your application root.
APP_ROOT = Pathname.new File.expand_path("../../", __FILE__)
Expand All @@ -19,15 +19,17 @@ demo_files = [
Dir.chdir APP_ROOT do
app_name = File.basename(File.expand_path("../../", __FILE__))

if app_name == 'roadrunner-rails'
if app_name == "roadrunner-rails"
puts Rainbow("This project appears to already have been setup.").red
puts Rainbow("If not, change the root folder to the project name (seperated by hyphens, ie: my-new-project)").red
puts Rainbow("If not, change the root folder to the project name.").red
puts Rainbow("(seperated by hyphens, ie: my-new-project)").red
exit!(1)
end

if app_name.include?("_") || app_name.include?(" ")
puts Rainbow("Don't put spaces or underscores in your project directory name.").red
puts Rainbow("Please rename your directory to use hyphens to seperate words (example: my-new-project)").red
puts Rainbow("Please rename your directory to use hyphens to seperate words.").red
puts Rainbow("(example: my-new-project)").red
exit!(1)
end

Expand All @@ -49,12 +51,12 @@ Dir.chdir APP_ROOT do

puts Rainbow("== Renaming stuff to match app name: #{app_name} ==").cyan
{
'Roadrunner' + 'Rails' => camel_name,
'roadrunner' + '-rails' => app_name,
'roadrunner' + '_rails' => underscore_name,
'Roadrunner' + ' Rails' => title_name,
"Roadrunner" + "Rails" => camel_name,
"roadrunner" + "-rails" => app_name,
"roadrunner" + "_rails" => underscore_name,
"Roadrunner" + " Rails" => title_name
}.each do |old_name, new_name|
system %Q{find . -type f -print | xargs sed -i '' 's/#{old_name}/#{new_name}/g'}
system %(find . -type f -print | xargs sed -i '' 's/#{old_name}/#{new_name}/g')
end

# remove the root line from routes.rb
Expand All @@ -74,9 +76,9 @@ Dir.chdir APP_ROOT do
# system "cp config/database.yml.sample config/database.yml"
# end

#puts "\n== Preparing database =="
#system "bin/rake db:setup"
# puts "\n== Preparing database =="
# system "bin/rake db:setup"

#puts "\n== Restarting application server =="
#system "touch tmp/restart.txt"
end
# puts "\n== Restarting application server =="
# system "touch tmp/restart.txt"
end

0 comments on commit 38d6476

Please sign in to comment.