tago 0.0.2 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0127fd10025c451f556575af7705a2956defe95bca254d3c6e15fd340b23c0b1
4
- data.tar.gz: 00e85043722bb7b4a1303954ecd6df39f8b3bd001090cfe61d14235b3b0bfdd3
3
+ metadata.gz: ca493bba45fba480f54ec89dd4a4d231007d280b51638c114781b8813d524796
4
+ data.tar.gz: d51d2b4626ad2582256e389b760644487f15fa812dac456ae394a3e1fb8061e7
5
5
  SHA512:
6
- metadata.gz: ec9090a17889ec2cb4ebbf66323ccf678bcd668c82320731bf1c00f23a1fb5d348f76c50f16d03ff0967ae8ffae99340b1ed6f9ce08e7488914a0b6ef5647552
7
- data.tar.gz: c84b2694de35f985e1150d5464c186ac61c3b6155ff2ba0a7e97a72cbab5945dffdb2d8363ca992d423c96308756fba7964454516afa7125e052d1b81e4b709e
6
+ metadata.gz: 94b64b5ef1d881edf4245c57175949bba7ae452f288e6a2fa9590dba9c1de53f88650618c9d7a137d37f01391ecc5ef42346ef785cb6ff150b16f7529f0f188c
7
+ data.tar.gz: 969c82c7573afee0bdaf16503e0a955d25753e682e65f4a6a9151a3de709e7547da4d4f5076af9d34e0b07d54ce71949cb8b5e9b512ddf3d85b75421c54c78db
data/Gemfile CHANGED
@@ -1,32 +1,17 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2024 Yegor Bugayenko
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the 'Software'), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in all
13
- # copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- # SOFTWARE.
3
+ # SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
4
+ # SPDX-License-Identifier: MIT
22
5
 
23
6
  source 'https://rubygems.org'
24
7
  gemspec
25
8
 
26
- gem 'minitest', '5.23.1', require: false
27
- gem 'rake', '13.2.1', require: false
28
- gem 'rubocop', '1.64.1', require: false
29
- gem 'rubocop-rspec', '3.0.1', require: false
30
- gem 'simplecov', '0.22.0', require: false
31
- gem 'simplecov-cobertura', '2.1.0', require: false
32
- gem 'yard', '0.9.36', require: false
9
+ gem 'minitest', '~>5.24', require: false
10
+ gem 'rake', '~>13.2', require: false
11
+ gem 'rubocop', '~>1.75', require: false
12
+ gem 'rubocop-minitest', '~>0.38', require: false
13
+ gem 'rubocop-performance', '~>1.25', require: false
14
+ gem 'rubocop-rake', '~>0.7', require: false
15
+ gem 'simplecov', '~>0.22', require: false
16
+ gem 'simplecov-cobertura', '~>3.0', require: false
17
+ gem 'yard', '~>0.9', require: false
data/Gemfile.lock CHANGED
@@ -6,65 +6,81 @@ PATH
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- ast (2.4.2)
10
- docile (1.4.0)
11
- json (2.7.2)
12
- language_server-protocol (3.17.0.3)
13
- minitest (5.23.1)
14
- parallel (1.25.1)
15
- parser (3.3.2.0)
9
+ ast (2.4.3)
10
+ docile (1.4.1)
11
+ json (2.13.2)
12
+ language_server-protocol (3.17.0.5)
13
+ lint_roller (1.1.0)
14
+ minitest (5.25.5)
15
+ parallel (1.27.0)
16
+ parser (3.3.9.0)
16
17
  ast (~> 2.4.1)
17
18
  racc
18
- racc (1.8.0)
19
+ prism (1.4.0)
20
+ racc (1.8.1)
19
21
  rainbow (3.1.1)
20
- rake (13.2.1)
21
- regexp_parser (2.9.2)
22
- rexml (3.3.0)
23
- strscan
24
- rubocop (1.64.1)
22
+ rake (13.3.0)
23
+ regexp_parser (2.11.2)
24
+ rexml (3.4.2)
25
+ rubocop (1.80.2)
25
26
  json (~> 2.3)
26
- language_server-protocol (>= 3.17.0)
27
+ language_server-protocol (~> 3.17.0.2)
28
+ lint_roller (~> 1.1.0)
27
29
  parallel (~> 1.10)
