Class: EmberCli::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/ember_cli/command.rb

Instance Method Summary collapse

Constructor Details

#initialize(paths:, options: {}) ⇒ Command

Returns a new instance of Command.



5
6
7
8
# File 'lib/ember_cli/command.rb', line 5

def initialize(paths:, options: {})
  @paths = paths
  @options = options
end

Instance Method Details

#build(watch: false) ⇒ Object



16
17
18
# File 'lib/ember_cli/command.rb', line 16

def build(watch: false)
  ember_build(watch: watch)
end

#dev_server(host:, port:) ⇒ Object

Boots Vite's development server for an application generated with the Vite-based blueprint (ember-cli >= 6.8). This is what the blueprint's own npm start script runs.



23
24
25
26
27
28
29
30
31
32
# File 'lib/ember_cli/command.rb', line 23

def dev_server(host:, port:)
  line = Terrapin::CommandLine.new(paths.vite, [
    "--host :host",
    "--port :port",
    "--strictPort",
    "--clearScreen false",
  ].join(" "))

  line.command(host: host.to_s, port: port.to_s)
end

#testObject



10
11
12
13
14
# File 'lib/ember_cli/command.rb', line 10

def test
  line = Terrapin::CommandLine.new(paths.ember, "test --environment test")

  line.command
end