We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OpenStruct
Ruby 3.4 will warn on usage of ostruct, 3.5 will raise. Also see https://bugs.ruby-lang.org/issues/20309, ruby/ruby#10428
Something like this should be a good substitute, however since there seem to be no tests for CLI behaviour I'm not confident enough to PR myself:
# arguments.rb Options = Struct.new( :time, :counter, :mode, :digest, :secret, ) def default_options Options.new time: true, counter: 0, mode: :time end def to_h { time: options!.time, counter: options!.counter, digest: options!.digest, secret: options!.secret! } end # cli.rb if options.mode == :time ROTP::TOTP.new(options.secret, options.to_h).now elsif options.mode == :hmac ROTP::HOTP.new(options.secret, options.to_h).at options.counter end
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Ruby 3.4 will warn on usage of ostruct, 3.5 will raise. Also see https://bugs.ruby-lang.org/issues/20309, ruby/ruby#10428
Something like this should be a good substitute, however since there seem to be no tests for CLI behaviour I'm not confident enough to PR myself:
The text was updated successfully, but these errors were encountered: