rscons 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MWUxZmFhZjYxM2JhN2QzNTE0OWVkODEwMGQxMGFlZjQ4OTRkMmExMg==
4
+ OWUzMDNlZjIxODVkZjhkNzg4MjQyZWZkMmQ2YWFiNjNmZmQyOWQ2OA==
5
5
  data.tar.gz: !binary |-
6
- ZWQzNjAxMzBmZDI3ZDVjMzlkMTBiZGQ0YjU1YjllZTcyY2NlOTkxOQ==
6
+ MWRhYzY1YTNlMjIyMDkyYzE4ZjZjMTU4YjVlZmFiMDk2MjBjYWRiNg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZDI2MGJiMjY1ZGM3YmQ2NjlhNGI5MThhNGM5MWU0MWEyZDI1MmI1NjY4MDAz
10
- NjViZmYwZTcxNzBlZWM0NmNjODk3MjhjNWQyZWJiZmUxNzc1ZjZmNWUxYjk5
11
- MDUyNWI1ZWFlYzVmMWZkYmY3YmJmYjlhZGI4MTk3MjU0MmFiYzg=
9
+ ODQwNTE4YjI5MmRiMjljNTMzMjRkYzU2OGZkMGUwNTgzMThlZmQzYWZhN2U0
10
+ NjUyNDgyZDUzZGQwZDMwYmJmZTYzNjA2MGQxMjcxYzIyNmQxNzcyM2RhODU5
11
+ ODMyMjMyODk5MTI5MWEwMTFlYWRlMjJiZTkwMDJhN2EyMGY1N2I=
12
12
  data.tar.gz: !binary |-
13
- ZjQzN2I1MjU5ZjEwNTM3MjliZGUzNzA1ODczYTk5NWNjN2ViMThlOTg0ZjM3
14
- MjczNmEyZWY4MDQ4M2M1YjUxZDFkM2JhNTI5MDA1NzY3MmE4MDU0ZDQ5Mzlm
15
- MDkxZjMzMThlODFlNjI0NTBjMjhhOGE2NjliOTc5NmIzOTZjYmQ=
13
+ ZjBkZDAzNjk3ZDkyMWFmMGEzZTg1ZTZiZTIzNmNjMmM4OGFmYzczOGQ0NTIw
14
+ NTMxNjUyNThjNzQ4MmMxYWY5YjNhYTY3NzZkZjQ0MjNmOTY5NzkxN2U5ZjY4
15
+ YzQ2NTIyNDMwZGU1OGNiMmIzZTM0ZWM3ODQwY2IzN2E1NGJlNTM=
data/README.md CHANGED
@@ -243,7 +243,14 @@ http://rubydoc.info/github/holtrop/rscons/frames.
243
243
 
244
244
  ## Release Notes
245
245
 
246
+ ### v1.3.0
247
+
248
+ - change Environment#execute() options parameter to accept the following options keys:
249
+ - :env to pass an environment Hash to Kernel#system
250
+ - :options to pass an options Hash to Kernel#system
251
+
246
252
  ### v1.2.0
253
+
247
254
  - add :clone option to Environment#clone to control exactly which Environment attributes are cloned
248
255
  - allow nil to be passed in to Environment#build_root=
249
256
 
@@ -224,7 +224,9 @@ module Rscons
224
224
  # @param short_desc [String] Message to print if the Environment's echo
225
225
  # mode is set to :short
226
226
  # @param command [Array] The command to execute.
227
- # @param options [Hash] Optional options to pass to Kernel#system.
227
+ # @param options [Hash] Optional options, possible keys:
228
+ # - :env - environment Hash to pass to Kernel#system.
229
+ # - :options - options Hash to pass to Kernel#system.
228
230
  def execute(short_desc, command, options = {})
229
231
  print_command = proc do
230
232
  puts command.map { |c| c =~ /\s/ ? "'#{c}'" : c }.join(' ')
@@ -234,7 +236,9 @@ module Rscons
234
236
  elsif @echo == :short
235
237
  puts short_desc
236
238
  end
237
- system(*command, options).tap do |result|
239
+ env_args = options[:env] ? [options[:env]] : []
240
+ options_args = options[:options] ? [options[:options]] : []
241
+ system(*env_args, *command, *options_args).tap do |result|
238
242
  unless result or @echo == :command
239
243
  $stdout.write "Failed command was: "
240
244
  print_command.call
@@ -1,4 +1,4 @@
1
1
  module Rscons
2
2
  # gem version
3
- VERSION = "1.2.0"
3
+ VERSION = "1.3.0"
4
4
  end
@@ -219,7 +219,7 @@ module Rscons
219
219
  it "prints the short description and executes the command" do
220
220
  env = Environment.new(echo: :short)
221
221
  env.should_receive(:puts).with("short desc")
222
- env.should_receive(:system).with("a", "command", {}).and_return(true)
222
+ env.should_receive(:system).with("a", "command").and_return(true)
223
223
  env.execute("short desc", ["a", "command"])
224
224
  end
225
225
  end
@@ -228,7 +228,7 @@ module Rscons
228
228
  it "prints the short description, executes the command, and prints the failed command line" do
229
229
  env = Environment.new(echo: :short)
230
230
  env.should_receive(:puts).with("short desc")
231
- env.should_receive(:system).with("a", "command", {}).and_return(false)
231
+ env.should_receive(:system).with("a", "command").and_return(false)
232
232
  $stdout.should_receive(:write).with("Failed command was: ")
233
233
  env.should_receive(:puts).with("a command")
234
234
  env.execute("short desc", ["a", "command"])
@@ -240,8 +240,8 @@ module Rscons
240
240
  it "prints the command executed and executes the command" do
241
241
  env = Environment.new(echo: :command)
242
242
  env.should_receive(:puts).with("a command '--arg=val with spaces'")
243
- env.should_receive(:system).with("a", "command", "--arg=val with spaces", opt: :val).and_return(false)
244
- env.execute("short desc", ["a", "command", "--arg=val with spaces"], opt: :val)
243
+ env.should_receive(:system).with({modified: :environment}, "a", "command", "--arg=val with spaces", {opt: :val}).and_return(false)
244
+ env.execute("short desc", ["a", "command", "--arg=val with spaces"], env: {modified: :environment}, options: {opt: :val})
245
245
  end
246
246
  end
247
247
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rscons
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Holtrop
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-20 00:00:00.000000000 Z
11
+ date: 2014-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec-core