Class: Dapp::Config::Shell

Inherits:
Object
  • Object
show all
Defined in:
lib/dapp/config/shell.rb

Overview

Shell

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize ⇒ Shell

Returns a new instance of Shell.



8
9
10
11
12
13
# File 'lib/dapp/config/shell.rb', line 8

def initialize
  @_infra_install = []
  @_infra_setup   = []
  @_install   = []
  @_setup     = []
end

Instance Attribute Details

#_infra_install ⇒ Object (readonly)

Returns the value of attribute _infra_install.



5
6
7
# File 'lib/dapp/config/shell.rb', line 5

def _infra_install
  @_infra_install
end

#_infra_install_cache_version ⇒ Object (readonly)

Returns the value of attribute _infra_install_cache_version.



6
7
8
# File 'lib/dapp/config/shell.rb', line 6

def _infra_install_cache_version
  @_infra_install_cache_version
end

#_infra_setup ⇒ Object (readonly)

Returns the value of attribute _infra_setup.



5
6
7
# File 'lib/dapp/config/shell.rb', line 5

def _infra_setup
  @_infra_setup
end

#_infra_setup_cache_version ⇒ Object (readonly)

Returns the value of attribute _infra_setup_cache_version.



6
7
8
# File 'lib/dapp/config/shell.rb', line 6

def _infra_setup_cache_version
  @_infra_setup_cache_version
end

#_install ⇒ Object (readonly)

Returns the value of attribute _install.



5
6
7
# File 'lib/dapp/config/shell.rb', line 5

def _install
  @_install
end

#_install_cache_version ⇒ Object (readonly)

Returns the value of attribute _install_cache_version.



6
7
8
# File 'lib/dapp/config/shell.rb', line 6

def _install_cache_version
  @_install_cache_version
end

#_setup ⇒ Object (readonly)

Returns the value of attribute _setup.



5
6
7
# File 'lib/dapp/config/shell.rb', line 5

def _setup
  @_setup
end

#_setup_cache_version ⇒ Object (readonly)

Returns the value of attribute _setup_cache_version.



6
7
8
# File 'lib/dapp/config/shell.rb', line 6

def _setup_cache_version
  @_setup_cache_version
end

Instance Method Details

#clone ⇒ Object



55
56
57
# File 'lib/dapp/config/shell.rb', line 55

def clone
  Marshal.load(Marshal.dump(self))
end

#infra_install(*args, cache_version: nil) ⇒ Object



15
16
17
18
# File 'lib/dapp/config/shell.rb', line 15

def infra_install(*args, cache_version: nil)
  @_infra_install.concat(args)
  @_infra_install_cache_version = cache_version
end

#infra_setup(*args, cache_version: nil) ⇒ Object



20
21
22
23
# File 'lib/dapp/config/shell.rb', line 20

def infra_setup(*args, cache_version: nil)
  @_infra_setup.concat(args)
  @_infra_setup_cache_version = cache_version
end

#install(*args, cache_version: nil) ⇒ Object



25
26
27
28
# File 'lib/dapp/config/shell.rb', line 25

def install(*args, cache_version: nil)
  _install.concat(args)
  @_install_cache_version = cache_version
end

#reset_all ⇒ Object



51
52
53
# File 'lib/dapp/config/shell.rb', line 51

def reset_all
  methods.tap { |arr| arr.delete(__method__) }.grep(/^reset_/).each(&method(:send))
end

#reset_infra_install ⇒ Object



35
36
37
# File 'lib/dapp/config/shell.rb', line 35

def reset_infra_install
  @_infra_install = []
end

#reset_infra_setup ⇒ Object



39
40
41
# File 'lib/dapp/config/shell.rb', line 39

def reset_infra_setup
  @_infra_setup = []
end

#reset_install ⇒ Object



43
44
45
# File 'lib/dapp/config/shell.rb', line 43

def reset_install
  @_install = []
end

#reset_setup ⇒ Object



47
48
49
# File 'lib/dapp/config/shell.rb', line 47

def reset_setup
  @_setup = []
end

#setup(*args, cache_version: nil) ⇒ Object



30
31
32
33
# File 'lib/dapp/config/shell.rb', line 30

def setup(*args, cache_version: nil)
  _setup.concat(args)
  @_setup_cache_version = cache_version
end