exercism-config 0.55.0 → 0.61.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: a42c20a18518d79b395077d78b0f90bec60ac57653c10a5a133223c79608663b
4
- data.tar.gz: 2c973dc0c16b4470437a017d7bd9680f7592ec1eaec7c6e2fcfd05b7092cb5f2
3
+ metadata.gz: d32d19c956e6ce73b0132ca9f9b8e5b8f1082cc166cc3462b1dd488547c111b1
4
+ data.tar.gz: 6f83202d7037b9ce139d5b635198abcd2d84be4c86aa40b7cd809f8c8d3b6e51
5
5
  SHA512:
6
- metadata.gz: 1305bf2e9d5d869613fff94e16af3019c128fba0ad18513363f11ec07b232073931aab86926da96fa16e19854b7c866fa4d16fcf4d405000130ddffa7e75b07a
7
- data.tar.gz: 2122efe11a548a36b8d2db0730e101689dc173ebf9417a5d1e0a49ed29381e138f5063b5111aab1abc5220d0c9d4a146a22f1f2d92b945ec21b018868b08461e
6
+ metadata.gz: c3e358c67a51fa58ab28dfea5a3f68d37c8e80bf856df13d8fc9727cc51c358cbaffb76b5effad5c3586968fc6f28072ea848f9768051fbc78ca896497218894
7
+ data.tar.gz: f045f937ad759aad0d09a2870b0f410f5b8453f80fb2dd126e8d50700fa0c272ed0083d4155da2e301c6bd8aa8e266bae97284b095b1b49e2f9ddc9e1b7dcc72
data/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
  ## Usage
9
9
 
10
- This gem provides you with the following config and secrets:
10
+ This gem provides you with the following config, secrets and helper methods:
11
11
 
12
12
  ```ruby
13
13
  # Config
@@ -25,10 +25,17 @@ Exercism.config.tooling_orchestrator_url
25
25
  Exercism.config.language_server_url
26
26
 
27
27
  # Secrets
28
+ Exercism.secrets.github_access_token
28
29
  Exercism.secrets.github_omniauth_app_id
29
30
  Exercism.secrets.github_omniauth_app_secret
31
+ Exercism.secrets.github_webhooks_secret
30
32
  Exercism.secrets.hcaptcha_site_key
31
33
  Exercism.secrets.hcaptcha_secret
34
+
35
+ # Helper methods (create new clients)
36
+ Exercism.dynamodb_client
37
+ Exercism.s3_client
38
+ Exercism.ecr_client
32
39
  ```
33
40
 
34
41
  ## Explaination
@@ -38,6 +38,6 @@ Gem::Specification.new do |spec|
38
38
  # This isn't a compulsary dependency
39
39
  # but can be used if someone puts it in their
40
40
  # own Gemfile when using this.
41
- spec.add_development_dependency 'aws-sdk-s3'
42
41
  spec.add_development_dependency 'aws-sdk-ecr'
42
+ spec.add_development_dependency 'aws-sdk-s3'
43
43
  end
@@ -10,6 +10,22 @@ module Exercism
10
10
  self.aws_settings = aws_settings
11
11
  end
12
12
 
13
+ def method_missing(name, *args)
14
+ super.tap do |val|
15
+ next unless val.nil?
16
+
17
+ keys = to_h.keys
18
+ raise NoMethodError, name unless keys.include?(name.to_s) || keys.include?(name.to_sym)
19
+ end
20
+ end
21
+
22
+ def respond_to_missing?(*args)
23
+ super
24
+ true
25
+ rescue NoMethodError
26
+ false
27
+ end
28
+
13
29
  PROPS_WITH_TEST_SUFFIX.each do |prop|
14
30
  define_method prop do
15
31
  Exercism.env.test? ? "#{super()}-test" : super()
@@ -20,6 +36,8 @@ module Exercism
20
36
  hash = to_h
21
37
  PROPS_WITH_TEST_SUFFIX.each do |prop|
22
38
  hash[prop] = send(prop)
39
+ rescue NoMethodError
40
+ # We don't want to show nil or empty string values in the JSON output
23
41
  end
24
42
  hash.to_json
25
43
  end
@@ -3,13 +3,13 @@ module ExercismConfig
3
3
  include Mandate
4
4
 
5
5
  def call
6
- return generate_mock if Exercism.env.test?
6
+ return use_non_production_settings unless Exercism.env.production?
7
7
 
8
8
  retrieve_from_dynamodb
9
9
  end
10
10
 
11
11
  private
12
- def generate_mock
12
+ def use_non_production_settings
13
13
  require 'erb'
14
14
  require 'yaml'
15
15
 
@@ -43,6 +43,5 @@ module ExercismConfig
43
43
  'local'
44
44
  end
45
45
  end
46
-
47
46
  end
48
47
  end
@@ -3,13 +3,13 @@ module ExercismConfig
3
3
  include Mandate
4
4
 
5
5
  def call
6
- return generate_mock if Exercism.env.test?
6
+ return use_non_production_settings unless Exercism.env.production?
7
7
 
8
8
  retrieve_from_aws
9
9
  end
10
10
 
11
11
  private
12
- def generate_mock
12
+ def use_non_production_settings
13
13
  require 'erb'
14
14
  require 'yaml'
15
15
 
@@ -1,3 +1,3 @@
1
1
  module ExercismConfig
2
- VERSION = '0.55.0'.freeze
2
+ VERSION = '0.61.0'.freeze
3
3
  end
@@ -1,12 +1,28 @@
1
+ # Anycable
1
2
  anycable_redis_url: redis://127.0.0.1:6379/1
2
3
  anycable_rpc_host: 127.0.0.1:50051
