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
115 116 117 |
# File 'lib/slideshow/cli/opts.rb', line 115 def config_path @config_path || File.join( Env.home, '.slideshow' ) end |
#config_path=(value) ⇒ Object
111 112 113 |
# File 'lib/slideshow/cli/opts.rb', line 111 def config_path=(value) @config_path = value end |
#fetch_all=(boolean) ⇒ Object
77 78 79 |
# File 'lib/slideshow/cli/opts.rb', line 77 def fetch_all=(boolean) @fetch_all = boolean end |
#fetch_all? ⇒ Boolean
81 82 83 84 |
# File 'lib/slideshow/cli/opts.rb', line 81 def fetch_all? return false if @fetch_all.nil? # default fetch all flag is false @fetch_all == true end |
#has_includes? ⇒ Boolean
97 98 99 |
# File 'lib/slideshow/cli/opts.rb', line 97 def has_includes? @includes.nil? ? false : true end |
#header_level ⇒ Object
33 34 35 36 |
# File 'lib/slideshow/cli/opts.rb', line 33 def header_level ## todo: check 0 is not nil? @header_level || 1 end |
#header_level=(value) ⇒ Object
29 30 31 |
# File 'lib/slideshow/cli/opts.rb', line 29 def header_level=(value) @header_level = value.to_i end |
#includes ⇒ Object
92 93 94 95 |
# File 'lib/slideshow/cli/opts.rb', line 92 def includes # fix: use os-agnostic delimiter (use : for Mac/Unix?) @includes.nil? ? [] : @includes.split( ';' ) end |
#includes=(value) ⇒ Object
88 89 90 |
# File 'lib/slideshow/cli/opts.rb', line 88 def includes=(value) @includes = value end |
#manifest ⇒ Object
106 107 108 |
# File 'lib/slideshow/cli/opts.rb', line 106 def manifest @manifest || 's6' end |
#manifest=(value) ⇒ Object
102 103 104 |
# File 'lib/slideshow/cli/opts.rb', line 102 def manifest=(value) @manifest = value end |
#merge_gli_options!(options = {}) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/slideshow/cli/opts.rb', line 8 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
123 124 125 |
# File 'lib/slideshow/cli/opts.rb', line 123 def output_path @output_path || '.' end |
#output_path=(value) ⇒ Object
119 120 121 |
# File 'lib/slideshow/cli/opts.rb', line 119 def output_path=(value) @output_path = value end |
#quick_manifest ⇒ Object
71 72 73 |
# File 'lib/slideshow/cli/opts.rb', line 71 def quick_manifest @quick_manifest || 'welcome' end |
#quick_manifest=(value) ⇒ Object
67 68 69 |
# File 'lib/slideshow/cli/opts.rb', line 67 def quick_manifest=(value) @quick_manifest = value end |
#slide=(boolean) ⇒ Object
38 39 40 |
# File 'lib/slideshow/cli/opts.rb', line 38 def (boolean) = boolean end |
#slide? ⇒ Boolean
42 43 44 45 |
# File 'lib/slideshow/cli/opts.rb', line 42 def return false if .nil? # default slide flag is false == true end |
#takahashi=(boolean) ⇒ Object
47 48 49 |
# File 'lib/slideshow/cli/opts.rb', line 47 def takahashi=(boolean) @takahashi = boolean end |
#takahashi? ⇒ Boolean
51 52 53 54 |
# File 'lib/slideshow/cli/opts.rb', line 51 def takahashi? return false if @takahashi.nil? # default takahashi flag is false @takahashi == true end |
#verbose=(boolean) ⇒ Object
add: alias for debug ??
56 57 58 |
# File 'lib/slideshow/cli/opts.rb', line 56 def verbose=(boolean) # add: alias for debug ?? @verbose = boolean end |
#verbose? ⇒ Boolean
60 61 62 63 |
# File 'lib/slideshow/cli/opts.rb', line 60 def verbose? return false if @verbose.nil? # default verbose/debug flag is false @verbose == true end |