Skip to content

Commit

Permalink
Merge branch 'master' into hash-key-colors
Browse files Browse the repository at this point in the history
  • Loading branch information
paddor authored Jan 9, 2024
2 parents 2df42b6 + cbbf6d5 commit 0c2a8ad
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 11 deletions.
1 change: 1 addition & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Lints

on:
merge_group:
pull_request:
push:
branches:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/rspec.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Specs

on:
merge_group:
pull_request:
push:
branches:
Expand All @@ -20,6 +21,7 @@ jobs:
- "3.0"
- "3.1"
- "3.2"
- "3.3"
- "head"
- "jruby-9.3"
runs-on: ${{ matrix.os }}-latest
Expand Down
7 changes: 7 additions & 0 deletions gemfiles/rails_6.1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@
source "https://rubygems.org"

gem "activerecord-jdbcsqlite3-adapter", "~> 61.0", platform: :jruby
gem "appraisal", git: "https://github.com/thoughtbot/appraisal.git", branch: :main
gem "fakefs", "~> 1.2"
gem "nokogiri", "~> 1.10"
gem "pry"
gem "rails", "~> 6.1.0"
gem "rspec", "~> 3.9"
gem "rubocop", "~> 1.20"
gem "rubocop-rspec", "~> 2.4"
gem "sqlite3", platform: :mri

gemspec path: "../"
7 changes: 7 additions & 0 deletions gemfiles/rails_7.0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@
source "https://rubygems.org"

gem "activerecord-jdbcsqlite3-adapter", "~> 70.0", platform: :jruby
gem "appraisal", git: "https://github.com/thoughtbot/appraisal.git", branch: :main
gem "fakefs", "~> 1.2"
gem "nokogiri", "~> 1.10"
gem "pry"
gem "rails", "~> 7.0.0"
gem "rspec", "~> 3.9"
gem "rubocop", "~> 1.20"
gem "rubocop-rspec", "~> 2.4"
gem "sqlite3", platform: :mri

gemspec path: "../"
7 changes: 7 additions & 0 deletions gemfiles/sequel_5.0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,14 @@

source "https://rubygems.org"

gem "appraisal", git: "https://github.com/thoughtbot/appraisal.git", branch: :main
gem "fakefs", "~> 1.2"
gem "jdbc-sqlite3", platform: :jruby
gem "nokogiri", "~> 1.10"
gem "pry"
gem "rspec", "~> 3.9"
gem "rubocop", "~> 1.20"
gem "rubocop-rspec", "~> 2.4"
gem "sequel", "~> 5.0"
gem "sqlite3", platform: :mri

Expand Down
2 changes: 1 addition & 1 deletion lib/amazing_print/core_ext/awesome_method_array.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def grep(pattern, &blk)
super(pattern)
end
arr.instance_variable_set(:@__awesome_methods__, instance_variable_get(:@__awesome_methods__))
arr.select! { |item| (item.is_a?(Symbol) || item.is_a?(String)) } # grep block might return crap.
arr.select! { |item| item.is_a?(Symbol) || item.is_a?(String) } # grep block might return crap.
arr
end
end
4 changes: 2 additions & 2 deletions spec/ext/nokogiri_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
it 'colorizes tags' do
xml = Nokogiri::XML('<html><body><h1></h1></body></html>')
# FIXME: Due to something strange with Nokogiri and JRuby, we need to remove extra blank lines.
output = xml.ai.gsub(/\n\n/, "\n")
output = xml.ai.gsub("\n\n", "\n")
expect(output).to eq <<~EOS
<?xml version="1.0"?>\e[1;32m
\e[0m<\e[1;36mhtml\e[0m>\e[1;32m
Expand All @@ -32,7 +32,7 @@
it 'colorizes class and id' do
xml = Nokogiri::XML('<html><body><h1><span class="world" id="hello"></span></h1></body></html>')
# FIXME: Due to something strange with Nokogiri and JRuby, we need to remove extra blank lines.
output = xml.ai.gsub(/\n\n/, "\n")
output = xml.ai.gsub("\n\n", "\n")
expect(output).to eq <<~EOS
<?xml version="1.0"?>\e[1;32m
\e[0m<\e[1;36mhtml\e[0m>\e[1;32m
Expand Down
16 changes: 8 additions & 8 deletions spec/formats_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -502,13 +502,13 @@

#------------------------------------------------------------------------------
describe 'File' do
it 'displays a file (plain)', unix: true do
it 'displays a file (plain)', :unix do
File.open(__FILE__, 'r') do |f|
expect(f.ai(plain: true)).to eq("#{f.inspect}\n" + `ls -alF #{f.path}`.chop)
end
end

it 'displays a file (plain) akin to powershell Get-ChildItem', mswin: true do
it 'displays a file (plain) akin to powershell Get-ChildItem', :mswin do
File.open(__FILE__, 'r') do |f|
expect(f.ai(plain: true)).to eq("#{f.inspect}\n" + AmazingPrint::Formatters::GetChildItem.new(f.path).to_s)
end
Expand All @@ -517,13 +517,13 @@

#------------------------------------------------------------------------------
describe 'Dir' do
it 'displays a direcory (plain)', unix: true do
it 'displays a direcory (plain)', :unix do
Dir.open(File.dirname(__FILE__)) do |d|
expect(d.ai(plain: true)).to eq("#{d.inspect}\n" + `ls -alF #{d.path}`.chop)
end
end

it 'displays a directory (plain) akin to powershell Get-ChildItem', mswin: true do
it 'displays a directory (plain) akin to powershell Get-ChildItem', :mswin do
Dir.open(File.dirname(__FILE__)) do |d|
expect(d.ai(plain: true)).to eq("#{d.inspect}\n" + AmazingPrint::Formatters::GetChildItem.new(d.path).to_s)
end
Expand Down Expand Up @@ -687,7 +687,7 @@ class My < Hash; end
EOS
end

it 'inherited from File should be displayed as File', unix: true do
it 'inherited from File should be displayed as File', :unix do
class My < File; end

my = begin
Expand All @@ -698,21 +698,21 @@ class My < File; end
expect(my.ai(plain: true)).to eq("#{my.inspect}\n" + `ls -alF #{my.path}`.chop)
end

it 'inherited from File should be displayed as File', mswin: true do
it 'inherited from File should be displayed as File', :mswin do
class My < File; end
my = My.new('nul') # it's /dev/null in Windows
expect(my.ai(plain: true)).to eq("#{my.inspect}\n" + AmazingPrint::Formatters::GetChildItem.new(my.path).to_s)
end

it 'inherited from Dir should be displayed as Dir', unix: true do
it 'inherited from Dir should be displayed as Dir', :unix do
class My < Dir; end

require 'tmpdir'
my = My.new(Dir.tmpdir)
expect(my.ai(plain: true)).to eq("#{my.inspect}\n" + `ls -alF #{my.path}`.chop)
end

it 'inherited from Dir are displayed as Dir', mswin: true do
it 'inherited from Dir are displayed as Dir', :mswin do
class My < Dir; end

require 'tmpdir'
Expand Down

0 comments on commit 0c2a8ad

Please sign in to comment.