lib/jammit/command_line.rb in jammit-0.2.6 vs lib/jammit/command_line.rb in jammit-0.2.7

- old
+ new

@@ -25,10 +25,11 @@ # The @Jammit::CommandLine@ runs from the contents of @ARGV@. def initialize parse_options ensure_configuration_file Jammit.load_configuration(@options[:config_path]) + Jammit.packager.force = @options[:force] Jammit.packager.precache_all(@options[:output_folder], @options[:base_url]) end private @@ -44,22 +45,26 @@ # Uses @OptionParser@ to grab the options: *--output*, *--config*, and # *--base-url*... def parse_options @options = { - :config_path => Jammit::DEFAULT_CONFIG_PATH, - :output_folder => nil, - :base_url => nil + :config_path => Jammit::DEFAULT_CONFIG_PATH, + :output_folder => nil, + :base_url => nil, + :force => false } @option_parser = OptionParser.new do |opts| opts.on('-o', '--output PATH', 'output folder for packages (default: "public/assets")') do |output_folder| @options[:output_folder] = output_folder end opts.on('-c', '--config PATH', 'path to assets.yml (default: "config/assets.yml")') do |config_path| @options[:config_path] = config_path end opts.on('-u', '--base-url URL', 'base URL for MHTML (ex: "http://example.com")') do |base_url| @options[:base_url] = base_url + end + opts.on('-f', '--force', 'force a rebuild of all assets') do |force| + @options[:force] = force end opts.on_tail('-v', '--version', 'display Jammit version') do puts "Jammit version #{Jammit::VERSION}" exit end \ No newline at end of file