Class: Blacksmith::Cli

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/blacksmith/cli.rb,
lib/blacksmith/cli/init.rb,
lib/blacksmith/cli/build.rb,
lib/blacksmith/cli/watch.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.pwdObject



7
8
9
# File 'lib/blacksmith/cli.rb', line 7

def self.pwd
  Dir.pwd
end

.source_rootObject



4
5
6
# File 'lib/blacksmith/cli.rb', line 4

def self.source_root
  File.dirname(__FILE__)
end

Instance Method Details

#buildObject



4
5
6
# File 'lib/blacksmith/cli/build.rb', line 4

def build
  Blacksmith.app.build
end

#init(project_name) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'lib/blacksmith/cli/init.rb', line 5

def init(project_name)
  create_file "#{project_name}/config.rb" do
    "set :build_files, ['#{project_name}']"
    "set :jshint,  false # in development "
    "set :gzip,    true"
    "set :compile, false"
  end
  create_file  "#{project_name}/source/#{project_name}.js"
  create_file  "#{project_name}/build/.gitkeep"
end

#watchObject



4
5
# File 'lib/blacksmith/cli/watch.rb', line 4

def watch
end