Last active
December 20, 2015 17:49
-
-
Save samuelkadolph/6171589 to your computer and use it in GitHub Desktop.
Revisions
-
samuelkadolph revised this gist
Mar 9, 2014 . 1 changed file with 8 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -18,17 +18,22 @@ def replace(path, pattern, replacement) Dir["{app,config,test}/**/*.rb", "bin/*", "Gemfile", "Rakefile"].each do |path| replace(path, /(?<!\w)'|'(?!\w)/, '"') replace(path, /require (?:::)?File\.expand_path\("..\/([^"]+)",\s*__FILE__\)/, "require_relative \"\\1\"") replace(path, /^\s*#(?!!).*\n/, "") replace(path, /\A\n+/, "") end replace("config.ru", /(?<!\w)'|'(?!\w)/, '"') replace("config.ru", /require (?:::)?File\.expand_path\("..\/([^"]+)",\s*__FILE__\)/, "require File.expand_path(\"../\\1\", __FILE__)") replace("config.ru", /^\s*#(?!!).*\n/, "") replace("config.ru", /\A\n+/, "") FileUtils.rm_rf("lib/assets") File.truncate("db/seeds.rb", 0) File.truncate("public/robots.txt", 0) FileUtils.rm_rf("vendor") FileUtils.mv("README.rdoc", "README.md") -
samuelkadolph revised this gist
Mar 9, 2014 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,7 +11,7 @@ def replace(path, pattern, replacement) run "git init" run "git add --all" run "git commit --message 'Initial rails application'" log :lean, "making the app lean" log :clean, "making the app clean" @@ -33,3 +33,6 @@ def replace(path, pattern, replacement) FileUtils.mv("README.rdoc", "README.md") File.truncate("README.md", 0) run "git add --all" run "git commit --message 'Lean and clean'" -
samuelkadolph revised this gist
Mar 9, 2014 . 1 changed file with 3 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -20,15 +20,16 @@ def replace(path, pattern, replacement) replace(path, /(?<!\w)'|'(?!\w)/, '"') replace(path, /require (?:::)?File\.expand_path\("..\/([^"]+)",\s*__FILE__\)/, "require_relative \"\\1\" ") replace(path, /^\s*#(?!!).*\n/, "") replace(path, /\A\n+/, "\n") end replace("config.ru", /(?<!\w)'|'(?!\w)/, '"') replace("config.ru", /require (?:::)?File\.expand_path\("..\/([^"]+)",\s*__FILE__\)/, "require File.expand_path(\"../\\1\", __FILE__)") replace("config.ru", /^\s*#(?!!).*\n/, "") replace("config.ru", /\A\n+/, "\n") FileUtils.rm_rf("lib/assets") FileUtils.rm_rf("vendor") FileUtils.mv("README.rdoc", "README.md") File.truncate("README.md", 0) -
samuelkadolph revised this gist
Mar 9, 2014 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,10 @@ def replace(path, pattern, replacement) File.open(path, "r+") do |file| contents = file.read file.truncate(0) file.pos = 0 file << contents.gsub(pattern, replacement) end end @@ -18,7 +18,7 @@ def replace(path, pattern, replacement) Dir["{app,config,test}/**/*.rb", "bin/*", "Gemfile", "Rakefile"].each do |path| replace(path, /(?<!\w)'|'(?!\w)/, '"') replace(path, /require (?:::)?File\.expand_path\("..\/([^"]+)",\s*__FILE__\)/, "require_relative \"\\1\" ") replace(path, /^\s*#(?!!).*\n/, "") replace(path, /\A\n+/, "") end -
samuelkadolph revised this gist
Aug 7, 2013 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -28,6 +28,7 @@ def replace(path, pattern, replacement) replace("config.ru", /^\s*#(?!!).*\n/, "") replace("config.ru", /\A\n+/, "") FileUtils.rm_rf("lib/assets") FileUtils.rm_rf("vendor") FileUtils.mv("README.rdoc", "README.md") File.truncate("README.md", 0) -
samuelkadolph revised this gist
Aug 7, 2013 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,7 +16,7 @@ def replace(path, pattern, replacement) log :lean, "making the app lean" log :clean, "making the app clean" Dir["{app,config,test}/**/*.rb", "bin/*", "Gemfile", "Rakefile"].each do |path| replace(path, /(?<!\w)'|'(?!\w)/, '"') replace(path, /require (?:::)?File\.expand_path\("..\/([^"]+)",\s*__FILE__\)/, "require_relative(\"\\1\")") replace(path, /^\s*#(?!!).*\n/, "") @@ -28,5 +28,6 @@ def replace(path, pattern, replacement) replace("config.ru", /^\s*#(?!!).*\n/, "") replace("config.ru", /\A\n+/, "") FileUtils.rm_rf("lib/assets", "vendor") FileUtils.mv("README.rdoc", "README.md") File.truncate("README.md", 0) -
samuelkadolph revised this gist
Aug 7, 2013 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -27,3 +27,6 @@ def replace(path, pattern, replacement) replace("config.ru", /require (?:::)?File\.expand_path\("..\/([^"]+)",\s*__FILE__\)/, "require File.expand_path(\"../\\1\", __FILE__)") replace("config.ru", /^\s*#(?!!).*\n/, "") replace("config.ru", /\A\n+/, "") FileUtils.mv("README.rdoc", "README.md") File.truncate("README.md", 0) -
samuelkadolph revised this gist
Aug 7, 2013 . 1 changed file with 6 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,9 +16,14 @@ def replace(path, pattern, replacement) log :lean, "making the app lean" log :clean, "making the app clean" Dir["{app,config}/**/*.rb", "bin/*", "Gemfile", "Rakefile"].each do |path| replace(path, /(?<!\w)'|'(?!\w)/, '"') replace(path, /require (?:::)?File\.expand_path\("..\/([^"]+)",\s*__FILE__\)/, "require_relative(\"\\1\")") replace(path, /^\s*#(?!!).*\n/, "") replace(path, /\A\n+/, "") end replace("config.ru", /(?<!\w)'|'(?!\w)/, '"') replace("config.ru", /require (?:::)?File\.expand_path\("..\/([^"]+)",\s*__FILE__\)/, "require File.expand_path(\"../\\1\", __FILE__)") replace("config.ru", /^\s*#(?!!).*\n/, "") replace("config.ru", /\A\n+/, "") -
samuelkadolph revised this gist
Aug 7, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -18,7 +18,7 @@ def replace(path, pattern, replacement) Dir["{app,config}/**/*.rb", "bin/*", "Gemfile", "Rakefile", "config.ru"].each do |path| replace(path, /(?<!\w)'|'(?!\w)/, '"') replace(path, /require (?:::)?File\.expand_path\("..\/([^"]+)",\s*__FILE__\)/, "require_relative(\"\\1\")") replace(path, /^\s*#(?!!).*\n/, "") replace(path, /\A\n+/, "") end -
samuelkadolph revised this gist
Aug 7, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,6 +19,6 @@ def replace(path, pattern, replacement) Dir["{app,config}/**/*.rb", "bin/*", "Gemfile", "Rakefile", "config.ru"].each do |path| replace(path, /(?<!\w)'|'(?!\w)/, '"') replace(path, /require (?:::)?File\.expand_path\("..\/([^"]+)", __FILE__\)/, "require_relative(\"\\1\")") replace(path, /^\s*#(?!!).*\n/, "") replace(path, /\A\n+/, "") end -
samuelkadolph revised this gist
Aug 7, 2013 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,12 +13,12 @@ def replace(path, pattern, replacement) run "git add --all" run "git commit -m 'Initial rails application'" log :lean, "making the app lean" log :clean, "making the app clean" Dir["{app,config}/**/*.rb", "bin/*", "Gemfile", "Rakefile", "config.ru"].each do |path| replace(path, /(?<!\w)'|'(?!\w)/, '"') replace(path, /require (?:::)?File\.expand_path\("..\/([^"]+)", __FILE__\)/, "require_relative(\"\\1\")") replace(path, /^\s*#.*$\n/, "") replace(path, /\A\n+/, "") end -
samuelkadolph revised this gist
Aug 7, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -17,7 +17,7 @@ def replace(path, pattern, replacement) log :replace, "" log :remove, "comments" Dir["{app,config}/**/*.rb", "bin/*", "Gemfile", "Rakefile", "config.ru"].each do |path| replace(path, /(?<!\w)'|'(?!\w)/, '"') replace(path, /require (?:::)?File\.expand_path\("..\/([^"]+)", __FILE__\)/, "require_relative(\"\\1\")") replace(path, /^\s*#.*$\n/, "") -
samuelkadolph revised this gist
Aug 7, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,6 +19,6 @@ def replace(path, pattern, replacement) Dir["{app,bin,config}/**/*.rb", "Gemfile", "Rakefile", "config.ru"].each do |path| replace(path, /(?<!\w)'|'(?!\w)/, '"') replace(path, /require (?:::)?File\.expand_path\("..\/([^"]+)", __FILE__\)/, "require_relative(\"\\1\")") replace(path, /^\s*#.*$\n/, "") end -
samuelkadolph revised this gist
Aug 7, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,6 +19,6 @@ def replace(path, pattern, replacement) Dir["{app,bin,config}/**/*.rb", "Gemfile", "Rakefile", "config.ru"].each do |path| replace(path, /(?<!\w)'|'(?!\w)/, '"') replace(path, /require (?:::)?File\.expand_path\("..\/([^"]+)", __FILE__\)/, "require_relative(\"\1\")") replace(path, /^\s*#.*$\n/, "") end -
samuelkadolph revised this gist
Aug 7, 2013 . 1 changed file with 6 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,6 +14,11 @@ def replace(path, pattern, replacement) run "git commit -m 'Initial rails application'" log :replace, "' with \"" log :replace, "" log :remove, "comments" Dir["{app,bin,config}/**/*.rb", "Gemfile", "Rakefile", "config.ru"].each do |path| replace(path, /(?<!\w)'|'(?!\w)/, '"') replace(path, /require File\.expand_path\("..\/([^"]+)", __FILE__\)/, "require_relative(\"\1\")") replace(path, /^\s*#.*$\n/, "") end -
samuelkadolph revised this gist
Aug 7, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,7 +13,7 @@ def replace(path, pattern, replacement) run "git add --all" run "git commit -m 'Initial rails application'" log :replace, "' with \"" Dir["{app,config}/**/*.rb"].each do |path| replace(path, /(?<!\w)'|'(?!\w)/, '"') end -
samuelkadolph revised this gist
Aug 7, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -15,5 +15,5 @@ def replace(path, pattern, replacement) log :replace, "foo" Dir["{app,config}/**/*.rb"].each do |path| replace(path, /(?<!\w)'|'(?!\w)/, '"') end -
samuelkadolph revised this gist
Aug 7, 2013 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,6 +13,7 @@ def replace(path, pattern, replacement) run "git add --all" run "git commit -m 'Initial rails application'" log :replace, "foo" Dir["{app,config}/**/*.rb"].each do |path| replace(path, /(?<=^|\s)'|'(?=\s|$)/, '"') end -
samuelkadolph revised this gist
Aug 7, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ def replace(path, pattern, replacement) File.open(path, "r+") do |file| contents = file.read file.truncate(0) file.pos = 0 file << contents.gsub(pattern, replacement) -
samuelkadolph revised this gist
Aug 7, 2013 . 1 changed file with 14 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,18 @@ def replace(path, pattern, replacement) File.open(path, "r+") do |file| contents = file.read file.truncate file.pos = 0 file << contents.gsub(pattern, replacement) end end run "git init" run "git add --all" run "git commit -m 'Initial rails application'" Dir["{app,config}/**/*.rb"].each do |path| replace(path, /(?<=^|\s)'|'(?=\s|$)/, '"') end -
samuelkadolph revised this gist
Aug 7, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,4 +2,4 @@ run "git add --all" run "git commit -m 'Initial rails application'" run "sed -i '' \"s/'/\\\"/\" {app,config}/**/*.rb" -
samuelkadolph created this gist
Aug 7, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ run "git init" run "git add --all" run "git commit -m 'Initial rails application'" run "sed -i '' \"s/'/\"/\" {app,config}/**/*.rb"