Skip to content

Commit 66f3cb0

Browse files
Merge branch 'master' into hash-formats
2 parents 3286d74 + 4c8dc64 commit 66f3cb0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+974
-429
lines changed

.github/workflows/lint.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
name: Lints
22

33
on:
4+
merge_group:
45
pull_request:
56
push:
67
branches:
78
- master
89

910
jobs:
10-
build:
11+
lint:
1112

1213
runs-on: ubuntu-latest
1314

1415
steps:
15-
- uses: actions/checkout@v2
16+
- uses: actions/checkout@v3
1617
- uses: ruby/setup-ruby@v1
1718
with:
18-
ruby-version: 3.0
19+
ruby-version: 3.1
1920
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
2021
- name: Lint files with Rubocop
2122
run: |

.github/workflows/rspec.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Specs
22

33
on:
4+
merge_group:
45
pull_request:
56
push:
67
branches:
@@ -18,12 +19,15 @@ jobs:
1819
- "2.6"
1920
- "2.7"
2021
- "3.0"
22+
- "3.1"
23+
- "3.2"
24+
- "3.3"
2125
- "head"
22-
- "jruby"
26+
- "jruby-9.3"
2327
runs-on: ${{ matrix.os }}-latest
2428
continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'debug' }}
2529
steps:
26-
- uses: actions/checkout@v2
30+
- uses: actions/checkout@v3
2731
- name: Set up Ruby ${{ matrix.ruby }}
2832
uses: ruby/setup-ruby@v1
2933
with:
@@ -32,7 +36,6 @@ jobs:
3236
run: |
3337
sudo apt-get update
3438
sudo apt-get -y install libsqlite3-dev
35-
gem install bundler
3639
bundle install --retry 3
3740
- name: Test with all appraisals
3841
if : ${{ matrix.ruby != 'head' }}

.rubocop.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,6 @@ Style/HashTransformValues:
2929
Style/StringLiterals:
3030
Exclude:
3131
- gemfiles/*
32+
33+
Style/FetchEnvVar:
34+
Enabled: false

.rubocop_todo.yml

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2021-09-12 22:42:23 UTC using RuboCop version 1.20.0.
3+
# on 2021-12-27 20:50:12 UTC using RuboCop version 1.24.0.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
77
# versions of RuboCop, may require this file to be generated again.
88

9+
# Offense count: 1
10+
# Cop supports --auto-correct.
11+
# Configuration parameters: Include.
12+
# Include: **/*.gemspec
13+
Gemspec/RequireMFA:
14+
Exclude:
15+
- 'amazing_print.gemspec'
16+
917
# Offense count: 4
1018
# Configuration parameters: IgnoredMethods.
1119
Lint/AmbiguousBlockAssociation:
@@ -111,6 +119,11 @@ RSpec/BeforeAfterAll:
111119
# Configuration parameters: IgnoredMetadata.
112120
RSpec/DescribeClass:
113121
Exclude:
122+
- '**/spec/features/**/*'
123+
- '**/spec/requests/**/*'
124+
- '**/spec/routing/**/*'
125+
- '**/spec/system/**/*'
126+
- '**/spec/views/**/*'
114127
- 'spec/core_ext/logger_spec.rb'
115128
- 'spec/core_ext/string_spec.rb'
116129
- 'spec/ext/action_view_spec.rb'
@@ -174,7 +187,7 @@ RSpec/MultipleDescribes:
174187

175188
# Offense count: 43
176189
RSpec/MultipleExpectations:
177-
Max: 20
190+
Max: 21
178191

179192
# Offense count: 1
180193
RSpec/NestedGroups:
@@ -221,14 +234,30 @@ Style/DocumentDynamicEvalDefinition:
221234
Exclude:
222235
- 'lib/amazing_print/core_ext/awesome_method_array.rb'
223236

224-
# Offense count: 27
237+
# Offense count: 28
225238
# Configuration parameters: AllowedConstants.
226239
Style/Documentation:
227240
Enabled: false
228241

242+
# Offense count: 1
243+
# Cop supports --auto-correct.
244+
# Configuration parameters: EnforcedStyle.
245+
# SupportedStyles: always, always_true, never
246+
Style/FrozenStringLiteralComment:
247+
Exclude:
248+
- 'gemfiles/*'
249+
- 'object_example.rb'
250+
251+
# Offense count: 5
252+
Style/OpenStructUse:
253+
Exclude:
254+
- 'lib/amazing_print.rb'
255+
- 'lib/amazing_print/ext/ostruct.rb'
256+
- 'spec/ext/ostruct_spec.rb'
257+
229258
# Offense count: 16
230259
# Cop supports --auto-correct.
231-
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
260+
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
232261
# URISchemes: http, https
233262
Layout/LineLength:
234263
Max: 216

Appraisals

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,22 @@ if RUBY_VERSION < '3'
3737
end
3838
end
3939

40+
if RUBY_VERSION >= '2.7'
41+
appraise 'rails-7.0' do
42+
gem 'activerecord-jdbcsqlite3-adapter', '~> 70.0', platform: :jruby
43+
gem 'rails', '~> 7.0.0'
44+
gem 'sqlite3', platform: :mri
45+
end
46+
47+
appraise 'mongoid-7.0' do
48+
gem 'mongoid', '~> 7.0.0'
49+
end
50+
51+
appraise 'mongoid-8.0' do
52+
gem 'mongoid', '~> 8.0.0'
53+
end
54+
end
55+
4056
appraise 'rails-6.1' do
4157
gem 'activerecord-jdbcsqlite3-adapter', '~> 61.0', platform: :jruby
4258
gem 'rails', '~> 6.1.0'

CHANGELOG.md

Lines changed: 56 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,75 @@
1+
# CHANGELOG
2+
13
## Unreleased
24

5+
## V1.6.0
6+
7+
- Use pager with Pry #96
8+
- Add Rails 7 appraisal #98
9+
- Allow Hash keys to be colorized #99
10+
- Use CI merge queue #104
11+
- Add support for Ruby 3.3 #105
12+
- Add Mongoid field aliases #106
13+
- Add bigdecimal gem #109
14+
- Add ExtLoader to help with require order issues #110
15+
16+
## v1.5.0
17+
18+
- Drop support for Ruby 2.3 and 2.4 as well as JRuby 9.1
19+
- Add File/Dir formatters for mswin platform #48
20+
- Don't monkey patch String class #91
21+
- Fix ruby19 hash syntax so it can be copy-pasted #94
22+
323
## v1.4.0
4-
- Support loading config from `$XDG_CONFIG_HOME/aprc` - #63
5-
- Remove support for Rails 5.1 #75
6-
- Update AR specs for Ruby 2.6.7 #76
7-
- Load .aprc configs only once. #74
8-
- Add XDG config support #77
9-
- Rubocop updates #79
10-
- Update Irb integration for v1.2.6+ #81
24+
25+
- Support loading config from `$XDG_CONFIG_HOME/aprc` - #63
26+
- Remove support for Rails 5.1 #75
27+
- Update AR specs for Ruby 2.6.7 #76
28+
- Load .aprc configs only once. #74
29+
- Add XDG config support #77
30+
- Rubocop updates #79
31+
- Update Irb integration for v1.2.6+ #81
1132

1233
## v1.3.0
13-
- Fix HTML escaping problems #53
14-
- Update test suite for Ruby 2.7.2 and JRuby #61
15-
- Add ActionView spec for html_safe #65
16-
- Add support for Rails 6.1 #68
17-
- Update specs for Ruby 3.0 #69
34+
35+
- Fix HTML escaping problems #53
36+
- Update test suite for Ruby 2.7.2 and JRuby #61
37+
- Add ActionView spec for html_safe #65
38+
- Add support for Rails 6.1 #68
39+
- Update specs for Ruby 3.0 #69
1840

1941
## v1.2.2
20-
- Support Ruby 3.0 / IRB 1.2.6 - #57
21-
- Fix FrozenError - #51
22-
- Drop support for Ruby 2.3 and 2.4 as well as JRuby 9.1 - #46
23-
- Add passing of `options` to `Logger#ap` - #55
42+
43+
- Support Ruby 3.0 / IRB 1.2.6 - #57
44+
- Fix FrozenError - #51
45+
- Drop support for Ruby 2.3 and 2.4 as well as JRuby 9.1 - #46
46+
- Add passing of `options` to `Logger#ap` - #55
2447

2548
## v1.2.1
26-
- Correctly print active_model_errors for models that don't have tables - #42 by sahglie
27-
- Update AmazingPrint::MongoMapper for frozen strings - #44
2849

29-
## v1.2.0
50+
- Correctly print active_model_errors for models that don't have tables - #42 by sahglie
51+
- Update AmazingPrint::MongoMapper for frozen strings - #44
3052

31-
- Fix frozen string literal issue with ActiveRecord
32-
- Add uncolor String method to remove ANSI color codes - #30 by duffyjp
33-
- Restore original copyright - #33 by amarshall
34-
- Remove method core extension since it is not needed since ruby 1.9 - #37 by grosser
35-
- Remove pale and black string color aliases - #38
36-
- Fix formatting ActionController::Parameters - #29
53+
## v1.2.0
3754

55+
- Fix frozen string literal issue with ActiveRecord
56+
- Add uncolor String method to remove ANSI color codes - #30 by duffyjp
57+
- Restore original copyright - #33 by amarshall
58+
- Remove method core extension since it is not needed since ruby 1.9 - #37 by grosser
59+
- Remove pale and black string color aliases - #38
60+
- Fix formatting ActionController::Parameters - #29
3861

3962
## v1.1.0
40-
- Print out method keyword arguments
41-
- Fix NoMethodError with Sequel
42-
- Code cleanups
4363

44-
Thanks for the great contributions from:
45-
46-
- andydna
47-
- beanieboi
64+
- Print out method keyword arguments
65+
- Fix NoMethodError with Sequel
66+
- Code cleanups
4867

68+
Thanks for the great contributions from:
4969

70+
- andydna
71+
- beanieboi
5072

5173
## v1.0.0
52-
- Initial Release.
74+
75+
- Initial Release.

Gemfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,15 @@ source 'https://rubygems.org'
44

55
# Specify your gem's dependencies in amazing_print.gemspec
66
gemspec
7+
8+
# Development dependencies
9+
# Update this once https://github.com/thoughtbot/appraisal/pull/202 is released
10+
gem 'appraisal', git: 'https://github.com/thoughtbot/appraisal.git', branch: :main
11+
12+
gem 'bigdecimal'
13+
gem 'fakefs', '~> 1.2'
14+
gem 'nokogiri', '~> 1.10'
15+
gem 'pry'
16+
gem 'rspec', '~> 3.9'
17+
gem 'rubocop', '~> 1.20'
18+
gem 'rubocop-rspec', '~> 2.4'

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@
33
[![RubyGems][gem_version_badge]][ruby_gems]
44
[![RubyGems][gem_downloads_badge]][ruby_gems]
55
|
6-
[![Travis CI][travis_ci_badge]][travis_ci]
76
![Specs](https://github.com/amazing-print/amazing_print/workflows/Specs/badge.svg)
8-
![Lint](https://github.com/amazing-print/amazing_print/workflows/Lint/badge.svg)
7+
![Lint](https://github.com/amazing-print/amazing_print/workflows/Lints/badge.svg)
98
|
109
[![Gitter](https://badges.gitter.im/amazing-print/community.svg)](https://gitter.im/amazing-print/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
1110

@@ -316,11 +315,11 @@ formatting:
316315

317316
<%= ap @accounts.first, :html => true %>
318317

319-
### String Convenience Methods ###
318+
### Colorizing Strings ###
320319
Use methods such as `.red` to set string color:
321320

322321
```ruby
323-
irb> puts "red text".red
322+
irb> puts AmazingPrint::Colors.red("red text")
324323
red text # (it's red)
325324
```
326325

amazing_print.gemspec

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,6 @@ Gem::Specification.new do |s|
2222
s.license = 'MIT'
2323

2424
s.files = Dir['[A-Z]*[^~]'] + Dir['lib/**/*.rb'] + Dir['spec/**/*'] + ['.gitignore']
25-
s.test_files = Dir['spec/**/*']
2625
s.executables = []
2726
s.require_paths = ['lib']
28-
29-
s.add_development_dependency 'appraisal', '~> 2.3'
30-
s.add_development_dependency 'fakefs', '~> 1.2'
31-
s.add_development_dependency 'nokogiri', '~> 1.10'
32-
s.add_development_dependency 'pry'
33-
s.add_development_dependency 'rspec', '~> 3.9'
34-
s.add_development_dependency 'rubocop', '~> 1.20'
35-
s.add_development_dependency 'rubocop-rspec', '~> 2.4'
3627
end

gemfiles/rails_6.1.gemfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@
33
source "https://rubygems.org"
44

55
gem "activerecord-jdbcsqlite3-adapter", "~> 61.0", platform: :jruby
6+
gem "appraisal", git: "https://github.com/thoughtbot/appraisal.git", branch: :main
7+
gem "fakefs", "~> 1.2"
8+
gem "nokogiri", "~> 1.10"
9+
gem "pry"
610
gem "rails", "~> 6.1.0"
11+
gem "rspec", "~> 3.9"
12+
gem "rubocop", "~> 1.20"
13+
gem "rubocop-rspec", "~> 2.4"
714
gem "sqlite3", platform: :mri
815

916
gemspec path: "../"

0 commit comments

Comments
 (0)