Sha256: 93f030c28df07d50b68a65132181175e084a6a9cece64e81dc46235693b7de30

Contents?: true

Size: 610 Bytes

Versions: 12

Compression:

Stored size: 610 Bytes

Contents

require 'rails/generators'

module Rails
  module Generators
    class Base < Thor::Group

      protected

      def add_to_manifest(manifest, &block)
        if File.exists? "app/javascript/packs/#{manifest}"
          append_file "app/javascript/packs/#{manifest}", &block
        else
          create_file "app/javascript/packs/#{manifest}", &block
        end
      end

      def yarn(package, version = nil)
        return if system("yarn add #{package}#{'@' + version if version}")
        raise Thor::Error.new("yarn failed to install #{package} with version #{version}")
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
rails-hyperstack-1.0.alpha1.4 lib/generators/hyperstack/install_generator_base.rb
hyperloop-0.99.6 lib/generators/hyperloop/install_generator_base.rb
rails-hyperstack-1.0.alpha1.3 lib/generators/hyperstack/install_generator_base.rb
hyperloop-0.99.5 lib/generators/hyperloop/install_generator_base.rb
hyperloop-0.99.4 lib/generators/hyperloop/install_generator_base.rb
rails-hyperstack-1.0.alpha1.2 lib/generators/hyperstack/install_generator_base.rb
rails-hyperstack-1.0.alpha1.1 lib/generators/hyperstack/install_generator_base.rb
rails-hyperstack-1.0.alpha1 lib/generators/hyperstack/install_generator_base.rb
hyperloop-0.99.3 lib/generators/hyperloop/install_generator_base.rb
hyperloop-0.99.2 lib/generators/hyperloop/install_generator_base.rb
hyperloop-0.99.1 lib/generators/hyperloop/install_generator_base.rb
hyperloop-0.99.0 lib/generators/hyperloop/install_generator_base.rb