Module: Dependagrab
- Defined in:
- lib/dependagrab.rb,
lib/dependagrab/cli.rb,
lib/dependagrab/gh_api.rb,
lib/dependagrab/version.rb,
lib/dependagrab/file_writer.rb,
lib/dependagrab/github_client.rb,
lib/dependagrab/console_writer.rb
Defined Under Namespace
Modules: GHAPI Classes: CLI, ConsoleWriter, Error, FileWriter, GhApiError, GithubClient, MissingConfigError
Constant Summary collapse
- VERSION =
"0.1.7"
Class Method Summary collapse
Class Method Details
.run(options) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/dependagrab.rb', line 13 def self.run() result = Dependagrab::GithubClient.new().grab if [:output] begin output_file = FileWriter.new([:output]).write!(result[:alerts]) if [:print] puts "#{result[:alerts].count} dependency warnings written to '#{.fetch(:output)}'" end output_file rescue => e STDERR.puts "Failed to write file '#{.fetch(:output)}'" STDERR.puts "Error: #{e.} (set DEBUG=true for detailed backtrace)" STDERR.puts e.backtrace if ENV['DEBUG'] exit 1 end else if [:print] ConsoleWriter.new.write!(result[:alerts]) else result[:alerts] end end end |