mattock 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,15 +2,10 @@ require 'mattock/command-task'
2
2
 
3
3
  module Mattock
4
4
  class BundleCommandTask < CommandTask
5
- class BundleEnvCleaner < CommandLine
6
- def initialize(original)
7
- @original = original
8
- end
9
-
10
- def run
11
- original_env = ENV.to_hash
12
- if defined? Bundler
13
- %w{
5
+ def cleaned_env
6
+ env = {}
7
+ if defined? Bundler
8
+ %w{
14
9
  BUNDLER_EDITOR
15
10
  BUNDLE_APP_CONFIG
16
11
  BUNDLE_BIN_PATH
@@ -28,26 +23,17 @@ module Mattock
28
23
  RB_USER_INSTALL
29
24
  RUBYOPT
30
25
  VISUAL
31
- }.each do |bundler_varname|
32
- begin
33
- ENV[bundler_varname] = Bundler::ORIGINAL_ENV.fetch(bundler_varname)
34
- rescue KeyError
35
- ENV.delete(bundler_varname)
36
- end
37
- end
26
+ }.each do |bundler_varname|
27
+ env[bundler_varname] = Bundler::ORIGINAL_ENV[bundler_varname]
38
28
  end
39
- %w{
40
- BUNDLE_GEMFILE
41
- }
42
-
43
- @original.run
44
- ensure
45
- ENV.replace(original_env)
46
29
  end
30
+ env["BUNDLE_GEMFILE"] = nil
31
+ env
47
32
  end
48
33
 
49
34
  def decorated(command)
50
- BundleEnvCleaner.new(command)
35
+ command.command_environment.merge!(cleaned_env)
36
+ command
51
37
  end
52
38
  end
53
39
  end
@@ -224,6 +224,7 @@ module Mattock
224
224
  class CommandChain < CommandLine
225
225
  def initialize
226
226
  @commands = []
227
+ @command_environment = {}
227
228
  super(nil)
228
229
  end
229
230
 
@@ -238,7 +239,7 @@ module Mattock
238
239
  #Honestly this is sub-optimal - biggest driver for considering the
239
240
  #mini-shell approach here.
240
241
  def command_environment
241
- @commands.reverse.inject({}) do |env, command|
242
+ @command_environment = @commands.reverse.inject(@command_environment) do |env, command|
242
243
  env.merge(command.command_environment)
243
244
  end
244
245
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mattock
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-10-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: corundum
16
- requirement: &81969870 !ruby/object:Gem::Requirement
16
+ requirement: &84793580 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.0.1
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *81969870
24
+ version_requirements: *84793580
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: valise
27
- requirement: &81968880 !ruby/object:Gem::Requirement
27
+ requirement: &84792520 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -35,10 +35,10 @@ dependencies:
35
35
  - 6
36
36
  type: :runtime
37
37
  prerelease: false
38
- version_requirements: *81968880
38
+ version_requirements: *84792520
39
39
  - !ruby/object:Gem::Dependency
40
40
  name: tilt
41
- requirement: &81968150 !ruby/object:Gem::Requirement
41
+ requirement: &84791720 !ruby/object:Gem::Requirement
42
42
  none: false
43
43
  requirements:
44
44
  - - ! '>'
@@ -48,7 +48,7 @@ dependencies:
48
48
  - 0
49
49
  type: :runtime
50
50
  prerelease: false
51
- version_requirements: *81968150
51
+ version_requirements: *84791720
52
52
  description: ! " If Rake won't do it by itself, you oughtta Mattock.\n\n If you
53
53
  survived the pun, you might enjoy this gem.\n\n Features:\n\n * Extensions to
54
54
  Tasklibs to support powerful deerpaths.\n * A commandline library that supports
@@ -102,7 +102,7 @@ rdoc_options:
102
102
  - --main
103
103
  - doc/README
104
104
  - --title
105
- - mattock-0.3.3 RDoc
105
+ - mattock-0.3.4 RDoc
106
106
  require_paths:
107
107
  - lib/
108
108
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -113,7 +113,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
113
113
  version: '0'
114
114
  segments:
115
115
  - 0
116
- hash: -1048665203
116
+ hash: -1040167503
117
117
  required_rubygems_version: !ruby/object:Gem::Requirement
118
118
  none: false
119
119
  requirements: