Sha256: 45a2c909b1e564990de2787d3798b86855cb16921067d99f5571c48b165ec3f3
Contents?: true
Size: 1.73 KB
Versions: 11
Compression:
Stored size: 1.73 KB
Contents
require "guard/cli/environments/bundler" require "guard/commander" require "guard/guardfile/generator" module Guard module Cli module Environments class Valid def initialize(options) @options = options end def start_guard # TODO: just to make sure tests are ok Bundler.new.verify unless @options[:no_bundler_warning] Guard.start(@options) rescue Dsl::Error, Guardfile::Evaluator::NoPluginsError, Guardfile::Evaluator::NoGuardfileError, Guardfile::Evaluator::NoCustomGuardfile => e # catch to throw message instead of call stack UI.error(e.message) abort end def initialize_guardfile(plugin_names = []) bare = @options[:bare] Guard.init(@options) session = Guard.state.session generator = Guardfile::Generator.new begin Guardfile::Evaluator.new(session.evaluator_options).evaluate rescue Guardfile::Evaluator::NoGuardfileError generator.create_guardfile end return 0 if bare # 0 - exit code # Evaluate because it might have existed and creating was skipped # FIXME: still, I don't know why this is needed Guardfile::Evaluator.new(session.evaluator_options).evaluate if plugin_names.empty? generator.initialize_all_templates else plugin_names.each do |plugin_name| generator.initialize_template(plugin_name) end end # TODO: capture exceptions to show msg and return exit code on # failures 0 # exit code end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems