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 backends for Gemstash storage of private gems #242

Closed
wants to merge 8 commits into from
6 changes: 6 additions & 0 deletions lib/gemstash/cli/setup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def run
ask_database
ask_protected_fetch
ask_timeout
ask_bachend
gayashanbc marked this conversation as resolved.
Show resolved Hide resolved
check_cache
check_storage
check_database
Expand Down Expand Up @@ -122,6 +123,11 @@ def ask_timeout
@config[:fetch_timeout] = timeout.to_i
end

def ask_bachend
gayashanbc marked this conversation as resolved.
Show resolved Hide resolved
say_current_config(:backend, "Current backend")
@config[:backend] = ask_with_default("What backend?", %w[local s3], "local")
olleolleolle marked this conversation as resolved.
Show resolved Hide resolved
end

def check_cache
try("cache") { gemstash_env.cache_client.alive! }
end
Expand Down
3 changes: 2 additions & 1 deletion lib/gemstash/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ class Configuration
puma_threads: 16,
puma_workers: 1,
cache_expiration: 30 * 60,
cache_max_size: 500
cache_max_size: 500,
backend: "local"
}.freeze

DEFAULT_FILE = File.expand_path("~/.gemstash/config.yml").freeze
Expand Down