28
30
  parser (>= 3.3.0.2)
29
31
  rainbow (>= 2.2.2, < 4.0)
30
- regexp_parser (>= 1.8, < 3.0)
31
- rexml (>= 3.2.5, < 4.0)
32
- rubocop-ast (>= 1.31.1, < 2.0)
32
+ regexp_parser (>= 2.9.3, < 3.0)
33
+ rubocop-ast (>= 1.46.0, < 2.0)
33
34
  ruby-progressbar (~> 1.7)
34
- unicode-display_width (>= 2.4.0, < 3.0)
35
- rubocop-ast (1.31.3)
36
- parser (>= 3.3.1.0)
37
- rubocop-rspec (3.0.1)
38
- rubocop (~> 1.61)
35
+ unicode-display_width (>= 2.4.0, < 4.0)
36
+ rubocop-ast (1.46.0)
37
+ parser (>= 3.3.7.2)
38
+ prism (~> 1.4)
39
+ rubocop-minitest (0.38.2)
40
+ lint_roller (~> 1.1)
41
+ rubocop (>= 1.75.0, < 2.0)
42
+ rubocop-ast (>= 1.38.0, < 2.0)
43
+ rubocop-performance (1.25.0)
44
+ lint_roller (~> 1.1)
45
+ rubocop (>= 1.75.0, < 2.0)
46
+ rubocop-ast (>= 1.38.0, < 2.0)
47
+ rubocop-rake (0.7.1)
48
+ lint_roller (~> 1.1)
49
+ rubocop (>= 1.72.1)
39
50
  ruby-progressbar (1.13.0)
40
51
  simplecov (0.22.0)
41
52
  docile (~> 1.1)
42
53
  simplecov-html (~> 0.11)
43
54
  simplecov_json_formatter (~> 0.1)
44
- simplecov-cobertura (2.1.0)
55
+ simplecov-cobertura (3.1.0)
45
56
  rexml
46
57
  simplecov (~> 0.19)
47
- simplecov-html (0.12.3)
58
+ simplecov-html (0.13.2)
48
59
  simplecov_json_formatter (0.1.4)
49
- strscan (3.1.0)
50
- unicode-display_width (2.5.0)
51
- yard (0.9.36)
60
+ unicode-display_width (3.1.5)
61
+ unicode-emoji (~> 4.0, >= 4.0.4)
62
+ unicode-emoji (4.0.4)
63
+ yard (0.9.37)
52
64
 
53
65
  PLATFORMS
54
66
  arm64-darwin-22
67
+ arm64-darwin-23
68
+ arm64-darwin-24
55
69
  x64-mingw-ucrt
56
70
  x86_64-darwin-20
57
71
  x86_64-linux
58
72
 
59
73
  DEPENDENCIES
60
- minitest (= 5.23.1)
61
- rake (= 13.2.1)
62
- rubocop (= 1.64.1)
63
- rubocop-rspec (= 3.0.1)
64
- simplecov (= 0.22.0)
65
- simplecov-cobertura (= 2.1.0)
74
+ minitest (~> 5.24)
75
+ rake (~> 13.2)
76
+ rubocop (~> 1.75)
77
+ rubocop-minitest (~> 0.38)
78
+ rubocop-performance (~> 1.25)
79
+ rubocop-rake (~> 0.7)
80
+ simplecov (~> 0.22)
81
+ simplecov-cobertura (~> 3.0)
66
82
  tago!
67
- yard (= 0.9.36)
83
+ yard (~> 0.9)
68
84
 
69
85
  BUNDLED WITH
70
- 2.4.22
86
+ 2.5.16
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  (The MIT License)
2
2
 
3
- Copyright (c) 2024 Yegor Bugayenko
3
+ Copyright (c) 2024-2025 Yegor Bugayenko
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the 'Software'), to deal
data/LICENSES/MIT.txt ADDED
@@ -0,0 +1,21 @@
1
+ (The MIT License)
2
+
3
+ Copyright (c) 2024-2025 Yegor Bugayenko
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the 'Software'), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/README.md CHANGED
@@ -1,16 +1,22 @@
1
1
  # Adds `.ago()` Method to the `Time` Class
2
2
 
