-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed all of the shell scripts to ruby scripts. Still ned to finish the upgrade script and tests need to e run on windows still
- Loading branch information
atomicpages
authored and
atomicpages
committed
Jul 7, 2014
1 parent
aa686b4
commit 2d885cd
Showing
12 changed files
with
252 additions
and
250 deletions.
There are no files selected for viewing
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Auto detect text files and perform LF normalization | ||
* text=auto |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,5 @@ | ||
*.gem | ||
*.rbc | ||
.bundle | ||
.config | ||
.sass-cache | ||
flavors/*/css | ||
*.config.scss | ||
skeleton.scss | ||
skeleton.css | ||
skeleton.* | ||
skeleton_template.css | ||
*.html | ||
coverage | ||
InstalledFiles | ||
lib/bundler/man | ||
pkg | ||
rdoc | ||
spec/reports | ||
test/tmp | ||
test/version_tmp | ||
tmp | ||
TODO.md | ||
|
||
# YARD artifacts | ||
.yardoc | ||
_yardoc | ||
doc/ |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
module Helper | ||
|
||
def isValidName(name) | ||
if name !~ /[-a-zA-Z0-9_]+/i | ||
return false | ||
end | ||
|
||
return true | ||
end | ||
|
||
def yesno(question) | ||
puts question | ||
answer = gets.chomp | ||
while answer !~ /y(es)?|n(o)?/i do | ||
puts "Invalid input. #{question} [y/n]" | ||
answer = gets.chomp | ||
yesno(question) | ||
end | ||
|
||
if answer =~ /y(es)/i | ||
return true | ||
end | ||
|
||
return false | ||
end | ||
|
||
def nfqr(question, regex, errorMsg = "Invalid input. #{question}", isValid = nil) | ||
puts isValid != 0 ? question : errorMsg | ||
reply = gets.chomp | ||
|
||
if reply =~ regex | ||
return nfqr(question, regex, errorMsg, 0) | ||
end | ||
|
||
return reply | ||
end | ||
|
||
def cp(file, destination) | ||
if !File.exists?(file) # fail quickly if not found | ||
raise SystemCallError, "#{file} was not found or does not exist" | ||
end | ||
|
||
dest = File.open(destination, "w") | ||
|
||
File.open(file, "r") do |f| | ||
f.each_line do |line| | ||
dest.puts(line) | ||
end | ||
end | ||
|
||
dest.close | ||
end | ||
|
||
def gem_available?(name) | ||
Gem::Specification.find_by_name(name) | ||
rescue Gem::LoadError | ||
return false | ||
rescue | ||
return Gem.available?(name) | ||
end | ||
|
||
end |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env ruby -w | ||
|
||
require_relative("assets/helper") | ||
|
||
BEGIN { | ||
if Dir.pwd =~ /bin$/i | ||
Dir.chdir("../") | ||
end | ||
puts "Setup utility working..." | ||
} | ||
|
||
include Helper | ||
|
||
STDOUT.flush | ||
name = Helper.nfqr("Please enter in the name of your project with no spaces or special characters other than - or _ and press [ENTER]", /[^\w\-]/, "Project name invalid, please try again and press [ENTER]") | ||
|
||
puts "Project name is #{name}" | ||
puts "Renaming _MYconfig.scss to _#{name}.config.scss" | ||
File.rename("_MYconfig.scss", "_#{name}.config.scss") | ||
|
||
puts "Renaming skeleton_template to skeleton" | ||
if File.exists?("skeleton_template.scss") | ||
File.rename("skeleton_template.scss", "skeleton.scss") | ||
else | ||
puts "skeleton_template.scss does not exist. Skipping..." | ||
end | ||
|
||
puts "Adding user override to core/_config.scss" | ||
file = File.open("skeleton/core/_config.scss", "a") | ||
file.puts "@import \"../../_#{name}.config.scss\"" | ||
file.close | ||
|
||
END { | ||
puts "Setup utility is complete!" | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/usr/bin/env ruby -w | ||
|
||
require_relative("assets/helper") | ||
|
||
BEGIN { | ||
if Dir.pwd =~ /bin$/i | ||
Dir.chdir("../") | ||
end | ||
puts "Theme setup utility working..." | ||
} | ||
|
||
include Helper | ||
|
||
STDOUT.flush | ||
name = Helper.nfqr("Please enter in the name of your theme with no spaces or special characters other than - or _ and press [ENTER]", /[^\w\-]/, "Theme name invalid, please try again and press [ENTER]") | ||
puts "Theme name is #{name}" | ||
|
||
if !Dir.exists?("skeleton/themes/#{name}") | ||
Dir.mkdir("skeleton/themes/#{name}") | ||
end | ||
|
||
# create files and folders | ||
puts "Creating required files and folders..." | ||
file = File.open("skeleton/themes/_loader.scss", "w") | ||
file.puts("// #{name} theme created with love using Skeleton Sass theme setup script!") | ||
file.puts("\n@import \"#{name}/vars\";") | ||
file.puts("@import \"#{name}/base\";") | ||
file.puts("@import \"sphenoid/skeleton\"; // Override manually if you wish to create your own grid") | ||
puts "skeleton/themes/_loader.scss has been updated... moving on" | ||
|
||
if !Dir.exists?("skeleton/themes/#{name}/marrow") | ||
Dir.mkdir("skeleton/themes/#{name}/marrow") | ||
end | ||
|
||
Helper.cp("skeleton/themes/demo/_base.scss", "skeleton/themes/#{name}/_base.scss") | ||
Helper.cp("skeleton/themes/demo/_vars.scss", "skeleton/themes/#{name}/_vars.scss") | ||
|
||
END { | ||
puts "Theme setup complete!" | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.