quiz_api_client 2.9.0 → 3.0.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
- SHA256:
3
- metadata.gz: b8e9117e1b2cc22ef6f530c9ffdc08bc0660c068a51b808b53db9e6cb7e4bd53
4
- data.tar.gz: 880060748ab051cf51ea29e7b568c30ae49aac9577bb81c7c6eb55aba2e74f23
2
+ SHA1:
3
+ metadata.gz: 0002646bbd669ca217b0ccaf7efb17c3c4cfd71c
4
+ data.tar.gz: 89fd9e51d2c4ef12392f8d8d6e726365133d20ef
5
5
  SHA512:
6
- metadata.gz: f5312c786cdd9e0e5a30f5adc487989fdd7fb65d4e3a6dc8c2dc3e44eb150bbdf9e692722deff4716637b88d00c13dc8fabb7b3e196c3518b431341f62fe4d9d
7
- data.tar.gz: 3900c41dd19f1c7991f213629d771df77073ab3094e9a7209e0bfd150b40ecff4ac2d7ce822f7c3f3a16b150295a6c68921ba378a725598f3e81e0f74e744fb6
6
+ metadata.gz: d9046f4bd68c290d8131afcb57b9410812b3283d9a18190b59772c8cbf46a2da16ff0b6d66687a76df5321c832c1a9e6de495687a72852ba0c329f81dd115b9c
7
+ data.tar.gz: 93ffc9705ec2df78a76bbce0e66aebb3c1e1f2f28e662cf8de2839296ce2e81388a90a7863746cbc4b48ca587fb9d606ee9f79b65e650513026d9c011d3ff070
@@ -1,4 +1,7 @@
1
+ /.gitignore
2
+ /.ruby-version
1
3
  /coverage
2
4
  /docker-compose.*
3
5
  /Dockerfile*
6
+ /Gemfile.lock
4
7
  /**/*.gem
data/.gitignore CHANGED
@@ -1,5 +1,6 @@
1
1
  /.bundle/
2
2
  /.yardoc
3
+ /.ruby-version
3
4
  /_yardoc/
4
5
  /coverage/
5
6
  /doc/
data/.rspec CHANGED
@@ -1,2 +1,3 @@
1
+ --require spec_helper
1
2
  --format documentation
2
3
  --color
@@ -1,5 +1,5 @@
1
1
  AllCops:
2
- TargetRubyVersion: 2.3
2
+ TargetRubyVersion: 2.4
3
3
 
4
4
  Metrics/ClassLength:
5
5
  Max: 200 # Default: 100
@@ -16,6 +16,9 @@ Metrics/BlockLength:
16
16
  - quiz_api_client.gemspec
17
17
  - spec/**/*.rb
18
18
 
19
+ Naming/MemoizedInstanceVariableName:
20
+ EnforcedStyleForLeadingUnderscores: required
21
+
19
22
  Layout/AlignParameters:
20
23
  # Alignment of parameters in multi-line method calls.
21
24
  #
@@ -29,7 +32,7 @@ Layout/AlignParameters:
29
32
  Layout/CaseIndentation:
30
33
  EnforcedStyle: end
31
34
 
32
- Lint/EndAlignment:
35
+ Layout/EndAlignment:
33
36
  EnforcedStyleAlignWith: variable
34
37
 
35
38
  Style/ClassAndModuleChildren:
@@ -59,13 +62,11 @@ Style/Documentation:
59
62
  Enabled: false
60
63
 
61
64
  Style/FrozenStringLiteralComment:
62
- # `when_needed` will add the frozen string literal comment to files
63
- # only when the `TargetRubyVersion` is set to 2.3+.
64
65
  # `always` will always add the frozen string literal comment to a file
65
66
  # regardless of the Ruby version or if `freeze` or `<<` are called on a
66
67
  # string literal. If you run code against multiple versions of Ruby, it is
67
68
  # possible that this will create errors in Ruby 2.3.0+.
68
69
  #
69
70
  # See: https://wyeworks.com/blog/2015/12/1/immutable-strings-in-ruby-2-dot-3
70
- EnforcedStyle: when_needed
71
+ EnforcedStyle: always
71
72
  Enabled: false
data/Dockerfile CHANGED
@@ -1,20 +1,11 @@
1
1
  FROM instructure/rvm
2
2
 
3
- WORKDIR /app
3
+ RUN mkdir -p coverage log pacts
4
4
 
