runicode 0.1.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 +7 -0
- data/lib/runicode.rb +13 -0
- metadata +60 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 13d4a6f377234114d485b206f30cffac38efaf3a
|
4
|
+
data.tar.gz: 50ac995dcfdadbc84bbccc0b4568a1ea0455ccfe
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6b19bad6382a2f2c79786f434cde70576bd8a10f762e552787572f08816390da8b5500485c187901d998b88202668ade7e923f98ee8f0e9a38639e708d4ac3c8
|
7
|
+
data.tar.gz: 76467610dfe6546edeb25969ff7db0faf779458f5155eec325c7dc3fc040dc2fabf75b9c5a4051290b5817e3df00237d13617d7eaa134eb6194b00fceba1ed7f
|
data/lib/runicode.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
class Runicode
|
2
|
+
char_classes = %w(\p{C} \p{Z} \p{Blank})
|
3
|
+
group = "[#{char_classes.join('')}]"
|
4
|
+
start_of_string = "\\A#{group}+"
|
5
|
+
end_of_string = "#{group}+\\z"
|
6
|
+
STRIP_EXPRESSION = Regexp.new("(#{start_of_string})|(#{end_of_string})")
|
7
|
+
# /(\A[\p{C}\p{Z}\p{Blank}]+)|([\p{C}\p{Z}\p{Blank}]+\z)/
|
8
|
+
|
9
|
+
def self.strip(str)
|
10
|
+
str.gsub STRIP_EXPRESSION, ''
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
metadata
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: runicode
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Greg Polumbo
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-06-02 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rspec
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
description: Helper method for stripping unicode 'control', 'other', and 'blank' characters
|
28
|
+
from strings
|
29
|
+
email: gregory_polumbo@hms.harvard.edu
|
30
|
+
executables: []
|
31
|
+
extensions: []
|
32
|
+
extra_rdoc_files: []
|
33
|
+
files:
|
34
|
+
- lib/runicode.rb
|
35
|
+
homepage: https://github.com/gerggggggg/runicode
|
36
|
+
licenses:
|
37
|
+
- MIT
|
38
|
+
metadata: {}
|
39
|
+
post_install_message:
|
40
|
+
rdoc_options: []
|
41
|
+
require_paths:
|
42
|
+
- lib
|
43
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
49
|
+
requirements:
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: '0'
|
53
|
+
requirements: []
|
54
|
+
rubyforge_project:
|
55
|
+
rubygems_version: 2.6.11
|
56
|
+
signing_key:
|
57
|
+
specification_version: 4
|
58
|
+
summary: Helper method for stripping unicode 'control', 'other', and 'blank' characters
|
59
|
+
from strings
|
60
|
+
test_files: []
|