3
- aws_submissions_bucket: exercism-staging-submissions
4
- aws_tooling_jobs_bucket: exercism-staging-tooling-jobs
4
+
5
+ # DynamoDB config
5
6
  dynamodb_tooling_jobs_table: tooling_jobs
6
7
  dynamodb_tooling_language_groups_table: tooling_language_groups
8
+
9
+ # Internal Routes
10
+ language_server_url: ws://127.0.0.1:3023
7
11
  spi_url: http://127.0.0.1:3020
8
12
  tooling_orchestrator_url: http://127.0.0.1:3021
9
- language_server_url: ws://127.0.0.1:3023
10
13
 
14
+ # MySQL
11
15
  mysql_master_endpoint: 127.0.0.1
16
+ mysql_socket: /tmp/mysql.
12
17
  mysql_port: <%= ENV["MYSQL_PORT"] %>
18
+
19
+ # S3 Config
20
+ aws_submissions_bucket: exercism-staging-submissions
21
+ aws_tooling_jobs_bucket: exercism-staging-tooling-jobs
22
+
23
+ # Sidekiq Config
24
+ sidekiq_redis_url: redis://127.0.0.1:6379/2
25
+
26
+ # EFS Config
27
+ efs_submissions_mount_point: "/tmp/exercism/efs/submissions"
28
+ efs_repositories_mount_point: "/tmp/exercism/efs/repos"
@@ -1,11 +1,28 @@
1
+ # Anycable
1
2
  anycable_redis_url: redis://redis:6379/1
2
3
  anycable_rpc_host: 0.0.0.0:50051
3
- aws_submissions_bucket: exercism-staging-submissions
4
- aws_tooling_jobs_bucket: exercism-staging-tooling-jobs
4
+
5
+ # DynamoDB config
5
6
  dynamodb_tooling_jobs_table: tooling_jobs
6
7
  dynamodb_tooling_language_groups_table: tooling_language_groups
7
- mysql_master_endpoint: mysql
8
- mysql_port: 3306
8
+
9
+ # Internal Routes
9
10
  spi_url: http://website:3020
10
11
  tooling_orchestrator_url: http://tooling-orchestrator:3021
11
- language_server_url: ws://localhost:3023
12
+ language_server_url: ws://local.exercism.io:3023
13
+
14
+ # MySQL
15
+ mysql_master_endpoint: mysql
16
+ mysql_socket: null
17
+ mysql_port: 3306
18
+
19
+ # S3 Config
20
+ aws_submissions_bucket: exercism-staging-submissions
21
+ aws_tooling_jobs_bucket: exercism-staging-tooling-jobs
22
+
23
+ # Sidekiq Config
24
+ sidekiq_redis_url: redis://redis:6379/2
25
+
26
+ # EFS Config
27
+ efs_submissions_mount_point: "/tmp/exercism/efs/submissions"
28
+ efs_repositories_mount_point: "/tmp/exercism/efs/repos"
@@ -1,11 +1,28 @@
1
+ # Anycable
1
2
  anycable_redis_url: redis://127.0.0.1:6379/1
2
3
  anycable_rpc_host: 127.0.0.1:50051
3
- aws_submissions_bucket: exercism-staging-submissions
4
- aws_tooling_jobs_bucket: exercism-staging-tooling-jobs
4
+
5
+ # DynamoDB config
5
6
  dynamodb_tooling_jobs_table: tooling_jobs
6
7
  dynamodb_tooling_language_groups_table: tooling_language_groups
8
+
9
+ # Internal Routes
10
+ language_server_url: ws://local.exercism.io:3023
11
+ spi_url: http://local.exercism.io:3020
12
+ tooling_orchestrator_url: http://local.exercism.io:3021
13
+
14
+ # MySQL
7
15
  mysql_master_endpoint: localhost
8
16
  mysql_socket: /tmp/mysql.sock
9
- spi_url: http://localhost:3020
10
- tooling_orchestrator_url: http://localhost:3021
11
- language_server_url: ws://localhost:3023
17
+ mysql_port: null
18
+
19
+ # S3 Config
20
+ aws_submissions_bucket: exercism-staging-submissions
21
+ aws_tooling_jobs_bucket: exercism-staging-tooling-jobs
22
+
23
+ # Sidekiq Config
24
+ sidekiq_redis_url: redis://127.0.0.1:6379/2
25
+
26
+ # EFS Config
27
+ efs_submissions_mount_point: "/tmp/exercism/efs/submissions"
28
+ efs_repositories_mount_point: "/tmp/exercism/efs/repos"
@@ -1,4 +1,7 @@
1
+ github_access_token: "some-github-access-token"
1
2
  github_omniauth_app_id: "some-github-app-id"
2
3
  github_omniauth_app_secret: "some-github-app-exercism-secret"
4
+ github_webhooks_secret: "some-github-webhooks-secret"
3
5
  hcaptcha_site_key: "some-hcaptcha-site-key"
4
6
  hcaptcha_secret: "some-hcaptcha-secret"
7
+ website_secret_key_base: "74732f062c60ffc4f2898b1ed36d1876cd34bb83ba3928bc14c1fd61a189179728a305b02b7de01a1f0a7627864d28cb410d64a8952465e5dd681522d8afc8d7"
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.55.0
4
+ version: 0.61.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-12-01 00:00:00.000000000 Z
11
+ date: 2021-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-dynamodb
@@ -123,7 +123,7 @@ dependencies:
123
123
  - !ruby/object:Gem::Version
124
124
  version: '12.3'
125
125
  - !ruby/object:Gem::Dependency
126
- name: aws-sdk-s3
126
+ name: aws-sdk-ecr
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - ">="
@@ -137,7 +137,7 @@ dependencies:
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  - !ruby/object:Gem::Dependency
140
- name: aws-sdk-ecr
140
+ name: aws-sdk-s3
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - ">="