gitlab-labkit 0.0.3 → 0.0.4

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: 2e2b96ee615763a900d4250febc1c88ba8d144e4fa8cc972480a4f6ff9eab37e
4
- data.tar.gz: ff1fa050ecde439b8bee866a8898e83bd6e8938a4f6f3cb46cce6c3b293d379d
3
+ metadata.gz: de8b261c2e8cb807efc60666a66cb873ac78515f6683500a5d012d1eb8239253
4
+ data.tar.gz: 81db5405e294b647fa851c6673e48f898d0b729785b26173c30ff19860e3d7fb
5
5
  SHA512:
6
- metadata.gz: 14a684e60485902bd23d4fad464c730eb126a0443731de937f152146ae0fbf8935574798c2f810b5fd649a9365d81de9f0e97935bf9da44e89646837a6b1fa71
7
- data.tar.gz: b66791346a37b628f8ebe37a272f3d78b3e9793f9011540c85cd5682f6a7942797de3f08657defe528c83cc8feaaf3569fe853b4c5525275363b1ecbd82919f1
6
+ metadata.gz: c38a4dac36cc77fb4cc2df6308ce7e4053be708689b0970f0aebf605da02a347c32c9ffa364bd7db84f6b8e9d978ff07eda1c66d827cac472ca6a5275e4bf654
7
+ data.tar.gz: eb0e29293b2185d51f57c16e18087d408e38f2a9f0d5f6ffc12319b87691e2b367e3e9e8f10eddc3301c782a3900a650785be6ba8f3ae5032e648084ed6346ac
data/.gitignore ADDED
@@ -0,0 +1,3 @@
1
+ Gemfile.lock
2
+ *.gem
3
+ node_modules
data/.gitlab-ci.yml ADDED
@@ -0,0 +1,26 @@
1
+ .test_template: &test_definition
2
+ stage: test
3
+ script:
4
+ - bundle install
5
+ - bundle exec rake verify build install
6
+
7
+ test:2.6:
8
+ image: ruby:2.6
9
+ <<: *test_definition
10
+
11
+ test:2.5:
12
+ image: ruby:2.5
13
+ <<: *test_definition
14
+
15
+ test:2.4:
16
+ image: ruby:2.4
17
+ <<: *test_definition
18
+
19
+ deploy:
20
+ stage: deploy
21
+ script:
22
+ - "printf '---\n:rubygems_api_key: $RUBYGEMS_API_KEY\n' > ~/.gem/credentials"
23
+ - bundle install
24
+ - bundle exec rake release[remote]
25
+ only:
26
+ - tags
data/.prettierrc ADDED
@@ -0,0 +1,3 @@
1
+ {
2
+ "printWidth": 160
3
+ }
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --require ./spec/spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,12 @@
1
+ require:
2
+ - rubocop-rspec
3
+
4
+ inherit_gem:
5
+ gitlab-styles:
6
+ - rubocop-default.yml
7
+
8
+ Style/HashSyntax:
9
+ EnforcedStyle: no_mixed_keys
10
+
11
+ Style/SymbolLiteral:
12
+ Enabled: No
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ ruby-2.5.3
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gemspec
data/Rakefile ADDED
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+
5
+ begin
6
+ require 'rspec/core/rake_task'
7
+ RSpec::Core::RakeTask.new(:spec)
8
+ rescue LoadError
9
+ end
10
+
11
+ require 'rubocop/rake_task'
12
+ RuboCop::RakeTask.new
13
+
14
+ task :format do
15
+ prettier_cmd = "./node_modules/.bin/prettier --write --plugin=@prettier/plugin-ruby '**/*.rb'"
16
+ sh "#{prettier_cmd} || npm install && #{prettier_cmd}"
17
+ end
18
+
19
+ task "format:check" do
20
+ prettier_cmd = "./node_modules/.bin/prettier --check --plugin=@prettier/plugin-ruby '**/*.rb'"
21
+ sh "#{prettier_cmd} || npm install && #{prettier_cmd}"
22
+ end
23
+
24
+ task :default => %w[spec rubocop build format:check]
25
+
26
+ task :fix => %w[format rubocop:auto_correct]
27
+
28
+ task :verify => %w[spec rubocop]
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
 
4
4
  Gem::Specification.new do |spec|
5
5
  spec.name = 'gitlab-labkit'
6
- spec.version = '0.0.3'
6
+ spec.version = '0.0.4'
7
7
  spec.authors = ['Andrew Newdigate']
8
8
  spec.email = ['andrew@gitlab.com']
9
9
 
@@ -11,8 +11,9 @@ Gem::Specification.new do |spec|
11
11
  spec.homepage = 'http://about.gitlab.com'
12
12
  spec.license = 'MIT'
13
13
 
