Class: Ruboclean::CliArguments

Inherits:
Object
  • Object
show all
Defined in:
lib/ruboclean/cli_arguments.rb

Overview

Reads command line arguments and exposes corresponding reader methods

Instance Method Summary collapse

Constructor Details

#initialize(command_line_arguments = []) ⇒ CliArguments

Returns a new instance of CliArguments.



6
7
8
# File 'lib/ruboclean/cli_arguments.rb', line 6

def initialize(command_line_arguments = [])
  @command_line_arguments = Array(command_line_arguments)
end

Instance Method Details

#pathObject



10
11
12
# File 'lib/ruboclean/cli_arguments.rb', line 10

def path
  @path ||= find_path
end

#preserve_comments?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/ruboclean/cli_arguments.rb', line 22

def preserve_comments?
  @preserve_comments ||= find_argument("--preserve-comments")
end

#preserve_paths?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/ruboclean/cli_arguments.rb', line 26

def preserve_paths?
  @preserve_paths ||= find_argument("--preserve-paths")
end

#silent?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/ruboclean/cli_arguments.rb', line 18

def silent?
  @silent ||= find_argument("--silent")
end

#verbose?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/ruboclean/cli_arguments.rb', line 14

def verbose?
  !silent?
end

#verify?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/ruboclean/cli_arguments.rb', line 30

def verify?
  @verify ||= find_argument("--verify")
end