lib/gumdrop/cli/internal.rb in gumdrop-1.0.0 vs lib/gumdrop/cli/internal.rb in gumdrop-1.0.1

- old
+ new

@@ -1,7 +1,6 @@ require 'fileutils' -require 'listen' require 'thor' module Gumdrop::CLI class Internal < Thor include Thor::Actions @@ -25,27 +24,14 @@ Gumdrop.run options.merge(mode:'build') end desc 'server', 'Run development server' def server - Gumdrop.site.options = options.merge(mode:'build') + Gumdrop.site.options = options.merge(mode:'server') Gumdrop::Server end - desc 'watch', "Watch filesystem for changes and recompile" - method_option :quiet, default:false, aliases:'-q', type: :boolean - method_option :subdued, default:false, aliases:'-s', type: :boolean, desc:"Subdued output (....)" - method_option :resume, default:false, aliases:'-r', type: :boolean, desc:"Auto resume rendering after any errors" - def watch - Gumdrop.run options.merge(mode:'merge') - paths= [Gumdrop.site.source_dir, Gumdrop.site.sitefile] #? Sitefile too? - paths << Gumdrop.site.data_dir if File.directory? Gumdrop.site.data_dir - Listen.to(*paths, :latency => 0.5) do |m, a, r| - Gumdrop.rebuild options.merge(mode:'merge') - end - end - desc 'template [NAME]', "Create local template from this project" def template(name) template= name template_path = home_template_path name if File.exists? template_path @@ -86,10 +72,9 @@ desc "version", "Displays Gumdrop version" def version say "Gumdrop v#{ Gumdrop::VERSION }" end - private def home_path(name="") File.expand_path "~" /".gumdrop" / name