Class: Cosensee::CLI::Option

Inherits:
Object
  • Object
show all
Defined in:
lib/cosensee/cli/option.rb

Overview

Option class for Cosensee::CLI

Instance Attribute Summary collapse

Instance Method Summary collapse

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

Parameters:

  • value

    the value to set the attribute clean to.



8
9
10
# File 'lib/cosensee/cli/option.rb', line 8

def clean=(value)
  @clean = value
end

#css_dirObject

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

Parameters:

  • value

    the value to set the attribute failed to.



8
9
10
# File 'lib/cosensee/cli/option.rb', line 8

def failed=(value)
  @failed = value
end

#filenameObject



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

Parameters:

  • value

    the value to set the attribute init to.



8
9
10
# File 'lib/cosensee/cli/option.rb', line 8

def init=(value)
  @init = value
end

#output_dirObject

Returns the value of attribute output_dir.



7
8
9
# File 'lib/cosensee/cli/option.rb', line 7

def output_dir
  @output_dir
end

#portObject

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

Parameters:

  • value

    the value to set the attribute remote to.



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

Parameters:

  • value

    the value to set the attribute server to.



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

Parameters:

  • value

    the value to set the attribute skip_tailwind_execution to.



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_urlObject



32
33
34
# File 'lib/cosensee/cli/option.rb', line 32

def base_url
  @base_url || ENV['COSENSEE_BASE_URL']
end

#clean?Boolean

Returns:

  • (Boolean)


56
57
58
# File 'lib/cosensee/cli/option.rb', line 56

def clean?
  @clean
end

#failed?Boolean

Returns:

  • (Boolean)


44
45
46
# File 'lib/cosensee/cli/option.rb', line 44

def failed?
  @failed
end

#init?Boolean

Returns:

  • (Boolean)


60
61
62
# File 'lib/cosensee/cli/option.rb', line 60

def init?
  !!@init
end

#project_dirObject



36
37
38
# File 'lib/cosensee/cli/option.rb', line 36

def project_dir
  @init || '.'
end

#project_nameObject



28
29
30
# File 'lib/cosensee/cli/option.rb', line 28

def project_name
  @remote || ENV['COSENSEE_PROJECT_NAME']
end

#remote?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/cosensee/cli/option.rb', line 40

def remote?
  !!@remote
end

#server?Boolean

Returns:

  • (Boolean)


48
49
50
# File 'lib/cosensee/cli/option.rb', line 48

def server?
  @server
end

#skip_tailwind_execution?Boolean

Returns:

  • (Boolean)


52
53
54
# File 'lib/cosensee/cli/option.rb', line 52

def skip_tailwind_execution?
  @skip_tailwind_execution
end