lib/generators/serviceworker/install_generator.rb in serviceworker-rails-0.5.5 vs lib/generators/serviceworker/install_generator.rb in serviceworker-rails-0.6.0

- old
+ new

@@ -1,5 +1,7 @@ +# frozen_string_literal: true + require "rails/generators" require "fileutils" module Serviceworker module Generators @@ -31,11 +33,11 @@ end def update_application_layout layout = detect_layout snippet = %(<link rel="manifest" href="/manifest.json" />) - snippet << %(\n<meta name="apple-mobile-web-app-capable" content="yes">) + snippet += %(\n<meta name="apple-mobile-web-app-capable" content="yes">) unless layout conditional_warn "Could not locate application layout. To insert manifest tags manually, use:\n\n#{snippet}\n" return end insert_into_file layout, snippet, before: "</head>\n" @@ -53,9 +55,10 @@ def detect_js_format %w[.js .js.erb .coffee .coffee.erb .js.coffee .js.coffee.erb].each do |ext| next unless File.exist?(javascripts_dir("application#{ext}")) return [ext, "#="] if ext.include?(".coffee") + return [ext, "//="] end end def detect_layout