monotonic_tick_count 0.2.0 → 0.2.1

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: 24396582479ebb18e5024106bfedb5b8ed4c21d9e91f9b1ab1e511d37c035d71
4
- data.tar.gz: 843d6385685841f6820a31be5566b7ff8fdef751e27618566365fbd28d3e353f
3
+ metadata.gz: 8959e6880634a46051dd28e4d93f8b8a3d5c4550bda0418b295fa74dd8607f93
4
+ data.tar.gz: 60b61d19511e6aa03ba207256c090d0a01e930d1ec947a20a123ed1a8aaf5153
5
5
  SHA512:
6
- metadata.gz: 9398249d9f6d1b395598c2085de84f447225487fdc879419c134ac9a5e694f8c1e2ee5b335105f291aa503908aad0e00a4f0f208265d7ec2a1a67b69750e2a31
7
- data.tar.gz: 5d2c0a7fff1738e1ae6f6d24ae3bd1459e7f5fe792767cd336a6fe7f3d587cede05f7041914b5eabb821ff95b51248d51a14568750fec9591b414abbe3b13ad3
6
+ metadata.gz: 592c767309c9c8930e5aab010456da3e4e8b15e30b993123661dcd8edefcbb27ae1fc8eff4fec0f5474aca6ecc9cc5446f492f1fe33c6fda87f47168ac4a7da0
7
+ data.tar.gz: b8674d845f67025e476abddff9109331dfa0816e28be328afe545f303260aeb1aebaca0990857cabf9fe1aba2305e9db03e6d7cbf8788789503a07d8a51e2988
@@ -0,0 +1,51 @@
1
+ #!/usr/bin/groovy
2
+ @Library('jenkins-pipeline@v0.4.5')
3
+ import com.invoca.docker.*;
4
+ pipeline {
5
+ agent {
6
+ kubernetes {
7
+ defaultContainer "ruby"
8
+ yamlFile ".jenkins/ruby_build_pod.yml"
9
+ }
10
+ }
11
+
12
+ environment {
13
+ GITHUB_TOKEN = credentials('github_token')
14
+ BUNDLE_GEM__FURY__IO = credentials('gemfury_deploy_token')
15
+ }
16
+
17
+ stages {
18
+ stage('Setup') {
19
+ steps {
20
+ updateGitHubStatus('clean-build', 'pending', 'Unit tests.')
21
+ script {
22
+ sh 'bundle install'
23
+ }
24
+ }
25
+ }
26
+ stage('Unit Test') {
27
+ steps {
28
+ script {
29
+ sh 'bundle exec rspec --format RspecJunitFormatter --out spec/reports/rspec.xml'
30
+ }
31
+ }
32
+ post {
33
+ always { junit '*/reports/*.xml' }
34
+ success { updateGitHubStatus('clean-build', 'success', 'Unit tests.') }
35
+ failure { updateGitHubStatus('clean-build', 'failure', 'Unit tests.') }
36
+ }
37
+ }
38
+ }
39
+ }
40
+
41
+ void updateGitHubStatus(String context, String status, String description) {
42
+ gitHubStatus([
43
+ repoSlug: 'Invoca/monotonic_tick_count',
44
+ sha: env.GIT_COMMIT,
45
+ description: description,
46
+ context: context,
47
+ targetURL: env.BUILD_URL,
48
+ token: env.GITHUB_TOKEN,
49
+ status: status
50
+ ])
51
+ }
@@ -0,0 +1,19 @@
1
+ ---
2
+ apiVersion: v1
3
+ kind: Pod
4
+ metadata:
5
+ labels:
6
+ jenkins/monotonic-tick_count: 'true'
7
+ namespace: jenkins
8
+ name: monotonic-tick_count
9
+ spec:
10
+ containers:
11
+ - name: ruby
12
+ image: ruby:2.6.5
13
+ tty: true
14
+ resources:
15
+ requests:
16
+ memory: "100Mi"
17
+ command:
18
+ - cat
19
+
@@ -0,0 +1,22 @@
1
+ # Changelog
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [0.2.1] - 2020-07-09
10
+ ### Changed
11
+ - MonotonicTickCount#timer: yield start_tick to block
12
+
13
+ ## [0.2.0] - 2020-04-21
14
+ ### Added
15
+ - jenkins pipeline
16
+
17
+ ### Changed
18
+ - prepared for initial release
19
+
20
+ [Unreleased]: https://github.com/Invoca/monotonic_tick_count/compare/v0.2.1...HEAD
21
+ [0.2.1]: https://github.com/Invoca/monotonic_tick_count/releases/tag/v0.2.0...v0.2.1
22
+ [0.2.0]: https://github.com/Invoca/monotonic_tick_count/releases/tag/v0.2.0
data/Gemfile CHANGED
@@ -9,7 +9,8 @@ group :development do
9
9
  gem 'bundler', '~> 1.15'
10
10
  gem 'pry'
11
11
  gem 'rake'
12
- gem 'rspec'
12
+ gem 'rspec', '~> 3.7'
13
+ gem 'rspec_junit_formatter', '~> 0.4'
13
14
  gem 'rspec-mocks'
14
15
  gem 'rubocop', '0.54.0'
15
16
  end
data/README.md CHANGED
@@ -15,7 +15,7 @@ tick_count_b - tick_count_a => 900.0
15
15
 
16
16
  Finding the elapsed seconds of a block
17
17
  ```
18
- return_val, elapsed_seconds = MonotonicTickCount.timer do
18
+ return_val, elapsed_seconds = MonotonicTickCount.timer do |start_tick|
19
19
  sleep(10)
20
20
  1
21
21
  end
@@ -62,9 +62,9 @@ class MonotonicTickCount
62
62
 
63
63
  # yields to the caller and returns a pair: [result from yield, float time in seconds of block run]
64
64
  def timer
65
- start = self.now
66
- result = yield
67
- [result, self.now - start]
65
+ start_tick = self.now
66
+ result = yield(start_tick)
67
+ [result, self.now - start_tick]
68
68
  end
69
69
  end
70
70
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class MonotonicTickCount
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: monotonic_tick_count
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Colin Kelley
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-09-07 00:00:00.000000000 Z
11
+ date: 2020-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -32,8 +32,11 @@ extensions: []
32
32
  extra_rdoc_files: []
33
33
  files:
34
34
  - ".gitignore"
35
+ - ".jenkins/Jenkinsfile"
36
+ - ".jenkins/ruby_build_pod.yml"
35
37
  - ".rubocop.yml"
36
38
  - ".travis.yml"
39
+ - CHANGELOG.md
37
40
  - Gemfile
38
41
  - LICENSE.txt
39
42
  - README.md
@@ -48,7 +51,7 @@ licenses:
48
51
  - MIT
49
52
  metadata:
50
53
  allowed_push_host: https://rubygems.org
51
- post_install_message:
54
+ post_install_message:
52
55
  rdoc_options: []
53
56
  require_paths:
54
57
  - lib
@@ -63,9 +66,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
63
66
  - !ruby/object:Gem::Version
64
67
  version: '0'
65
68
  requirements: []
66
- rubyforge_project:
67
- rubygems_version: 2.7.6
68
- signing_key:
69
+ rubygems_version: 3.0.1
70
+ signing_key:
69
71
  specification_version: 4
70
72
  summary: PORO to hold a monotonic tick count. Useful for measuring time differences.
71
73
  test_files: []