Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.4'
bundler-cache: true
- name: Build and test
run: |
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/.bundle/
/.yardoc
/Gemfile.lock
/_yardoc/
/coverage/
/doc/
Expand Down
1 change: 0 additions & 1 deletion .ruby-version

This file was deleted.

74 changes: 74 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
PATH
remote: .
specs:
rich-text (0.6.0)
activesupport (~> 8.0)
diff-lcs (~> 1.5)
nokogiri (~> 1.16)

GEM
remote: https://rubygems.org/
specs:
activesupport (8.0.1)
base64
benchmark (>= 0.3)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
logger (>= 1.4.2)
minitest (>= 5.1)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
uri (>= 0.13.1)
base64 (0.2.0)
benchmark (0.4.0)
bigdecimal (3.1.9)
concurrent-ruby (1.3.5)
connection_pool (2.5.0)
diff-lcs (1.5.1)
drb (2.2.1)
i18n (1.14.7)
concurrent-ruby (~> 1.0)
logger (1.6.5)
mini_portile2 (2.8.8)
minitest (5.25.4)
nokogiri (1.18.2)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nokogiri (1.18.2-aarch64-linux-gnu)
racc (~> 1.4)
nokogiri (1.18.2-arm-linux-gnu)
racc (~> 1.4)
nokogiri (1.18.2-arm64-darwin)
racc (~> 1.4)
nokogiri (1.18.2-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.18.2-x86_64-linux-gnu)
racc (~> 1.4)
racc (1.8.1)
rake (13.2.1)
securerandom (0.4.1)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
uri (1.0.2)
yard (0.9.37)

PLATFORMS
aarch64-linux
arm-linux
arm64-darwin
x86-linux
x86_64-darwin
x86_64-linux

DEPENDENCIES
bundler (~> 2.5)
minitest (~> 5.22)
rake (~> 13.1)
rich-text!
yard (~> 0.9)

BUNDLED WITH
2.6.3
5 changes: 4 additions & 1 deletion lib/rich-text/op.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,10 @@ def to_json(*args)
# RichText::Op.new(:insert, 'abc', { bold: true }).inspect(false) => 'insert="abc" {:bold=>true}'
def inspect(wrap = true)
str = "#{type}=#{value.inspect}"
str << " #{attributes.inspect}" if attributes?
if attributes?
formatted_attrs = attributes.map { |k,v| "#{k.inspect}=>#{v.inspect}" }.join(', ')
str << " {#{formatted_attrs}}"
end
wrap ? "#<#{self.class.name} #{str}>" : str
end

Expand Down
2 changes: 1 addition & 1 deletion rich-text.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
spec.require_paths = ['lib']

spec.required_ruby_version = '~> 3.3.6'
spec.required_ruby_version = '~> 3.4.1'

spec.add_dependency 'activesupport', '~> 8.0'
spec.add_dependency 'diff-lcs', '~> 1.5'
Expand Down
Loading