Skip to content

Commit

Permalink
Removed Literal in favour of Dry::Initializer and Dry::Types
Browse files Browse the repository at this point in the history
  • Loading branch information
joelmoss committed Jun 3, 2024
1 parent 4a54d26 commit 6303e3e
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 94 deletions.
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ group :development do

# Playground
gem 'htmlbeautifier'
gem 'literal', github: 'joeldrapper/literal'
gem 'phlexible'
gem 'rouge'
end
Expand Down
175 changes: 84 additions & 91 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
GIT
remote: https://github.com/joeldrapper/literal.git
revision: 561119cc461535f41d8c58c27960d08807c97855
specs:
literal (0.1.0)
concurrent-ruby (~> 1.2)
zeitwerk (~> 2.6)

PATH
remote: .
specs:
Expand Down Expand Up @@ -46,71 +38,71 @@ PATH
GEM
remote: https://rubygems.org/
specs:
actioncable (7.1.3.2)
actionpack (= 7.1.3.2)
activesupport (= 7.1.3.2)
actioncable (7.1.3.3)
actionpack (= 7.1.3.3)
activesupport (= 7.1.3.3)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
zeitwerk (~> 2.6)
actionmailbox (7.1.3.2)
actionpack (= 7.1.3.2)
activejob (= 7.1.3.2)
activerecord (= 7.1.3.2)
activestorage (= 7.1.3.2)
activesupport (= 7.1.3.2)
actionmailbox (7.1.3.3)
actionpack (= 7.1.3.3)
activejob (= 7.1.3.3)
activerecord (= 7.1.3.3)
activestorage (= 7.1.3.3)
activesupport (= 7.1.3.3)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.1.3.2)
actionpack (= 7.1.3.2)
actionview (= 7.1.3.2)
activejob (= 7.1.3.2)
activesupport (= 7.1.3.2)
actionmailer (7.1.3.3)
actionpack (= 7.1.3.3)
actionview (= 7.1.3.3)
activejob (= 7.1.3.3)
activesupport (= 7.1.3.3)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.2)
actionpack (7.1.3.2)
actionview (= 7.1.3.2)
activesupport (= 7.1.3.2)
actionpack (7.1.3.3)
actionview (= 7.1.3.3)
activesupport (= 7.1.3.3)
nokogiri (>= 1.8.5)
racc
rack (>= 2.2.4)
rack-session (>= 1.0.1)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
actiontext (7.1.3.2)
actionpack (= 7.1.3.2)
activerecord (= 7.1.3.2)
activestorage (= 7.1.3.2)
activesupport (= 7.1.3.2)
actiontext (7.1.3.3)
actionpack (= 7.1.3.3)
activerecord (= 7.1.3.3)
activestorage (= 7.1.3.3)
activesupport (= 7.1.3.3)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.1.3.2)
activesupport (= 7.1.3.2)
actionview (7.1.3.3)
activesupport (= 7.1.3.3)
builder (~> 3.1)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
activejob (7.1.3.2)
activesupport (= 7.1.3.2)
activejob (7.1.3.3)
activesupport (= 7.1.3.3)
globalid (>= 0.3.6)
activemodel (7.1.3.2)
activesupport (= 7.1.3.2)
activerecord (7.1.3.2)
activemodel (= 7.1.3.2)
activesupport (= 7.1.3.2)
activemodel (7.1.3.3)
activesupport (= 7.1.3.3)
activerecord (7.1.3.3)
activemodel (= 7.1.3.3)
activesupport (= 7.1.3.3)
timeout (>= 0.4.0)
activestorage (7.1.3.2)
actionpack (= 7.1.3.2)
activejob (= 7.1.3.2)
activerecord (= 7.1.3.2)
activesupport (= 7.1.3.2)
activestorage (7.1.3.3)
actionpack (= 7.1.3.3)
activejob (= 7.1.3.3)
activerecord (= 7.1.3.3)
activesupport (= 7.1.3.3)
marcel (~> 1.0)
activesupport (7.1.3.2)
activesupport (7.1.3.3)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
Expand All @@ -125,7 +117,7 @@ GEM
ast (2.4.2)
base64 (0.2.0)
benchmark-ips (2.13.0)
bigdecimal (3.1.7)
bigdecimal (3.1.8)
bindex (0.8.1)
builder (3.2.4)
capybara (3.40.0)
Expand All @@ -137,7 +129,7 @@ GEM
rack-test (>= 0.6.3)
regexp_parser (>= 1.5, < 3.0)
xpath (~> 3.2)
concurrent-ruby (1.2.3)
concurrent-ruby (1.3.1)
connection_pool (2.4.1)
crass (1.0.6)
cuprite (0.15)
Expand Down Expand Up @@ -176,11 +168,11 @@ GEM
globalid (1.2.1)
activesupport (>= 6.1)
htmlbeautifier (1.4.3)
i18n (1.14.4)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
io-console (0.7.2)
irb (1.12.0)
rdoc
irb (1.13.1)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
json (2.7.2)
language_server-protocol (3.17.0.3)
Expand All @@ -194,11 +186,11 @@ GEM
net-smtp
marcel (1.0.4)
matrix (0.4.2)
method_source (1.0.0)
method_source (1.1.0)
mini_mime (1.1.5)
minitest (5.22.3)
minitest (5.23.1)
mutex_m (0.2.0)
net-imap (0.4.10)
net-imap (0.4.12)
date
net-protocol
net-pop (0.1.2)
Expand All @@ -207,19 +199,19 @@ GEM
timeout
net-smtp (0.5.0)
net-protocol
nio4r (2.7.1)
nokogiri (1.16.4-arm64-darwin)
nio4r (2.7.3)
nokogiri (1.16.5-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.4-x86_64-linux)
nokogiri (1.16.5-x86_64-linux)
racc (~> 1.4)
oj (3.16.3)
bigdecimal (>= 3.0)
paco (0.2.3)
parallel (1.24.0)
parser (3.3.0.5)
parser (3.3.2.0)
ast (~> 2.4.1)
racc
phlex (1.10.0)
phlex (1.10.3)
phlex-rails (1.2.1)
phlex (~> 1.10.0)
railties (>= 6.1, < 8)
Expand All @@ -234,55 +226,56 @@ GEM
public_suffix (5.0.5)
puma (6.4.2)
nio4r (~> 2.0)
racc (1.7.3)
rack (3.0.10)
racc (1.8.0)
rack (3.0.11)
rack-session (2.0.0)
rack (>= 3.0.0)
rack-test (2.1.0)
rack (>= 1.3)
rackup (2.1.0)
rack (>= 3)
webrick (~> 1.8)
rails (7.1.3.2)
actioncable (= 7.1.3.2)
actionmailbox (= 7.1.3.2)
actionmailer (= 7.1.3.2)
actionpack (= 7.1.3.2)
actiontext (= 7.1.3.2)
actionview (= 7.1.3.2)
activejob (= 7.1.3.2)
activemodel (= 7.1.3.2)
activerecord (= 7.1.3.2)
activestorage (= 7.1.3.2)
activesupport (= 7.1.3.2)
rails (7.1.3.3)
actioncable (= 7.1.3.3)
actionmailbox (= 7.1.3.3)
actionmailer (= 7.1.3.3)
actionpack (= 7.1.3.3)
actiontext (= 7.1.3.3)
actionview (= 7.1.3.3)
activejob (= 7.1.3.3)
activemodel (= 7.1.3.3)
activerecord (= 7.1.3.3)
activestorage (= 7.1.3.3)
activesupport (= 7.1.3.3)
bundler (>= 1.15.0)
railties (= 7.1.3.2)
railties (= 7.1.3.3)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
railties (7.1.3.2)
actionpack (= 7.1.3.2)
activesupport (= 7.1.3.2)
railties (7.1.3.3)
actionpack (= 7.1.3.3)
activesupport (= 7.1.3.3)
irb
rackup (>= 1.0.0)
rake (>= 12.2)
thor (~> 1.0, >= 1.2.2)
zeitwerk (~> 2.6)
rainbow (3.1.1)
rake (13.2.1)
rdoc (6.6.3.1)
rdoc (6.7.0)
psych (>= 4.0.0)
regexp_parser (2.9.0)
reline (0.5.1)
regexp_parser (2.9.2)
reline (0.5.8)
io-console (~> 0.5)
require-hooks (0.2.2)
rexml (3.2.6)
rexml (3.2.8)
strscan (>= 3.0.9)
rouge (4.2.1)
rubocop (1.63.1)
rubocop (1.64.1)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
Expand All @@ -293,29 +286,30 @@ GEM
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.31.2)
parser (>= 3.3.0.4)
rubocop-ast (1.31.3)
parser (>= 3.3.1.0)
rubocop-packaging (0.5.2)
rubocop (>= 1.33, < 2.0)
rubocop-performance (1.21.0)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rake (0.6.0)
rubocop (~> 1.0)
ruby-next (1.0.2)
ruby-next (1.0.3)
paco (~> 0.2)
require-hooks (~> 0.2)
ruby-next-core (= 1.0.2)
ruby-next-core (= 1.0.3)
ruby-next-parser (>= 3.2.2.0)
unparser (~> 0.6.0)
ruby-next-core (1.0.2)
ruby-next-core (1.0.3)
ruby-next-parser (3.2.2.0)
parser (>= 3.0.3.1)
ruby-progressbar (1.13.0)
sqlite3 (1.7.3-arm64-darwin)
sqlite3 (1.7.3-x86_64-linux)
sqlite3 (2.0.2-arm64-darwin)
sqlite3 (2.0.2-x86_64-linux-gnu)
stringio (3.1.0)
sus (0.24.6)
strscan (3.1.0)
sus (0.25.0)
thor (1.3.1)
timeout (0.4.1)
tzinfo (2.0.6)
Expand All @@ -339,7 +333,7 @@ GEM
websocket-extensions (0.1.5)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.6.13)
zeitwerk (2.6.15)

PLATFORMS
arm64-darwin-21
Expand All @@ -359,7 +353,6 @@ DEPENDENCIES
gem3!
gem4!
htmlbeautifier
literal!
phlex-testing-capybara
phlexible
proscenium!
Expand Down
1 change: 0 additions & 1 deletion playground/app/components/application_component.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# frozen_string_literal: true

class ApplicationComponent < Proscenium::Phlex
extend Literal::Attributes
include Phlex::Rails::Helpers::Routes
include Phlexible::Rails::AElement

Expand Down
4 changes: 3 additions & 1 deletion playground/app/components/code_block_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
class CodeBlockComponent < ApplicationComponent
FORMATTER = Rouge::Formatters::HTML.new

attribute :syntax, _Nilable(_Union(String, Symbol)), positional: true
include Dry::Initializer.define lambda {
param :syntax, Dry::Types['coercible.symbol']
}

def view_template(&block)
@code = capture(&block)
Expand Down

0 comments on commit 6303e3e

Please sign in to comment.