kgl 0.0.1 → 0.0.3

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: a79f55cfe832aa5201063e4889e123bf901f6c32b3f2614b73570785d0a622a4
4
- data.tar.gz: 04d4cd0f6c9aeb34c8c121ade5d35a0877749c96894f3525deabc8817eb14c94
3
+ metadata.gz: 4bc114cb34920ec7950a6874a45e45cc62ffcc6451adeb30382ed64d892b265c
4
+ data.tar.gz: e06a04ee09a85dec8c6a68c08cf226955f1ed0d73f4bcb59d9cf64634a824481
5
5
  SHA512:
6
- metadata.gz: d7ae7d157744d0cbb6fb68c2012d78c30a377047981b5ceb6b080533b15144a13fa359d39c5a954f2a805e77c9f223554badd056db1cdcc734abeb30f0a605c9
7
- data.tar.gz: 78760ddeee6dd993e5707b46072550f023dceb661f430072f7976db205a555ebe0c3edbd1f4e24c0bd881a1ad9cdd841db59d32cd730bcf002b1e5304edac9f7
6
+ metadata.gz: 919d930965c4975a63f0421195eaa0b1125b0f6e3142cca2fc2c4b077353876076dc82d5c4858be623235f4a8d06fb4dfeef034f0ee70c83e87341134ce2ea4f
7
+ data.tar.gz: e72edc905d3658ab0b90993c5f8a868579b1aa8e6790db2ca711ae41f7ff21d6263f1f904018230be715b303e10a5eebbf4c3621fd0e826ed380aa64b5e831f1
data/CHANGELOG.md CHANGED
@@ -1,4 +1,10 @@
1
1
  # Change Log
2
2
 
3
+ ## 0.0.3 2024/12/03
4
+ - Add Kgl.#rpw.
5
+
6
+ ## 0.0.2 2020/04/23
7
+ - Change default value of the Integer#to_msm's argument to 59.94.
8
+
3
9
  ## 0.0.1 2019/08/31
4
10
  - First release.
data/README.md CHANGED
@@ -22,13 +22,13 @@ An alias of original `Math.#log`. It returns the natural logarithm of `anti_loga
22
22
  ### `Math.#log(base, anti_logarithm=base.tap{base=Math::E})`
23
23
  Returns the logarithm of `anti_logarithm` to base `base`.
24
24
 
25
- ### `Math.#lg(anti_logarithm)
25
+ ### `Math.#lg(anti_logarithm)`
26
26
  Returns the logarithm of `anti_logarithm` to base 2.
27
27
 
28
28
  ### `Float#to_r`, `String#to_r`
29
29
  Returns `Rational` value of `self`.
30
30
 
31
- ### `Integer#to_msm(fps=60)`
31
+ ### `Integer#to_msm(fps=59.94)`
32
32
  Returns `"[minutes]:[seconds].[milliseconds]"` which corresponds to `self` frames.
33
33
  The submilliseconds will be rounded. `fps` is frames per second.
34
34
 
data/lib/kgl/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Kgl
2
- VERSION = "0.0.1"
2
+ VERSION = '0.0.3'
3
3
  end
data/lib/kgl.rb CHANGED
@@ -3,10 +3,25 @@ require "kgl/suu"
3
3
  require "kgl/kmath"
4
4
 
5
5
  class Integer
6
- def to_msm(fps=60)
6
+ def to_msm(fps=59.94)
7
7
  s, f = divmod(fps)
8
8
  ms = (f*1000).quo(fps).round
9
9
  m, s = s.divmod(60)
10
10
  %Q|#{m}:#{s}.#{ms}|
11
11
  end
12
12
  end
13
+
14
+ module Kgl
15
+ module_function def rpw(n, sym='!#$%&*+,-./:;<=>?@')
16
+ ls = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' + sym
17
+ m = ls.length
18
+ `openssl rand #{n}`.bytes.map do |i|
19
+ while m <= i
20
+ i = `openssl rand 1`.bytes[0]
21
+ end
22
+ ls[i]
23
+ end.join
24
+ rescue Errno::ENOENT => e
25
+ raise 'Kgl.#rpw requires openssl command'
26
+ end
27
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kgl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - KAZOON
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-08-30 00:00:00.000000000 Z
11
+ date: 2024-12-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,7 +52,7 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: 0.12.2
55
- description:
55
+ description:
56
56
  email:
57
57
  - cycloawaodorin+gem@gmail.com
58
58
  executables: []
@@ -81,7 +81,7 @@ metadata:
81
81
  homepage_uri: https://github.com/cycloawaodorin/
82
82
  source_code_uri: https://github.com/cycloawaodorin/kgl
83
83
  changelog_uri: https://github.com/cycloawaodorin/kgl/blob/master/CHANGELOG.md
84
- post_install_message:
84
+ post_install_message:
85
85
  rdoc_options: []
86
86
  require_paths:
87
87
  - lib
@@ -96,8 +96,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
96
96
  - !ruby/object:Gem::Version
97
97
  version: '0'
98
98
  requirements: []
99
- rubygems_version: 3.0.6
100
- signing_key:
99
+ rubygems_version: 3.5.23
100
+ signing_key:
101
101
  specification_version: 4
102
102
  summary: A gem for personal use.
103
103
  test_files: []