Class: Nesta::Commands::Theme::Enable

Inherits:
Object
  • Object
show all
Includes:
Command
Defined in:
lib/nesta/commands.rb

Instance Method Summary collapse

Methods included from Command

#copy_template, #copy_templates, #fail, #template_root, #update_config_yaml

Constructor Details

#initialize(*args) ⇒ Enable

Returns a new instance of Enable.



283
284
285
286
287
288
# File 'lib/nesta/commands.rb', line 283

def initialize(*args)
  name = args.shift
  options = args.shift || {}
  name.nil? && (raise UsageError.new('name not specified'))
  @name = name
end

Instance Method Details

#executeObject



290
291
292
# File 'lib/nesta/commands.rb', line 290

def execute
  update_config_yaml(/^\s*#?\s*theme:.*/, "theme: #{@name}")
end