Class: Spar::CLI
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.source_root ⇒ Object
11 12 13 |
# File 'lib/spar/cli.rb', line 11 def self.source_root File.('../../..', __FILE__) end |
Instance Method Details
#deploy(environment = 'production') ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/spar/cli.rb', line 28 def deploy(environment='production') Spar.environment = environment say "Deploying #{Spar.root} to the #{Spar.environment} environment" if strategy = Spar.settings['deploy_strategy'] require "spar/deployers/#{strategy}_deployer" deployer = Kernel.const_get("#{strategy.capitalize()}Deployer").new deployer.run(Spar::Compiler.assets) else raise "You are trying to deploy to the #{environment} environment, but you have not declared a :deploy_strategy in config.yml for this environment. The available options are: 'local', 's3', and 'cloudfront'." end end |
#new(name) ⇒ Object
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/spar/cli.rb', line 56 def new(name) # first, copy in the base directory directory('lib/spar/generators/templates/base', name) if ![:css] # copy in the sass files directory('lib/spar/generators/templates/styles/sass', name) else # copy in the css files directory('lib/spar/generators/templates/styles/css', name) end if ![:html] # copy in the haml files directory('lib/spar/generators/templates/pages/haml', name) else # copy in the html files directory('lib/spar/generators/templates/pages/html', name) end if ![:js] # copy in the coffee files directory('lib/spar/generators/templates/scripts/coffee', name) else # copy in the js files directory('lib/spar/generators/templates/scripts/js', name) end end |