5
- COPY quiz_api_client.gemspec Gemfile /app/
6
- COPY lib/quiz_api_client/version.rb /app/lib/quiz_api_client/version.rb
7
-
8
- USER root
9
- RUN chown -R docker:docker /app
10
-
11
- USER docker
5
+ COPY --chown=docker:docker quiz_api_client.gemspec Gemfile ./
6
+ COPY --chown=docker:docker lib/quiz_api_client/version.rb lib/quiz_api_client/version.rb
12
7
  RUN /bin/bash -l -c "rvm-exec 2.4 bundle install --jobs 5"
13
- COPY . /app
14
- RUN rm -f Gemfile.lock
15
8
 
16
- USER root
17
- RUN chown -R docker:docker /app
18
- USER docker
9
+ COPY --chown=docker:docker . .
19
10
 
20
11
  CMD /bin/bash -l -c "rvm-exec 2.4 bundle exec rspec"
@@ -0,0 +1,71 @@
1
+ pipeline {
2
+ agent {
3
+ label 'docker'
4
+ }
5
+ stages {
6
+ stage('Build') {
7
+ steps {
8
+ sh 'docker-compose build --pull'
9
+ }
10
+ }
11
+ stage('Lint') {
12
+ steps {
13
+ sh '''
14
+ docker-compose run --rm app /bin/bash -lc \
15
+ "rvm-exec 2.4 bundle exec rubocop --fail-level autocorrect"
16
+ '''
17
+ }
18
+ }
19
+ stage('Test') {
20
+ steps {
21
+ sh 'docker-compose run --name coverage app'
22
+ sh 'docker-compose run app /bin/bash -l -c "rvm-exec 2.4 bundle exec rspec -t pact"'
23
+ }
24
+ }
25
+ stage ('Publish') {
26
+ when { environment name: "GERRIT_EVENT_TYPE", value: "change-merged"}
27
+ environment {
28
+ PACT_BROKER_PASSWORD = credentials('pact_broker_password')
29
+ JENKINS_URL = "${env.JENKINS_URL}"
30
+ PACT_CONSUMER_TAG = 'master'
31
+ PACT_BROKER_USERNAME = 'quizzes'
32
+ PACT_BROKER_HOST = 'inst-pact-broker.inseng.net'
33
+ }
34
+ steps {
35
+ script {
36
+ sh '''
37
+ sha="$(git rev-parse --short HEAD)"
38
+
39
+ docker-compose run --rm \
40
+ -e JENKINS_URL="${JENKINS_URL}" \
41
+ -e PACT_BROKER_HOST="${PACT_BROKER_HOST}" \
42
+ -e PACT_BROKER_USERNAME="${PACT_BROKER_USERNAME}" \
43
+ -e PACT_BROKER_PASSWORD="${PACT_BROKER_PASSWORD}" \
44
+ -e PACT_CONSUMER_TAG="${PACT_CONSUMER_TAG}" \
45
+ -e SHA="${sha}" \
46
+ app /bin/bash -l -c "rvm-exec 2.4 bundle exec rake broker:pact:publish:jenkins_post_merge"
47
+ '''
48
+ }
49
+ }
50
+ }
51
+ }
52
+
53
+ post {
54
+ success {
55
+ sh 'docker cp coverage:/usr/src/app/coverage .'
56
+ publishHTML target: [
57
+ allowMissing: false,
58
+ alwaysLinkToLastBuild: false,
59
+ keepAll: true,
60
+ reportDir: "coverage",
61
+ reportFiles: 'index.html',
62
+ reportName: 'Coverage Report'
63
+ ]
64
+ }
65
+ cleanup { // Always runs after all other post conditions=
66
+ sh 'docker-compose kill'
67
+ sh 'docker-compose rm -f'
68
+ sh 'docker images -qf "dangling=true" | xargs docker rmi -f &>/dev/null'
69
+ }
70
+ }
71
+ }
data/Rakefile CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'bundler/gem_tasks'
2
2
  require 'pact_broker/client/tasks'
3
3
  require 'rspec/core/rake_task'
4
- require_relative './spec/contracts/pact_config'
4
+ require_relative './spec/support/pact_config'
5
5
 
6
6
  RSpec::Core::RakeTask.new(:spec)
7
7
 
