Class: TuyaCIDSL::TuyaDSL
- Inherits:
-
Object
- Object
- TuyaCIDSL::TuyaDSL
- Includes:
- Singleton
- Defined in:
- lib/tuya/ci/DSL/tuya_dsl.rb
Instance Method Summary collapse
-
#initialize ⇒ TuyaDSL
constructor
A new instance of TuyaDSL.
- #load_monitors ⇒ Object
- #load_monitors_git(git) ⇒ Object
- #load_monitors_path(path) ⇒ Object
- #trigger_module_begin(options) ⇒ Object
- #trigger_module_end(options) ⇒ Object
- #trigger_project_begin(options) ⇒ Object
- #trigger_project_end(options) ⇒ Object
Constructor Details
#initialize ⇒ TuyaDSL
Returns a new instance of TuyaDSL.
9 10 11 12 13 14 15 |
# File 'lib/tuya/ci/DSL/tuya_dsl.rb', line 9 def initialize @default_root_file = 'CIFile' @default_folder = 'CIMonitors' @files = [] @monitors = {} load_files end |
Instance Method Details
#load_monitors ⇒ Object
29 30 31 32 33 34 |
# File 'lib/tuya/ci/DSL/tuya_dsl.rb', line 29 def load_monitors @files.each do |item| add_monitor item end # puts @monitors end |
#load_monitors_git(git) ⇒ Object
17 18 19 20 21 |
# File 'lib/tuya/ci/DSL/tuya_dsl.rb', line 17 def load_monitors_git(git) git_downloader = TYCiCore::GitDownloader.new git git_downloader.download '.dsl_common' load_monitors_path git_downloader.folder_path end |
#load_monitors_path(path) ⇒ Object
23 24 25 26 27 |
# File 'lib/tuya/ci/DSL/tuya_dsl.rb', line 23 def load_monitors_path(path) if File.exist? path @files += Dir["#{path}/**/*"].reject{|o|File.directory?(o)} end end |
#trigger_module_begin(options) ⇒ Object
36 37 38 |
# File 'lib/tuya/ci/DSL/tuya_dsl.rb', line 36 def trigger_module_begin() trigger 'before_module_build', end |
#trigger_module_end(options) ⇒ Object
40 41 42 |
# File 'lib/tuya/ci/DSL/tuya_dsl.rb', line 40 def trigger_module_end() trigger 'after_module_build', end |
#trigger_project_begin(options) ⇒ Object
44 45 46 |
# File 'lib/tuya/ci/DSL/tuya_dsl.rb', line 44 def trigger_project_begin() trigger 'before_project_build', end |
#trigger_project_end(options) ⇒ Object
48 49 50 |
# File 'lib/tuya/ci/DSL/tuya_dsl.rb', line 48 def trigger_project_end() trigger 'after_project_build', end |