mirror of
https://github.com/chromebrew/chromebrew.git
synced 2026-01-09 15:37:56 -05:00
Add packages for default and bundled Ruby gems. (#10535)
* Update create_gem_packages. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Add default gems package. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Add default gems to core. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Handle gem names with underscores and dashes. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Try to make gem reinstalls faster. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Update awscli. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Adjust early gem install exit logic. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Adjust default packages script. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Gem install refactoring... Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Refactor gem compile. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Fix create_gem_packages description. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Work around matrix removal breaking crew. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * lint Signed-off-by: Satadru Pramanik <satadru@gmail.com> --------- Signed-off-by: Satadru Pramanik <satadru@gmail.com>
This commit is contained in:
committed by
GitHub
parent
8fc94ad1f1
commit
c78b28be9e
@@ -1,6 +1,25 @@
|
||||
# lib/misc_functions.rb
|
||||
# Generic implementations of various functions/algorithms that are not crew-specific.
|
||||
require 'matrix'
|
||||
def require_gem(gem_name_and_require = nil, require_override = nil)
|
||||
# Allow only loading gems when needed.
|
||||
return if gem_name_and_require.nil?
|
||||
|
||||
gem_name = gem_name_and_require.split('/')[0]
|
||||
begin
|
||||
gem gem_name
|
||||
rescue LoadError
|
||||
puts " -> install #{gem_name} gem".orange
|
||||
Gem.install(gem_name)
|
||||
gem gem_name
|
||||
end
|
||||
requires = if require_override.nil?
|
||||
gem_name_and_require.split('/')[1].nil? ? gem_name_and_require.split('/')[0] : gem_name_and_require
|
||||
else
|
||||
require_override
|
||||
end
|
||||
require requires
|
||||
end
|
||||
require_gem('matrix')
|
||||
|
||||
class MiscFunctions
|
||||
def self.human_size(bytes)
|
||||
|
||||
Reference in New Issue
Block a user