epitools 0.4.8 → 0.4.9
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/epitools.gemspec +2 -1
- data/lib/epitools/path.rb +1 -0
- data/spec/path_spec.rb +6 -0
- data/spec/tos.rb +73 -0
- metadata +5 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.9
|
data/epitools.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{epitools}
|
8
|
-
s.version = "0.4.
|
8
|
+
s.version = "0.4.9"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["epitron"]
|
@@ -76,6 +76,7 @@ Gem::Specification.new do |s|
|
|
76
76
|
"spec/ratio_spec.rb",
|
77
77
|
"spec/spec_helper.rb",
|
78
78
|
"spec/sys_spec.rb",
|
79
|
+
"spec/tos.rb",
|
79
80
|
"spec/zopen_spec.rb"
|
80
81
|
]
|
81
82
|
|
data/lib/epitools/path.rb
CHANGED
data/spec/path_spec.rb
CHANGED
data/spec/tos.rb
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
# to_s vs. to_str test
|
2
|
+
|
3
|
+
module String_Test
|
4
|
+
def initialize(arg)
|
5
|
+
@test = arg
|
6
|
+
end
|
7
|
+
|
8
|
+
def to_s
|
9
|
+
puts 'to_s called!'
|
10
|
+
'to_s ' + @test
|
11
|
+
end
|
12
|
+
|
13
|
+
def to_str
|
14
|
+
puts 'to_str called!'
|
15
|
+
'to_str ' + @test
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
class Both
|
20
|
+
include String_Test
|
21
|
+
end
|
22
|
+
|
23
|
+
class No_to_s
|
24
|
+
include String_Test
|
25
|
+
undef_method :to_s
|
26
|
+
end
|
27
|
+
|
28
|
+
class No_to_str
|
29
|
+
include String_Test
|
30
|
+
undef_method :to_str
|
31
|
+
end
|
32
|
+
|
33
|
+
class Neither
|
34
|
+
include String_Test
|
35
|
+
undef_method :to_s
|
36
|
+
undef_method :to_str
|
37
|
+
end
|
38
|
+
|
39
|
+
|
40
|
+
[Both, No_to_s, No_to_str, Neither].each do |curr_class|
|
41
|
+
puts
|
42
|
+
puts '=' * 40
|
43
|
+
puts curr_class.to_s
|
44
|
+
puts '=' * 40
|
45
|
+
|
46
|
+
t = curr_class.new('foo')
|
47
|
+
[
|
48
|
+
%q{t },
|
49
|
+
%q{p t },
|
50
|
+
%q{print t, "\n" },
|
51
|
+
%q{puts t },
|
52
|
+
%q{puts t.to_s },
|
53
|
+
%q{puts t, t },
|
54
|
+
%q{"#{t}" },
|
55
|
+
%q{puts "#{t}" },
|
56
|
+
%q{puts t.to_str },
|
57
|
+
%q{puts 'ADDING:' + t },
|
58
|
+
%q{'123'.split(t) },
|
59
|
+
%q{Dir.glob(t) },
|
60
|
+
%q{File.new(t) },
|
61
|
+
%q{/./.match(t) },
|
62
|
+
%q{nil.respond_to?(t) },
|
63
|
+
|
64
|
+
].each do |code|
|
65
|
+
puts 'RUNNING: ' + code
|
66
|
+
begin
|
67
|
+
eval code
|
68
|
+
rescue Exception => e
|
69
|
+
puts "ERROR: #{e}"
|
70
|
+
end
|
71
|
+
puts '-' * 20
|
72
|
+
end
|
73
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: epitools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 29
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.4.
|
9
|
+
- 9
|
10
|
+
version: 0.4.9
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- epitron
|
@@ -115,6 +115,7 @@ files:
|
|
115
115
|
- spec/spec_helper.rb
|
116
116
|
- spec/sys_spec.rb
|
117
117
|
- spec/zopen_spec.rb
|
118
|
+
- spec/tos.rb
|
118
119
|
has_rdoc: true
|
119
120
|
homepage: http://github.com/epitron/epitools
|
120
121
|
licenses:
|
@@ -161,4 +162,5 @@ test_files:
|
|
161
162
|
- spec/ratio_spec.rb
|
162
163
|
- spec/spec_helper.rb
|
163
164
|
- spec/sys_spec.rb
|
165
|
+
- spec/tos.rb
|
164
166
|
- spec/zopen_spec.rb
|