@@ -14,7 +14,7 @@ function print_results() {
14
14
  docker cp contracts:/usr/src/app/pacts . &> /dev/null
15
15
  docker rm -f contracts &> /dev/null
16
16
 
17
- docker-compose rm -fv contracts-testrunner &> /dev/null
17
+ docker-compose rm -fv app &> /dev/null
18
18
  }
19
19
  trap print_results INT TERM EXIT
20
20
  set -e
@@ -23,5 +23,5 @@ rm -rf pacts
23
23
  sha="$(git rev-parse --short HEAD)"
24
24
 
25
25
 
26
- docker-compose run --name contracts -e SHA="${sha}" contracts-testrunner bash -c \
26
+ docker-compose run --name contracts -e SHA="${sha}" app bash -c \
27
27
  "bundle && bundle exec rspec spec/contracts && bundle exec rake broker:pact:publish:local"
@@ -1,19 +1,11 @@
1
- version: '2'
1
+ version: '3.5'
2
2
 
3
3
  services:
4
- testrunner:
5
- volumes:
6
- - .:/app
7
- - bundler-config:/home/docker/.rvm/gems/ruby-2.4.0
8
-
9
- contracts-testrunner:
10
- #external_links: # linux
11
- # - dory_dinghy_http_proxy:pact-broker.docker # linux
4
+ app:
5
+ # This port doesn't exist, but doing this tricks Dory proxy into hooking up
6
+ # the container so it can actually talk to the Pact Broker.
7
+ expose: [8080]
8
+ external_links:
9
+ - ${PROXY_CONTAINER:-dinghy_http_proxy}:pact-broker.docker
12
10
  volumes:
13
11
  - .:/usr/src/app
14
- #- api-logs:/usr/src/app/log # linux:fs
15
- - bundler-config:/home/docker/.rvm/gems/ruby-2.4.0
16
-
17
- volumes:
18
- bundler-config: {}
19
- api-logs: {}
@@ -1,13 +1,8 @@
1
- version: '2'
1
+ version: '3.5'
2
2
 
3
3
  services:
4
- testrunner:
4
+ app:
5
5
  build: .
6
-
7
- contracts-testrunner:
8
- build:
9
- context: .
10
- dockerfile: Dockerfile.contracts
11
6
  volumes:
12
7
  - pacts:/usr/src/app/pacts
13
8
 
@@ -23,6 +23,7 @@ module QuizApiClient
23
23
 
24
24
  def get(path, all: false, query: {})
25
25
  return make_request :get, url_for(path), query: query unless all
26
+
26
27
  make_paginated_request :get, url_for(path), query: query
27
28
  end
28
29
 
@@ -91,6 +92,7 @@ module QuizApiClient
91
92
  until request_url.nil?
92
93
  resp = make_request(method, request_url, request_options)
93
94
  raise RequestFailed, "#{url} responded #{resp.body} (#{resp.code})" unless resp.code == 200
95
+
94
96
  entities.concat(resp.parsed_response)
95
97
  request_url, request_options = next_page(resp, url, options)
96
98
  end
@@ -119,6 +121,7 @@ module QuizApiClient
119
121
 
120
122
  def next_page_link(response, options)
121
123
  return if response.headers['link'].blank?
124
+
122
125
  links = LinkHeader.parse(response.headers['link']).links
123
126
  next_link = links.find { |link| link['rel'] == 'next' }
124
127
  [next_link.href, options] if next_link
@@ -2,6 +2,7 @@ module QuizApiClient::Services
2
2
  class ItemAnalysesService < BaseApiService
3
3
  def list(params:, token: nil, all: false)
4
4
  raise 'Quiz Id Required' unless params.key?(:quiz_id)
