diff options
| author | Mike McQuaid | 2018-01-17 10:42:43 +0000 | 
|---|---|---|
| committer | Mike McQuaid | 2018-01-17 10:42:43 +0000 | 
| commit | 1f48e17f1b2f681ea56b72b8d2c1eebdb77f2181 (patch) | |
| tree | d6441603e1e8fb405b91ab1bb0e869c5a4af6a69 /Library/Homebrew/dev-cmd | |
| parent | 8cd0d85afba1bd07a6af24ffca54518ec8ff0d1c (diff) | |
| download | brew-1f48e17f1b2f681ea56b72b8d2c1eebdb77f2181.tar.bz2 | |
rubocop: fix brew style warnings.
Diffstat (limited to 'Library/Homebrew/dev-cmd')
| -rw-r--r-- | Library/Homebrew/dev-cmd/create.rb | 134 | 
1 files changed, 65 insertions, 69 deletions
| diff --git a/Library/Homebrew/dev-cmd/create.rb b/Library/Homebrew/dev-cmd/create.rb index e5481b532..122be2593 100644 --- a/Library/Homebrew/dev-cmd/create.rb +++ b/Library/Homebrew/dev-cmd/create.rb @@ -165,77 +165,73 @@ class FormulaCreator      path.write ERB.new(template, nil, ">").result(binding)    end -  def template; <<~EOS -    # Documentation: https://docs.brew.sh/Formula-Cookbook.html -    #                http://www.rubydoc.info/github/Homebrew/brew/master/Formula -    # PLEASE REMOVE ALL GENERATED COMMENTS BEFORE SUBMITTING YOUR PULL REQUEST! - -    class #{Formulary.class_s(name)} < Formula -      desc "#{desc}" -      homepage "#{homepage}" -    <% if head? %> -      head "#{url}" -    <% else %> -      url "#{url}" -    <% unless version.nil? or version.detected_from_url? %> -      version "#{version}" -    <% end %> -      sha256 "#{sha256}" -    <% end %> - -    <% if mode == :cmake %> -      depends_on "cmake" => :build -    <% elsif mode == :meson %> -      depends_on "meson" => :build -      depends_on "ninja" => :build -    <% elsif mode.nil? %> -      # depends_on "cmake" => :build -    <% end %> - -      def install -        # ENV.deparallelize  # if your formula fails when building in parallel - -    <% if mode == :cmake %> -        system "cmake", ".", *std_cmake_args -    <% elsif mode == :autotools %> -        # Remove unrecognized options if warned by configure -        system "./configure", "--disable-debug", -                              "--disable-dependency-tracking", -                              "--disable-silent-rules", -                              "--prefix=\#{prefix}" -    <% elsif mode == :meson %> -        mkdir "build" do -          system "meson", "--prefix=\#{prefix}", ".." -          system "ninja" -          system "ninja", "test" -          system "ninja", "install" +  def template +    <<~EOS +      # Documentation: https://docs.brew.sh/Formula-Cookbook.html +      #                http://www.rubydoc.info/github/Homebrew/brew/master/Formula +      # PLEASE REMOVE ALL GENERATED COMMENTS BEFORE SUBMITTING YOUR PULL REQUEST! +       class #{Formulary.class_s(name)} < Formula +        desc "#{desc}" +        homepage "#{homepage}" +      <% if head? %> +        head "#{url}" +      <% else %> +        url "#{url}" +      <% unless version.nil? or version.detected_from_url? %> +        version "#{version}" +      <% end %> +        sha256 "#{sha256}" +      <% end %> +       <% if mode == :cmake %> +        depends_on "cmake" => :build +      <% elsif mode == :meson %> +        depends_on "meson" => :build +        depends_on "ninja" => :build +      <% elsif mode.nil? %> +        # depends_on "cmake" => :build +      <% end %> +         def install +          # ENV.deparallelize  # if your formula fails when building in parallel +       <% if mode == :cmake %> +          system "cmake", ".", *std_cmake_args +      <% elsif mode == :autotools %> +          # Remove unrecognized options if warned by configure +          system "./configure", "--disable-debug", +                                "--disable-dependency-tracking", +                                "--disable-silent-rules", +                                "--prefix=\#{prefix}" +      <% elsif mode == :meson %> +          mkdir "build" do +            system "meson", "--prefix=\#{prefix}", ".." +            system "ninja" +            system "ninja", "test" +            system "ninja", "install" +          end +      <% else %> +          # Remove unrecognized options if warned by configure +          system "./configure", "--disable-debug", +                                "--disable-dependency-tracking", +                                "--disable-silent-rules", +                                "--prefix=\#{prefix}" +          # system "cmake", ".", *std_cmake_args +      <% end %> +      <% if mode != :meson %> +          system "make", "install" # if this fails, try separate make/make install steps +      <% end %> +        end +         test do +          # `test do` will create, run in and delete a temporary directory. +          # +          # This test will fail and we won't accept that! For Homebrew/homebrew-core +          # this will need to be a test that verifies the functionality of the +          # software. Run the test with `brew test #{name}`. Options passed +          # to `brew install` such as `--HEAD` also need to be provided to `brew test`. +          # +          # The installed folder is not in the path, so use the entire path to any +          # executables being tested: `system "\#{bin}/program", "do", "something"`. +          system "false"          end -    <% else %> -        # Remove unrecognized options if warned by configure -        system "./configure", "--disable-debug", -                              "--disable-dependency-tracking", -                              "--disable-silent-rules", -                              "--prefix=\#{prefix}" -        # system "cmake", ".", *std_cmake_args -    <% end %> -    <% if mode != :meson %> -        system "make", "install" # if this fails, try separate make/make install steps -    <% end %> -      end - -      test do -        # `test do` will create, run in and delete a temporary directory. -        # -        # This test will fail and we won't accept that! For Homebrew/homebrew-core -        # this will need to be a test that verifies the functionality of the -        # software. Run the test with `brew test #{name}`. Options passed -        # to `brew install` such as `--HEAD` also need to be provided to `brew test`. -        # -        # The installed folder is not in the path, so use the entire path to any -        # executables being tested: `system "\#{bin}/program", "do", "something"`. -        system "false"        end -    end      EOS    end  end | 
