jake 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/jake.rb +1 -1
- data/lib/jake/build.rb +6 -1
- data/lib/jake/buildable.rb +3 -2
- data/lib/jake/bundle.rb +2 -1
- metadata +1 -1
data/lib/jake.rb
CHANGED
data/lib/jake/build.rb
CHANGED
@@ -6,7 +6,8 @@ module Jake
|
|
6
6
|
|
7
7
|
DEFAULT_LAYOUT = 'together'
|
8
8
|
|
9
|
-
|
9
|
+
include Enumerable
|
10
|
+
attr_reader :helper
|
10
11
|
|
11
12
|
def initialize(dir, config = nil)
|
12
13
|
@dir = File.expand_path(dir)
|
@@ -31,6 +32,10 @@ module Jake
|
|
31
32
|
end
|
32
33
|
end
|
33
34
|
|
35
|
+
def each(&block)
|
36
|
+
@builds.each(&block)
|
37
|
+
end
|
38
|
+
|
34
39
|
def force!
|
35
40
|
@forced = true
|
36
41
|
end
|
data/lib/jake/buildable.rb
CHANGED
@@ -35,9 +35,10 @@ module Jake
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def header
|
38
|
-
@config[:header] ?
|
38
|
+
content = @config[:header] ?
|
39
39
|
Jake.read("#{ directory }/#{ @config[:header] }") :
|
40
40
|
@build.header
|
41
|
+
ERB.new(content).result(@build.helper.get_binding)
|
41
42
|
end
|
42
43
|
|
43
44
|
def packer_settings(build_name)
|
@@ -50,7 +51,7 @@ module Jake
|
|
50
51
|
def write!
|
51
52
|
puts "Package #{@name}..."
|
52
53
|
|
53
|
-
@build.
|
54
|
+
@build.each do |name, settings|
|
54
55
|
next unless build_needed?(name)
|
55
56
|
|
56
57
|
@build.helper.build = name
|
data/lib/jake/bundle.rb
CHANGED
@@ -10,7 +10,8 @@ module Jake
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def code(name)
|
13
|
-
|
13
|
+
joiner = (packer_settings(name) == false) ? "\n\n\n" : "\n"
|
14
|
+
@code[name] ||= @config[:files].map { |pkg| @build.package(pkg).code(name) }.join(joiner)
|
14
15
|
end
|
15
16
|
|
16
17
|
end
|