Enabled frozen string literals

This commit is contained in:
Mike Angell
2019-09-16 12:54:33 +10:00
parent 9a42c8c8b2
commit 7abb8a3554
121 changed files with 380 additions and 151 deletions
+2
View File
@@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'benchmark/ips'
require_relative 'theme_runner'
+2
View File
@@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'stackprof'
require_relative 'theme_runner'
+2
View File
@@ -1,3 +1,5 @@
# frozen_string_literal: true
class CommentForm < Liquid::Block
Syntax = /(#{Liquid::VariableSignature}+)/
+2
View File
@@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'yaml'
module Database
+2
View File
@@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'json'
module JsonFilter
+2
View File
@@ -1,3 +1,5 @@
# frozen_string_literal: true
$LOAD_PATH.unshift(__dir__ + '/../../lib')
require_relative '../../lib/liquid'
+2
View File
@@ -1,3 +1,5 @@
# frozen_string_literal: true
module MoneyFilter
def money_with_currency(money)
return '' if money.nil?
+2
View File
@@ -1,3 +1,5 @@
# frozen_string_literal: true
class Paginate < Liquid::Block
Syntax = /(#{Liquid::QuotedFragment})\s*(by\s*(\d+))?/
+2
View File
@@ -1,3 +1,5 @@
# frozen_string_literal: true
module ShopFilter
def asset_url(input)
"/files/1/[shop_id]/[shop_id]/assets/#{input}"
+2
View File
@@ -1,3 +1,5 @@
# frozen_string_literal: true
module TagFilter
def link_to_tag(label, tag)
"<a title=\"Show tag #{tag}\" href=\"/collections/#{@context['handle']}/#{tag}\">#{label}</a>"
+2
View File
@@ -1,3 +1,5 @@
# frozen_string_literal: true
module WeightFilter
def weight(grams)
format("%.2f", grams / 1000)
+2
View File
@@ -1,3 +1,5 @@
# frozen_string_literal: true
# This profiler run simulates Shopify.
# We are looking in the tests directory for liquid files and render them within the designated layout file.
# We will also export a substantial database to liquid which the templates can render values of.