ninja-gen 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 451b908f2bce1a65c8a0724c07f971594c34ab7d
4
- data.tar.gz: f40509209c1f10f52c7426581d7ecb4f147a3fcb
3
+ metadata.gz: 90aa98d1e0b536a791503112227ab3c670875780
4
+ data.tar.gz: 05098694246c85bbf066cb9c77633e8de82ca62d
5
5
  SHA512:
6
- metadata.gz: f46fcfeb64826966e689afb45c5fcd92632720aad6332001402afed24644c2b03f505930c03be6c17c26639a20dd238d2331d7ebf1ce01784fe7c31cefd8fa5a
7
- data.tar.gz: 7c5b1a4534bdec4bfc6bc5e46fedba9ad90a00bed1b8112c62a725c40c364b6ef522f6818ca93f70bfbc11e18a6f72211173d05741737cf255cab65f39c6b2b4
6
+ metadata.gz: cc2d55c384c1449ceb34897997aee8977763ab6c6f06da9c6d768af142090be08d2ce11bc238bfe1fb597b85a26fdb59b6c229f8f37035b199dfb36805bbbb8f
7
+ data.tar.gz: d9112a125ac3355b482c0323817503a3b39f5b61e97660ec3220fcb0c99285e3fccf0bb7c28532ae7096e3051ba24fa79e5e5cfdf3f1c542c425863d003205b8
data/Rakefile CHANGED
@@ -0,0 +1,2 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
data/lib/ninja/file.rb CHANGED
@@ -25,8 +25,9 @@ module Ninja
25
25
  end
26
26
  end
27
27
 
28
- def default(outputs)
29
- raise "Expected output(s) to be paths." unless [*outputs].all?{|output| /\A(?:[-\w\.]+\/?)+\z/.match(output)}
28
+ def defaults(outputs)
29
+ # TODO(mtwilliams): Accept variables (\$[\w]|\$\{[\w]\}).
30
+ # raise "Expected output(s) to be paths." unless [*outputs].all?{|output| /\A(?:[-\w\.]+\/?)+\z/.match(output)}
30
31
  @defaults.push(*outputs)
31
32
  end
32
33
 
@@ -43,6 +44,7 @@ module Ninja
43
44
  # TODO(mtwilliams): Escape.
44
45
  f.write "#{variable.name} = #{variable.value}\n"
45
46
  end
47
+ f.write "\n" unless @variables.empty?
46
48
 
47
49
  @rules.each do |rule|
48
50
  f.write "rule #{rule.name}\n"
@@ -64,9 +66,11 @@ module Ninja
64
66
  @builds.each do |build|
65
67
  f.write "build #{build.output}: #{build.rule} #{build.inputs.join(' ')}\n"
66
68
  end
67
- f.write "\n" unless @builds.empty?
68
69
 
69
- f.write "default #{@defaults.join(' ')}\n" unless @defaults.empty?
70
+ unless @defaults.empty?
71
+ f.write "\n" unless @builds.empty?
72
+ f.write "default #{@defaults.join(' ')}\n" unless @defaults.empty?
73
+ end
70
74
 
71
75
  # TODO(mtwilliams): Aliases (via the 'phony' rule).
72
76
  # TODO(mtwilliams): Execute other files (via 'subninja').
data/lib/ninja/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Ninja
2
2
  module VERSION #:nodoc:
3
- MAJOR, MINOR, PATCH, PRE = [0, 1, 0]
3
+ MAJOR, MINOR, PATCH, PRE = [0, 1, 1]
4
4
  STRING = [MAJOR, MINOR, PATCH, PRE].compact.join('.')
5
5
  end
6
6
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ninja-gen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Williams