lib/middleman-deploy/extension.rb in middleman-deploy-0.0.3 vs lib/middleman-deploy/extension.rb in middleman-deploy-0.0.4

- old
+ new

@@ -3,11 +3,11 @@ # Extension namespace module Middleman module Deploy - class Options < Struct.new(:host, :port, :user, :path, :clean); end + class Options < Struct.new(:method, :host, :port, :user, :path, :clean); end class << self def options @@options @@ -15,20 +15,22 @@ def registered(app, options_hash={}, &block) options = Options.new(options_hash) yield options if block_given? + options.method ||= :rsync options.port ||= 22 options.clean ||= false @@options = options app.send :include, Helpers app.after_configuration do - if (!options.host || !options.user || !options.path) - raise <<EOF + if (options.method == :rsync) + if (!options.host || !options.user || !options.path) + raise <<EOF ERROR: middleman-deploy is not setup correctly. host, user, and path *must* be set in config.rb. For example: @@ -37,9 +39,10 @@ deploy.host = "www.example.com" deploy.path = "/srv/www/site" end EOF + end end end end alias :included :registered