build 1.0.1 → 1.0.2

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: 0672d1e74b4a1753f505fe1caaf2f8af65d6852f
4
- data.tar.gz: 469d82145d094b22728592dec37206a389eecb55
3
+ metadata.gz: 07a1382e77048bad6c8d5af13134ec4993217280
4
+ data.tar.gz: f930333edf53c22176c8feb6752516c98ca5248d
5
5
  SHA512:
6
- metadata.gz: 369f70d27a19a9d6baea48c338bab9452969cc1c74d5c358cf270b299be29a7f98e8a6212cd4c9c88e2c6310001b892216a0997814f3fd604badbccba54d65fe
7
- data.tar.gz: 34847f234674d9327e337a92bd9e5774fea0ad628a9eb098f4c7b7aafb3facd30497d5d6ae33e43030cebd78c579c3ea89d0805d64f54c8383be8f01e69241b8
6
+ metadata.gz: 1d2464ea7d62859298c39a161fbe46de0455ce567f3b783cbf2a1ea28b687180b9b092f4d3fa0476566cc54c2b02e49271007fb8fb107074e8c0831ba035338a
7
+ data.tar.gz: 0348149089ebb58cec3afaac0970d04e5df6016b4c7a1e12cd0055e7565dda95fc0329ceb40e87676c6eed412579f23f7a963f61b10d7f5add665b6484f5ac2a
data/README.md CHANGED
@@ -18,7 +18,7 @@ And then execute:
18
18
 
19
19
  Or install it yourself as:
20
20
 
21
- $ gem install build-files
21
+ $ gem install build
22
22
 
23
23
  ## Usage
24
24
 
data/build.gemspec CHANGED
@@ -19,8 +19,8 @@ Gem::Specification.new do |spec|
19
19
 
20
20
  spec.required_ruby_version = '>= 2.0'
21
21
 
22
- spec.add_dependency "build-graph", "~> 1.0.0"
23
- spec.add_dependency "build-environment", "~> 1.0.0"
22
+ spec.add_dependency "build-graph", "~> 1.0.1"
23
+ spec.add_dependency "build-environment", "~> 1.1.0"
24
24
  spec.add_dependency "build-makefile", "~> 1.0.0"
25
25
 
26
26
  spec.add_dependency "graphviz"
@@ -23,6 +23,7 @@ require_relative 'name'
23
23
 
24
24
  require 'build/files'
25
25
  require 'build/graph'
26
+ require 'build/makefile'
26
27
 
27
28
  require 'process/group'
28
29
 
@@ -109,7 +110,7 @@ module Build
109
110
  @node.dirty?
110
111
  end
111
112
 
112
- def run(*arguments)
113
+ def spawn(*arguments)
113
114
  if wet?
114
115
  @logger.info('shell') {arguments}
115
116
  status = @group.spawn(*arguments)
@@ -120,7 +121,13 @@ module Build
120
121
  end
121
122
  end
122
123
 
123
- alias run! run
124
+ def shell_environment
125
+ @shell_environment ||= environment.flatten.export
126
+ end
127
+
128
+ def run!(*arguments)
129
+ self.spawn(shell_environment, *arguments)
130
+ end
124
131
 
125
132
  def touch(path)
126
133
  return unless wet?
@@ -139,8 +146,9 @@ module Build
139
146
  def rm(path)
140
147
  return unless wet?
141
148
 
142
- @logger.info('shell'){ ['rm', path] }
143
- FileUtils.rm(path)
149
+ @logger.info('shell'){ ['rm -rf', path] }
150
+
151
+ FileUtils.rm_rf(path)
144
152
  end
145
153
 
146
154
  def mkpath(path)
@@ -184,12 +192,13 @@ module Build
184
192
  end
185
193
 
186
194
  class Controller
187
- def initialize
195
+ def initialize(logger: nil)
188
196
  @module = Module.new
189
197
 
190
- @logger = Logger.new($stdout)
191
- @logger.level = Logger::INFO
192
- @logger.formatter = CompactFormatter.new
198
+ @logger = logger || Logger.new($stdout).tap do |logger|
199
+ logger.level = Logger::INFO
200
+ logger.formatter = CompactFormatter.new
201
+ end
193
202
 
194
203
  # Top level nodes:
195
204
  @nodes = []
data/lib/build/version.rb CHANGED
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Build
22
- VERSION = "1.0.1"
22
+ VERSION = "1.0.2"
23
23
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: build
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-06 00:00:00.000000000 Z
11
+ date: 2015-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: build-graph
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.0.0
19
+ version: 1.0.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.0.0
26
+ version: 1.0.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: build-environment
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.0.0
33
+ version: 1.1.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 1.0.0
40
+ version: 1.1.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: build-makefile
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -119,7 +119,6 @@ files:
119
119
  - ".simplecov"
120
120
  - ".travis.yml"
121
121
  - Gemfile
122
- - LICENSE.txt
123
122
  - README.md
124
123
  - Rakefile
125
124
  - build.gemspec
data/LICENSE.txt DELETED
@@ -1,22 +0,0 @@
1
- Copyright (c) 2015 Samuel Williams
2
-
3
- MIT License
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
12
-
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
15
-
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.