exercism_config 0.22.0 → 0.23.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9d04d6dcac3ff734c956cc7c17dfb5b89189d6eed7155b10bd16d4c32f614803
4
- data.tar.gz: '097db1c56e98ae198500107728f42ff66644e63ca701984d8c011967997ec50e'
3
+ metadata.gz: d5babef3a3749dac8779c483f8afaa93df5b1c11a07fb1c79e6bfa8a0ad628e3
4
+ data.tar.gz: 30d6b0c117bf61cadbcafbd2756c955eb7d57fddf77a3e9f6da47da2ac18afc5
5
5
  SHA512:
6
- metadata.gz: 2641075761befa26d18ce70585b44cec77ae173f5776d0803a8cfe82b300f350704192dc786511ef899218aaa0059d5ddd08d692a3ace4ec9f1b0cf7ed35d7ee
7
- data.tar.gz: 868cf09c1a605b02b547290221081afee195ff9367955be86ac3924d791f6eaf2662398679edea0cc28c7fd26e2718a3acb1c9039109129640113fcbf837d3d9
6
+ metadata.gz: 6baf1d362986f1d905fa4c3579cc5f24ae2d654c302ad7074660ba2019d74516713f4802e9a33b7258c0273a18ba483f70511efe5c2795039aaddd34f730d0da
7
+ data.tar.gz: d73f47b8063a043feb2dbebe3972fa6edff048aeee4aad0e175a8c22edd24b364a5bb944a0fea4b0385b1be90802288584da06f89663ef0a33982f69e3ff89c6
@@ -30,4 +30,9 @@ Gem::Specification.new do |spec|
30
30
  spec.add_development_dependency "rake", "~> 12.3"
31
31
  spec.add_development_dependency "minitest", "~> 5.0"
32
32
  spec.add_development_dependency "mocha"
33
+
34
+ # This isn't a compulsary dependency
35
+ # but can be used if someone puts it in their
36
+ # own gemfile
37
+ spec.add_development_dependency "aws-sdk-s3"
33
38
  end
@@ -6,6 +6,7 @@ require 'json'
6
6
  require_relative 'exercism_config/determine_environment'
7
7
  require_relative 'exercism_config/generate_aws_settings'
8
8
  require_relative 'exercism_config/setup_dynamodb_client'
9
+ require_relative 'exercism_config/setup_s3_client'
9
10
  require_relative 'exercism_config/retrieve'
10
11
  require_relative 'exercism_config/generate_aws_settings'
11
12
  require_relative "exercism_config/version"
@@ -22,7 +22,7 @@ module ExercismConfig
22
22
  return nil unless %i[development test].include?(Exercism.environment)
23
23
  return "http://127.0.0.1:#{ENV["DYNAMODB_PORT"]}" if ENV["EXERCISM_CI"]
24
24
 
25
- host = ENV["EXERCISM_DOCKER"] ? "dynamodb:8000" : "localhost:3039"
25
+ host = ENV["EXERCISM_DOCKER"] ? "dynamodb:8000" : "localhost:3040"
26
26
  "http://#{host}"
27
27
  end
28
28
  end
@@ -0,0 +1,33 @@
1
+ module ExercismConfig
2
+ class SetupS3Client
3
+ include Mandate
4
+
5
+ def call
6
+ require 'aws-sdk-s3'
7
+
8
+ aws_settings = GenerateAwsSettings.().merge(
9
+ endpoint: config_endpoint,
10
+ force_path_style: true,
11
+
12
+ # We don't want a profile for this AWS service
13
+ # as we run it locally. But we do normally, so
14
+ # we locally override this here.
15
+ profile: nil
16
+ ).select {|k,v|v}
17
+ Aws::S3::Client.new(aws_settings)
18
+ end
19
+
20
+ private
21
+ attr_reader :environment
22
+
23
+ memoize
24
+ def config_endpoint
25
+ return nil unless %i[development test].include?(Exercism.environment)
26
+ return "http://127.0.0.1:#{ENV["S3_PORT"]}" if ENV["EXERCISM_CI"]
27
+
28
+ host = ENV["EXERCISM_DOCKER"] ? "s3:3041" : "lvh.me:3041"
29
+ "http://#{host}"
30
+ end
31
+ end
32
+ end
33
+
@@ -1,3 +1,3 @@
1
1
  module ExercismConfig
2
- VERSION = "0.22.0"
2
+ VERSION = "0.23.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exercism_config
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.22.0
4
+ version: 0.23.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Walker
@@ -108,6 +108,20 @@ dependencies:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: aws-sdk-s3
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
111
125
  description:
112
126
  email:
113
127
  - jez.walker@gmail.com
@@ -132,6 +146,7 @@ files:
132
146
  - lib/exercism_config/generate_aws_settings.rb
133
147
  - lib/exercism_config/retrieve.rb
134
148
  - lib/exercism_config/setup_dynamodb_client.rb
149
+ - lib/exercism_config/setup_s3_client.rb
135
150
  - lib/exercism_config/version.rb
136
151
  - settings/ci.yml
137
152
  - settings/development.yml