sub_object 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 +14 -0
- data/Makefile +2 -1
- data/README.en.rdoc +4 -2
- data/sub_object.gemspec +8 -3
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cba7eccff10ce8fb7481c89515c1a249457c6cb71bb221f8fea20f5f9de00c20
|
4
|
+
data.tar.gz: 708f9c6c8b60c4b846eed1e5c0c7f682885b311f129105c5c1ced09b850fbc5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: faf7f261efb2304b693a4b9868a4c1d828a2a7dff32630a27b70b387d77fba5c41a8b2e37ad6c3f094ee9f33146d2048c5f46cd6b8b5e691b33dc76af872a7dd
|
7
|
+
data.tar.gz: 735655afd567b92ba9400924aa0ee4ac1841429eceb97ea74cae4281bc1e8e8d23c7165e40efd028ac6c2150ed9f267637fa15a499bd4c0371723a774a3dd410
|
data/ChangeLog
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
-----
|
2
|
+
(Version: 1.0.1)
|
3
|
+
2019-11-07 Masa Sakano
|
4
|
+
* Minor update in documentation.
|
5
|
+
|
6
|
+
-----
|
7
|
+
2019-11-05 Masa Sakano
|
8
|
+
* Correct .github/README.md as auto-conversion from rdoc to md badly failed for the sample code.
|
9
|
+
|
10
|
+
-----
|
11
|
+
(Version: 1.0)
|
12
|
+
2019-11-05 Masa Sakano
|
13
|
+
|
14
|
+
* Initial but pretty much complete commit (Ver.1.0).
|
data/Makefile
CHANGED
@@ -18,6 +18,7 @@ clean:
|
|
18
18
|
test:
|
19
19
|
rake test
|
20
20
|
|
21
|
+
## yard2md_afterclean in Gem plain_text https://rubygems.org/gems/plain_text
|
21
22
|
doc:
|
22
|
-
yard doc; [[ -x ".github" && ( "README.en.rdoc" -nt ".github/README.md" ) ]] && ( ruby -r rdoc -e 'puts RDoc::Markup::ToMarkdown.new.convert ARGF.read' < README.en.rdoc > .github/README.md ; echo ".github/README.md is updated." ) || exit 0
|
23
|
+
yard doc; [[ -x ".github" && ( "README.en.rdoc" -nt ".github/README.md" ) ]] && ( ruby -r rdoc -e 'puts RDoc::Markup::ToMarkdown.new.convert ARGF.read' < README.en.rdoc | yard2md_afterclean > .github/README.md ; echo ".github/README.md is updated." ) || exit 0
|
23
24
|
|
data/README.en.rdoc
CHANGED
@@ -47,7 +47,7 @@ information it needs for the +source+ is basically +source.object_id+
|
|
47
47
|
or equivalent, which is nothing in terms of memory use.
|
48
48
|
In other words, this class does
|
49
49
|
not create the copy of sub-Object from the original source object, as,
|
50
|
-
for example, +String#[i,j]+ does.
|
50
|
+
for example, +String#[ i, j ]+ does.
|
51
51
|
|
52
52
|
As an example, the child class {SubString}[http://rubygems.org/gems/sub_string] (provided as a different Gem)
|
53
53
|
works as:
|
@@ -97,7 +97,7 @@ perfectly possible; indeed it is defined as {SubObject::SubArray}.
|
|
97
97
|
To be fair, I am afraid *SubArray* class does not have much practical
|
98
98
|
value (apart from the demonstration of the concept!), because the only
|
99
99
|
advantage of this class is to use the minimum memory, whereas the
|
100
|
-
original sub-array as in +Array#[i,j]+ does not take much memory in
|
100
|
+
original sub-array as in +Array#[ i, j ]+ does not take much memory in
|
101
101
|
the first place, given Array is by definition just a container.
|
102
102
|
|
103
103
|
By stark contrast, each sub-String in Ruby default takes up memory
|
@@ -226,6 +226,8 @@ An example of +SubObject+ with a test class +MyC+, which
|
|
226
226
|
3. has the method +plus1+, which returns its instance variable plus 1,
|
227
227
|
4. has the method +dest!+
|
228
228
|
|
229
|
+
**Code sample**:
|
230
|
+
|
229
231
|
class MyC
|
230
232
|
def initialize(a); @x = a; end
|
231
233
|
def [](a, b); MyC.new(a+b); end
|
data/sub_object.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_object'.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_object).each do |f|
|
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
|
|
13
13
|
# File.executable?(path) ? s.executables << f : raise("ERROR: Executable (#{path}) is not executable!")
|
14
14
|
# end
|
15
15
|
s.authors = ["Masa Sakano"]
|
16
|
-
s.date = %q{2019-11-
|
16
|
+
s.date = %q{2019-11-07}.sub(/.*/){|c| (Date.parse(c) == Date.today) ? c : raise("ERROR: s.date=(#{c}) is not today!")}
|
17
17
|
s.summary = %q{Parent class for memory-efficient sub-Something}
|
18
18
|
s.description = %q{Class SubObject that is the parent class for Ruby SubString and SubArray classes and alike, providing the base interface. This and child classes use negligible memory space, as their instance holds the positional information only. It behaves exactly like the source object (duck-typing), except destructive modification is prohibited. If the original source object is destructively altered, the corresponding instance can detect it and issue warning.}
|
19
19
|
# s.email = %q{abc@example.com}
|
@@ -47,6 +47,11 @@ Gem::Specification.new do |s|
|
|
47
47
|
# s.requirements << 'libmagick, v6.0' # Simply, info to users.
|
48
48
|
# s.rubygems_version = %q{1.3.5} # This is always set automatically!!
|
49
49
|
|
50
|
+
## cf. https://guides.rubygems.org/specification-reference/#metadata
|
50
51
|
s.metadata["yard.run"] = "yri" # use "yard" to build full HTML docs.
|
52
|
+
s.metadata["changelog_uri"] = "https://github.com/masasakano/#{s.name}/blob/master/ChangeLog"
|
53
|
+
# s.metadata["source_code_uri"] = "https://github.com/masasakano/sub_object"
|
54
|
+
# s.metadata["documentation_uri"] = "https://www.example.info/gems/bestgemever/0.0.1"
|
55
|
+
|
51
56
|
end
|
52
57
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sub_object
|
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
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-11-
|
11
|
+
date: 2019-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Class SubObject that is the parent class for Ruby SubString and SubArray
|
14
14
|
classes and alike, providing the base interface. This and child classes use negligible
|
@@ -23,6 +23,7 @@ extra_rdoc_files:
|
|
23
23
|
- README.en.rdoc
|
24
24
|
files:
|
25
25
|
- ".gitignore"
|
26
|
+
- ChangeLog
|
26
27
|
- LICENSE.txt
|
27
28
|
- Makefile
|
28
29
|
- README.en.rdoc
|
@@ -36,6 +37,7 @@ licenses:
|
|
36
37
|
- MIT
|
37
38
|
metadata:
|
38
39
|
yard.run: yri
|
40
|
+
changelog_uri: https://github.com/masasakano/sub_object/blob/master/ChangeLog
|
39
41
|
post_install_message:
|
40
42
|
rdoc_options:
|
41
43
|
- "--charset=UTF-8"
|