diff --git a/Gemfile b/Gemfile index b5881c4a..f0501732 100644 --- a/Gemfile +++ b/Gemfile @@ -26,3 +26,7 @@ group :test do gem 'liquid-c', github: 'Shopify/liquid-c', ref: 'main' end end + +gem "vernier", "~> 1.0" + +gem "debug", "~> 1.9" diff --git a/Gemfile.lock b/Gemfile.lock index 66ff4734..d9cdd94a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -16,6 +16,13 @@ GEM specs: ast (2.4.2) benchmark-ips (2.13.0) + debug (1.9.2) + irb (~> 1.10) + reline (>= 0.3.8) + io-console (0.7.2) + irb (1.13.1) + rdoc (>= 4.0.0) + reline (>= 0.4.2) json (2.7.2) language_server-protocol (3.17.0.3) memory_profiler (1.0.1) @@ -24,10 +31,16 @@ GEM parser (3.3.0.5) ast (~> 2.4.1) racc + psych (5.1.2) + stringio racc (1.7.3) rainbow (3.1.1) rake (13.2.1) + rdoc (6.7.0) + psych (>= 4.0.0) regexp_parser (2.9.0) + reline (0.5.8) + io-console (~> 0.5) rexml (3.2.6) rubocop (1.61.0) json (~> 2.3) @@ -49,15 +62,18 @@ GEM rubocop (~> 1.44) ruby-progressbar (1.13.0) stackprof (0.2.26) + stringio (3.1.0) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) unicode-display_width (2.5.0) + vernier (1.0.1) PLATFORMS ruby DEPENDENCIES benchmark-ips + debug (~> 1.9) liquid! liquid-c! memory_profiler @@ -68,6 +84,7 @@ DEPENDENCIES rubocop-shopify (~> 2.12.0) stackprof terminal-table + vernier (~> 1.0) BUNDLED WITH 2.5.7 diff --git a/example/liquid2profile b/example/liquid2profile index 752e296d..0c0cc9ff 100755 --- a/example/liquid2profile +++ b/example/liquid2profile @@ -29,7 +29,7 @@ optparse = OptionParser.new do |opts| opts.on("--db [DB]", "use the provided db file instead of the default") do |db| options[:db] = db end - opts.on("--n-runs [N]", "number of runs") do |n| + opts.on("-n [N]", "number of runs") do |n| options[:n_runs] = n.to_i end opts.on("--skip-samply-run", "skip running samply") do @@ -55,8 +55,6 @@ if options[:samply_run] && !options[:vernier] "record", "--output", samply_output, - "bundle", - "exec", "ruby", "--yjit", "--yjit-perf", diff --git a/lib/liquid.rb b/lib/liquid.rb index eba84e14..7bf5aabb 100644 --- a/lib/liquid.rb +++ b/lib/liquid.rb @@ -49,6 +49,7 @@ module Liquid self.cache_classes = true end +require "debug" require "liquid/version" require 'liquid/parse_tree_visitor' require 'liquid/lexer' diff --git a/product.liquid b/product.liquid new file mode 100644 index 00000000..ad97d244 --- /dev/null +++ b/product.liquid @@ -0,0 +1,34 @@ +
+ {% for image in product.images %}
+ {{ product.title | escape }} +
+ {% endfor %} +
+
+

{{ product.title }}

+ {{ product.description }} + + {% if product.available %} +
+ +
+
+ + +
+ + +
+ {% else %} +

This product is temporarily unavailable

+ {% endif %} + +
+ Continue Shopping
+ Browse more {{ product.type }} or additional {{ product.vendor }} products. +
+