diff options
| author | Markus Reiter | 2016-08-22 09:53:06 +0200 |
|---|---|---|
| committer | GitHub | 2016-08-22 09:53:06 +0200 |
| commit | 6ef09ab4636fa90eb6a88018e8ec0468da466383 (patch) | |
| tree | 42b7a476731c426816efad3f57cf25b486462c0c | |
| parent | 5504e2c1320d52f8a92a33c90c313a47668979c0 (diff) | |
| parent | 7b8bae710e79f51b4286b9cf955c837d09f078f1 (diff) | |
| download | brew-6ef09ab4636fa90eb6a88018e8ec0468da466383.tar.bz2 | |
Merge pull request #776 from reitermarkus/refactoring
Cask Refactoring
| -rw-r--r-- | Library/.editorconfig | 12 | ||||
| -rw-r--r-- | Library/Homebrew/cask/.editorconfig | 9 | ||||
| -rw-r--r-- | Library/Homebrew/cask/.simplecov | 4 | ||||
| -rw-r--r-- | Library/Homebrew/cask/Gemfile | 4 | ||||
| -rw-r--r-- | Library/Homebrew/cask/Gemfile.lock | 54 | ||||
| -rw-r--r-- | Library/Homebrew/cask/Rakefile | 5 | ||||
| -rw-r--r-- | Library/Homebrew/cleanup.rb | 9 | ||||
| -rw-r--r-- | Library/Homebrew/cmd/man.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/manpages/brew-cask.1.md (renamed from Library/Homebrew/cask/doc/man_page/brew-cask.1.md) | 0 | ||||
| -rw-r--r-- | Library/Homebrew/readall.rb | 9 |
10 files changed, 34 insertions, 74 deletions
diff --git a/Library/.editorconfig b/Library/.editorconfig index bbd2c927c..439f7c93c 100644 --- a/Library/.editorconfig +++ b/Library/.editorconfig @@ -1,17 +1,17 @@ # http://editorconfig.org -[Homebrew/**.rb] + +root = true + +[*] charset = utf-8 end_of_line = lf indent_style = space indent_size = 2 insert_final_newline = true + +[{Homebrew/**.rb,.simplecov}] trim_trailing_whitespace = true [Taps/homebrew/**.rb] -charset = utf-8 -end_of_line = lf -indent_style = space -indent_size = 2 -insert_final_newline = true # trailing whitespace is crucial for patches trim_trailing_whitespace = false diff --git a/Library/Homebrew/cask/.editorconfig b/Library/Homebrew/cask/.editorconfig deleted file mode 100644 index c6c8b3621..000000000 --- a/Library/Homebrew/cask/.editorconfig +++ /dev/null @@ -1,9 +0,0 @@ -root = true - -[*] -indent_style = space -indent_size = 2 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true diff --git a/Library/Homebrew/cask/.simplecov b/Library/Homebrew/cask/.simplecov index f152ccc91..e1a2a4001 100644 --- a/Library/Homebrew/cask/.simplecov +++ b/Library/Homebrew/cask/.simplecov @@ -1,7 +1,5 @@ SimpleCov.start do - add_filter 'bin/' - add_filter 'Casks/' - add_filter 'developer/' + add_filter 'lib/vendor/' add_filter 'doc/' add_filter 'spec/' add_filter 'test/' diff --git a/Library/Homebrew/cask/Gemfile b/Library/Homebrew/cask/Gemfile index cc1771d11..c164a3f67 100644 --- a/Library/Homebrew/cask/Gemfile +++ b/Library/Homebrew/cask/Gemfile @@ -11,10 +11,6 @@ group :development do gem "rubocop-cask", "~> 0.8.3" end -group :release do - gem "ronn", "0.7.3" -end - group :test do gem "coveralls", require: false gem "minitest", "5.4.1" diff --git a/Library/Homebrew/cask/Gemfile.lock b/Library/Homebrew/cask/Gemfile.lock index 954938b17..b65784444 100644 --- a/Library/Homebrew/cask/Gemfile.lock +++ b/Library/Homebrew/cask/Gemfile.lock @@ -4,58 +4,40 @@ GEM ansi (1.5.0) ast (2.3.0) builder (3.2.2) - byebug (8.2.1) - coderay (1.1.0) - coveralls (0.8.10) - json (~> 1.8) - rest-client (>= 1.6.8, < 2) - simplecov (~> 0.11.0) + byebug (9.0.5) + coderay (1.1.1) + coveralls (0.8.15) + json (>= 1.8, < 3) + simplecov (~> 0.12.0) term-ansicolor (~> 1.3) thor (~> 0.19.1) - tins (~> 1.6.0) + tins (>= 1.6.0, < 2) diff-lcs (1.2.5) docile (1.1.5) - domain_name (0.5.25) - unf (>= 0.0.5, < 1.0.0) - hpricot (0.8.6) - http-cookie (1.0.2) - domain_name (~> 0.5) - json (1.8.3) + json (2.0.2) metaclass (0.0.4) method_source (0.8.2) - mime-types (2.99) minitest (5.4.1) - minitest-reporters (1.1.7) + minitest-reporters (1.1.11) ansi builder minitest (>= 5.0) ruby-progressbar mocha (1.1.0) metaclass (~> 0.0.1) - mustache (1.0.2) - netrc (0.11.0) parser (2.3.1.2) ast (~> 2.2) powerpack (0.1.1) - pry (0.10.3) + pry (0.10.4) coderay (~> 1.1.0) method_source (~> 0.8.1) slop (~> 3.4) - pry-byebug (3.3.0) - byebug (~> 8.0) + pry-byebug (3.4.0) + byebug (~> 9.0) pry (~> 0.10) public_suffix (2.0.2) rainbow (2.1.0) rake (10.4.2) - rdiscount (2.1.8) - rest-client (1.8.0) - http-cookie (>= 1.0.2, < 2.0) - mime-types (>= 1.16, < 3.0) - netrc (~> 0.7) - ronn (0.7.3) - hpricot (>= 0.8.2) - mustache (>= 0.7.0) - rdiscount (>= 1.5.8) rspec (3.0.0) rspec-core (~> 3.0.0) rspec-expectations (~> 3.0.0) @@ -71,8 +53,8 @@ GEM rspec-mocks (3.0.4) rspec-support (~> 3.0.0) rspec-support (3.0.4) - rspec-wait (0.0.8) - rspec (>= 2.11, < 3.5) + rspec-wait (0.0.9) + rspec (>= 3, < 4) rubocop (0.41.2) parser (>= 2.3.1.1, < 3.0) powerpack (~> 0.1) @@ -83,19 +65,16 @@ GEM public_suffix (~> 2.0) rubocop (~> 0.41.1) ruby-progressbar (1.8.1) - simplecov (0.11.1) + simplecov (0.12.0) docile (~> 1.1.0) - json (~> 1.8) + json (>= 1.8, < 3) simplecov-html (~> 0.10.0) simplecov-html (0.10.0) slop (3.6.0) term-ansicolor (1.3.2) tins (~> 1.0) thor (0.19.1) - tins (1.6.0) - unf (0.1.4) - unf_ext - unf_ext (0.0.7.1) + tins (1.12.0) unicode-display_width (1.1.0) PLATFORMS @@ -109,7 +88,6 @@ DEPENDENCIES pry pry-byebug rake - ronn (= 0.7.3) rspec (~> 3.0.0) rspec-its rspec-wait diff --git a/Library/Homebrew/cask/Rakefile b/Library/Homebrew/cask/Rakefile index 6c638ff49..6a6f76e6f 100644 --- a/Library/Homebrew/cask/Rakefile +++ b/Library/Homebrew/cask/Rakefile @@ -44,8 +44,3 @@ task :console do ARGV.clear Hbc.pry end - -desc "Generate man page from Markdown source" -task :man do - sh "brew man" -end diff --git a/Library/Homebrew/cleanup.rb b/Library/Homebrew/cleanup.rb index 96689be11..41c4bbf34 100644 --- a/Library/Homebrew/cleanup.rb +++ b/Library/Homebrew/cleanup.rb @@ -121,11 +121,12 @@ module Homebrew map { |p| HOMEBREW_PREFIX/p }.each { |p| paths << p if p.exist? } workers = (0...Hardware::CPU.cores).map do Thread.new do - begin - while p = paths.pop(true) - quiet_system "find", p, "-name", ".DS_Store", "-delete" + Kernel.loop do + begin + quiet_system "find", paths.deq(true), "-name", ".DS_Store", "-delete" + rescue ThreadError + break # if queue is empty end - rescue ThreadError # ignore empty queue error end end end diff --git a/Library/Homebrew/cmd/man.rb b/Library/Homebrew/cmd/man.rb index 536b27984..0191d76c7 100644 --- a/Library/Homebrew/cmd/man.rb +++ b/Library/Homebrew/cmd/man.rb @@ -38,7 +38,7 @@ module Homebrew convert_man_page(markup, TARGET_DOC_PATH/"brew.1.html") convert_man_page(markup, TARGET_MAN_PATH/"brew.1") - cask_markup = (HOMEBREW_LIBRARY/"Homebrew/cask/doc/man_page/brew-cask.1.md").read + cask_markup = (HOMEBREW_LIBRARY/"Homebrew/manpages/brew-cask.1.md").read convert_man_page(cask_markup, TARGET_MAN_PATH/"brew-cask.1") end diff --git a/Library/Homebrew/cask/doc/man_page/brew-cask.1.md b/Library/Homebrew/manpages/brew-cask.1.md index fc14d54d1..fc14d54d1 100644 --- a/Library/Homebrew/cask/doc/man_page/brew-cask.1.md +++ b/Library/Homebrew/manpages/brew-cask.1.md diff --git a/Library/Homebrew/readall.rb b/Library/Homebrew/readall.rb index 4d09226f5..61222e015 100644 --- a/Library/Homebrew/readall.rb +++ b/Library/Homebrew/readall.rb @@ -11,12 +11,13 @@ module Readall failed = false workers = (0...Hardware::CPU.cores).map do Thread.new do - begin - while rb = ruby_files_queue.pop(true) + Kernel.loop do + begin # As a side effect, print syntax errors/warnings to `$stderr`. - failed = true if syntax_errors_or_warnings?(rb) + failed = true if syntax_errors_or_warnings?(ruby_files_queue.deq(true)) + rescue ThreadError + break end - rescue ThreadError # ignore empty queue error end end end |
