Sha256: f1e9af08e137590bc0425eb170b0874c061edcb1f4796b7481ba17785ac37f58

Contents?: true

Size: 478 Bytes

Versions: 6

Compression:

Stored size: 478 Bytes

Contents

module SewingKit
  module Webpack
    class Dev
      attr_accessor :pid

      def start
        @pid = spawn
        detach
      end

      private

      def spawn
        Kernel.spawn(
          { 'NODE_ENV' => 'development' },
          'node_modules/.bin/sewing-kit',
          'dev',
          chdir: Rails.root.to_s,
          out: $stdout,
          err: $stderr,
        ) || exit(1)
      end

      def detach
        Process.detach pid
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sewing_kit-0.5.5 lib/sewing_kit/webpack/dev.rb
sewing_kit-0.5.4 lib/sewing_kit/webpack/dev.rb
sewing_kit-0.5.3 lib/sewing_kit/webpack/dev.rb
sewing_kit-0.5.2 lib/sewing_kit/webpack/dev.rb
sewing_kit-0.5.1 lib/sewing_kit/webpack/dev.rb
sewing_kit-0.5.0 lib/sewing_kit/webpack/dev.rb