Skip to content

Commit

Permalink
Only show relevant files when pass in --full option
Browse files Browse the repository at this point in the history
  • Loading branch information
JuanitoFatas committed Jun 8, 2019
1 parent fa91926 commit 9ac9bc6
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions lib/gel/command/env.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,23 @@

class Gel::Command::Env < Gel::Command
def run(command_line)
MarkdownFormatter.format(metadata)
option = { full: (command_line.shift == "--full") }
data = metadata(option)
MarkdownFormatter.format(data)
end

private

def metadata
{
def metadata(option)
metadata = {
"Gel" => gel_envs,
"User" => user_envs,
"Ruby" => ruby_envs,
"Relevant Files" => RELEVANT_FILES,
}
if option[:full]
metadata.merge!("Relevant Files" => RELEVANT_FILES)
end
metadata
end

module MarkdownFormatter
Expand Down

0 comments on commit 9ac9bc6

Please sign in to comment.