class SyntaxTree::CLI::ConfigFile

We allow a minimal configuration file to act as additional command line arguments to the CLI. Each line of the config file should be a new argument, as in:

--plugins=plugin/single_quote
--print-width=100

When invoking the CLI, we will read this config file and then parse it if it exists in the current working directory.

Constants

FILENAME

Attributes

filepath[R]

Public Class Methods

new() click to toggle source
# File lib/syntax_tree/cli.rb, line 549
def initialize
  @filepath = File.join(Dir.pwd, FILENAME)
end

Public Instance Methods

arguments() click to toggle source
# File lib/syntax_tree/cli.rb, line 557
def arguments
  exists? ? File.readlines(filepath, chomp: true) : []
end
exists?() click to toggle source
# File lib/syntax_tree/cli.rb, line 553
def exists?
  File.readable?(filepath)
end