21 Commits

Author SHA1 Message Date
Mike McQuaid
9fca172d03 Fix HOMEBREW_RUBY_WARNINGS="-w"
Fix various circular requirements, method redefinitions, etc.
2018-04-07 20:28:56 +01:00
Maxim Belkin
70005859b1
build_environment: Linux env vars 2017-10-19 15:24:30 -05:00
Markus Reiter
3cdf8f938a Use scoped RSpec matchers. 2017-05-15 17:23:40 +02:00
Markus Reiter
0ab750bf24 Use module_function for commands. 2016-10-02 00:24:47 +02:00
Mike McQuaid
6693915399 rubocop --auto-correct all remaining files.
But remove some manual `.freeze`s on constants that shouldn't be
constants.
2016-09-17 16:14:13 +01:00
Baptiste Fontaine
24a1eeceb3 Common build environment methods moved in build_environment.rb
Closes Homebrew/homebrew#45966.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-11-17 00:17:22 +01:00
BrewTestBot
13d544e11e Core files style updates.
Closes Homebrew/homebrew#42354.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-03 13:22:35 +01:00
Jack Nagel
7ee49db51e Remove proc handling from BuildEnvironment 2014-07-07 22:02:32 -05:00
Jack Nagel
6664ec23dc Merge should return self 2014-07-07 20:03:41 -05:00
Jack Nagel
23b4da18c2 Only call proc if it is set
Fixes Homebrew/homebrew#30723.
Fixes Homebrew/homebrew#30724.
Fixes Homebrew/homebrew#30727.
2014-07-07 19:47:11 -05:00
Jack Nagel
5ba06ff614 Define 1.8 marshal hooks in terms of 1.9+ marshal hooks 2014-07-07 18:12:24 -05:00
Jack Nagel
cbdb46887a Remove knowledge of serialization details by marshaling twice 2014-07-07 18:12:24 -05:00
Jack Nagel
8c4569b7c2 Fix BuildEnvironment initializer 2014-07-07 18:12:24 -05:00
Jack Nagel
879ec96743 Only store one proc per BuildEnvironment instance 2014-07-07 17:36:20 -05:00
Jack Nagel
9e7f5dc261 Merge instead of calling << in a loop 2014-07-07 09:15:56 -05:00
Jack Nagel
1b0f0824fe Requirement: env DSL is evaluated in context of self, not ENV
This was meant to support:

  env do |req|
    append_path 'PATH', req.some_method
    ...
  end

i.e., the block was evaluated in the context of ENV. But it turned out
to be not so useful after all, so I'm ripping it out before something
actually depends on it.
2013-04-01 16:17:35 -05:00
Jack Nagel
aca48deda0 BuildEnvironment: use separate sets for procs and symbols 2013-02-25 14:01:02 -06:00
Jack Nagel
2503cedf2c Object#instance_exec for Ruby 1.8.6
Not thread safe! But I don't think we care.

We want to evaluate the env DSL block in the context of ENV for asthetic
reasons, but we also want access to methods on the requirement instance.
We can use #instance_exec to pass the requirement itself into the block:

  class Foo < Requirement
    env do |req|
      append 'PATH', req.some_path
    end

    def some_path
      which 'something'
    end
  end

Also add a simplified version of Object#instance_exec for Ruby 1.8.6.
2013-01-21 17:24:11 -06:00
Jack Nagel
c53af42117 Allow env DSL to take a block
In addition to

  env :userpaths
  env :std

requirements can now do

  env do
    append 'PATH', '/some/path/to/bin'
    # and more
  end
2013-01-21 17:24:10 -06:00
Jack Nagel
a358bee8e2 Clean up BuildEnvironment interface a bit 2012-12-26 14:37:02 -06:00
Adam Vandenberg
88ad4c061d Support env :std, :userpaths
Closes Homebrew/homebrew#14654.
2012-09-14 09:14:48 -07:00