lib/caravan.rb in caravan-0.6.2 vs lib/caravan.rb in caravan-0.7.0

- old
+ new

@@ -35,11 +35,11 @@ if merged_conf["once"] deploy_once(deployer) exit(0) end listener.start - + trap("INT") do listener.stop deployer.before_destroy Caravan::Message.success("\tHalting watching.") exit(0) @@ -50,10 +50,11 @@ def deploy_once(deployer) deployer.before_deploy deployer.run deployer.after_deploy + Caravan::Message.success("Deployed once.") end def create_listener(deployer, src_path) Listen.to(src_path) do |modified, added, removed| # rubocop:disable Lint/NonLocalExitFromIterator @@ -62,15 +63,13 @@ deployer.run deployer.after_deploy end end - def process_conf(src_path) + def process_conf(src_path, yaml_name = Caravan::Config.default_conf_name) Caravan::Message.success("Reading configuration...") - if src_path.nil? - src_path = '.' - end - user_config_path = File.join(File.expand_path(src_path), Caravan::Config.default_conf_name) + src_path = '.' if src_path.nil? + user_config_path = File.join(File.expand_path(src_path), yaml_name) conf = Caravan::Config.from(user_config_path) conf end def sleep_forever