Exception: SewingKit::Webpack::NodeSewingKitNotRunnable
- Inherits:
-
StandardError
- Object
- StandardError
- SewingKit::Webpack::NodeSewingKitNotRunnable
- Defined in:
- lib/sewing_kit/webpack/webpack.rb
Overview
Raised if the node sewing-kit isn’t installed/runnable.
Instance Method Summary collapse
- #highlight(message) ⇒ Object
-
#initialize(mode, cause = nil) ⇒ NodeSewingKitNotRunnable
constructor
A new instance of NodeSewingKitNotRunnable.
Constructor Details
#initialize(mode, cause = nil) ⇒ NodeSewingKitNotRunnable
Returns a new instance of NodeSewingKitNotRunnable.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/sewing_kit/webpack/webpack.rb', line 7 def initialize(mode, cause = nil) = if "development" == mode "Try `yarn add @shopify/sewing-kit`" else "\nIf this is a container build, try:\n" \ " - Adding #{highlight("https://github.com/heroku/heroku-buildpack-nodejs")} to your " \ "#{highlight(".buildpacks")} file\n" \ " - Adding #{highlight("YARN_PRODUCTION=false")} to your pipeline's environment variables\n" \ end super( "sewing-kit is not runnable.\n" \ "#{}\n" + (cause ? "Original error #{cause}" : "") ) end |
Instance Method Details
#highlight(message) ⇒ Object
24 25 26 |
# File 'lib/sewing_kit/webpack/webpack.rb', line 24 def highlight() "\u001b[1m\u001b[37m#{}\u001b[39m\u001b[22m" end |