Sha256: 388500432fbd61a6b8dad9756e8f04c5c65e2a2e541516986285484b0c007227

Contents?: true

Size: 502 Bytes

Versions: 1

Compression:

Stored size: 502 Bytes

Contents

require 'dotenv'
Dotenv.load
require_relative './syntax_builder/with_namespace'
require_relative './syntax_builder/without_namespace'

module JsGenerator
  class AppJs
    attr_reader :syntax_builder

    def initialize(syntax_builder)
      @syntax_builder = syntax_builder
    end

    def append_script
      File.open("app/javascript/packs/application.js", 'a') do |f|
        f << syntax_builder.script_for_append
      end

      puts '✍️ Appended script to application.js'
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
js_generator-0.1.3 lib/js_generator/app_js.rb