sub_string 1.0 → 1.0.1
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/ChangeLog +10 -0
- data/README.en.rdoc +11 -5
- data/sub_string.gemspec +12 -6
- metadata +7 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8363082abbe2b91aa7a063ccdfc4719bdd06e5c476d64bf33b3e8a8bb5fa4590
|
4
|
+
data.tar.gz: 0ec710c61e5d727714f8fe9b19e8ea74da998678e727c124da9ba8e749c2f0c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: faba092f12dd756167e205c0f864e3bc0d72f61f8754489c64ff8628021df1e0bd4d302df945d4fc33e47e574d3d533c19e9c6a13bbb9f2a883935344dee240e
|
7
|
+
data.tar.gz: 1c1cdf4451a452014b88210388277dee145960800f75f9bb14f41ac7c8648d5324a15f2fbae34d7e911bcb7e23fd3d9e2d9a50b42a67015ec33de26d00f2ea67
|
data/ChangeLog
ADDED
data/README.en.rdoc
CHANGED
@@ -5,6 +5,11 @@
|
|
5
5
|
|
6
6
|
Class {SubString} that expresses Ruby sub-String but taking up negligible memory space, as its instance holds the positional information only. It behaves exactly like String (duck-typing), except destructive modification is prohibited. If the original string is destructively modified, warning is issued.
|
7
7
|
|
8
|
+
On the surface, this is a String version of the class MatchSkeleton
|
9
|
+
{match_skeleton}[https://rubygems.org/gems/match_skeleton] (also in
|
10
|
+
{Github}[https://github.com/masasakano/match_skeleton]), which is an
|
11
|
+
alternative and much memorly-lighter version of MatchData.
|
12
|
+
|
8
13
|
For the detailed background concept (and algorithm), see the reference page of the
|
9
14
|
generalized parent class, SubObject, either at the
|
10
15
|
{Ruby Gems page}[http://rubygems.org/gems/sub_object]
|
@@ -28,7 +33,7 @@ of information (plus a hash value, strictly speaking), and hence uses negligible
|
|
28
33
|
Note that only the information this instance needs for *source* is
|
29
34
|
+source.object_id+ or equivalent, which is really negligible in size.
|
30
35
|
In other words, this class does not create the copy of sub-Object from
|
31
|
-
the original source object as the Ruby default +String#[i,j]+ does.
|
36
|
+
the original source object as the Ruby default +String#[ i, j ]+ does.
|
32
37
|
|
33
38
|
Then, whenever it is referred to, it reconstructs the original
|
34
39
|
sub-String object:
|
@@ -71,7 +76,7 @@ be applied to the instance of this class.
|
|
71
76
|
|
72
77
|
=== Potential use
|
73
78
|
|
74
|
-
Each sub-String in Ruby like +String[i, j]+ or +String[i..j]+ takes up memory
|
79
|
+
Each sub-String in Ruby like +String#[ i, j ]+ or +String#[ i..j ]+ takes up memory
|
75
80
|
according to the length of the sub-String. Consider an example:
|
76
81
|
|
77
82
|
src = "Some very extremely lengthy string.... (snipped)".
|
@@ -144,10 +149,11 @@ In default it is nil and $VERBOSE is referred to.
|
|
144
149
|
== Install
|
145
150
|
|
146
151
|
This script requires {Ruby}[http://www.ruby-lang.org] Version 2.0
|
147
|
-
or above.
|
152
|
+
or above. And this library depends on {SubObject (sub_object)}[https://rubygems.org/gems/sub_object], which you can
|
153
|
+
find in RubyGems.
|
148
154
|
|
149
|
-
You can install
|
150
|
-
Or, alternatively, download
|
155
|
+
You can install the packages of both this library and SubObject with the usual Ruby gem command.
|
156
|
+
Or, alternatively, download them and put the library files in one of your Ruby library search paths.
|
151
157
|
|
152
158
|
== Developer's note
|
153
159
|
|
data/sub_string.gemspec
CHANGED
@@ -4,8 +4,8 @@ require 'rake'
|
|
4
4
|
require 'date'
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
|
-
s.name =
|
8
|
-
s.version = "1.0"
|
7
|
+
s.name = 'sub_string'.sub(/.*/){|c| (c == File.basename(Dir.pwd)) ? c : raise("ERROR: s.name=(#{c}) in gemspec seems wrong!")}
|
8
|
+
s.version = "1.0.1".sub(/.*/){|c| fs = Dir.glob('changelog{,.*}', File::FNM_CASEFOLD); raise('More than one ChangeLog exist!') if fs.size > 1; warn("WARNING: Version(s.version=#{c}) already exists in #{fs[0]} - ok?") if fs.size == 1 && !IO.readlines(fs[0]).grep(/^\(Version: #{Regexp.quote c}\)$/).empty? ; c } # n.b., In macOS, changelog and ChangeLog are identical in default.
|
9
9
|
# s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
10
10
|
# s.bindir = 'bin'
|
11
11
|
# %w(sub_string).each do |f|
|
@@ -15,7 +15,9 @@ Gem::Specification.new do |s|
|
|
15
15
|
s.authors = ["Masa Sakano"]
|
16
16
|
s.date = %q{2019-11-05}.sub(/.*/){|c| (Date.parse(c) == Date.today) ? c : raise("ERROR: s.date=(#{c}) is not today!")}
|
17
17
|
s.summary = %q{Duck-typed String class with negligible memory use}
|
18
|
-
s.description =
|
18
|
+
s.description = <<-EOF
|
19
|
+
Class SubString that expresses Ruby sub-String but taking up negligible memory space, as its instance holds the positional information only. It behaves exactly like String (duck-typing), except destructive modification is prohibited. If the original string is destructively altered, warning is issued.
|
20
|
+
EOF
|
19
21
|
# s.email = %q{abc@example.com}
|
20
22
|
s.extra_rdoc_files = [
|
21
23
|
#"LICENSE.txt",
|
@@ -36,9 +38,9 @@ Gem::Specification.new do |s|
|
|
36
38
|
s.files.reject! { |fn| File.symlink? fn }
|
37
39
|
|
38
40
|
s.add_runtime_dependency 'sub_object', '>= 1.0'
|
39
|
-
# s.add_development_dependency "bourne", [">= 0"]
|
40
|
-
s.homepage =
|
41
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
41
|
+
# s.add_development_dependency "bourne", [">= 0"] # '~> 2.0' to mean for only 2.0.x
|
42
|
+
s.homepage = "https://www.wisebabel.com"
|
43
|
+
s.rdoc_options = ["--charset=UTF-8"] # "-e UTF-8" is now Default...
|
42
44
|
|
43
45
|
# s.require_paths = ["lib"] # Default "lib"
|
44
46
|
s.required_ruby_version = '>= 2.0' # respond_to_missing?
|
@@ -47,6 +49,10 @@ Gem::Specification.new do |s|
|
|
47
49
|
# s.requirements << 'libmagick, v6.0' # Simply, info to users.
|
48
50
|
# s.rubygems_version = %q{1.3.5} # This is always set automatically!!
|
49
51
|
|
52
|
+
## cf. https://guides.rubygems.org/specification-reference/#metadata
|
50
53
|
s.metadata["yard.run"] = "yri" # use "yard" to build full HTML docs.
|
54
|
+
s.metadata["changelog_uri"] = "https://github.com/masasakano/sub_string/blob/master/ChangeLog"
|
55
|
+
s.metadata["source_code_uri"] = "https://github.com/masasakano/sub_string"
|
56
|
+
# s.metadata["documentation_uri"] = "https://www.example.info/gems/bestgemever/0.0.1"
|
51
57
|
end
|
52
58
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sub_string
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masa Sakano
|
@@ -24,10 +24,10 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.0'
|
27
|
-
description: Class SubString that expresses Ruby sub-String but taking up negligible
|
27
|
+
description: " Class SubString that expresses Ruby sub-String but taking up negligible
|
28
28
|
memory space, as its instance holds the positional information only. It behaves
|
29
|
-
exactly like String (duck-typing), except destructive modification is prohibited.
|
30
|
-
the original string is destructively altered, warning is issued
|
29
|
+
exactly like String (duck-typing), except destructive modification is prohibited.
|
30
|
+
\ If the original string is destructively altered, warning is issued.\n"
|
31
31
|
email:
|
32
32
|
executables: []
|
33
33
|
extensions: []
|
@@ -35,6 +35,7 @@ extra_rdoc_files:
|
|
35
35
|
- README.en.rdoc
|
36
36
|
files:
|
37
37
|
- ".gitignore"
|
38
|
+
- ChangeLog
|
38
39
|
- LICENSE.txt
|
39
40
|
- Makefile
|
40
41
|
- README.en.rdoc
|
@@ -47,6 +48,8 @@ licenses:
|
|
47
48
|
- MIT
|
48
49
|
metadata:
|
49
50
|
yard.run: yri
|
51
|
+
changelog_uri: https://github.com/masasakano/sub_string/blob/master/ChangeLog
|
52
|
+
source_code_uri: https://github.com/masasakano/sub_string
|
50
53
|
post_install_message:
|
51
54
|
rdoc_options:
|
52
55
|
- "--charset=UTF-8"
|