class Tuya::Command::Lib::Create

Public Class Methods

new(argv) click to toggle source
Calls superclass method
# File lib/tuya/cli/odm/command/lib/create.rb, line 14
def initialize(argv)
        super
end
options() click to toggle source
# File lib/tuya/cli/odm/command/lib/create.rb, line 9
def self.options
        [
        ]
end

Public Instance Methods

createModule() click to toggle source
# File lib/tuya/cli/odm/command/lib/create.rb, line 37
def createModule

        system = Tuya::System.instance

        group = system.group

        if group
                template = TYCiCore::TYTemplate.new(group.name)
                template.create
                @template = template
        else
                puts "\nCan not find your Tuya Group, please use 'tuya group create --name=group_name'".red
        end

end
run() click to toggle source
# File lib/tuya/cli/odm/command/lib/create.rb, line 18
        def run
                puts "Start create tuya module...".yellow

                createModule

                puts "create module successful".green
                puts "\n\n我们默认添加了SDK依赖, 可在Podfile文件中查看, SDK文档及使用请参考:".green
                puts "https://github.com/TuyaInc/tuyasmart_home_ios_sdk\n".magenta.underline
                puts "我们的文档地址:".green
                puts "https://tuyainc.github.io/\n".magenta.underline

                Tuya::TYLib.create_lib @template
end
showProgress() click to toggle source
# File lib/tuya/cli/odm/command/lib/create.rb, line 32
def showProgress
        progressbar = ProgressBar.create
        100.times { progressbar.increment; sleep 3 }
end