Browse files

Build when calling build and alias to_s

  • Loading branch information...
1 parent c096092 commit a6f565cad6eaf73dfc85049116943dff28f8a4e9 @subtleGradient subtleGradient committed Aug 1, 2008
Showing with 5 additions and 3 deletions.
  1. +5 −3 build.rb
View
8 build.rb
@@ -22,7 +22,6 @@ def initialize(path = File.dirname(__FILE__))
@path = path
@scripts = []
@included = []
- @string = ""
@data = {}
@build_path ||= @path + '/mootools.js'
@@ -49,12 +48,15 @@ def load_script(name)
end
@included.push name
@data[name][:deps].each { |dep| load_script dep }
+ @string ||= ""
@string << File.read(@path + "/Source/#{@data[name][:folder]}/#{name}.js") << "\n"
end
- def to_s
- @string.sub('%build%', build_number)
+ def build
+ @string ||= full_build
+ @string.sub!('%build%', build_number)
end
+ alias :to_s :build
def build_number
ref = File.read(File.dirname(__FILE__) + '/.git/HEAD').chomp.match(/ref: (.*)/)[1]

0 comments on commit a6f565c

Please sign in to comment.