bridge_blueprint 0.0.06 → 0.0.7

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
  SHA1:
3
- metadata.gz: d8a68f02757c7f40a292efbc3881a81da73d0700
4
- data.tar.gz: 7ac7101287000b7426ea73bb80ddc2a4c069db33
3
+ metadata.gz: 648fb3cdd4632441ea69faceece261f3de0494b9
4
+ data.tar.gz: 9f3ee9ce9afe2f263cc78ed6bd4372ccc7c173c2
5
5
  SHA512:
6
- metadata.gz: 0c4496431f46b3182cbe48da9531f5a95645ae692a54fc22b3fbdea074cebafba82562ab0f00dc2f1c92a360f487fd68d1885215652e85261f970065811d9d93
7
- data.tar.gz: 203ea3230d0dd1a513afca9624caa8fa94e26035356645439b57209a610b1b7b6d332ec3833917e0d0e136e2ca74fe75b52fbf9febb919d7b5d39ec698df7eff
6
+ metadata.gz: 871443c0cd31f831d4f4463b90fdb90cde0b78053c9ab0fb7427cec22e84bdc95817bd9d9e3ccddcc40f1b729ea465c8a3529ba082ead5d9bce87206975e97f2
7
+ data.tar.gz: d09ffe2a72ccc00b58b402d122ec96a177e76d4603d7e8f72b755190b9ad666e690018443420c7a78a8c84ea32790c1bc5c00d8a223069e4b5024cabffb4ac09
data/.gitignore CHANGED
@@ -1,6 +1,50 @@
1
- /.*.iml
2
- .idea/
3
- bridge_api.iml
4
- .byebug.*
5
- .byebug_history
6
- .*.gem
1
+ *.gem
2
+ *.rbc
3
+ /.config
4
+ /coverage/
5
+ /InstalledFiles
6
+ /pkg/
7
+ /spec/reports/
8
+ /spec/examples.txt
9
+ /test/tmp/
10
+ /test/version_tmp/
11
+ /tmp/
12
+
13
+ # Used by dotenv library to load environment variables.
14
+ # .env
15
+
16
+ ## Specific to RubyMotion:
17
+ .dat*
18
+ .repl_history
19
+ build/
20
+ *.bridgesupport
21
+ build-iPhoneOS/
22
+ build-iPhoneSimulator/
23
+
24
+ ## Specific to RubyMotion (use of CocoaPods):
25
+ #
26
+ # We recommend against adding the Pods directory to your .gitignore. However
27
+ # you should judge for yourself, the pros and cons are mentioned at:
28
+ # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
29
+ #
30
+ # vendor/Pods/
31
+
32
+ ## Documentation cache and generated files:
33
+ /.yardoc/
34
+ /_yardoc/
35
+ /doc/
36
+ /rdoc/
37
+
38
+ ## Environment normalization:
39
+ /.bundle/
40
+ /vendor/bundle
41
+ /lib/bundler/man/
42
+
43
+ # for a library or gem, you might want to ignore these files since the code is
44
+ # intended to run in multiple environments; otherwise, check them in:
45
+ # Gemfile.lock
46
+ # .ruby-version
47
+ # .ruby-gemset
48
+
49
+ # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
50
+ .rvmrc
@@ -0,0 +1,24 @@
1
+ AllCops:
2
+ Exclude:
3
+ - 'bin/**/*'
4
+ - 'node_modules/**/*'
5
+ - 'vendor/**/*'
6
+ Metrics/ClassLength:
7
+ Max: 150
8
+ Metrics/LineLength:
9
+ Max: 120
10
+ Style/Documentation:
11
+ Enabled: false
12
+ Metrics/BlockLength:
13
+ Exclude:
14
+ - 'bridge_blueprint.gemspec'
15
+ - 'spec/**/*'
16
+ Style/FrozenStringLiteralComment:
17
+ Enabled: false
18
+ Style/SymbolArray:
19
+ Enabled: false
20
+ Metrics/MethodLength:
21
+ Exclude:
22
+ - spec/**/*
23
+ Naming/AccessorMethodName:
24
+ Enabled: false
@@ -0,0 +1,7 @@
1
+ # This file is copied to spec/ when you run 'rails generate rspec:install'
2
+ SimpleCov.minimum_coverage 80
3
+ SimpleCov.minimum_coverage_by_file 80
4
+ SimpleCov.start do
5
+ add_group 'lib', 'lib'
6
+ add_filter 'spec'
7
+ end
@@ -0,0 +1,14 @@
1
+ FROM ruby:2.5.0
2
+
3
+ RUN apt-get update
4
+
5
+ RUN mkdir -p /usr/src/app
6
+ COPY Gemfile /usr/src/app/
7
+ COPY Gemfile.lock /usr/src/app/
8
+ COPY bridge_blueprint.gemspec /usr/src/app/
9
+ COPY /lib/bridge_blueprint/version.rb /usr/src/app/lib/bridge_blueprint/
10
+
11
+ WORKDIR /usr/src/app
12
+ RUN bundle install --system
13
+
14
+ COPY . /usr/src/app/
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bridge_blueprint (0.0.06)
4
+ bridge_blueprint (0.0.7)
5
5
  bridge_api (~> 0.1.16)
