Class: TuyaCIDSL::DSLExecute
- Inherits:
-
Object
- Object
- TuyaCIDSL::DSLExecute
- Defined in:
- lib/tuya/ci/DSL/exe/dsl_exe.rb
Instance Attribute Summary collapse
-
#folder ⇒ Object
Returns the value of attribute folder.
-
#folder_path ⇒ Object
Returns the value of attribute folder_path.
-
#from_git ⇒ Object
Returns the value of attribute from_git.
-
#git ⇒ Object
Returns the value of attribute git.
-
#sh ⇒ Object
Returns the value of attribute sh.
Instance Method Summary collapse
- #download(git) ⇒ Object
- #execute ⇒ Object
-
#initialize(sh) ⇒ DSLExecute
constructor
A new instance of DSLExecute.
Constructor Details
#initialize(sh) ⇒ DSLExecute
Returns a new instance of DSLExecute.
6 7 8 9 10 11 12 |
# File 'lib/tuya/ci/DSL/exe/dsl_exe.rb', line 6 def initialize(sh) @sh = sh @git = '' @from_git = false @folder = '' @folder_path = '' end |
Instance Attribute Details
#folder ⇒ Object
Returns the value of attribute folder.
4 5 6 |
# File 'lib/tuya/ci/DSL/exe/dsl_exe.rb', line 4 def folder @folder end |
#folder_path ⇒ Object
Returns the value of attribute folder_path.
4 5 6 |
# File 'lib/tuya/ci/DSL/exe/dsl_exe.rb', line 4 def folder_path @folder_path end |
#from_git ⇒ Object
Returns the value of attribute from_git.
4 5 6 |
# File 'lib/tuya/ci/DSL/exe/dsl_exe.rb', line 4 def from_git @from_git end |
#git ⇒ Object
Returns the value of attribute git.
4 5 6 |
# File 'lib/tuya/ci/DSL/exe/dsl_exe.rb', line 4 def git @git end |
#sh ⇒ Object
Returns the value of attribute sh.
4 5 6 |
# File 'lib/tuya/ci/DSL/exe/dsl_exe.rb', line 4 def sh @sh end |
Instance Method Details
#download(git) ⇒ Object
28 29 30 31 32 33 34 35 36 |
# File 'lib/tuya/ci/DSL/exe/dsl_exe.rb', line 28 def download(git) @from_git = true git_downloader = TYCiCore::GitDownloader.new git @git = git @folder = git_downloader.folder git_downloader.download '.dsl' @folder_path = git_downloader.folder_path end |
#execute ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/tuya/ci/DSL/exe/dsl_exe.rb', line 14 def execute if @from_git command_cp = "cp -a #{@folder_path} ./" puts "Trigger will copy shell by:#{command_cp}" system command_cp result = run_shell delete else result = run_shell end result end |