Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rubygems version enforcement #32

Merged
merged 5 commits into from
Oct 23, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions lib/gemstash/cli/start.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def initialize(cli)
end

def run
check_rubygems_version
store_config
setup_logging
store_daemonized
Expand All @@ -36,6 +37,13 @@ def store_daemonized
Gemstash::Env.daemonized = daemonize?
end

def check_rubygems_version
@cli.say(@cli.set_color("Rubygems version is too old, " \
"please update rubygems by running: " \
"gem update --system", :red)) unless
Gem::Requirement.new(">= 2.4").satisfied_by?(Gem::Version.new(Gem::VERSION))
end

def daemonize?
@cli.options[:daemonize]
end
Expand Down