upperkut 0.1.3 → 0.1.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 +4 -4
- data/.circleci/config.yml +63 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +14 -1
- data/README.md +4 -0
- data/lib/upperkut/strategy.rb +2 -3
- data/lib/upperkut/version.rb +1 -1
- metadata +3 -3
- data/.travis.yml +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7793f7bbdc5c1ca3301ac58060ebcccb74b04abb
|
4
|
+
data.tar.gz: 23c894883a95c00b113f92a9275565d6fa1bc35c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30932fa2ac443396621e73252f71c665b9d5e1ec2659aa8e37325faf30bf318340694c63d66f274ab5346b38ab36657e8dac5211a2dac272abe05976e30e8b57
|
7
|
+
data.tar.gz: ab3d183ba7731e30c1010dcd7a032dc28ba12b017c75521021565232e427eaebd007195f12484c2e2054274250792486e3832bbdfe7a3616237ccae738755ef2
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# Ruby CircleCI 2.0 configuration file
|
2
|
+
#
|
3
|
+
# Check https://circleci.com/docs/2.0/language-ruby/ for more details
|
4
|
+
#
|
5
|
+
version: 2
|
6
|
+
jobs:
|
7
|
+
build:
|
8
|
+
docker:
|
9
|
+
- image: circleci/ruby:2.4.4
|
10
|
+
environment:
|
11
|
+
CC_TEST_REPORTER_ID: 03ab83a772148a577d29d4acf438d7ebdc95c632224122d0ba8dbb291eedebe6
|
12
|
+
COVERAGE: true
|
13
|
+
steps:
|
14
|
+
- checkout
|
15
|
+
|
16
|
+
# Download and cache dependencies
|
17
|
+
- restore_cache:
|
18
|
+
keys:
|
19
|
+
- v1-dependencies-{{ checksum "Gemfile.lock" }}
|
20
|
+
# fallback to using the latest cache if no exact match is found
|
21
|
+
- v1-dependencies-
|
22
|
+
|
23
|
+
- run:
|
24
|
+
name: install dependencies
|
25
|
+
command: |
|
26
|
+
bundle install --jobs=4 --retry=3 --path vendor/bundle
|
27
|
+
|
28
|
+
- save_cache:
|
29
|
+
paths:
|
30
|
+
- ./vendor/bundle
|
31
|
+
key: v1-dependencies-{{ checksum "Gemfile.lock" }}
|
32
|
+
|
33
|
+
- run:
|
34
|
+
name: Setup Code Climate test-reporter
|
35
|
+
command: |
|
36
|
+
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
37
|
+
chmod +x ./cc-test-reporter
|
38
|
+
./cc-test-reporter before-build
|
39
|
+
|
40
|
+
# run tests!
|
41
|
+
- run:
|
42
|
+
name: run tests
|
43
|
+
command: |
|
44
|
+
mkdir /tmp/test-results
|
45
|
+
TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)"
|
46
|
+
|
47
|
+
bundle exec rspec --format progress \
|
48
|
+
--format RspecJunitFormatter \
|
49
|
+
--out /tmp/test-results/rspec.xml \
|
50
|
+
--format progress \
|
51
|
+
$TEST_FILES
|
52
|
+
- run:
|
53
|
+
name: Submit coverage
|
54
|
+
command: |
|
55
|
+
./cc-test-reporter after-build --coverage-input-type simplecov --exit-code $?
|
56
|
+
|
57
|
+
# collect reports
|
58
|
+
- store_test_results:
|
59
|
+
path: /tmp/test-results
|
60
|
+
|
61
|
+
- store_artifacts:
|
62
|
+
path: /tmp/test-results
|
63
|
+
destination: test-results
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
upperkut (0.1.
|
4
|
+
upperkut (0.1.4)
|
5
5
|
redis (>= 3.3.5, < 5)
|
6
6
|
|
7
7
|
GEM
|
@@ -9,8 +9,11 @@ GEM
|
|
9
9
|
specs:
|
10
10
|
coderay (1.1.2)
|
11
11
|
diff-lcs (1.3)
|
12
|
+
docile (1.3.1)
|
12
13
|
fakeredis (0.7.0)
|
13
14
|
redis (>= 3.2, < 5.0)
|
15
|
+
fivemat (1.3.6)
|
16
|
+
json (2.1.0)
|
14
17
|
method_source (0.9.0)
|
15
18
|
pry (0.11.3)
|
16
19
|
coderay (~> 1.1.0)
|
@@ -30,6 +33,13 @@ GEM
|
|
30
33
|
diff-lcs (>= 1.2.0, < 2.0)
|
31
34
|
rspec-support (~> 3.7.0)
|
32
35
|
rspec-support (3.7.1)
|
36
|
+
rspec_junit_formatter (0.4.1)
|
37
|
+
rspec-core (>= 2, < 4, != 2.12.0)
|
38
|
+
simplecov (0.16.1)
|
39
|
+
docile (~> 1.1)
|
40
|
+
json (>= 1.8, < 3)
|
41
|
+
simplecov-html (~> 0.10.0)
|
42
|
+
simplecov-html (0.10.2)
|
33
43
|
|
34
44
|
PLATFORMS
|
35
45
|
ruby
|
@@ -37,9 +47,12 @@ PLATFORMS
|
|
37
47
|
DEPENDENCIES
|
38
48
|
bundler (~> 1.16)
|
39
49
|
fakeredis
|
50
|
+
fivemat
|
40
51
|
pry
|
41
52
|
rake (~> 10.0)
|
42
53
|
rspec (~> 3.0)
|
54
|
+
rspec_junit_formatter
|
55
|
+
simplecov
|
43
56
|
upperkut!
|
44
57
|
|
45
58
|
BUNDLED WITH
|
data/README.md
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
# Upperkut
|
2
2
|
|
3
|
+
[](https://circleci.com/gh/ResultadosDigitais/upperkut/tree/master)
|
4
|
+
[](https://codeclimate.com/repos/5b318a7c6d37b70272008676/maintainability)
|
5
|
+
[](https://codeclimate.com/repos/5b318a7c6d37b70272008676/test_coverage)
|
6
|
+
|
3
7
|
Batch background processing tool.
|
4
8
|
|
5
9
|
## Installation
|
data/lib/upperkut/strategy.rb
CHANGED
@@ -34,12 +34,11 @@ module Upperkut
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def latency
|
37
|
-
item = redis.lrange(key,
|
37
|
+
item = redis.lrange(key, 0, 0)
|
38
38
|
item = decode_json_items(item).first
|
39
39
|
return 0 unless item
|
40
40
|
now = Time.now.to_f
|
41
|
-
|
42
|
-
lat
|
41
|
+
now - item.fetch('enqueued_at', Time.now).to_f
|
43
42
|
end
|
44
43
|
|
45
44
|
def clear
|
data/lib/upperkut/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: upperkut
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nando Sousa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-06-
|
11
|
+
date: 2018-06-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis
|
@@ -80,9 +80,9 @@ executables:
|
|
80
80
|
extensions: []
|
81
81
|
extra_rdoc_files: []
|
82
82
|
files:
|
83
|
+
- ".circleci/config.yml"
|
83
84
|
- ".gitignore"
|
84
85
|
- ".rspec"
|
85
|
-
- ".travis.yml"
|
86
86
|
- CODE_OF_CONDUCT.md
|
87
87
|
- Gemfile
|
88
88
|
- Gemfile.lock
|