Class: Danger::PluginJSON
- Inherits:
-
CLAide::Command::Plugins
- Object
- CLAide::Command::Plugins
- Danger::PluginJSON
- Defined in:
- lib/danger/commands/plugins/plugin_json.rb
Instance Attribute Summary collapse
-
#cork ⇒ Object
Returns the value of attribute cork.
Instance Method Summary collapse
-
#initialize(argv) ⇒ PluginJSON
constructor
A new instance of PluginJSON.
- #run ⇒ Object
Constructor Details
#initialize(argv) ⇒ PluginJSON
Returns a new instance of PluginJSON.
11 12 13 14 15 16 |
# File 'lib/danger/commands/plugins/plugin_json.rb', line 11 def initialize(argv) @refs = argv.arguments! unless argv.arguments.empty? @cork = Cork::Board.new(silent: argv.option("silent", false), verbose: argv.option("verbose", false)) super end |
Instance Attribute Details
#cork ⇒ Object
Returns the value of attribute cork.
9 10 11 |
# File 'lib/danger/commands/plugins/plugin_json.rb', line 9 def cork @cork end |
Instance Method Details
#run ⇒ Object
30 31 32 33 34 35 36 37 38 |
# File 'lib/danger/commands/plugins/plugin_json.rb', line 30 def run file_resolver = PluginFileResolver.new(@refs) paths = file_resolver.resolve_to_paths parser = PluginParser.new(paths) parser.parse json = parser.to_json_string cork.puts json end |