6
6
  open_uri_redirections (~> 0.2.1)
7
7
  rubyzip (~> 1.2.1)
@@ -16,6 +16,7 @@ GEM
16
16
  tzinfo (~> 1.1)
17
17
  addressable (2.5.1)
18
18
  public_suffix (~> 2.0, >= 2.0.2)
19
+ ast (2.4.0)
19
20
  bridge_api (0.1.19)
20
21
  faraday (~> 0.9.0)
21
22
  faraday_middleware (~> 0.9.0)
@@ -26,6 +27,7 @@ GEM
26
27
  crack (0.4.3)
27
28
  safe_yaml (~> 1.0.0)
28
29
  diff-lcs (1.3)
30
+ docile (1.3.0)
29
31
  faraday (0.9.2)
30
32
  multipart-post (>= 1.2, < 3)
31
33
  faraday_middleware (0.9.2)
@@ -37,11 +39,16 @@ GEM
37
39
  hashdiff (0.3.4)
38
40
  i18n (1.0.0)
39
41
  concurrent-ruby (~> 1.0)
42
+ json (2.1.0)
40
43
  link_header (0.0.8)
41
44
  method_source (0.8.2)
42
45
  minitest (5.11.3)
43
46
  multipart-post (2.0.0)
44
47
  open_uri_redirections (0.2.1)
48
+ parallel (1.12.1)
49
+ parser (2.5.1.0)
50
+ ast (~> 2.4.0)
51
+ powerpack (0.1.1)
45
52
  pry (0.10.4)
46
53
  coderay (~> 1.1.0)
47
54
  method_source (~> 0.8.1)
@@ -50,6 +57,7 @@ GEM
50
57
  rack (1.6.5)
51
58
  rack-protection (1.5.3)
52
59
  rack
60
+ rainbow (3.0.0)
53
61
  rake (0.9.6)
54
62
  rspec (2.99.0)
55
63
  rspec-core (~> 2.99.0)
@@ -59,8 +67,21 @@ GEM
59
67
  rspec-expectations (2.99.2)
60
68
  diff-lcs (>= 1.1.3, < 2.0)
61
69
  rspec-mocks (2.99.4)
70
+ rubocop (0.54.0)
71
+ parallel (~> 1.10)
72
+ parser (>= 2.5)
73
+ powerpack (~> 0.1)
74
+ rainbow (>= 2.2.2, < 4.0)
75
+ ruby-progressbar (~> 1.7)
76
+ unicode-display_width (~> 1.0, >= 1.0.1)
77
+ ruby-progressbar (1.9.0)
62
78
  rubyzip (1.2.1)
63
79
  safe_yaml (1.0.4)
80
+ simplecov (0.16.1)
81
+ docile (~> 1.1)
82
+ json (>= 1.8, < 3)
83
+ simplecov-html (~> 0.10.0)
84
+ simplecov-html (0.10.2)
64
85
  sinatra (1.4.8)
65
86
  rack (~> 1.5)
66
87
  rack-protection (~> 1.4)
@@ -70,6 +91,7 @@ GEM
70
91
  tilt (1.4.1)
71
92
  tzinfo (1.2.5)
72
93
  thread_safe (~> 0.1)
94
+ unicode-display_width (1.3.2)
73
95
  webmock (2.3.2)
74
96
  addressable (>= 2.3.6)
75
97
  crack (>= 0.3.2)
@@ -85,6 +107,8 @@ DEPENDENCIES
85
107
  pry (~> 0)
86
108
  rake (~> 0)
87
109
  rspec (~> 2.6)
110
+ rubocop (~> 0.54.0)
111
+ simplecov (~> 0.16.1)
88
112
  sinatra (~> 1.0)
89
113
  tilt (~> 1.3, >= 1.3.4)
90
114
  webmock (~> 2.3.1)
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env bash
2
+
3
+ set +e
4
+ EXIT_CODES=0
5
+
6
+ #Skip this for now until we can fix all the cop issues
7
+
8
+ #echo "Analyzing ruby code with rubocop"
9
+ #bundle exec gergich capture rubocop "bundle exec rubocop --fail-level autocorrect"
10
+ #EXIT_CODES=$(($EXIT_CODES + $?))
11
+
12
+ echo 'Running ruby specs'
13
+ bundle exec rspec
14
+ EXIT_CODES=$(($EXIT_CODES + $?))
15
+
16
+ bundle exec gergich publish
17
+ exit $EXIT_CODES
@@ -29,6 +29,8 @@ Gem::Specification.new do |gem|
29
29
  gem.add_development_dependency 'pry', '~> 0'
30
30
  gem.add_development_dependency 'rake', '~> 0'
31
31
  gem.add_development_dependency 'rspec', '~> 2.6'
32
+ gem.add_development_dependency 'rubocop', '~> 0.54.0'
33
+ gem.add_development_dependency 'simplecov', '~> 0.16.1'
32
34
  gem.add_development_dependency 'sinatra', '~> 1.0'
33
35
  gem.add_development_dependency 'tilt', '>= 1.3.4', '~> 1.3'
