lib/stack.rb in stack-0.0.3 vs lib/stack.rb in stack-0.0.4
- old
+ new
@@ -1,9 +1,15 @@
# rubygems
require 'rubygems'
+
require 'optparse'
+
require 'liquid'
+require 'maruku'
+require 'mash'
+require 'RedCloth'
+require 'less'
require 'core_ext/hash'
require 'stack/configuration'
require 'stack/generator'
@@ -23,12 +29,12 @@
}.freeze
# Array of valid commands stack can use
COMMANDS = %w(create generate server)
- # Array of valid extensions
- EXTENSIONS = %w(.html .markdown .mdown)
+ # Array of transformable extensions (these extensions go through the liquid transformer)
+ EXTENSIONS = %w(.html .markdown .mdown .mkdn .md .textile .js .css)
class << self
attr_accessor :runner
end
@@ -46,11 +52,11 @@
end
end
opts.on("-t", "--target [DIR]", "Directory to use as the target directory") do |l| config[:target] = l unless l.nil? end
opts.on_tail("-h", "--help", "Show this message") { puts opts; exit }
- opts.on_tail("-v", "--version" "Show version") do puts "stack #{Stack::version}"; exit; end
+ opts.on_tail("-v", "--version", "Show version") do puts "stack #{Stack::version}"; exit; end
end
parser.parse! argv
options = Stack::configuration(config)
@@ -59,10 +65,10 @@
end
# Merges the configuration from YAML file, command line and defaults
def self.configuration(override)
config = { }
- source = File.join(override['source'] || Stack::DEFAULTS[:source])
+ source = File.join(override[:source] || Stack::DEFAULTS[:source])
config_file = File.join(source, "_stack.yml")
begin
yml = YAML.load_file(config_file)
\ No newline at end of file