Class: Tuya::Command::Group::GroupInit
- Inherits:
-
Tuya::Command::Group
- Object
- CLAide::Command
- Tuya::Command
- Tuya::Command::Group
- Tuya::Command::Group::GroupInit
- Defined in:
- lib/tycli/command/group/init.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(argv) ⇒ GroupInit
constructor
A new instance of GroupInit.
- #run ⇒ Object
- #validate! ⇒ Object
Constructor Details
#initialize(argv) ⇒ GroupInit
Returns a new instance of GroupInit.
24 25 26 27 |
# File 'lib/tycli/command/group/init.rb', line 24 def initialize(argv) super @name = argv.option('name') end |
Class Method Details
.options ⇒ Object
18 19 20 21 22 |
# File 'lib/tycli/command/group/init.rb', line 18 def self. [ ['--name=group_name', '--name the name for your group'] ] end |
Instance Method Details
#run ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/tycli/command/group/init.rb', line 9 def run puts "group name is #{@name}".green require 'tycli/group' require 'tycli/config' group = Tuya::ConfigGroup.new(@name) Tuya::TYGroup.setup_local_repo group end |
#validate! ⇒ Object
29 30 31 |
# File 'lib/tycli/command/group/init.rb', line 29 def validate! help! "name need" unless @name end |