37 Commits

Author SHA1 Message Date
Markus Reiter
480e264d9a
Lint Ruby docs. 2024-05-01 11:35:21 +02:00
Markus Reiter
0f0055ede4
Make documentation @api private by default. 2024-04-26 19:04:20 +02:00
Douglas Eichelberger
24cf6076e8 brew style --fix 2023-04-24 20:42:39 -07:00
Issy Long
0c86425d6a
rubocop: Drop "o" from Naming/MethodParameterName allowlist
- I couldn't figure out what this would stand for, so I asked on Slack
  if anyone had better ideas otherwise I'd go with "ostrich" or
  "octopus". Rylan suggested "option", which is very sensible.
2023-03-11 00:17:29 +00:00
Issy Long
e9d994622e
rubocop: Drop "f" from Naming/MethodParameterName allowlist
- This either stands for "file" but more often than not "formula".
2023-03-11 00:17:27 +00:00
Bo Anderson
abfbb46678
Freeze formula definition once first instance is created 2022-08-31 20:40:42 +01:00
Sean Molenaar
2de6958a36
build_environment: add proper types to dump() and fix inreplace error 2022-08-15 19:03:55 +02:00
fn ⌃ ⌥
f7cc71b195 build_environment: delete BuildEnvironment#userpaths? 2021-09-30 14:06:00 -07:00
Markus Reiter
70dd41cfd8 Add type signatures to BuildEnvironment. 2020-11-19 16:07:50 +01:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Markus Reiter
b5363025a6 Refactor and document BuildEnvironment. 2020-08-14 18:41:44 +02:00
Mike McQuaid
cd777088d0
build_environment: tweak frozen string handling. 2019-05-01 09:03:39 +01:00
Kevin Menard
2f21de596f Fix bad mutable call on a frozen string. 2019-04-30 13:12:27 -04:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
Mike McQuaid
eed1444d61
Update deprecations and cleanup
- Move `odeprecated` to `odisabled`
- Remove `odisabled`
- Enable automatic cleanup on install/reinstall/upgrade.
2019-01-23 21:57:40 +00:00
Andrew Janke
e0a8a79921 Style fixes for Rubocop 0.57.1 2018-06-30 19:40:14 -04:00
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