Class: Slideshow::Opts
- Inherits:
-
Object
- Object
- Slideshow::Opts
- Defined in:
- lib/slideshow/cli/opts.rb
Instance Method Summary collapse
- #config_path ⇒ Object
- #config_path=(value) ⇒ Object
- #fetch_all=(boolean) ⇒ Object
- #fetch_all? ⇒ Boolean
- #has_includes? ⇒ Boolean
- #header_level ⇒ Object
- #header_level=(value) ⇒ Object
- #includes ⇒ Object
- #includes=(value) ⇒ Object
- #manifest ⇒ Object
- #manifest=(value) ⇒ Object
- #merge_gli_options!(options = {}) ⇒ Object
- #output_path ⇒ Object
- #output_path=(value) ⇒ Object
- #quick_manifest ⇒ Object
- #quick_manifest=(value) ⇒ Object
- #slide=(boolean) ⇒ Object
- #slide? ⇒ Boolean
- #takahashi=(boolean) ⇒ Object
- #takahashi? ⇒ Boolean
-
#verbose=(boolean) ⇒ Object
add: alias for debug ??.
- #verbose? ⇒ Boolean
Instance Method Details
#config_path ⇒ Object
113 114 115 |
# File 'lib/slideshow/cli/opts.rb', line 113 def config_path @config_path || File.join( Env.home, '.slideshow' ) end |
#config_path=(value) ⇒ Object
109 110 111 |
# File 'lib/slideshow/cli/opts.rb', line 109 def config_path=(value) @config_path = value end |
#fetch_all=(boolean) ⇒ Object
75 76 77 |
# File 'lib/slideshow/cli/opts.rb', line 75 def fetch_all=(boolean) @fetch_all = boolean end |
#fetch_all? ⇒ Boolean
79 80 81 82 |
# File 'lib/slideshow/cli/opts.rb', line 79 def fetch_all? return false if @fetch_all.nil? # default fetch all flag is false @fetch_all == true end |
#has_includes? ⇒ Boolean
95 96 97 |
# File 'lib/slideshow/cli/opts.rb', line 95 def has_includes? @includes.nil? ? false : true end |
#header_level ⇒ Object
31 32 33 34 |
# File 'lib/slideshow/cli/opts.rb', line 31 def header_level ## todo: check 0 is not nil? @header_level || 1 end |
#header_level=(value) ⇒ Object
27 28 29 |
# File 'lib/slideshow/cli/opts.rb', line 27 def header_level=(value) @header_level = value.to_i end |
#includes ⇒ Object
90 91 92 93 |
# File 'lib/slideshow/cli/opts.rb', line 90 def includes # fix: use os-agnostic delimiter (use : for Mac/Unix?) @includes.nil? ? [] : @includes.split( ';' ) end |
#includes=(value) ⇒ Object
86 87 88 |
# File 'lib/slideshow/cli/opts.rb', line 86 def includes=(value) @includes = value end |
#manifest ⇒ Object
104 105 106 |
# File 'lib/slideshow/cli/opts.rb', line 104 def manifest @manifest || 's6' end |
#manifest=(value) ⇒ Object
100 101 102 |
# File 'lib/slideshow/cli/opts.rb', line 100 def manifest=(value) @manifest = value end |
#merge_gli_options!(options = {}) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/slideshow/cli/opts.rb', line 6 def ( ={} ) @header_level = 1 if [:h1] == true @header_level = 2 if [:h2] == true = true if [:slide] == true @takahashi = true if [:slide] == true @verbose = true if [:verbose] == true @fetch_all = true if [:all] == true @config_path = [:config] if [:config].present? @output_path = [:output] if [:output].present? @manifest = [:template] if [:template].present? ## NB: will use :template option too @quick_manifest = [:template] if [:template].present? end |
#output_path ⇒ Object
121 122 123 |
# File 'lib/slideshow/cli/opts.rb', line 121 def output_path @output_path || '.' end |
#output_path=(value) ⇒ Object
117 118 119 |
# File 'lib/slideshow/cli/opts.rb', line 117 def output_path=(value) @output_path = value end |
#quick_manifest ⇒ Object
69 70 71 |
# File 'lib/slideshow/cli/opts.rb', line 69 def quick_manifest @quick_manifest || 'welcome' end |
#quick_manifest=(value) ⇒ Object
65 66 67 |
# File 'lib/slideshow/cli/opts.rb', line 65 def quick_manifest=(value) @quick_manifest = value end |
#slide=(boolean) ⇒ Object
36 37 38 |
# File 'lib/slideshow/cli/opts.rb', line 36 def (boolean) = boolean end |
#slide? ⇒ Boolean
40 41 42 43 |
# File 'lib/slideshow/cli/opts.rb', line 40 def return false if .nil? # default slide flag is false == true end |
#takahashi=(boolean) ⇒ Object
45 46 47 |
# File 'lib/slideshow/cli/opts.rb', line 45 def takahashi=(boolean) @takahashi = boolean end |
#takahashi? ⇒ Boolean
49 50 51 52 |
# File 'lib/slideshow/cli/opts.rb', line 49 def takahashi? return false if @takahashi.nil? # default takahashi flag is false @takahashi == true end |
#verbose=(boolean) ⇒ Object
add: alias for debug ??
54 55 56 |
# File 'lib/slideshow/cli/opts.rb', line 54 def verbose=(boolean) # add: alias for debug ?? @verbose = boolean end |
#verbose? ⇒ Boolean
58 59 60 61 |
# File 'lib/slideshow/cli/opts.rb', line 58 def verbose? return false if @verbose.nil? # default verbose/debug flag is false @verbose == true end |