Module: Jake

Defined in:
lib/jake.rb,
lib/jake/build.rb,
lib/jake/bundle.rb,
lib/jake/package.rb,
lib/jake/buildable.rb

Defined Under Namespace

Classes: Build, Buildable, Bundle, Helper, Package

Constant Summary collapse

VERSION =
'0.9.3'
CONFIG_FILE =
'jake.yml'
HELPER_FILE =
'Jakefile'

Class Method Summary collapse

Class Method Details

.build(path, options = {}) ⇒ Object



7
8
9
10
11
# File 'lib/jake.rb', line 7

def self.build(path, options = {})
  build = Build.new(path, nil, options)
  build.force! if options[:force]
  build.run!
end

.read(path) ⇒ Object



13
14
15
16
17
# File 'lib/jake.rb', line 13

def self.read(path)
  path = File.expand_path(path)
  path = File.file?(path) ? path : ( File.file?("#{path}.js") ? "#{path}.js" : nil )
  path and File.read(path).strip
end

.symbolize_hash(hash, deep = true) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/jake.rb', line 19

def self.symbolize_hash(hash, deep = true)
  hash.inject({}) do |output, (key, value)|
    value = Jake.symbolize_hash(value) if deep and value.is_a?(Hash)
    output[(key.to_sym rescue key) || key] = value
    output
  end
end