remain_timer 0.1.0 → 0.2.0
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/.github/workflows/ruby.yml +35 -0
- data/Rakefile +6 -1
- data/lib/remain_timer.rb +8 -6
- data/lib/remain_timer/version.rb +1 -1
- data/remain_timer.gemspec +13 -14
- metadata +4 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8cc9b0db18963128be3fbca5ece763d666e5e8c1a9ec8f31122518bdf8819474
|
4
|
+
data.tar.gz: 5a9559815a43b8b09d8817a00c161a2dd4b041d9d7cab8166103ca7d0b727f30
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 171bf41d67020c2fa890b55a12d4ad3734a06dc5f0bb0e7298439ac4d892199ceea61f12f2294f9a5d711f8cc66c19e011e1d5aa629a33c9c0cf1c222701fc5e
|
7
|
+
data.tar.gz: c9fbb5ed9f89542abe59df6e4c098dac0b70a5c7860c56c3cb5c764d68e116efe604bb1ac79285610000a2da31a4c3746a1c73627505e06e0f8578d8cc4200e0
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# This workflow uses actions that are not certified by GitHub.
|
2
|
+
# They are provided by a third-party and are governed by
|
3
|
+
# separate terms of service, privacy policy, and support
|
4
|
+
# documentation.
|
5
|
+
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
|
6
|
+
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
|
7
|
+
|
8
|
+
name: Ruby
|
9
|
+
|
10
|
+
on:
|
11
|
+
push:
|
12
|
+
branches: [ master ]
|
13
|
+
pull_request:
|
14
|
+
branches: [ master ]
|
15
|
+
|
16
|
+
jobs:
|
17
|
+
test:
|
18
|
+
|
19
|
+
runs-on: ubuntu-latest
|
20
|
+
|
21
|
+
steps:
|
22
|
+
- uses: actions/checkout@v2
|
23
|
+
- name: Set up Ruby
|
24
|
+
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
|
25
|
+
# change this to (see https://github.com/ruby/setup-ruby#versioning):
|
26
|
+
# uses: ruby/setup-ruby@v1
|
27
|
+
uses: ruby/setup-ruby@ec106b438a1ff6ff109590de34ddc62c540232e0
|
28
|
+
with:
|
29
|
+
ruby-version: 2.6
|
30
|
+
- name: Install dependencies
|
31
|
+
run: bundle install
|
32
|
+
- name: Run rubocop
|
33
|
+
run: bundle exec rake rubocop
|
34
|
+
- name: Run tests
|
35
|
+
run: bundle exec rake
|
data/Rakefile
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
2
|
require "rake/testtask"
|
3
|
+
require "rubocop/rake_task"
|
4
|
+
require "prettier"
|
5
|
+
require "prettier/rake/task"
|
3
6
|
require "yard"
|
4
7
|
require "yard/rake/yardoc_task"
|
5
8
|
|
@@ -10,5 +13,7 @@ Rake::TestTask.new(:test) do |t|
|
|
10
13
|
end
|
11
14
|
|
12
15
|
YARD::Rake::YardocTask.new
|
16
|
+
RuboCop::RakeTask.new
|
17
|
+
Prettier::Rake::Task.new { |t| t.source_files = "{{lib,test}/**/*.rb,*.gemspec,Rakefile}" }
|
13
18
|
|
14
|
-
task :
|
19
|
+
task default: :test
|
data/lib/remain_timer.rb
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
require "remain_timer/version"
|
2
|
-
require "
|
2
|
+
require "duration_format"
|
3
|
+
|
4
|
+
# rubocop:disable Airbnb/OptArgParameters
|
3
5
|
|
4
6
|
class RemainTimer
|
5
|
-
attr_accessor :all_count, :estimate_laptime_size
|
7
|
+
attr_accessor :all_count, :estimate_laptime_size
|
6
8
|
|
7
|
-
def initialize(estimate_laptime_size: 20
|
9
|
+
def initialize(estimate_laptime_size: 20)
|
8
10
|
@laptimes = []
|
9
11
|
@estimate_laptime_size = estimate_laptime_size
|
10
12
|
@duration_format = duration_format
|
@@ -40,7 +42,6 @@ class RemainTimer
|
|
40
42
|
all_count: all_count,
|
41
43
|
past_count: past_count,
|
42
44
|
remain_count: remain_count,
|
43
|
-
duration_format: duration_format,
|
44
45
|
)
|
45
46
|
end
|
46
47
|
|
@@ -60,7 +61,6 @@ class RemainTimer
|
|
60
61
|
:all_count,
|
61
62
|
:past_count,
|
62
63
|
:remain_count,
|
63
|
-
:duration_format,
|
64
64
|
keyword_init: true,
|
65
65
|
) do
|
66
66
|
def to_s
|
@@ -80,7 +80,9 @@ class RemainTimer
|
|
80
80
|
private
|
81
81
|
|
82
82
|
def dfmt(duration)
|
83
|
-
duration.nil? ? "?" :
|
83
|
+
duration.nil? ? "?" : DurationFormat.format(duration)
|
84
84
|
end
|
85
85
|
end
|
86
86
|
end
|
87
|
+
|
88
|
+
# rubocop:enable Airbnb/OptArgParameters
|
data/lib/remain_timer/version.rb
CHANGED
data/remain_timer.gemspec
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
require_relative
|
1
|
+
require_relative "lib/remain_timer/version"
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
|
-
spec.name
|
5
|
-
spec.version
|
6
|
-
spec.licenses
|
7
|
-
spec.authors
|
8
|
-
spec.email
|
4
|
+
spec.name = "remain_timer"
|
5
|
+
spec.version = RemainTimer::VERSION
|
6
|
+
spec.licenses = %w[Zlib]
|
7
|
+
spec.authors = %w[Narazaka]
|
8
|
+
spec.email = %w[info@narazaka.net]
|
9
9
|
|
10
10
|
spec.summary = "A small tool for estimating and displaying the remaining time of batch jobs/tasks"
|
11
11
|
spec.homepage = "https://github.com/Narazaka/remain_timer"
|
@@ -16,12 +16,11 @@ Gem::Specification.new do |spec|
|
|
16
16
|
|
17
17
|
# Specify which files should be added to the gem when it is released.
|
18
18
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
19
|
-
spec.files =
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
spec.
|
24
|
-
spec.
|
25
|
-
|
26
|
-
spec.add_dependency "chronic_duration", "~> 0.10"
|
19
|
+
spec.files =
|
20
|
+
Dir.chdir(File.expand_path("..", __FILE__)) do
|
21
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
22
|
+
end
|
23
|
+
spec.bindir = "exe"
|
24
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
25
|
+
spec.require_paths = %w[lib]
|
27
26
|
end
|
metadata
CHANGED
@@ -1,29 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: remain_timer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Narazaka
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
12
|
-
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: chronic_duration
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '0.10'
|
20
|
-
type: :runtime
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '0.10'
|
11
|
+
date: 2020-10-02 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
27
13
|
description:
|
28
14
|
email:
|
29
15
|
- info@narazaka.net
|
@@ -31,6 +17,7 @@ executables: []
|
|
31
17
|
extensions: []
|
32
18
|
extra_rdoc_files: []
|
33
19
|
files:
|
20
|
+
- ".github/workflows/ruby.yml"
|
34
21
|
- ".gitignore"
|
35
22
|
- ".prettierrc"
|
36
23
|
- ".rubocop.yml"
|