potp 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 572944d75dff4240e25ec32bb91202acd04ce07b2dea52e585fb765bf579076d
4
- data.tar.gz: 633ba7f0dac49a1c66d71680a030571b32185806adf6e9e9111bc5561d937865
3
+ metadata.gz: 2d2b61f010b1f9a9e5b0d2a1d878abe5c913e6bd46a2821a59ec063baed5c136
4
+ data.tar.gz: a28abecf2c51b234512f3b5b5799a40c19e5ebe2fbdd049e774f5c03c3550a96
5
5
  SHA512:
6
- metadata.gz: 4e6b4d5efe9da1b692486e28a56fcf20f4c858a99bb7d870889c4cee21540fff2061589088ba01917333dcf83ec9d3293e4e9741d79d468fac039d5913b0bef2
7
- data.tar.gz: 5ed1543a5214cb4be08e1b0b54d7ebff17833ed7442757bc7a5605356d52860967d136bf0ed2a0eb3629024797d65df313dd70ab198dd1b3397b412740744c5f
6
+ metadata.gz: 75af955f1f116a0c2ecd1e8862ff523e5a25767bd17ce21c5031efca79d8a4f908e3ba80ab8e11d66a02992a0304e4110fa62344002fab9b8ecaca5a202beecb
7
+ data.tar.gz: 7f2a3394b5c2dcb31e103d321be1d637f3d74a897474c500189bb956231971f80165dfd624fd6a6aff1a1b53cc23afa072c26f4ddb2070b73cc6404755e28c42
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  # BSD-2-clause license, extended by language use conditions
2
2
 
3
- Copyright (C) 2024, Bertram Scharpf <software@bertram-scharpf.de>.
3
+ Copyright (C) 2025, Bertram Scharpf <software@bertram-scharpf.de>.
4
4
  All rights reserved.
5
5
 
6
6
  Redistribution and use in source and binary forms, with or without
data/README.md CHANGED
@@ -137,6 +137,6 @@ potp --help
137
137
 
138
138
  ## Copyright
139
139
 
140
- * (C) 2024 Bertram Scharpf <software@bertram-scharpf.de>
140
+ * (C) 2025 Bertram Scharpf <software@bertram-scharpf.de>
141
141
  * License: [BSD-2-Clause+](./LICENSE)
142
142
 
data/bin/potp CHANGED
@@ -19,7 +19,7 @@ class POTP::Appl < Application
19
19
  NAME = "potp"
20
20
  VERSION = POTP::VERSION
21
21
  SUMMARY = "Plain One Time Password Tool"
22
- COPYRIGHT = "(C) 2024 Bertram Scharpf <software@bertram-scharpf.de>"
22
+ COPYRIGHT = "(C) 2025 Bertram Scharpf <software@bertram-scharpf.de>"
23
23
  LICENSE = "BSD-2-Clause+"
24
24
  AUTHOR = "Bertram Scharpf <software@bertram-scharpf.de>"
25
25
 
@@ -5,7 +5,7 @@
5
5
  # The purpose of this is simply to reduce dependencies.
6
6
 
7
7
  begin
8
- require "supplement____"
8
+ require "supplement"
9
9
  rescue LoadError
10
10
  class NilClass ; def notempty? ; end ; end
11
11
  class String ; def notempty? ; self unless empty? ; end ; end
data/lib/potp/totp.rb CHANGED
@@ -15,8 +15,6 @@ module POTP
15
15
 
16
16
  attr_reader :interval
17
17
 
18
- # @option options [Integer] interval (30) the time interval in seconds for OTP
19
- # This defaults to 30 which is standard.
20
18
  def initialize secret, interval: nil, **kwargs
21
19
  @interval = interval || DEFAULT_INTERVAL
22
20
  super secret, **kwargs
@@ -29,9 +27,8 @@ module POTP
29
27
  fin = now = timeint at||Time.now
30
28
  now -= drift_behind if drift_behind
31
29
  fin += drift_ahead if drift_ahead
32
- if after then
33
- after += @interval
34
- now = after if now < after
30
+ if after and now < after then
31
+ now = after + @interval
35
32
  end
36
33
  now -= now % @interval
37
34
  while now < fin do
data/lib/potp/version.rb CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  module POTP
7
7
 
8
- VERSION = "1.0.0".freeze
8
+ VERSION = "1.0.1".freeze
9
9
 
10
10
  end
11
11
 
data/potp.gemspec CHANGED
@@ -26,10 +26,11 @@ Gem::Specification.new do |s|
26
26
  s.add_dependency "appl", "~>1"
27
27
  end
28
28
 
29
- s.require_paths = %w(lib)
30
- s.extensions = %w()
31
- s.files = Dir[ "lib/**/*.rb", "bin/*", ]
32
- s.executables = %w(potp)
33
- s.extra_rdoc_files = %w(LICENSE README.md potp.gemspec)
29
+ s.require_paths = %w(lib)
30
+ s.extensions = %w()
31
+ s.files = Dir[ "lib/**/*.rb", "bin/*", ]
32
+ s.executables = %w(potp)
33
+ s.extra_rdoc_files = %w(LICENSE README.md potp.gemspec)
34
+
34
35
  end
35
36
 
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: potp
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bertram Scharpf
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-12-31 00:00:00.000000000 Z
10
+ date: 2025-01-02 00:00:00.000000000 Z
12
11
  dependencies: []
13
12
  description: |
14
13
  A Ruby library for generating and verifying one time passwords,
@@ -39,7 +38,6 @@ homepage: https://github.com/BertramScharpf/ruby-potp
39
38
  licenses:
40
39
  - LicenseRef-LICENSE
41
40
  metadata: {}
42
- post_install_message:
43
41
  rdoc_options: []
44
42
  require_paths:
45
43
  - lib
@@ -55,8 +53,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
55
53
  version: '0'
56
54
  requirements:
57
55
  - Just Ruby and some more if you like
58
- rubygems_version: 3.5.23
59
- signing_key:
56
+ rubygems_version: 3.6.2
60
57
  specification_version: 4
61
58
  summary: Plain One Time Password Tool
62
59
  test_files: []