Module: AppProfiler::Yarn::Command
- Includes:
- Exec
- Included in:
- WithFirefoxProfiler, WithSpeedscope
- Defined in:
- lib/app_profiler/yarn/command.rb
Defined Under Namespace
Classes: YarnError
Instance Method Summary collapse
- #setup_yarn ⇒ Object
- #valid_commands ⇒ Object
- #yarn(command, *options) ⇒ Object
- #yarn_setup ⇒ Object
- #yarn_setup=(state) ⇒ Object
Instance Method Details
#setup_yarn ⇒ Object
36 37 38 39 40 |
# File 'lib/app_profiler/yarn/command.rb', line 36 def setup_yarn ensure_yarn_installed yarn("init", "--yes") unless package_json_exists? end |
#valid_commands ⇒ Object
24 25 26 |
# File 'lib/app_profiler/yarn/command.rb', line 24 def valid_commands VALID_COMMANDS end |
#yarn(command, *options) ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/app_profiler/yarn/command.rb', line 28 def yarn(command, *) setup_yarn unless yarn_setup exec("yarn", command, *) do raise YarnError, "Failed to run #{command}." end end |
#yarn_setup ⇒ Object
42 43 44 |
# File 'lib/app_profiler/yarn/command.rb', line 42 def yarn_setup @yarn_initialized || false end |
#yarn_setup=(state) ⇒ Object
46 47 48 |
# File 'lib/app_profiler/yarn/command.rb', line 46 def yarn_setup=(state) @yarn_initialized = state end |