exercism-config 0.36.0 → 0.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 97a6e5acb4ba0d52a4c9ace53896415a63c223bad24b8efc9b0390f0740d7307
4
- data.tar.gz: b5b66fdec816ae029fa2f4db3e1db28f538f29f74a4b71473e007e0991845565
3
+ metadata.gz: 5c3553a925d735e0f255f9e3c7afc498b1b6c33d70d30026b138beed0fbd49d0
4
+ data.tar.gz: 9270aee69112a25339a7c9c68450f72418a7ddfdd59667b571151025e3cc89cc
5
5
  SHA512:
6
- metadata.gz: a210de31c00337cfa8d713fa4fde4854a3ddd8ea08a8057179bd8996d829e6968a31b349e5a11e5e082a6c406f19192203321e6062670d9aa14e88da2c12017d
7
- data.tar.gz: c623fa955cdeaa244540ecc5785d5dd862321aa06f0a004a2cc7cbe5ecd6d067415e02c5dc0db79f2fe052148847cdc7b81c462d05e31f9edce679eb10362a7e
6
+ metadata.gz: 5a8016773caff1b76a54e9d71febcda4b9e87b37e309859f02568a1146e54af2c0fc7f9336d351b6e5b24fa7ac82f14a5ead9ba71226583b64565ca67cccf5f3
7
+ data.tar.gz: 066ea0f51d9aaf4f3e6b4daf46b743510ebd41a399f299fca560e860f5dd17d39a5ccd31afe2bb6cabfed4f7524dc87d05bb0778f2b55082f3fbd823aaa2f567
@@ -1,4 +1,4 @@
1
1
  #!/bin/bash
2
2
 
3
- git diff --name-status --staged | grep '^[MA]' | grep -o '\\s\\+.*rb' | xargs bundle exec rubocop --except Metrics --auto-correct --format quiet --force-exclusion lib/exercism-config.rb && \
4
- git diff --name-status --staged | grep '^[MA]' | grep -o '\\s\\+.*rb' | xargs git add
3
+ git diff --name-status --staged | grep '^[MA]' | grep -o '\s\+.*rb' | xargs bundle exec rubocop --except Metrics --auto-correct --format quiet --force-exclusion lib/exercism-config.rb && \
4
+ git diff --name-status --staged | grep '^[MA]' | grep -o '\s\+.*rb' | xargs git add
@@ -3,7 +3,7 @@ require "bundler/setup"
3
3
  require "exercism-config"
4
4
 
5
5
  # Only allow this to run in development
6
- return unless Exercism.env.development?
6
+ return if Exercism.env.production?
7
7
 
8
8
  puts "Create AWS/DynamoDB tables..."
9
9
 
@@ -15,7 +15,7 @@ Exercism.config.dynamodb_client = ExercismConfig::SetupDynamoDBClient.()
15
15
 
16
16
  # We don't need this running for CI atm as none of our
17
17
  # tests actually hit s3. Although we might choose to change this
18
- unless ENV["EXERCISM_CI"]
18
+ unless ENV["EXERCISM_CI"] || ENV["EXERCISM_SKIP_S3"]
19
19
  begin
20
20
  ExercismConfig::SetupS3Client.().create_bucket(bucket: Exercism.config.aws_iterations_bucket)
21
21
  rescue Seahorse::Client::NetworkingError => e
@@ -18,7 +18,7 @@ module Exercism
18
18
  class ConfigError < RuntimeError; end
19
19
 
20
20
  def self.env
21
- @environment ||= ExercismConfig::DetermineEnvironment.()
21
+ @env ||= ExercismConfig::DetermineEnvironment.()
22
22
  end
23
23
 
24
24
  def self.environment
@@ -1,12 +1,26 @@
1
1
  module Exercism
2
2
  class Config < OpenStruct
3
+ PROPS_WITH_TEST_SUFFIX = %i[
4
+ dynamodb_tooling_jobs_table
5
+ ].freeze
6
+
3
7
  def initialize(data, aws_settings)
4
8
  super(data)
5
9
  self.aws_settings = aws_settings
6
10
  end
7
11
 
12
+ PROPS_WITH_TEST_SUFFIX.each do |prop|
13
+ define_method prop do
14
+ Exercism.env.test? ? "#{super()}-test" : super()
15
+ end
16
+ end
17
+
8
18
  def to_json(*_args)
9
- to_h.to_json
19
+ hash = to_h
20
+ PROPS_WITH_TEST_SUFFIX.each do |prop|
21
+ hash[prop] = send(prop)
22
+ end
23
+ hash.to_json
10
24
  end
11
25
  end
12
26
  end
@@ -1,3 +1,3 @@
1
1
  module ExercismConfig
2
- VERSION = '0.36.0'.freeze
2
+ VERSION = '0.37.0'.freeze
3
3
  end
@@ -1,7 +1,7 @@
1
1
  anycable_redis_url: redis://127.0.0.1:6379/1
2
2
  anycable_rpc_host: 127.0.0.1:50051
3
3
  aws_iterations_bucket: exercism-staging-iterations
4
- dynamodb_tooling_jobs_table: tooling_jobs
4
+ dynamodb_tooling_jobs_table: tooling_jobs-test
5
5
  spi_url: http://127.0.0.1:3020
6
6
  tooling_orchestrator_url: http://127.0.0.1:3021
7
7
 
@@ -1,7 +1,7 @@
1
1
  anycable_redis_url: redis://some_anycable_redis_url:1234/9
2
2
  anycable_rpc_host: 1.2.3.4:9876543
3
3
  aws_iterations_bucket: some-iterations-bucket
4
- dynamodb_tooling_jobs_table: some_tooling_table
4
+ dynamodb_tooling_jobs_table: tooling_jobs-test
5
5
  spi_url: http://some_url:1234
6
6
  tooling_orchestrator_url: http://some_orchestrator_url:1234
7
7
 
@@ -1,7 +1,7 @@
1
1
  anycable_redis_url: redis://some_anycable_redis_url:1234/9
2
2
  anycable_rpc_host: 1.2.3.4:9876543
3
3
  aws_iterations_bucket: some-iterations-bucket
4
- dynamodb_tooling_jobs_table: some_tooling_table
4
+ dynamodb_tooling_jobs_table: tooling_jobs-test
5
5
  spi_url: http://some_url:1234
6
6
  tooling_orchestrator_url: http://some_orchestrator_url:1234
7
7
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exercism-config
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.36.0
4
+ version: 0.37.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Walker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-06 00:00:00.000000000 Z
11
+ date: 2020-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-dynamodb