Class: Bumpit::Managers::Yarn
Constant Summary collapse
- FILENAMES =
%w(package.json yarn.lock).freeze
- OUTDATED_COMMAND =
"npm outdated --json"
Class Method Summary collapse
-
.valid? ⇒ Boolean
Determine if the manager is valid.
Instance Method Summary collapse
-
#bump ⇒ void
Bump the dependencies, if there are any.
-
#message ⇒ String
Return a message for which dependencies were bumped.
Methods inherited from Base
Class Method Details
.valid? ⇒ Boolean
Determine if the manager is valid.
15 16 17 18 19 20 21 |
# File 'lib/bumpit/managers/yarn.rb', line 15 def self.valid? executable?("npm") && executable?("yarn") && FILENAMES.all? do |filename| File.exist?(Pathname.new(Dir.pwd).join(filename)) end end |
Instance Method Details
#bump ⇒ void
This method returns an undefined value.
Bump the dependencies, if there are any.
26 27 28 29 30 31 |
# File 'lib/bumpit/managers/yarn.rb', line 26 def bump if outdated.any? package_update yarn_update end end |
#message ⇒ String
Return a message for which dependencies were bumped.
36 37 38 39 40 |
# File 'lib/bumpit/managers/yarn.rb', line 36 def if outdated.any? "Updates #{to_sentence(outdated.keys.sort)} in JavaScript." end end |