Top Level Namespace

Defined Under Namespace

Modules: Shakapacker

Instance Method Summary collapse

Instance Method Details

#add_dependencies(dependencies, type) ⇒ Object



107
108
109
110
111
112
# File 'lib/install/template.rb', line 107

def add_dependencies(dependencies, type)
  package_json.manager.add!(dependencies, type: type)
rescue PackageJson::Error
  say "Shakapacker installation failed 😭 See above for details.", :red
  exit 1
end

#fetch_peer_dependenciesObject



114
115
116
# File 'lib/install/template.rb', line 114

def fetch_peer_dependencies
  PackageJson.read("#{__dir__}/../../").fetch("peerDependencies")
end

#package_jsonObject



47
48
49
# File 'lib/install/template.rb', line 47

def package_json
  @package_json ||= PackageJson.new
end