Class: CaseCheck::Params
- Inherits:
-
Object
- Object
- CaseCheck::Params
- Defined in:
- lib/case_check/commands.rb
Instance Method Summary collapse
- #coldfusion_directory ⇒ Object
- #coldfusion_directory_given ⇒ Object
- #configuration_file ⇒ Object
-
#initialize(argv, name = 'cf_case_check') ⇒ Params
constructor
A new instance of Params.
- #source_directory ⇒ Object
- #verbose? ⇒ Boolean
Constructor Details
#initialize(argv, name = 'cf_case_check') ⇒ Params
Returns a new instance of Params.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/case_check/commands.rb', line 7 def initialize(argv, name='cf_case_check') = OpenStruct.new opts = OptionParser.new do |opts| opts. = "Usage: #{name} [options]" opts.on("-d", "--dir DIRECTORY", "The application root from which to search. Defaults to the current directory.") do |p| .source_directory = p end opts.on("-c", "--config CONFIGYAML", "The configuration file which includes the directories to search for custom tags and CFCs.") do |p| .configfile = p end opts.on("-a", "--auto-configure DIRECTORY", "Automatically configure the directories to search for custom tag and CFCs using Coldfusion's configuration. (Coldfusion 8 Only)") do |p| .coldfusion_directory = p end opts.on("-v", "--verbose", "Show all references, including the ones which can be resolved exactly.") do |v| .verbose = true end opts.on_tail("-h", "--help", "Show this message") do CaseCheck.status_stream.puts opts CaseCheck.exit end opts.on_tail("--version", "Show version") do CaseCheck.status_stream.puts "#{name} #{CaseCheck.version}" CaseCheck.exit end end.parse!(argv) read_config! end |
Instance Method Details
#coldfusion_directory ⇒ Object
54 55 56 |
# File 'lib/case_check/commands.rb', line 54 def coldfusion_directory .coldfusion_directory || '/opt/coldfusion8' end |
#coldfusion_directory_given ⇒ Object
58 59 60 |
# File 'lib/case_check/commands.rb', line 58 def coldfusion_directory_given .coldfusion_directory end |
#configuration_file ⇒ Object
50 51 52 |
# File 'lib/case_check/commands.rb', line 50 def configuration_file .configfile || File.join(source_directory, "cf_case_check.yml") end |
#source_directory ⇒ Object
46 47 48 |
# File 'lib/case_check/commands.rb', line 46 def source_directory .source_directory || '.' end |
#verbose? ⇒ Boolean
62 63 64 |
# File 'lib/case_check/commands.rb', line 62 def verbose? .verbose end |