3
- [![DevOps By Rultor.com](http://www.rultor.com/b/yegor256/tago)](http://www.rultor.com/p/yegor256/tago)
3
+ [![DevOps By Rultor.com](https://www.rultor.com/b/yegor256/tago)](https://www.rultor.com/p/yegor256/tago)
4
4
  [![We recommend RubyMine](https://www.elegantobjects.org/rubymine.svg)](https://www.jetbrains.com/ruby/)
5
5
 
6
6
  [![rake](https://github.com/yegor256/tago/actions/workflows/rake.yml/badge.svg)](https://github.com/yegor256/tago/actions/workflows/rake.yml)
7
- [![PDD status](http://www.0pdd.com/svg?name=yegor256/tago)](http://www.0pdd.com/p?name=yegor256/tago)
8
- [![Gem Version](https://badge.fury.io/rb/tago.svg)](http://badge.fury.io/rb/tago)
7
+ [![PDD status](https://www.0pdd.com/svg?name=yegor256/tago)](https://www.0pdd.com/p?name=yegor256/tago)
8
+ [![Gem Version](https://badge.fury.io/rb/tago.svg)](https://badge.fury.io/rb/tago)
9
9
  [![Test Coverage](https://img.shields.io/codecov/c/github/yegor256/tago.svg)](https://codecov.io/github/yegor256/tago?branch=master)
10
- [![Yard Docs](http://img.shields.io/badge/yard-docs-blue.svg)](http://rubydoc.info/github/yegor256/tago/master/frames)
10
+ [![Yard Docs](https://img.shields.io/badge/yard-docs-blue.svg)](https://rubydoc.info/github/yegor256/tago/master/frames)
11
11
  [![Hits-of-Code](https://hitsofcode.com/github/yegor256/tago)](https://hitsofcode.com/view/github/yegor256/tago)
12
12
  [![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/yegor256/tago/blob/master/LICENSE.txt)
13
13
 
14
+ First, install it:
15
+
16
+ ```bash
17
+ gem install tago
18
+ ```
19
+
14
20
  Here is how you use it:
15
21
 
16
22
  ```ruby
@@ -19,11 +25,20 @@ start = Time.now
19
25
  puts "It took #{start.ago} to do it"
20
26
  ```
21
27
 
28
+ It's also possible to convert Float seconds to text:
29
+
30
+ ```ruby
31
+ s = Time.now - start
32
+ puts "It took #{s.seconds}"
33
+ ```
34
+
35
+ The gem basically extends the `Float` and `Time` classes with new methods.
36
+
22
37
  ## How to contribute
23
38
 
24
39
  Read
25
40
  [these guidelines](https://www.yegor256.com/2014/04/15/github-guidelines.html).
26
- Make sure you build is green before you contribute
41
+ Make sure your build is green before you contribute
27
42
  your pull request. You will need to have
28
43
  [Ruby](https://www.ruby-lang.org/en/) 3.2+ and
29
44
  [Bundler](https://bundler.io/) installed. Then:
data/REUSE.toml ADDED
@@ -0,0 +1,34 @@
1
+ # SPDX-FileCopyrightText: Copyright (c) 2025 Yegor Bugayenko
2
+ # SPDX-License-Identifier: MIT
3
+
4
+ version = 1
5
+ [[annotations]]
6
+ path = [
7
+ ".DS_Store",
8
+ ".gitattributes",
9
+ ".gitignore",
10
+ ".pdd",
11
+ "**.json",
12
+ "**.md",
13
+ "**.txt",
14
+ "**/.DS_Store",
15
+ "**/.gitignore",
16
+ "**/.pdd",
17
+ "**/*.csv",
18
+ "**/*.jpg",
19
+ "**/*.json",
20
+ "**/*.md",
21
+ "**/*.pdf",
22
+ "**/*.png",
23
+ "**/*.svg",
24
+ "**/*.txt",
25
+ "**/*.vm",
26
+ "**/CNAME",
27
+ "**/Gemfile.lock",
28
+ "Gemfile.lock",
29
+ "README.md",
30
+ "renovate.json",
31
+ ]
32
+ precedence = "override"
33
+ SPDX-FileCopyrightText = "Copyright (c) 2025 Yegor Bugayenko"
34
+ SPDX-License-Identifier = "MIT"
data/Rakefile CHANGED
@@ -1,24 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2024 Yegor Bugayenko
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the 'Software'), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in all
13
- # copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- # SOFTWARE.
3
+ # SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
4
+ # SPDX-License-Identifier: MIT
22
5
 
23
6
  require 'rubygems'
24
7
  require 'rake'
@@ -32,7 +15,7 @@ def version
32
15
  Gem::Specification.load(Dir['*.gemspec'].first).version
33
16
  end
34
17
 
35
- task default: %i[clean test rubocop yard copyright]
18
+ task default: %i[clean test rubocop yard]
36
19
 
37
20
  require 'rake/testtask'
38
21
  desc 'Run all unit tests'
@@ -54,13 +37,4 @@ require 'rubocop/rake_task'
54
37
  desc 'Run RuboCop on all directories'
55
38
  RuboCop::RakeTask.new(:rubocop) do |task|
56
39
  task.fail_on_error = true
57
- task.requires << 'rubocop-rspec'
58
- end
59
-
60
- task :copyright do
61
- sh "grep -q -r '#{Date.today.strftime('%Y')}' \
62
- --include '*.rb' \
63
- --include '*.txt' \
64
- --include 'Rakefile' \
65
- ."
66
40
  end
data/lib/tago.rb CHANGED
@@ -1,57 +1,55 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2024 Yegor Bugayenko
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software ansassociatesdocumentation files (the 'Software'), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, ansto permit persons to whom the Software is
10
- # furnishesto do so, subject to the following conditions:
11
- #
12
- # The above copyright notice ansthis permission notice shall be includesin all
13
- # copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- # SOFTWARE.
3
+ # SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
4
+ # SPDX-License-Identifier: MIT
22
5
 
23
6
  require 'time'
24
7
 
25
- # A new methosto print time as text.
8
+ # A new method to print time as text.
26
9
  #
27
10
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
28
- # Copyright:: Copyright (c) 2024 Yegor Bugayenko
11
+ # Copyright:: Copyright (c) 2024-2025 Yegor Bugayenko
29
12
  # License:: MIT
30
- class Time
31
- def ago(now = Time.now)
32
- s = now - self
13
+ class Float
14
+ def seconds
15
+ s = self
33
16
  s = -s if s.negative?
34
17
  if s < 0.001
35
18
  format('%dμs', s * 1000 * 1000)
36
19
  elsif s < 1
37
20
  format('%dms', s * 1000)
38
21
  elsif s < 10
39
- ms = format('%03d', s * 1000 % 1000)
40
- if ms == '000'
41
- format('%ds', s)
42
- else
43
- format('%<sec>ds%<msec>sms', sec: s, msec: ms)
44
- end
22
+ ms = (s * 1000 % 1000).to_i
23
+ ms.zero? ? format('%ds', s) : format('%<s>ds%<ms>dms', s:, ms:)
45
24
  elsif s < 100
46
25
  format('%ds', s)
47
26
  elsif s < 60 * 60
48
- format('%<mins>dm%<secs>ds', mins: s / 60, secs: s % 60)
27
+ mins = (s / 60).to_i
28
+ secs = (s % 60).to_i
29
+ secs.zero? ? format('%dm', mins) : format('%<mins>dm%<secs>ds', mins:, secs:)
49
30
  elsif s < 24 * 60 * 60
50
- format('%<hours>dh%<mins>dm', hours: s / (60 * 60), mins: (s % (60 * 60)) / 60)
31
+ hours = (s / (60 * 60)).to_i
32
+ mins = ((s % (60 * 60)) / 60).to_i
33
+ mins.zero? ? format('%dh', hours) : format('%<hours>dh%<mins>dm', hours:, mins:)
51
34
  elsif s < 7 * 24 * 60 * 60
52
- format('%<days>dd%<hours>dh', days: s / (24 * 60 * 60), hours: (s % (24 * 60 * 60)) / (60 * 60))
35
+ days = (s / (24 * 60 * 60)).to_i
36
+ hours = ((s % (24 * 60 * 60)) / (60 * 60)).to_i
37
+ hours.zero? ? format('%dd', days) : format('%<days>dd%<hours>dh', days:, hours:)
53
38
  else
54
- format('%<weeks>dw%<days>dd', weeks: s / (7 * 24 * 60 * 60), days: s % (7 * 24 * 60 * 60) / (24 * 60 * 60))
39
+ weeks = (s / (7 * 24 * 60 * 60)).to_i
40
+ days = (s / (24 * 60 * 60) % 7).to_i
41
+ days.zero? ? format('%dw', weeks) : format('%<weeks>dw%<days>dd', weeks:, days:)
55
42
  end
56
43
  end
57
44
  end
45
+
46
+ # A new method to print time as text.
47
+ #
48
+ # Author:: Yegor Bugayenko (yegor256@gmail.com)
49
+ # Copyright:: Copyright (c) 2024-2025 Yegor Bugayenko
50
+ # License:: MIT
51
+ class Time
52
+ def ago(now = Time.now)
53
+ (now - self).seconds
54
+ end
55
+ end
data/tago.gemspec CHANGED
@@ -1,33 +1,15 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright (c) 2024 Yegor Bugayenko
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the 'Software'), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in all
13
- # copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- # SOFTWARE.
3
+ # SPDX-FileCopyrightText: Copyright (c) 2024-2025 Yegor Bugayenko
4
+ # SPDX-License-Identifier: MIT
22
5
 
23
6
  require 'English'
24
- require_relative 'lib/tago'
25
7
 
26
8
  Gem::Specification.new do |s|
27
9
  s.required_rubygems_version = Gem::Requirement.new('>= 0') if s.respond_to? :required_rubygems_version=
28
10
  s.required_ruby_version = '>=3.0'
29
11
  s.name = 'tago'
30
- s.version = '0.0.2'
12
+ s.version = '0.2.0'
31
13
  s.license = 'MIT'
32
14
  s.summary = 'A new .ago() method for the Time class'
33
15
  s.description =
@@ -35,8 +17,8 @@ Gem::Specification.new do |s|
35
17
  'the existing class Time, thus making logging more convenient'
36
18
  s.authors = ['Yegor Bugayenko']
37
19
  s.email = 'yegor256@gmail.com'
38
- s.homepage = 'http://github.com/yegor256/tago.rb'
39
- s.files = `git ls-files`.split($RS)
20
+ s.homepage = 'https://github.com/yegor256/tago.rb'
21
+ s.files = `git ls-files | grep -v -E '^(test/|\\.|renovate)'`.split($RS)
40
22
  s.rdoc_options = ['--charset=UTF-8']
41
23
  s.extra_rdoc_files = ['README.md', 'LICENSE.txt']
42
24
  s.metadata['rubygems_mfa_required'] = 'true'
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tago
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-06-13 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies: []
13
12
  description: This simple gem adds a new supplementary method .ago() to the existing
14
13
  class Time, thus making logging more convenient
@@ -16,41 +15,23 @@ email: yegor256@gmail.com
16
15
  executables: []
17
16
  extensions: []
18
17
  extra_rdoc_files:
19
- - README.md
20
18
  - LICENSE.txt
19
+ - README.md
21
20
  files:
22
- - ".0pdd.yml"
23
- - ".gitattributes"
24
- - ".github/workflows/actionlint.yml"
25
- - ".github/workflows/codecov.yml"
26
- - ".github/workflows/copyrights.yml"
27
- - ".github/workflows/markdown-lint.yml"
28
- - ".github/workflows/pdd.yml"
29
- - ".github/workflows/rake.yml"
30
- - ".github/workflows/xcop.yml"
31
- - ".github/workflows/yamllint.yml"
32
- - ".gitignore"
33
- - ".pdd"
34
- - ".rubocop.yml"
35
- - ".rultor.yml"
36
- - ".simplecov"
37
- - ".yamllint.yml"
38
21
  - Gemfile
39
22
  - Gemfile.lock
40
23
  - LICENSE.txt
24
+ - LICENSES/MIT.txt
41
25
  - README.md
26
+ - REUSE.toml
42
27
  - Rakefile
43
28
  - lib/tago.rb
44
- - renovate.json
45
29
  - tago.gemspec
46
- - test/test__helper.rb
47
- - test/test_tago.rb
48
- homepage: http://github.com/yegor256/tago.rb
30
+ homepage: https://github.com/yegor256/tago.rb
49
31
  licenses:
50
32
  - MIT
51
33
  metadata:
52
34
  rubygems_mfa_required: 'true'
53
- post_install_message:
54
35
  rdoc_options:
55
36
  - "--charset=UTF-8"
56
37
  require_paths:
@@ -66,8 +47,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
66
47
  - !ruby/object:Gem::Version
67
48
  version: '0'
68
49
  requirements: []
69
- rubygems_version: 3.4.10
70
- signing_key:
50
+ rubygems_version: 3.6.9
71
51
  specification_version: 4
72
52
  summary: A new .ago() method for the Time class
73
53
  test_files: []
data/.0pdd.yml DELETED
@@ -1,25 +0,0 @@
1
- # Copyright (c) 2024 Yegor Bugayenko
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the 'Software'), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in all
11
- # copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
- # SOFTWARE.
20
- ---
21
- errors:
22
- - yegor256@gmail.com
23
- # alerts:
24
- # github:
25
- # - yegor256
data/.gitattributes DELETED
@@ -1,7 +0,0 @@
1
- # Check out all text files in UNIX format, with LF as end of line
2
- # Don't change this file. If you have any ideas about it, please
3
- # submit a separate issue about it and we'll discuss.
4
-
5
- * text=auto eol=lf
6
- *.java ident
7
- *.xml ident
@@ -1,41 +0,0 @@
1
- # Copyright (c) 2024 Yegor Bugayenko
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the 'Software'), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in all
11
- # copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
- # SOFTWARE.
20
- ---
21
- name: actionlint
22
- 'on':
23
- push:
24
- branches:
25
- - master
26
- pull_request:
27
- branches:
28
- - master
29
- jobs:
30
- actionlint:
31
- runs-on: ubuntu-22.04
32
- steps:
33
- - uses: actions/checkout@v4
34
- - name: Download actionlint
35
- id: get_actionlint
36
- # yamllint disable-line rule:line-length
37
- run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
38
- shell: bash
39
- - name: Check workflow files
40
- run: ${{ steps.get_actionlint.outputs.executable }} -color
41
- shell: bash
@@ -1,39 +0,0 @@
1
- # Copyright (c) 2024 Yegor Bugayenko
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the 'Software'), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in all
11
- # copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
- # SOFTWARE.
20
- ---
21
- name: codecov
22
- 'on':
23
- push:
24
- branches:
25
- - master
26
- jobs:
27
- codecov:
28
- runs-on: ubuntu-22.04
29
- steps:
30
- - uses: actions/checkout@v4
31
- - uses: ruby/setup-ruby@v1
32
- with:
33
- ruby-version: 3.2
34
- bundler-cache: true
35
- - run: bundle install
36
- - run: bundle exec rake
37
- - uses: codecov/codecov-action@v4.0.0-beta.3
38
- with:
39
- token: ${{ secrets.CODECOV_TOKEN }}
@@ -1,30 +0,0 @@
1
- # Copyright (c) 2024 Yegor Bugayenko
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the 'Software'), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in all
11
- # copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
- # SOFTWARE.
20
- ---
21
- name: copyrights
22
- 'on':
23
- push:
24
- pull_request:
25
- jobs:
26
- copyrights:
27
- runs-on: ubuntu-22.04
28
- steps:
29
- - uses: actions/checkout@v4
30
- - uses: yegor256/copyrights-action@0.0.4
@@ -1,38 +0,0 @@
1
- # Copyright (c) 2024 Yegor Bugayenko
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the 'Software'), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in all
11
- # copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
- # SOFTWARE.
20
- ---
21
- name: markdown-lint
22
- 'on':
23
- push:
24
- branches:
25
- - master
26
- pull_request:
27
- branches:
28
- - master
29
- paths-ignore: ['paper/**', 'sandbox/**']
30
- concurrency:
31
- group: markdown-lint-${{ github.ref }}
32
- cancel-in-progress: true
33
- jobs:
34
- markdown-lint:
35
- runs-on: ubuntu-22.04
36
- steps:
37
- - uses: actions/checkout@v4
38
- - uses: articulate/actions-markdownlint@v1
@@ -1,34 +0,0 @@
1
- # Copyright (c) 2024 Yegor Bugayenko
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the 'Software'), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in all
11
- # copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
- # SOFTWARE.
20
- ---
21
- name: pdd
22
- 'on':
23
- push:
24
- branches:
25
- - master
26
- pull_request:
27
- branches:
28
- - master
29
- jobs:
30
- pdd:
31
- runs-on: ubuntu-22.04
32
- steps:
33
- - uses: actions/checkout@v4
34
- - uses: volodya-lombrozo/pdd-action@master
@@ -1,44 +0,0 @@
1
- # Copyright (c) 2024 Yegor Bugayenko
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the 'Software'), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in all
11
- # copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
- # SOFTWARE.
20
- ---
21
- name: rake
22
- 'on':
23
- push:
24
- branches:
25
- - master
26
- pull_request:
27
- branches:
28
- - master
29
- jobs:
30
- rake:
31
- name: test
32
- strategy:
33
- matrix:
34
- os: [ubuntu-20.04, macos-12, windows-2022]
35
- ruby: [3.2, 3.3]
36
- runs-on: ${{ matrix.os }}
37
- steps:
38
- - uses: actions/checkout@v4
39
- - uses: ruby/setup-ruby@v1
40
- with:
41
- ruby-version: ${{ matrix.ruby }}
42
- bundler-cache: true
43
- - run: bundle install
44
- - run: bundle exec rake
@@ -1,30 +0,0 @@
1
- # Copyright (c) 2024 Yegor Bugayenko
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the 'Software'), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in all
11
- # copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
- # SOFTWARE.
20
- ---
21
- name: xcop
22
- 'on':
23
- push:
24
- pull_request:
25
- jobs:
26
- xcop:
27
- runs-on: ubuntu-22.04
28
- steps:
29
- - uses: actions/checkout@v4
30
- - uses: g4s8/xcop-action@master
@@ -1,36 +0,0 @@
1
- # Copyright (c) 2024 Yegor Bugayenko
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the 'Software'), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in all
11
- # copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
- # SOFTWARE.
20
- ---
21
- name: yamllint
22
- 'on':
23
- push:
24
- branches:
25
- - master
26
- pull_request:
27
- branches:
28
- - master
29
- jobs:
30
- yamllint:
31
- runs-on: ubuntu-22.04
32
- steps:
33
- - uses: actions/checkout@v4
34
- - uses: ibiqlik/action-yamllint@v3
35
- with:
36
- config_file: .yamllint.yml
data/.gitignore DELETED
@@ -1,8 +0,0 @@
1
- coverage/
2
- .idea/
3
- *.gem
4
- .bundle/
5
- .DS_Store
6
- rdoc/
7
- doc/
8
- .yardoc/
data/.pdd DELETED
@@ -1,7 +0,0 @@
1
- --source=.
2
- --verbose
3
- --exclude target/**/*
4
- --exclude coverage/**/*
5
- --rule min-words:20
6
- --rule min-estimate:15
7
- --rule max-estimate:90
data/.rubocop.yml DELETED
@@ -1,42 +0,0 @@
1
- # Copyright (c) 2024 Yegor Bugayenko
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the 'Software'), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in all
11
- # copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
- # SOFTWARE.
20
- ---
21
- AllCops:
22
- Exclude:
23
- - 'bin/**/*'
24
- - 'assets/**/*'
25
- - 'vendor/**/**'
26
- DisplayCopNames: true
27
- TargetRubyVersion: 3.2
28
- SuggestExtensions: false
29
- NewCops: enable
30
-
31
- Gemspec/RequiredRubyVersion:
32
- Enabled: false
33
- Metrics/AbcSize:
34
- Enabled: false
35
- Metrics/MethodLength:
36
- Enabled: false
37
- Layout/EndOfLine:
38
- EnforcedStyle: lf
39
- Metrics/CyclomaticComplexity:
40
- Enabled: false
41
- Metrics/PerceivedComplexity:
42
- Enabled: false
data/.rultor.yml DELETED
@@ -1,42 +0,0 @@
1
- # Copyright (c) 2024 Yegor Bugayenko
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the 'Software'), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in all
11
- # copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
- # SOFTWARE.
20
- ---
21
- docker:
22
- image: yegor256/rultor-image:1.23.1
23
- assets:
24
- rubygems.yml: yegor256/home#assets/rubygems.yml
25
- install: |
26
- pdd -f /dev/null
27
- bundle install --no-color
28
- release:
29
- pre: false
30
- script: |-
31
- [[ "${tag}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || exit -1
32
- bundle exec rake
33
- rm -rf *.gem
34
- sed -i "s/0\.0\.0/${tag}/g" tago.gemspec
35
- git add tago.gemspec
36
- git commit -m "version set to ${tag}"
37
- gem build tago.gemspec
38
- chmod 0600 ../rubygems.yml
39
- gem push *.gem --config-file ../rubygems.yml
40
- merge:
41
- script: |-
42
- bundle exec rake
data/.simplecov DELETED
@@ -1,41 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- #
4
- # Copyright (c) 2024 Yegor Bugayenko
5
- #
6
- # Permission is hereby granted, free of charge, to any person obtaining a copy
7
- # of this software and associated documentation files (the 'Software'), to deal
8
- # in the Software without restriction, including without limitation the rights
9
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- # copies of the Software, and to permit persons to whom the Software is
11
- # furnished to do so, subject to the following conditions:
12
- #
13
- # The above copyright notice and this permission notice shall be included in all
14
- # copies or substantial portions of the Software.
15
- #
16
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
19
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- # SOFTWARE.
23
-
24
- if Gem.win_platform?
25
- SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
26
- SimpleCov::Formatter::HTMLFormatter
27
- ]
28
- SimpleCov.start do
29
- add_filter '/test/'
30
- add_filter '/features/'
31
- end
32
- else
33
- SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new(
34
- [SimpleCov::Formatter::HTMLFormatter]
35
- )
36
- SimpleCov.start do
37
- add_filter '/test/'
38
- add_filter '/features/'
39
- minimum_coverage 20
40
- end
41
- end
data/.yamllint.yml DELETED
@@ -1,24 +0,0 @@
1
- # Copyright (c) 2024 Yegor Bugayenko
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the 'Software'), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in all
11
- # copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
- # SOFTWARE.
20
- ---
21
- rules:
22
- line-length:
23
- max: 80
24
- allow-non-breakable-words: true
data/renovate.json DELETED
@@ -1,6 +0,0 @@
1
- {
2
- "$schema": "https://docs.renovatebot.com/renovate-schema.json",
3
- "extends": [
4
- "config:base"
5
- ]
6
- }
data/test/test__helper.rb DELETED
@@ -1,31 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Copyright (c) 2024 Yegor Bugayenko
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the 'Software'), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in all
13
- # copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- # SOFTWARE.
22
-
23
- $stdout.sync = true
24
-
25
- require 'simplecov'
26
- SimpleCov.start
27
-
28
- require 'simplecov-cobertura'
29
- SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter
30
-
31
- require 'minitest/autorun'
data/test/test_tago.rb DELETED
@@ -1,53 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Copyright (c) 2024 Yegor Bugayenko
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the 'Software'), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in all
13
- # copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- # SOFTWARE.
22
-
23
- require 'minitest/autorun'
24
- require_relative '../lib/tago'
25
-
26
- # Main test.
27
- # Author:: Yegor Bugayenko (yegor256@gmail.com)
28
- # Copyright:: Copyright (c) 2024 Yegor Bugayenko
29
- # License:: MIT
30
- class TestTago < Minitest::Test
31
- def test_simple_printing
32
- t = Time.now
33
- assert_equal('14ms', (t - 0.014).ago(t))
34
- assert_equal('1s', (t - 1).ago(t))
35
- assert_equal('1s350ms', (t - 1.35).ago(t))
36
- assert_equal('67s', (t - 67).ago(t))
37
- assert_equal('4m5s', (t - 245).ago(t))
38
- assert_equal('13h18m', (t - (13.3 * 60 * 60)).ago(t))
39
- assert_equal('5d0h', (t - (5 * 24 * 60 * 60)).ago(t))
40
- assert_equal('5d7h', (t - (5.3 * 24 * 60 * 60)).ago(t))
41
- assert_equal('22w1d', (t - (155 * 24 * 60 * 60)).ago(t))
42
- end
43
-
44
- def test_inverse
45
- t = Time.now
46
- assert_equal('14ms', (t + 0.014).ago(t))
47
- assert_equal('1s', (t + 1).ago(t))
48
- assert_equal('67s', (t + 67).ago(t))
49
- assert_equal('13h0m', (t + (13 * 60 * 60)).ago(t))
50
- assert_equal('5d0h', (t + (5 * 24 * 60 * 60)).ago(t))
51
- assert_equal('22w1d', (t + (155 * 24 * 60 * 60)).ago(t))
52
- end
53
- end