5
+
5
6
  client(token: token).get(
6
7
  "/api/quizzes/#{params[:quiz_id]}/stats/item_analyses",
7
8
  all: all
@@ -10,6 +11,7 @@ module QuizApiClient::Services
10
11
 
11
12
  def get(params:, token: nil)
12
13
  raise 'Quiz Id and Item Id are Required' unless params.key?(:id) && params.key?(:quiz_id)
14
+
13
15
  client(token: token).get(
14
16
  "/api/quizzes/#{params[:quiz_id]}/stats/item_analyses/#{params[:id]}"
15
17
  )
@@ -2,6 +2,7 @@ module QuizApiClient::Services
2
2
  class ItemsService < BaseApiService
3
3
  def create(params:, token: nil)
4
4
  raise 'Quiz Id Required' unless params && params[:quiz_id]
5
+
5
6
  post_to_quiz_api(params: params, token: token)
6
7
  end
7
8
 
@@ -2,6 +2,7 @@ module QuizApiClient::Services
2
2
  class QtiImportsService < BaseApiService
3
3
  def create(params:, token: nil)
4
4
  raise 'Quiz Id Required' unless params && params[:quiz_id]
5
+
5
6
  post_to_quiz_api(params: params, token: token)
6
7
  end
7
8
 
@@ -2,6 +2,7 @@ module QuizApiClient::Services
2
2
  class QuizAnalysesService < BaseApiService
3
3
  def get(params:, token: nil)
4
4
  raise 'Quiz Id Required' unless params.key?(:quiz_id)
5
+
5
6
  get_from_quiz_api(params: params, token: token)
6
7
  end
7
8
 
@@ -2,6 +2,7 @@ module QuizApiClient::Services
2
2
  class QuizCloneJobService < BaseApiService
3
3
  def show(params:, token: nil)
4
4
  raise 'Quiz Clone Job Id Required' unless params && params[:id]
5
+
5
6
  get_from_quiz_api(params: params, token: token)
6
7
  end
7
8
 
@@ -2,17 +2,20 @@ module QuizApiClient::Services
2
2
  class QuizEntriesService < BaseApiService
3
3
  def create(params:, token: nil)
4
4
  raise 'Quiz Id Required' unless params && params[:id]
5
+
5
6
  post_to_quiz_api(params: params, token: token)
6
7
  end
7
8
 
8
9
  def list(params:, token: nil, all: false)
9
10
  raise 'Quiz Id Required' unless params && params[:id]
11
+
10
12
  get_from_quiz_api(params: params, token: token, all: all)
11
13
  end
12
14
 
13
15
  def destroy(params:, token: nil)
14
16
  raise 'Quiz Id Required' unless params && params[:quiz_id]
15
17
  raise 'Item Id Required' unless params && params[:id]
18
+
16
19
  delete_from_quiz_api(params, token)
17
20
  end
18
21
 
@@ -2,6 +2,7 @@ module QuizApiClient::Services
2
2
  class QuizSessionEventsService < BaseApiService
3
3
  def list(params:, token: nil, all: false)
4
4
  raise 'Quiz Session Id Required' unless params.key?(:quiz_session_id)
5
+
5
6
  get_from_quiz_api(params: params, token: token, all: all)
6
7
  end
7
8
 
@@ -2,6 +2,7 @@ module QuizApiClient::Services
2
2
  class QuizSessionResultService < BaseApiService
3
3
  def show(params:, token: nil)
4
4
  raise 'Quiz Session Result Id Required' unless params && params[:id]
5
+
5
6
  get_from_quiz_api(params: params, token: token)
6
7
  end
7
8
 
@@ -6,6 +6,7 @@ module QuizApiClient::Services
6
6
 
7
7
  def show(params:, token: nil)
8
8
  raise 'Quiz Session Id Required' unless params && params[:id]
9
+
9
10
  get_from_quiz_api(params: params, token: token)
10
11
  end
11
12
 
@@ -3,6 +3,7 @@ module QuizApiClient::Services
3
3
  def list(params:, token: nil)
4
4
  raise 'Quiz Id Required' unless params && params[:quiz_id]
5
5
  raise 'Quiz Session Ids Required' unless params && params[:ids]
6
+
6
7
  client(token: token).get(
7
8
  "/api/quizzes/#{params[:quiz_id]}/quiz_sessions",
8
9
  query: params[:ids].to_query('ids')
@@ -11,6 +12,7 @@ module QuizApiClient::Services
11
12
 
12
13
  def create(params:, token: nil)
13
14
  raise 'Quiz Id Required' unless params && params[:quiz_id]
15
+
14
16
  post_to_quiz_api(params: params, token: token)
15
17
  end
16
18
 
@@ -3,6 +3,7 @@ module QuizApiClient::Services
3
3
  def list(params:, token: nil, all: false)
4
4
  raise 'QuizSession Id Required' unless params && params[:quiz_session_id]
5
5
  raise 'QuizSessionResult Id Required' unless params && params[:quiz_session_result_id]
6
+
6
7
  get_from_quiz_api(params: params, token: token, all: all)
7
8
  end
8
9
 
@@ -2,6 +2,7 @@ module QuizApiClient::Services
2
2
  class SessionItemsService < BaseApiService
3
3
  def list(params:, token: nil, all: false)
4
4
  raise 'QuizSession Id Required' unless params && params[:quiz_session_id]
5
+
5
6
  get_from_quiz_api(params: params, token: token, all: all)
6
7
  end
7
8
 
@@ -2,6 +2,7 @@ module QuizApiClient::Services
2
2
  class SharedBanks < BaseApiService
3
3
  def list(params:, token: nil, all: false)
4
4
  raise 'Bank Id Required' unless params && params[:bank_id]
5
+
5
6
  client(token: token).get(
6
7
  "/api/banks/#{params[:bank_id]}/shared_banks",
7
8
  all: all
@@ -10,6 +11,7 @@ module QuizApiClient::Services
10
11
 
11
12
  def create(params:, token: nil)
12
13
  raise 'Bank Id Required' unless params && params[:bank_id]
14
+
13
15
  client(token: token).post(
14
16
  "/api/banks/#{params[:bank_id]}/shared_banks",
15
17
  params
@@ -19,6 +21,7 @@ module QuizApiClient::Services
19
21
  def update(params:, token: nil)
20
22
  raise 'Bank Id Required' unless params && params[:bank_id]
21
23
  raise 'Shared Bank Id Required' unless params && params[:shared_bank_id]
24
+
22
25
  shared_bank_id = params.delete(:shared_bank_id)
23
26
  client(token: token).put(
24
27
  "/api/banks/#{params[:bank_id]}/shared_banks/#{shared_bank_id}",
@@ -1,3 +1,3 @@
1
1
  module QuizApiClient
2
- VERSION = '2.9.0'.freeze
2
+ VERSION = '3.0.0'.freeze
3
3
  end
@@ -1,4 +1,4 @@
1
- lib = File.expand_path('../lib', __FILE__)
1
+ lib = File.expand_path('lib', __dir__)
2
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
  require 'quiz_api_client/version'
4
4
 
@@ -40,18 +40,18 @@ Gem::Specification.new do |spec|
40
40
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
41
41
  spec.require_paths = ['lib']
42
42
 
43
- spec.required_ruby_version = '>= 2.3'
43
+ spec.required_ruby_version = '>= 2.4'
44
44
 
45
- spec.add_dependency 'httparty', '~> 0.14.0'
46
- spec.add_dependency 'jwt', '>= 1.5', '< 3.0'
45
+ spec.add_dependency 'httparty', '~> 0.17'
46
+ spec.add_dependency 'jwt', '~> 2.2'
47
47
  spec.add_dependency 'link_header', '~> 0.0'
48
48
 
49
- spec.add_development_dependency 'bundler', '~> 1.15'
50
- spec.add_development_dependency 'pact', '~> 1.20.1'
51
- spec.add_development_dependency 'pact_broker-client', '~> 1.14.0'
52
- spec.add_development_dependency 'rake', '~> 12.0'
53
- spec.add_development_dependency 'rspec', '~> 3.7'
54
- spec.add_development_dependency 'rubocop', '~> 0.52.1'
49
+ spec.add_development_dependency 'bundler', '~> 1.17'
50
+ spec.add_development_dependency 'pact', '~> 1.41'
51
+ spec.add_development_dependency 'pact_broker-client', '~> 1.19'
52
+ spec.add_development_dependency 'rake', '~> 12.3'
53
+ spec.add_development_dependency 'rspec', '~> 3.8'
54
+ spec.add_development_dependency 'rubocop', '~> 0.74.0'
55
55
  spec.add_development_dependency 'simplecov'
56
56
  spec.add_development_dependency 'webmock'
57
57
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quiz_api_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.9.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Wang
@@ -19,7 +19,7 @@ authors:
19
19
  autorequire:
20
20
  bindir: exe
21
21
  cert_chain: []
22
- date: 2019-03-05 00:00:00.000000000 Z
22
+ date: 2019-08-27 00:00:00.000000000 Z
23
23
  dependencies:
24
24
  - !ruby/object:Gem::Dependency
25
25
  name: httparty
@@ -27,34 +27,28 @@ dependencies:
27
27
  requirements:
28
28
  - - "~>"
29
29
  - !ruby/object:Gem::Version
30
- version: 0.14.0
30
+ version: '0.17'
31
31
  type: :runtime
32
32
  prerelease: false
33
33
  version_requirements: !ruby/object:Gem::Requirement
34
34
  requirements:
35
35
  - - "~>"
36
36
  - !ruby/object:Gem::Version
37
- version: 0.14.0
37
+ version: '0.17'
38
38
  - !ruby/object:Gem::Dependency
39
39
  name: jwt
40
40
  requirement: !ruby/object:Gem::Requirement
41
41
  requirements:
42
- - - ">="
43
- - !ruby/object:Gem::Version
44
- version: '1.5'
45
- - - "<"
42
+ - - "~>"
46
43
  - !ruby/object:Gem::Version
47
- version: '3.0'
44
+ version: '2.2'
48
45
  type: :runtime
49
46
  prerelease: false
50
47
  version_requirements: !ruby/object:Gem::Requirement
51
48
  requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '1.5'
55
- - - "<"
49
+ - - "~>"
56
50
  - !ruby/object:Gem::Version
57
- version: '3.0'
51
+ version: '2.2'
58
52
  - !ruby/object:Gem::Dependency
59
53
  name: link_header
60
54
  requirement: !ruby/object:Gem::Requirement
@@ -75,84 +69,84 @@ dependencies:
75
69
  requirements:
76
70
  - - "~>"
77
71
  - !ruby/object:Gem::Version
78
- version: '1.15'
72
+ version: '1.17'
79
73
  type: :development
80
74
  prerelease: false
81
75
  version_requirements: !ruby/object:Gem::Requirement
82
76
  requirements:
83
77
  - - "~>"
84
78
  - !ruby/object:Gem::Version
85
- version: '1.15'
79
+ version: '1.17'
86
80
  - !ruby/object:Gem::Dependency
87
81
  name: pact
88
82
  requirement: !ruby/object:Gem::Requirement
89
83
  requirements:
90
84
  - - "~>"
91
85
  - !ruby/object:Gem::Version
92
- version: 1.20.1
86
+ version: '1.41'
93
87
  type: :development
94
88
  prerelease: false
95
89
  version_requirements: !ruby/object:Gem::Requirement
96
90
  requirements:
97
91
  - - "~>"
98
92
  - !ruby/object:Gem::Version
99
- version: 1.20.1
93
+ version: '1.41'
100
94
  - !ruby/object:Gem::Dependency
101
95
  name: pact_broker-client
102
96
  requirement: !ruby/object:Gem::Requirement
103
97
  requirements:
104
98
  - - "~>"
105
99
  - !ruby/object:Gem::Version
106
- version: 1.14.0
100
+ version: '1.19'
107
101
  type: :development
108
102
  prerelease: false
109
103
  version_requirements: !ruby/object:Gem::Requirement
110
104
  requirements:
111
105
  - - "~>"
112
106
  - !ruby/object:Gem::Version
113
- version: 1.14.0
107
+ version: '1.19'
114
108
  - !ruby/object:Gem::Dependency
115
109
  name: rake
116
110
  requirement: !ruby/object:Gem::Requirement
117
111
  requirements:
118
112
  - - "~>"
119
113
  - !ruby/object:Gem::Version
120
- version: '12.0'
114
+ version: '12.3'
121
115
  type: :development
122
116
  prerelease: false
123
117
  version_requirements: !ruby/object:Gem::Requirement
124
118
  requirements:
125
119
  - - "~>"
126
120
  - !ruby/object:Gem::Version
127
- version: '12.0'
121
+ version: '12.3'
128
122
  - !ruby/object:Gem::Dependency
129
123
  name: rspec
130
124
  requirement: !ruby/object:Gem::Requirement
131
125
  requirements:
132
126
  - - "~>"
133
127
  - !ruby/object:Gem::Version
134
- version: '3.7'
128
+ version: '3.8'
135
129
  type: :development
136
130
  prerelease: false
137
131
  version_requirements: !ruby/object:Gem::Requirement
138
132
  requirements:
139
133
  - - "~>"
140
134
  - !ruby/object:Gem::Version
141
- version: '3.7'
135
+ version: '3.8'
142
136
  - !ruby/object:Gem::Dependency
143
137
  name: rubocop
144
138
  requirement: !ruby/object:Gem::Requirement
145
139
  requirements:
146
140
  - - "~>"
147
141
  - !ruby/object:Gem::Version
148
- version: 0.52.1
142
+ version: 0.74.0
149
143
  type: :development
150
144
  prerelease: false
151
145
  version_requirements: !ruby/object:Gem::Requirement
152
146
  requirements:
153
147
  - - "~>"
154
148
  - !ruby/object:Gem::Version
155
- version: 0.52.1
149
+ version: 0.74.0
156
150
  - !ruby/object:Gem::Dependency
157
151
  name: simplecov
158
152
  requirement: !ruby/object:Gem::Requirement
@@ -205,14 +199,13 @@ files:
205
199
  - ".rspec"
206
200
  - ".rubocop.yml"
207
201
  - Dockerfile
208
- - Dockerfile.contracts
209
202
  - Gemfile
203
+ - Jenkinsfile
210
204
  - README.md
211
205
  - Rakefile
212
206
  - bin/console
213
207
  - bin/contracts-generate
214
208
  - bin/setup
215
- - build.sh
216
209
  - docker-compose.dev.override.yml
217
210
  - docker-compose.yml
218
211
  - lib/quiz_api_client.rb
@@ -250,7 +243,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
250
243
  requirements:
251
244
  - - ">="
252
245
  - !ruby/object:Gem::Version
253
- version: '2.3'
246
+ version: '2.4'
254
247
  required_rubygems_version: !ruby/object:Gem::Requirement
255
248
  requirements:
256
249
  - - ">="
@@ -258,7 +251,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
258
251
  version: '0'
259
252
  requirements: []
260
253
  rubyforge_project:
261
- rubygems_version: 2.7.8
254
+ rubygems_version: 2.6.14.4
262
255
  signing_key:
263
256
  specification_version: 4
264
257
  summary: Ruby client for quiz_api
@@ -1,19 +0,0 @@
1
- FROM instructure/ruby:2.3
2
-
3
- USER root
4
-
5
- ENV APP_HOME /usr/src/app
6
- RUN mkdir -p $APP_HOME/log
7
- RUN mkdir -p $APP_HOME/pacts
8
-
9
- COPY quiz_api_client.gemspec Gemfile $APP_HOME/
10
- COPY lib/quiz_api_client/version.rb $APP_HOME/lib/quiz_api_client/version.rb
11
-
12
- USER docker
13
- RUN bundle install --quiet --jobs 8
14
-
15
- USER root
16
- COPY . $APP_HOME
17
- RUN chown -R docker:docker $APP_HOME
18
-
19
- USER docker
data/build.sh DELETED
@@ -1,49 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- set -ex
4
-
5
- function publish_pact_file_to_pact_broker()
6
- {
7
- echo "Publishing pact file to Pact Broker..."
8
-
9
- sha="$(git rev-parse --short HEAD)"
10
-
11
- docker-compose run --rm \
12
- -e JENKINS_URL="${JENKINS_URL}" \
13
- -e PACT_BROKER_HOST="${PACT_BROKER_HOST}" \
14
- -e PACT_BROKER_USERNAME="${PACT_BROKER_USERNAME}" \
15
- -e PACT_BROKER_PASSWORD="${PACT_BROKER_PASSWORD}" \
16
- -e PACT_CONSUMER_TAG="${PACT_CONSUMER_TAG}" \
17
- -e SHA="${sha}" \
18
- contracts-testrunner bundle exec rake broker:pact:publish:jenkins_post_merge
19
- }
20
-
21
- function cleanup() {
22
- exit_code=$?
23
- set +e
24
- docker cp coverage:/app/coverage .
25
- docker-compose kill
26
- docker-compose rm -f
27
- exit $exit_code
28
- }
29
- trap cleanup INT TERM EXIT
30
-
31
- docker-compose build --pull
32
-
33
- echo "Running Rubocop..."
34
- docker-compose run --rm testrunner /bin/bash -lc \
35
- "rvm-exec 2.4 bundle exec rubocop --fail-level autocorrect"
36
-
37
- echo "Running test suite..."
38
- docker-compose run --name coverage testrunner $@
39
-
40
- echo
41
- echo "Running contract tests..."
42
- docker-compose run --name contracts -T contracts-testrunner bundle exec rspec spec/contracts
43
- docker cp contracts:/usr/src/app/pacts .
44
- docker cp contracts:/usr/src/app/log .
45
- echo
46
-
47
- if [[ "${GERRIT_EVENT_TYPE}" == "change-merged" ]]; then
48
- publish_pact_file_to_pact_broker
49
- fi