Class: Nesta::Commands::Theme::Install
- Inherits:
-
Object
- Object
- Nesta::Commands::Theme::Install
- Includes:
- Command
- Defined in:
- lib/nesta/commands.rb
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(url, options = {}) ⇒ Install
constructor
A new instance of Install.
Methods included from Command
#copy_template, #copy_templates, #fail, #template_root, #update_config_yaml
Constructor Details
#initialize(url, options = {}) ⇒ Install
Returns a new instance of Install.
161 162 163 164 165 |
# File 'lib/nesta/commands.rb', line 161 def initialize(url, = {}) url.nil? && (raise UsageError.new('URL not specified')) @url = url @name = File.basename(url, '.git').sub(/nesta-theme-/, '') end |
Instance Method Details
#execute ⇒ Object
167 168 169 170 171 |
# File 'lib/nesta/commands.rb', line 167 def execute system('git', 'clone', @url, "themes/#{@name}") FileUtils.rm_r(File.join("themes/#{@name}", '.git')) enable(@name) end |