Class: Cosensee::CLI::Option
- Inherits:
-
Object
- Object
- Cosensee::CLI::Option
- Defined in:
- lib/cosensee/cli/option.rb
Overview
Option class for Cosensee::CLI
Instance Attribute Summary collapse
-
#clean ⇒ Object
writeonly
Sets the attribute clean.
-
#css_dir ⇒ Object
Returns the value of attribute css_dir.
-
#failed ⇒ Object
writeonly
Sets the attribute failed.
- #filename ⇒ Object
-
#init ⇒ Object
writeonly
Sets the attribute init.
-
#output_dir ⇒ Object
Returns the value of attribute output_dir.
-
#port ⇒ Object
Returns the value of attribute port.
-
#remote ⇒ Object
writeonly
Sets the attribute remote.
-
#server ⇒ Object
writeonly
Sets the attribute server.
-
#skip_tailwind_execution ⇒ Object
writeonly
Sets the attribute skip_tailwind_execution.
Instance Method Summary collapse
- #base_url ⇒ Object
- #clean? ⇒ Boolean
- #failed? ⇒ Boolean
- #init? ⇒ Boolean
-
#initialize(filename: nil, remote: nil, port: DEFAULT_PORT, output_dir: DEFAULT_OUTPUT_DIR, css_dir: DEFAULT_CSS_DIR, server: nil, skip_tailwind_execution: false, init: nil, clean: false, base_url: nil) ⇒ Option
constructor
A new instance of Option.
- #project_dir ⇒ Object
- #project_name ⇒ Object
- #remote? ⇒ Boolean
- #server? ⇒ Boolean
- #skip_tailwind_execution? ⇒ Boolean
Constructor Details
#initialize(filename: nil, remote: nil, port: DEFAULT_PORT, output_dir: DEFAULT_OUTPUT_DIR, css_dir: DEFAULT_CSS_DIR, server: nil, skip_tailwind_execution: false, init: nil, clean: false, base_url: nil) ⇒ Option
Returns a new instance of Option.
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/cosensee/cli/option.rb', line 10 def initialize(filename: nil, remote: nil, port: DEFAULT_PORT, output_dir: DEFAULT_OUTPUT_DIR, css_dir: DEFAULT_CSS_DIR, server: nil, skip_tailwind_execution: false, init: nil, clean: false, base_url: nil) @remote = remote @filename = filename @port = port @output_dir = output_dir @css_dir = css_dir @server = server @skip_tailwind_execution = skip_tailwind_execution @failed = false @clean = clean @init = init @base_url = base_url end |
Instance Attribute Details
#clean=(value) ⇒ Object (writeonly)
Sets the attribute clean
8 9 10 |
# File 'lib/cosensee/cli/option.rb', line 8 def clean=(value) @clean = value end |
#css_dir ⇒ Object
Returns the value of attribute css_dir.
7 8 9 |
# File 'lib/cosensee/cli/option.rb', line 7 def css_dir @css_dir end |
#failed=(value) ⇒ Object (writeonly)
Sets the attribute failed
8 9 10 |
# File 'lib/cosensee/cli/option.rb', line 8 def failed=(value) @failed = value end |
#filename ⇒ Object
24 25 26 |
# File 'lib/cosensee/cli/option.rb', line 24 def filename @filename || ENV['COSENSEE_FILENAME'] end |
#init=(value) ⇒ Object (writeonly)
Sets the attribute init
8 9 10 |
# File 'lib/cosensee/cli/option.rb', line 8 def init=(value) @init = value end |
#output_dir ⇒ Object
Returns the value of attribute output_dir.
7 8 9 |
# File 'lib/cosensee/cli/option.rb', line 7 def output_dir @output_dir end |
#port ⇒ Object
Returns the value of attribute port.
7 8 9 |
# File 'lib/cosensee/cli/option.rb', line 7 def port @port end |
#remote=(value) ⇒ Object (writeonly)
Sets the attribute remote
8 9 10 |
# File 'lib/cosensee/cli/option.rb', line 8 def remote=(value) @remote = value end |
#server=(value) ⇒ Object (writeonly)
Sets the attribute server
8 9 10 |
# File 'lib/cosensee/cli/option.rb', line 8 def server=(value) @server = value end |
#skip_tailwind_execution=(value) ⇒ Object (writeonly)
Sets the attribute skip_tailwind_execution
8 9 10 |
# File 'lib/cosensee/cli/option.rb', line 8 def skip_tailwind_execution=(value) @skip_tailwind_execution = value end |
Instance Method Details
#base_url ⇒ Object
32 33 34 |
# File 'lib/cosensee/cli/option.rb', line 32 def base_url @base_url || ENV['COSENSEE_BASE_URL'] end |
#clean? ⇒ Boolean
56 57 58 |
# File 'lib/cosensee/cli/option.rb', line 56 def clean? @clean end |
#failed? ⇒ Boolean
44 45 46 |
# File 'lib/cosensee/cli/option.rb', line 44 def failed? @failed end |
#init? ⇒ Boolean
60 61 62 |
# File 'lib/cosensee/cli/option.rb', line 60 def init? !!@init end |
#project_dir ⇒ Object
36 37 38 |
# File 'lib/cosensee/cli/option.rb', line 36 def project_dir @init || '.' end |
#project_name ⇒ Object
28 29 30 |
# File 'lib/cosensee/cli/option.rb', line 28 def project_name @remote || ENV['COSENSEE_PROJECT_NAME'] end |
#remote? ⇒ Boolean
40 41 42 |
# File 'lib/cosensee/cli/option.rb', line 40 def remote? !!@remote end |
#server? ⇒ Boolean
48 49 50 |
# File 'lib/cosensee/cli/option.rb', line 48 def server? @server end |
#skip_tailwind_execution? ⇒ Boolean
52 53 54 |
# File 'lib/cosensee/cli/option.rb', line 52 def skip_tailwind_execution? @skip_tailwind_execution end |