jake 0.9.0 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  module Jake
2
- VERSION = '0.9.0'
2
+ VERSION = '0.9.1'
3
3
 
4
4
  CONFIG_FILE = 'jake.yml'
5
5
  HELPER_FILE = 'Jakefile'
@@ -6,7 +6,8 @@ module Jake
6
6
 
7
7
  DEFAULT_LAYOUT = 'together'
8
8
 
9
- attr_reader :helper, :builds
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
@@ -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.builds.each do |name, settings|
54
+ @build.each do |name, settings|
54
55
  next unless build_needed?(name)
55
56
 
56
57
  @build.helper.build = name
@@ -10,7 +10,8 @@ module Jake
10
10
  end
11
11
 
12
12
  def code(name)
13
- @code[name] ||= @config[:files].map { |pkg| @build.package(pkg).code(name) }.join("\n\n\n")
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jake
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Coglan