diff --git a/_MYconfig.scss b/_MYconfig.scss index 85f2e3b..bcc67f9 100644 --- a/_MYconfig.scss +++ b/_MYconfig.scss @@ -12,7 +12,8 @@ // // HOW TO RUN AUTOMATED SETUP // 1. Open terminal and issue the following command: -// bin/setup.sh +// bin/setup.rb - Note: You must have ruby installed +// to run this script // 2. Follow prompts from script // GLOBAL VARIABLES - include your variables here or alter the predefined vars diff --git a/bin/upgrade.rb b/bin/upgrade.rb index cd780d9..2d36b59 100755 --- a/bin/upgrade.rb +++ b/bin/upgrade.rb @@ -1,6 +1,69 @@ #!/usr/bin/env ruby -w -require_relative("assets/helper") +# Add module directly so the script works when copied +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 + BEGIN { if Dir.pwd =~ /bin$/i @@ -13,9 +76,7 @@ STDOUT.flush -puts "Warning: this script is incomplete at the moment. If you are using a BASH shell, please run bin/upgrade instead\n\n" - -puts "Disclaimer: this utility it meant to aid in upgrading from Skeleton Sass 1.x to Skeleton Sass 2.x. If you have followed the wiki articles then please do not use this script without a clean installation of Skeleton Sass 2.x. We, AtomicPages LLC, are not responsible for any unforeseen events that arise by using this script. Please follow the prompts." +puts "Disclaimer: this utility it meant to aid in upgrading from Skeleton Sass 1.x to Skeleton Sass 2.x. If you have followed the wiki articles then please do not use this script without a clean installation of Skeleton Sass 2.x. We, AtomicPages LLC, are not responsible for any unforeseen events that arise by using this script. Please follow the prompts.\n" resp = Helper.yesno("Did you add the contents from _vars.scss in Skeleton Sass 1.x to _MYconfig.scss in Skeleton Sass 2.x? [y/n]\nNote: If you ran the setup utility, your global configuration name might differ") @@ -36,7 +97,7 @@ abort("Global config file in root not found. Please execute bin/upgrade within the skeleton-sass directory. Current working directory is #{Dir.pwd}") end -puts "Using #{filename}" +puts "Using #{filename}..." variables = { "backgroundColor" => "background-color", @@ -50,6 +111,7 @@ "headingFamily" => "heading-family", "headingColor" => "heading-color", "baseWidth" => "base-width", + "baseWidthMQ" => "REMOVE_ME", "baseColWidth" => "base-col-width", "baseGutterWidth" => "base-gutter-width", "isFluid" => "is-fluid", @@ -59,12 +121,23 @@ "mobileLandscapeWidth" => "mobile-landscape-width" } -# variables.each do |key, value| -# key = key.gsub(/(?<=[a-z])(?=[A-Z])/, '-').downcase -# end +variables.each do |key, value| + %x(ruby -i.bak -pe "gsub /#{key}/i, '#{value}'" #{filename}) +end + +if File.exists?("#{filename}.bak") + File.delete("#{filename}.bak") +end -File.open(Dir.pwd + "/" + filename, "r+") do |file| - file.each_line do |line| - puts line +puts "Variable conversion complete..." +if filename == "_MYconfig.scss" + resp = Helper.yesno("Launch setup utility now? [y/n]") + if(resp =~ /n(o)?/i) + abort("Upgrade is complete! Rename _MYconfig.scss to a different name if you haven't done so already and import that file into core/_config.scss. You may also run bin/setup.rb from command line to automate this task.") + else + puts "Upgrade process complete! Launching setup now..." + system("ruby -w bin/setup.rb") end end + +puts "Upgrade is complete!" diff --git a/bower.json b/bower.json index c656dae..7e00038 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "skeleton-sass", - "version": "2.0.1", + "version": "2.0.2", "author": "Dennis Thompson", "homepage": "http://atomicpages.github.io/skeleton-sass/", "repository": { diff --git a/sache.json b/sache.json index 5880927..804f27d 100644 --- a/sache.json +++ b/sache.json @@ -4,7 +4,6 @@ "tags": [ "framework", "responsive", - "bower", "grids", "ui", "skeleton", diff --git a/skeleton/themes/sphenoid/_base.scss b/skeleton/themes/sphenoid/_base.scss index 82da03d..8b7b7a3 100644 --- a/skeleton/themes/sphenoid/_base.scss +++ b/skeleton/themes/sphenoid/_base.scss @@ -268,9 +268,7 @@ select { padding: relative(6px) relative(4px); outline: none; @include border-radius(2px); - font: { - family: $form-font; - }; + font-family: $form-font; @include font-size($font-size + 1); color: #777; margin: 0 0 relative(20px); @@ -292,22 +290,17 @@ select { padding: 0; } textarea { min-height: relative(60px); } label, legend { + span { + font-weight: normal; + @include font-size($font-size + 1); + color: #444; + } display: block; - font: { - weight: bold; - }; + font-weight: bold; @include font-size($font-size + 1); } select { width: relative(220px); } input[type="checkbox"] { display: inline; } -label span, -legend span { - font: { - weight: normal; - }; - @include font-size($font-size + 1); - color: #444; -} /* MISC * ------------------------------------------------ */ diff --git a/skeleton_template.scss b/skeleton_template.scss index 811cc8c..bcec257 100644 --- a/skeleton_template.scss +++ b/skeleton_template.scss @@ -3,7 +3,7 @@ * @author Dennis Thompson * @copyright Copyright (c) 2014 AtomicPages LLC * @license MIT - * @version 2.0.1 + * @version 2.0.2 */ @import "skeleton/themes/loader"; // sass --update -C skeleton.scss:skeleton.css