14
- spec.files = Dir.glob('lib/**/*.{rb,md}') + %w[gitlab-labkit.gemspec] # LICENSE README.md
14
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^spec/}) }
15
15
  spec.require_paths = ["lib"]
16
+ spec.required_ruby_version = '>= 2.3.0'
16
17
 
17
18
  spec.add_runtime_dependency 'activesupport', '~> 5'
18
19
  spec.add_runtime_dependency 'grpc', '~> 1.15'
@@ -0,0 +1,7 @@
1
+ # rubocop:disable Naming/FileName
2
+ module Labkit
3
+ autoload :Correlation, 'labkit/correlation'
4
+ autoload :Tracing, 'labkit/tracing'
5
+ autoload :Logging, 'labkit/logging'
6
+ end
7
+ # rubocop:enable Naming/FileName
@@ -44,10 +44,10 @@ module Labkit
44
44
 
45
45
  # This will provide a link into the distributed tracing for the current trace,
46
46
  # if it has been captured.
47
- def self.tracing_url
47
+ def self.tracing_url(service_name)
48
48
  return unless tracing_url_enabled?
49
49
 
50
- tracing_url_template.to_s % { correlation_id: Labkit::Correlation::CorrelationId.current_id.to_s, service: Labkit.process_name }
50
+ format(tracing_url_template.to_s, { correlation_id: Labkit::Correlation::CorrelationId.current_id.to_s, service: service_name })
51
51
  end
52
52
  end
53
53
  end
data/package-lock.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "labkit-ruby",
3
+ "requires": true,
4
+ "lockfileVersion": 1,
5
+ "dependencies": {
6
+ "@prettier/plugin-ruby": {
7
+ "version": "0.5.1",
8
+ "resolved": "https://registry.npmjs.org/@prettier/plugin-ruby/-/plugin-ruby-0.5.1.tgz",
9
+ "integrity": "sha512-i5vcRvswNc0FhR41CnKCIy4hIztXDJb99vFavn/4cDeSk9Gu2OYnorDCpgjSVnu8l7go2P4na+Rws3qoxrX09A==",
10
+ "dev": true,
11
+ "requires": {
12
+ "prettier": "^1.16.4"
13
+ }
14
+ },
15
+ "prettier": {
16
+ "version": "1.16.4",
17
+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.16.4.tgz",
18
+ "integrity": "sha512-ZzWuos7TI5CKUeQAtFd6Zhm2s6EpAD/ZLApIhsF9pRvRtM1RFo61dM/4MSRUA0SuLugA/zgrZD8m0BaY46Og7g==",
19
+ "dev": true
20
+ }
21
+ }
22
+ }
data/package.json ADDED
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "labkit-ruby",
3
+ "devDependencies": {
4
+ "@prettier/plugin-ruby": "^0.5.1",
5
+ "prettier": "^1.16.4"
6
+ }
7
+ }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab-labkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Newdigate
@@ -185,8 +185,16 @@ executables: []
185
185
  extensions: []
186
186
  extra_rdoc_files: []
187
187
  files:
188
+ - ".gitignore"
189
+ - ".gitlab-ci.yml"
190
+ - ".prettierrc"
191
+ - ".rspec"
192
+ - ".rubocop.yml"
193
+ - ".ruby-version"
194
+ - Gemfile
195
+ - Rakefile
188
196
  - gitlab-labkit.gemspec
189
- - lib/labkit.rb
197
+ - lib/gitlab-labkit.rb
190
198
  - lib/labkit/correlation.rb
191
199
  - lib/labkit/correlation/correlation_id.rb
192
200
  - lib/labkit/logging.rb
@@ -203,6 +211,8 @@ files:
203
211
  - lib/labkit/tracing/sidekiq/client_middleware.rb
204
212
  - lib/labkit/tracing/sidekiq/server_middleware.rb
205
213
  - lib/labkit/tracing/sidekiq/sidekiq_common.rb
214
+ - package-lock.json
215
+ - package.json
206
216
  homepage: http://about.gitlab.com
207
217
  licenses:
208
218
  - MIT
@@ -215,7 +225,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
215
225
  requirements:
216
226
  - - ">="
217
227
  - !ruby/object:Gem::Version
218
- version: '0'
228
+ version: 2.3.0
219
229
  required_rubygems_version: !ruby/object:Gem::Requirement
220
230
  requirements:
221
231
  - - ">="
data/lib/labkit.rb DELETED
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Labkit
4
- autoload :Correlation, 'labkit/correlation'
5
- autoload :Tracing, 'labkit/tracing'
6
- autoload :Logging, 'labkit/logging'
7
-
8
- def self.process_name
9
- return 'sidekiq' if Sidekiq.server?
10
- return 'console' if defined?(Rails::Console)
11
- return 'test' if Rails.env.test?
12
-
13
- 'web'
14
- end
15
- end