34
36
  gem.add_development_dependency 'webmock', '~>2.3.1'
@@ -0,0 +1,5 @@
1
+ set -e
2
+
3
+ docker-compose build
4
+ docker-compose up -d
5
+ docker-compose run -T web bin/jenkins
@@ -0,0 +1,18 @@
1
+ version: '2'
2
+
3
+ services:
4
+ web:
5
+ build:
6
+ context: .
7
+ dockerfile: ./Dockerfile
8
+ environment:
9
+ APP_DOMAIN: web
10
+ GERGICH_KEY: "${GERGICH_KEY}"
11
+ GERRIT_PROJECT: "${GERRIT_PROJECT}"
12
+ GERRIT_HOST: "${GERRIT_HOST}"
13
+ GERRIT_BRANCH: "${GERRIT_BRANCH}"
14
+ volumes:
15
+ - "coverage:/usr/src/app/coverage"
16
+
17
+ volumes:
18
+ coverage: {}
@@ -38,22 +38,18 @@ module BridgeBlueprint
38
38
  return
39
39
  when 'complete'
40
40
  return if Time.parse(dump['date']) > Time.now - 300
41
- end
41
+ end
42
42
  end
43
43
  @client.create_data_dump
44
44
  end
45
45
 
46
46
  def status
47
47
  dumps = get_dumps
48
- if !dumps.members.empty?
49
- return get_dumps.first['status']
50
- else
51
- return BridgeBlueprint::Constants::STATUS_NOT_FOUND
52
- end
48
+ return get_dumps.first['status'] unless dumps.members.empty?
49
+ BridgeBlueprint::Constants::STATUS_NOT_FOUND
53
50
  end
54
51
 
55
- def store_file(path)
56
- @file_path = path
52
+ def remote_url
57
53
  uri = URI.parse(@base_url)
58
54
  http = Net::HTTP.new(uri.host, uri.port)
59
55
  http.read_timeout = 300
@@ -61,9 +57,15 @@ module BridgeBlueprint
61
57
  req = Net::HTTP::Get.new("#{@base_url}/api/admin/data_dumps/download")
62
58
  req.add_field('Authorization', @auth_header)
63
59
  res = http.request(req)
64
- redirect_url = res['location']
60
+ res['location']
61
+ end
62
+
63
+ def store_file(path)
64
+ @file_path = path
65
+ url = remote_url
66
+ raise 'Missing location url from bridge data dump response' if url.blank?
65
67
  File.open(@file_path, 'w') do |_file|
66
- IO.copy_stream(open(redirect_url), @file_path)
68
+ IO.copy_stream(open(url), @file_path)
67
69
  end
68
70
  end
69
71
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BridgeBlueprint
4
- VERSION = '0.0.06' unless defined?(BridgeBlueprint::VERSION)
4
+ VERSION = '0.0.7' unless defined?(BridgeBlueprint::VERSION)
5
5
  end
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'simplecov'
3
4
  require 'bridge_blueprint'
4
5
  require 'rspec'
5
6
  require 'webmock/rspec'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bridge_blueprint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.06
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jay Shaffer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-10 00:00:00.000000000 Z
11
+ date: 2018-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bridge_api
@@ -128,6 +128,34 @@ dependencies:
128
128
  - - "~>"
129
129
  - !ruby/object:Gem::Version
130
130
  version: '2.6'
131
+ - !ruby/object:Gem::Dependency
132
+ name: rubocop
133
+ requirement: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - "~>"
136
+ - !ruby/object:Gem::Version
137
+ version: 0.54.0
138
+ type: :development
139
+ prerelease: false
140
+ version_requirements: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - "~>"
143
+ - !ruby/object:Gem::Version
144
+ version: 0.54.0
145
+ - !ruby/object:Gem::Dependency
146
+ name: simplecov
147
+ requirement: !ruby/object:Gem::Requirement
148
+ requirements:
149
+ - - "~>"
150
+ - !ruby/object:Gem::Version
151
+ version: 0.16.1
152
+ type: :development
153
+ prerelease: false
154
+ version_requirements: !ruby/object:Gem::Requirement
155
+ requirements:
156
+ - - "~>"
157
+ - !ruby/object:Gem::Version
158
+ version: 0.16.1
131
159
  - !ruby/object:Gem::Dependency
132
160
  name: sinatra
133
161
  requirement: !ruby/object:Gem::Requirement
@@ -184,11 +212,17 @@ extensions: []
184
212
  extra_rdoc_files: []
185
213
  files:
186
214
  - ".gitignore"
215
+ - ".rubocop.yml"
187
216
  - ".ruby-version"
217
+ - ".simplecov"
218
+ - Dockerfile
188
219
  - Gemfile
189
220
  - Gemfile.lock
190
221
  - README.rdoc
222
+ - bin/jenkins
191
223
  - bridge_blueprint.gemspec
224
+ - build.sh
225
+ - docker-compose.yml
192
226
  - lib/bridge_blueprint.rb
193
227
  - lib/bridge_blueprint/constants.rb
194
228
  - lib/bridge_blueprint/data_dump.rb