Sha256: a19159eddd990ff61f4ff6c44a49625d5e5fb0cfee35680392a35921292e290f

Contents?: true

Size: 1.16 KB

Versions: 46

Compression:

Stored size: 1.16 KB

Contents

# encoding: utf-8

module ClassyAssets
  class CLI < Thor 
    include Thor::Actions
    source_root File.expand_path('../../../bin/.files', __FILE__)

    desc "init", "Initializes ClassyAssets for your application"
    method_option :root, default: File.expand_path('../../../', __FILE__), desc: 'Path to the root of your application'
    def init  
      puts "Initializing ClassyAssets for your application..."
      empty_directory(File.join(options[:root], 'assets'))
      empty_directory(File.join(options[:root], 'assets', 'images'))
      empty_directory(File.join(options[:root], 'assets', 'javascripts'))
      empty_directory(File.join(options[:root], 'assets', 'stylesheets'))
      puts "Done!"
    end
    
    desc "install_hook", "Installs the optional git pre-commit hook, which will automatically precompile changed assets when you commit changed assets"
    method_option :root, default: File.expand_path('../../../', __FILE__), desc: 'Path to the root of your application'
    def install_hook
      puts "Installing ClassyAssets git pre-commit hook..."
      copy_file 'pre-commit.hook', File.join(options[:root], '.git', 'hooks', 'pre-commit')
    end
  end
end

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
classy_assets-0.14.5 lib/classy_assets/cli.rb
classy_assets-0.14.4 lib/classy_assets/cli.rb
classy_assets-0.14.2 lib/classy_assets/cli.rb
classy_assets-0.14.1 lib/classy_assets/cli.rb
classy_assets-0.14.0 lib/classy_assets/cli.rb
classy_assets-0.13.0 lib/classy_assets/cli.rb
classy_assets-0.12.0 lib/classy_assets/cli.rb
classy_assets-0.11.4 lib/classy_assets/cli.rb
classy_assets-0.11.3 lib/classy_assets/cli.rb
classy_assets-0.11.2 lib/classy_assets/cli.rb
classy_assets-0.11.1 lib/classy_assets/cli.rb
classy_assets-0.11.0 lib/classy_assets/cli.rb
classy_assets-0.10.0 lib/classy_assets/cli.rb
classy_assets-0.9.4 lib/classy_assets/cli.rb
classy_assets-0.9.3 lib/classy_assets/cli.rb
classy_assets-0.9.2 lib/classy_assets/cli.rb
classy_assets-0.9.1 lib/classy_assets/cli.rb
classy_assets-0.9.0 lib/classy_assets/cli.rb
classy_assets-0.8.2 lib/classy_assets/cli.rb
classy_assets-0.8.1 lib/classy_assets/cli.rb