nkrb 0.1.5 → 0.1.6
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/README.md +22 -1
- data/lib/nkrb/version.rb +1 -1
- data/lib/nkrb.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 595c0a755e2a50c9ec7b4c147d4e273bf6c8df06
|
|
4
|
+
data.tar.gz: 63154f0e93a68fbc647b8e8684d417026e21f0fa
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: eb432fb4abdef4de88f98745e01874596db3bb06ba628cf9ac07874fa349bdc0715af4db52df5045d67d36e5059087606a5df607c28566ba1c144068db90c3e8
|
|
7
|
+
data.tar.gz: 515e27982bb371ac8767406ae82ec3326daed4fefc4dd97ea8f90687cbb560c7a0639ceb0e7098a06f8590b07b2e78417726e7d86a392fc2b127a99c1c922c32
|
data/README.md
CHANGED
|
@@ -11,7 +11,7 @@ gem 'nkrb'
|
|
|
11
11
|
|
|
12
12
|
And then execute:
|
|
13
13
|
|
|
14
|
-
$ bundle
|
|
14
|
+
$ bundle install
|
|
15
15
|
|
|
16
16
|
Or install it yourself as:
|
|
17
17
|
|
|
@@ -113,6 +113,27 @@ p Nkrb.random_str(10)
|
|
|
113
113
|
# => "2vjAkcdB34"
|
|
114
114
|
```
|
|
115
115
|
|
|
116
|
+
#### 8. remove_ctr
|
|
117
|
+
```
|
|
118
|
+
ctr_str = "\n\nhello\t"
|
|
119
|
+
p Nkrb.remove_ctr(ctr_str, replace: "")
|
|
120
|
+
# => "hello"
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
#### 9.output_tsv
|
|
124
|
+
```
|
|
125
|
+
collection = [
|
|
126
|
+
{key1: "a1", key2: "a2"},
|
|
127
|
+
{key1: "a3", key2: "a4"},
|
|
128
|
+
]
|
|
129
|
+
|
|
130
|
+
Nkrb.output_tsv(collection, delimiter: "\t", required_header: true)
|
|
131
|
+
# =>
|
|
132
|
+
# key1\tkey2
|
|
133
|
+
# a1\ta2
|
|
134
|
+
# a3\ta4
|
|
135
|
+
```
|
|
136
|
+
|
|
116
137
|
|
|
117
138
|
## Development
|
|
118
139
|
|
data/lib/nkrb/version.rb
CHANGED
data/lib/nkrb.rb
CHANGED
|
@@ -134,8 +134,8 @@ module Nkrb
|
|
|
134
134
|
(0...len).map { o[rand(o.length)] }.join
|
|
135
135
|
end
|
|
136
136
|
|
|
137
|
-
def remove_ctr(str)
|
|
138
|
-
str.gsub(/[[:cntrl:]]/,
|
|
137
|
+
def remove_ctr(str, replace: "")
|
|
138
|
+
str.gsub(/[[:cntrl:]]/, replace)
|
|
139
139
|
end
|
|
140
140
|
|
|
141
141
|
def output_tsv(collection, delimiter: "\t", required_header: true)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: nkrb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- gnk-satoh
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-06-
|
|
11
|
+
date: 2017-06-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|