Skip to content

Commit

Permalink
Update deps, remove support for Ruby 2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
noteflakes committed Feb 19, 2024
1 parent 275d7a9 commit 6774521
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
ruby: ['3.0', 3.1, 3.2]
ruby: ['3.0', 3.1, 3.2, 3.3, head]

name: >-
${{matrix.os}}, ${{matrix.ruby}}
Expand Down
8 changes: 4 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ PATH
escape_utils (~> 1.3.0)
kramdown (~> 2.4.0)
kramdown-parser-gfm (~> 1.1.0)
rouge (~> 4.1.3)
rouge (~> 4.2.0)

GEM
remote: https://rubygems.org/
Expand All @@ -17,9 +17,9 @@ GEM
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
minitest (5.19.0)
minitest (5.22.2)
rexml (3.2.6)
rouge (4.1.3)
rouge (4.2.0)
tilt (2.2.0)

PLATFORMS
Expand All @@ -30,7 +30,7 @@ PLATFORMS
DEPENDENCIES
benchmark-ips (~> 2.7.2)
erubis (~> 2.7.0)
minitest (~> 5.19)
minitest (~> 5.22.0)
papercraft!
tilt (~> 2.2.0)

Expand Down
20 changes: 15 additions & 5 deletions examples/perf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
require 'erb'
require 'benchmark/ips'
require 'tilt'
require 'escape_utils'
require 'cgi'

App = Papercraft.html { |title:|
html5 {
Expand Down Expand Up @@ -36,7 +36,7 @@
}
}

HTML_APP = <<~HTML
HTML_APP_ERUBIS = <<~HTML
<!DOCTYPE html>
<html>
<body>
Expand All @@ -46,9 +46,19 @@
</html>
HTML

HTML_APP_ERB = <<~HTML
<!DOCTYPE html>
<html>
<body>
<%= render_erb_header(title: 'MyApp') %>
<%= render_erb_content %>
</body>
</html>
HTML

HTML_HEADER = <<~HTML
<header>
<h2 id="title"><%= EscapeUtils.escape_html(title) %></h2>
<h2 id="title"><%= CGI.escapeHTML(title) %></h2>
<button>1</button>
<button>2</button>
</header>
Expand All @@ -69,7 +79,7 @@

class Renderer
def render_erubis_app
@erubis_app ||= Tilt::ErubisTemplate.new { HTML_APP }
@erubis_app ||= Tilt::ErubisTemplate.new { HTML_APP_ERUBIS }
@erubis_app.render(self)
end

Expand All @@ -84,7 +94,7 @@ def render_erubis_content
end

def render_erb_app
@erb_app ||= Tilt::ERBTemplate.new { HTML_APP }
@erb_app ||= Tilt::ERBTemplate.new { HTML_APP_ERB }
@erb_app.render(self)
end

Expand Down
6 changes: 3 additions & 3 deletions papercraft.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ Gem::Specification.new do |s|
s.rdoc_options = ["--title", "Papercraft", "--main", "README.md"]
s.extra_rdoc_files = ["README.md", "papercraft.png"]
s.require_paths = ["lib"]
s.required_ruby_version = '>= 2.7'
s.required_ruby_version = '>= 3.0'

s.add_runtime_dependency 'escape_utils', '~>1.3.0'
s.add_runtime_dependency 'kramdown', '~>2.4.0'
s.add_runtime_dependency 'rouge', '~>4.1.3'
s.add_runtime_dependency 'rouge', '~>4.2.0'
s.add_runtime_dependency 'kramdown-parser-gfm', '~>1.1.0'

s.add_development_dependency 'minitest', '~>5.19'
s.add_development_dependency 'minitest', '~>5.22.0'
s.add_development_dependency 'benchmark-ips', '~>2.7.2'
s.add_development_dependency 'erubis', '~>2.7.0'
s.add_development_dependency 'tilt', '~>2.2.0'
Expand Down

0 comments on commit 6774521

Please sign in to comment.