perception 0.3.1 → 0.3.3
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.
- data/History.txt +3 -0
- data/Manifest.txt +3 -2
- data/Rakefile.rb +10 -13
- data/console.rb +7 -0
- data/demo/demo_pp.rb +2 -3
- data/demo/demo_system_info.rb +2 -2
- data/demo/demo_zz.rb +2 -2
- data/lib/perception/const.rb +31 -6
- data/lib/perception/date_and_time.rb +36 -9
- data/lib/perception/logging.rb +48 -20
- data/lib/perception/numeric.rb +16 -10
- data/lib/perception/perception_main.rb +8 -7
- data/lib/perception/perception_private.rb +5 -7
- data/lib/perception/ppp.rb +30 -5
- data/lib/perception/string_spread.rb +49 -14
- data/lib/perception.rb +6 -12
- data/profile.rb +8 -3
- data/test/_start_all.rb +9 -6
- data/test/test_date_and_time.rb +3 -3
- data/test/test_numeric.rb +3 -3
- data/test/test_ppp.rb +4 -7
- data/version.rb +6 -0
- metadata +21 -4
- data/script/console.rb +0 -10
data/History.txt
CHANGED
data/Manifest.txt
CHANGED
@@ -1,8 +1,10 @@
|
|
1
|
+
console.rb
|
1
2
|
History.txt
|
2
3
|
License.txt
|
3
4
|
Manifest.txt
|
4
|
-
README.txt
|
5
5
|
Rakefile.rb
|
6
|
+
README.txt
|
7
|
+
version.rb
|
6
8
|
demo/demo_pp.rb
|
7
9
|
demo/demo_system_info.rb
|
8
10
|
demo/demo_zz.rb
|
@@ -17,7 +19,6 @@ lib/perception/perception_private.rb
|
|
17
19
|
lib/perception/ppp.rb
|
18
20
|
lib/perception/string_spread.rb
|
19
21
|
profile.rb
|
20
|
-
script/console.rb
|
21
22
|
test/_start_all.rb
|
22
23
|
test/test_date_and_time.rb
|
23
24
|
test/test_numeric.rb
|
data/Rakefile.rb
CHANGED
@@ -1,35 +1,32 @@
|
|
1
1
|
# ruby encoding: utf-8
|
2
2
|
# ü
|
3
3
|
|
4
|
-
require '
|
5
|
-
|
6
|
-
require '
|
7
|
-
Kyanite.projectname = File.dirname(__FILE__).split("/")[-1].strip # Name des Projekt-Stammverzeichnisses
|
8
|
-
Kyanite.github_username = 'bklippstein'
|
4
|
+
require 'drumherum'
|
5
|
+
smart_init
|
6
|
+
require 'version'
|
9
7
|
require 'rdoc/task'
|
10
|
-
require '
|
8
|
+
require 'drumherum/rake'
|
11
9
|
|
10
|
+
Drumherum.github_username = 'bklippstein'
|
12
11
|
require 'perception'
|
13
12
|
|
14
|
-
# puts Kyanite.github_username
|
15
|
-
# puts Kyanite.projectname
|
16
|
-
# puts Hoe.class
|
17
13
|
|
18
14
|
# ----------------------------------------------------------------------------------------------
|
19
15
|
# Hoe
|
20
16
|
#
|
21
17
|
# http://nubyonrails.com/articles/tutorial-publishing-rubygems-with-hoe
|
22
18
|
#
|
23
|
-
$hoe = Hoe.spec
|
19
|
+
$hoe = Hoe.spec Drumherum.project_name do
|
24
20
|
|
25
21
|
# self.rubyforge_name = 'yourgemx' # if different than 'yourgem'
|
26
22
|
|
27
23
|
developer('Bjoern Klippstein', 'klippstein@klippstein.com')
|
28
|
-
summary = 'Beautiful and readable printouts for console and logs.'
|
24
|
+
summary = 'Beautiful and readable printouts for console and logs.'
|
25
|
+
extra_deps << ['drumherum', '>= 0.1.10']
|
29
26
|
extra_deps << ['kyanite', '>= 0.5.17']
|
30
27
|
extra_deps << ['highline', '>= 1.6.15']
|
31
28
|
remote_rdoc_dir = '' # Release to root only one project
|
32
|
-
urls = [["http://#{
|
29
|
+
urls = [["http://#{Drumherum.github_username}.github.com/#{Drumherum.project_name}/"]]
|
33
30
|
|
34
31
|
end
|
35
32
|
|
@@ -47,7 +44,7 @@ remove_task 'docs'
|
|
47
44
|
desc "generate RDoc documentation"
|
48
45
|
Rake::RDocTask.new(:docs) do |rd|
|
49
46
|
|
50
|
-
rd.title = "#{
|
47
|
+
rd.title = "#{Drumherum.project_class.to_s} #{Drumherum.project_version}"
|
51
48
|
|
52
49
|
rd.rdoc_dir = 'doc'
|
53
50
|
rd.rdoc_files.include('lib/**/*.rb')
|
data/console.rb
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# File: script/console
|
3
|
+
irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
|
4
|
+
libs = " -r irb/completion"
|
5
|
+
initfile = File.join(File.dirname(__FILE__), 'init.rb' )
|
6
|
+
libs << " -r #{initfile}"
|
7
|
+
exec "#{irb} #{libs} --simple-prompt --noreadline"
|
data/demo/demo_pp.rb
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
# ruby encoding: utf-8
|
2
2
|
# ü
|
3
3
|
if $0 == __FILE__
|
4
|
-
require
|
5
|
-
|
4
|
+
require 'drumherum'
|
5
|
+
smart_init
|
6
6
|
require 'perception'
|
7
7
|
end
|
8
8
|
|
9
9
|
|
10
|
-
|
11
10
|
module Perception #:nodoc
|
12
11
|
|
13
12
|
class DemoSee
|
data/demo/demo_system_info.rb
CHANGED
data/demo/demo_zz.rb
CHANGED
data/lib/perception/const.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# ruby encoding: utf-8
|
2
2
|
# ü
|
3
3
|
if $0 == __FILE__
|
4
|
-
require '
|
5
|
-
|
4
|
+
require 'drumherum'
|
5
|
+
smart_init
|
6
6
|
require 'perception'
|
7
7
|
end
|
8
8
|
|
@@ -73,11 +73,36 @@ end # module
|
|
73
73
|
|
74
74
|
|
75
75
|
# -----------------------------------------------------------------------------------------
|
76
|
-
#
|
76
|
+
# Ausprobieren
|
77
77
|
#
|
78
|
-
if $0 == __FILE__ then
|
78
|
+
if $0 == __FILE__ && Drumherum::loaded? then
|
79
79
|
|
80
|
-
|
81
|
-
|
80
|
+
# Hier einstellen, was laufen soll
|
81
|
+
#$run = :tests
|
82
|
+
$run = :demo
|
83
|
+
|
84
|
+
case $run
|
85
|
+
|
86
|
+
|
87
|
+
when :demo #------------------------------------------------------------------------------
|
88
|
+
|
89
|
+
require File.join(Drumherum::directory_main, 'demo', 'demo_pp' )
|
90
|
+
Perception::DemoSee.see_all_demos
|
91
|
+
|
92
|
+
|
93
|
+
when :tests #------------------------------------------------------------------------------
|
94
|
+
|
95
|
+
require File.join(Drumherum::directory_main, 'test', '_start_all' )
|
96
|
+
|
97
|
+
|
98
|
+
else #--------------------------------------------------------------------------------------
|
99
|
+
|
100
|
+
see '$run einstellen!'
|
101
|
+
|
102
|
+
|
103
|
+
end # case
|
82
104
|
|
105
|
+
|
106
|
+
|
107
|
+
|
83
108
|
end # if
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# ruby encoding: utf-8
|
2
2
|
# ü
|
3
3
|
if $0 == __FILE__
|
4
|
-
require '
|
5
|
-
|
4
|
+
require 'drumherum'
|
5
|
+
smart_init
|
6
6
|
require 'perception'
|
7
7
|
end
|
8
8
|
|
@@ -53,15 +53,42 @@ end
|
|
53
53
|
|
54
54
|
|
55
55
|
# -----------------------------------------------------------------------------------------
|
56
|
-
#
|
56
|
+
# Ausprobieren
|
57
57
|
#
|
58
|
-
if $0 == __FILE__ then
|
58
|
+
if $0 == __FILE__ && Drumherum::loaded? then
|
59
59
|
|
60
|
-
#
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
60
|
+
# Hier einstellen, was laufen soll
|
61
|
+
$run = :try
|
62
|
+
#$run = :tests
|
63
|
+
#$run = :demo
|
64
|
+
|
65
|
+
case $run
|
66
|
+
|
67
|
+
when :try #-------------------------------------------------------------------------------
|
68
|
+
|
69
|
+
ms = 2635200
|
70
|
+
puts (Time.now - ms*0).inspect_see(:norm => :de, :precision => 5)
|
71
|
+
see Time.now
|
72
|
+
|
73
|
+
when :demo #------------------------------------------------------------------------------
|
74
|
+
|
75
|
+
require File.join(Drumherum::directory_main, 'demo', 'demo_pp' )
|
76
|
+
Perception::DemoSee.see_all_demos
|
77
|
+
|
78
|
+
|
79
|
+
when :tests #------------------------------------------------------------------------------
|
80
|
+
|
81
|
+
require File.join(Drumherum::directory_main, 'test', 'test_date_and_time' )
|
82
|
+
|
83
|
+
|
84
|
+
else #--------------------------------------------------------------------------------------
|
85
|
+
|
86
|
+
see '$run einstellen!'
|
87
|
+
|
88
|
+
|
89
|
+
end # case
|
90
|
+
|
91
|
+
|
65
92
|
|
66
93
|
|
67
94
|
end # if
|
data/lib/perception/logging.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# ruby encoding: utf-8
|
2
2
|
# ü
|
3
3
|
if $0 == __FILE__
|
4
|
-
require '
|
5
|
-
|
4
|
+
require 'drumherum'
|
5
|
+
smart_init
|
6
6
|
require 'perception'
|
7
7
|
end
|
8
8
|
|
@@ -17,7 +17,7 @@ module Perception #:nodoc
|
|
17
17
|
|
18
18
|
# Logfile festlegen
|
19
19
|
unless logdir
|
20
|
-
mycaller = CallerUtils.mycaller(:skip => ['perception', 'ruby\gems', 'ruby/gems', 'test/unit'])
|
20
|
+
mycaller = CallerUtils.mycaller(:skip => ['perception', 'ruby\gems', 'ruby/gems', 'rubygems', 'test/unit'])
|
21
21
|
logdir = CallerUtils.mycaller_maindir(mycaller) + '/log' if mycaller
|
22
22
|
end
|
23
23
|
if ( logdir.nil? || logdir == 'test/log' )
|
@@ -25,9 +25,9 @@ module Perception #:nodoc
|
|
25
25
|
logdir = Dir::tmpdir + '/log'
|
26
26
|
end
|
27
27
|
logfile = File.join(logdir, filename)
|
28
|
-
|
29
|
-
|
30
|
-
|
28
|
+
puts "\nmycaller=#{mycaller.inspect_pp}"
|
29
|
+
puts "\nlogdir=#{logdir.inspect_pp}"
|
30
|
+
puts "\nlogfile=#{logfile.inspect_pp}"
|
31
31
|
|
32
32
|
|
33
33
|
# Erzeugen, wenn nötig
|
@@ -97,26 +97,54 @@ end
|
|
97
97
|
|
98
98
|
|
99
99
|
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
# ------------------------------------------------------------------------------
|
100
|
+
# -----------------------------------------------------------------------------------------
|
105
101
|
# Ausprobieren
|
106
|
-
#
|
107
|
-
if $0 == __FILE__ then
|
108
|
-
|
109
|
-
|
110
|
-
see "Hallo"
|
111
|
-
see 'Jups.', :g, :h
|
112
|
-
#seee.log_status
|
113
|
-
log 'Jups.'
|
114
|
-
log 'Jups.', :g, :h
|
102
|
+
#
|
103
|
+
if $0 == __FILE__ && Drumherum::loaded? then
|
115
104
|
|
105
|
+
# Hier einstellen, was laufen soll
|
106
|
+
$run = :try
|
107
|
+
#$run = :tests
|
108
|
+
#$run = :demo
|
109
|
+
|
110
|
+
case $run
|
111
|
+
|
112
|
+
when :try #-------------------------------------------------------------------------------
|
113
|
+
|
114
|
+
see $LOAD_PATH
|
115
|
+
see
|
116
|
+
see "Hallo"
|
117
|
+
see 'Jups.', :g, :h
|
118
|
+
see seee.logger
|
119
|
+
log 'Jups.'
|
120
|
+
log 'Jups.', :g, :h
|
121
|
+
|
122
|
+
when :demo #------------------------------------------------------------------------------
|
123
|
+
|
124
|
+
require File.join(Drumherum::directory_main, 'demo', 'demo_pp' )
|
125
|
+
Perception::DemoSee.see_all_demos
|
126
|
+
|
127
|
+
|
128
|
+
when :tests #------------------------------------------------------------------------------
|
129
|
+
|
130
|
+
require File.join(Drumherum::directory_main, 'test', '_start_all' )
|
131
|
+
|
132
|
+
|
133
|
+
else #--------------------------------------------------------------------------------------
|
134
|
+
|
135
|
+
see '$run einstellen!'
|
136
|
+
|
137
|
+
|
138
|
+
end # case
|
116
139
|
|
140
|
+
|
141
|
+
|
117
142
|
|
118
143
|
end # if
|
119
144
|
|
145
|
+
|
146
|
+
|
147
|
+
|
120
148
|
|
121
149
|
|
122
150
|
|
data/lib/perception/numeric.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# ruby encoding: utf-8
|
2
2
|
# ü
|
3
3
|
if $0 == __FILE__
|
4
|
-
require '
|
5
|
-
|
4
|
+
require 'drumherum'
|
5
|
+
smart_init
|
6
6
|
require 'perception'
|
7
7
|
end
|
8
8
|
|
@@ -138,19 +138,18 @@ end
|
|
138
138
|
# -----------------------------------------------------------------------------------------
|
139
139
|
# Ausprobieren, Tests
|
140
140
|
#
|
141
|
-
|
142
|
-
|
143
|
-
if $0 == __FILE__ then
|
141
|
+
if $0 == __FILE__ && Drumherum::loaded? then
|
144
142
|
|
145
143
|
# Hier einstellen, was laufen soll
|
146
|
-
$run = :
|
147
|
-
|
144
|
+
$run = :try1
|
145
|
+
#$run = :try2
|
148
146
|
#$run = :tests
|
147
|
+
#$run = :demo
|
149
148
|
|
150
149
|
case $run
|
151
150
|
|
152
151
|
|
153
|
-
when :
|
152
|
+
when :try1 #-------------------------------------------------------------------------------
|
154
153
|
|
155
154
|
test = [12567.89, 1256.789, 123.56789, 100.01, 100.0, 99.9, 12.0, 12, 12.56789, 1.256789, 1.5, 0, 0.1256789,0.01256789,0.001256789,0.0001256789, ]
|
156
155
|
test.each do |t|
|
@@ -161,7 +160,7 @@ if $0 == __FILE__ then
|
|
161
160
|
end
|
162
161
|
|
163
162
|
|
164
|
-
when :
|
163
|
+
when :try2 #-------------------------------------------------------------------------------
|
165
164
|
|
166
165
|
test = [7213541, 553337, 12567.89, 1256.789, 123.56789, 100.01, 100.0, 99.9, 12.0, 12, 12.56789, 1.256789, 1.5, 0, 0.1256789,0.01256789,0.001256789,0.0001256789, ]
|
167
166
|
test.each do |t|
|
@@ -171,9 +170,16 @@ if $0 == __FILE__ then
|
|
171
170
|
see_print t.to_s.rjust(15) + ' ########' + t.to_f.inspect_see + "########\n"
|
172
171
|
end
|
173
172
|
|
173
|
+
|
174
|
+
when :demo #------------------------------------------------------------------------------
|
175
|
+
|
176
|
+
require File.join(Drumherum::directory_main, 'demo', 'demo_pp' )
|
177
|
+
Perception::DemoSee.see_all_demos
|
178
|
+
|
179
|
+
|
174
180
|
when :tests #------------------------------------------------------------------------------
|
175
181
|
|
176
|
-
require File.join(
|
182
|
+
require File.join(Drumherum::directory_main, 'test', 'test_numeric' )
|
177
183
|
|
178
184
|
|
179
185
|
else #--------------------------------------------------------------------------------------
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# ruby encoding: utf-8
|
2
2
|
# ü
|
3
3
|
if $0 == __FILE__
|
4
|
-
require '
|
5
|
-
|
4
|
+
require 'drumherum'
|
5
|
+
smart_init
|
6
6
|
require 'perception'
|
7
7
|
end
|
8
8
|
|
@@ -304,11 +304,12 @@ end # class
|
|
304
304
|
|
305
305
|
|
306
306
|
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
307
|
+
# -----------------------------------------------------------------------------------------
|
308
|
+
# ausprobieren
|
309
|
+
#
|
310
|
+
if $0 == __FILE__ && Drumherum::loaded? then
|
311
|
+
require File.join(Drumherum::directory_main, 'demo', 'demo_pp' )
|
312
|
+
Perception::DemoSee.see_all_demos
|
312
313
|
end # if
|
313
314
|
|
314
315
|
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# ruby encoding: utf-8
|
2
2
|
# ü
|
3
3
|
if $0 == __FILE__
|
4
|
-
require '
|
5
|
-
|
4
|
+
require 'drumherum'
|
5
|
+
smart_init
|
6
6
|
require 'perception'
|
7
7
|
end
|
8
8
|
|
@@ -228,11 +228,9 @@ end # class
|
|
228
228
|
# -----------------------------------------------------------------------------------------
|
229
229
|
# ausprobieren
|
230
230
|
#
|
231
|
-
if $0 == __FILE__ then
|
232
|
-
|
233
|
-
|
234
|
-
Perception::DemoSee.see_all_demos
|
235
|
-
|
231
|
+
if $0 == __FILE__ && Drumherum::loaded? then
|
232
|
+
require File.join(Drumherum::directory_main, 'demo', 'demo_pp' )
|
233
|
+
Perception::DemoSee.see_all_demos
|
236
234
|
end # if
|
237
235
|
|
238
236
|
|
data/lib/perception/ppp.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# ruby encoding: utf-8
|
2
2
|
# ü
|
3
3
|
if $0 == __FILE__
|
4
|
-
require '
|
5
|
-
|
4
|
+
require 'drumherum'
|
5
|
+
smart_init
|
6
6
|
require 'perception'
|
7
7
|
end
|
8
8
|
|
@@ -375,10 +375,35 @@ end
|
|
375
375
|
|
376
376
|
|
377
377
|
# -----------------------------------------------------------------------------------------
|
378
|
-
#
|
378
|
+
# Ausprobieren
|
379
379
|
#
|
380
|
-
if $0 == __FILE__ then
|
380
|
+
if $0 == __FILE__ && Drumherum::loaded? then
|
381
381
|
|
382
|
-
|
382
|
+
# Hier einstellen, was laufen soll
|
383
|
+
$run = :tests
|
384
|
+
#$run = :demo
|
385
|
+
|
386
|
+
case $run
|
387
|
+
|
388
|
+
when :demo #------------------------------------------------------------------------------
|
389
|
+
|
390
|
+
require File.join(Drumherum::directory_main, 'demo', 'demo_pp' )
|
391
|
+
Perception::DemoSee.see_all_demos
|
392
|
+
|
393
|
+
|
394
|
+
when :tests #------------------------------------------------------------------------------
|
395
|
+
|
396
|
+
require File.join(Drumherum::directory_main, 'test', 'test_ppp' )
|
397
|
+
|
398
|
+
|
399
|
+
else #--------------------------------------------------------------------------------------
|
400
|
+
|
401
|
+
see '$run einstellen!'
|
402
|
+
|
403
|
+
|
404
|
+
end # case
|
383
405
|
|
406
|
+
|
407
|
+
|
408
|
+
|
384
409
|
end # if
|
@@ -1,8 +1,8 @@
|
|
1
1
|
# ruby encoding: utf-8
|
2
2
|
# ü
|
3
3
|
if $0 == __FILE__
|
4
|
-
require '
|
5
|
-
|
4
|
+
require 'drumherum'
|
5
|
+
smart_init
|
6
6
|
require 'perception'
|
7
7
|
end
|
8
8
|
require 'kyanite/array_of_enumerables'
|
@@ -135,25 +135,60 @@ end
|
|
135
135
|
|
136
136
|
|
137
137
|
|
138
|
-
|
139
|
-
|
140
138
|
# -----------------------------------------------------------------------------------------
|
141
|
-
#
|
139
|
+
# Ausprobieren
|
142
140
|
#
|
143
|
-
if $0 == __FILE__ then
|
141
|
+
if $0 == __FILE__ && Drumherum::loaded? then
|
142
|
+
|
143
|
+
# Hier einstellen, was laufen soll
|
144
|
+
$run = :try1
|
145
|
+
$run = :try2
|
146
|
+
# $run = :tests
|
147
|
+
# $run = :demo
|
148
|
+
|
149
|
+
case $run
|
150
|
+
|
151
|
+
when :try1 #-------------------------------------------------------------------------------
|
152
|
+
|
153
|
+
require 'rbconfig'
|
154
|
+
require 'facets/to_hash'
|
155
|
+
include RbConfig
|
156
|
+
see CONFIG.to_a[0..-1].to_h
|
157
|
+
|
158
|
+
when :try2 #-------------------------------------------------------------------------------
|
159
|
+
|
160
|
+
require 'rbconfig'
|
161
|
+
require 'facets/to_hash'
|
162
|
+
include RbConfig
|
163
|
+
see CONFIG.to_a[1..5].to_h
|
164
|
+
|
165
|
+
|
166
|
+
when :demo #------------------------------------------------------------------------------
|
167
|
+
|
168
|
+
require File.join(Drumherum::directory_main, 'demo', 'demo_pp' )
|
169
|
+
Perception::DemoSee.see_all_demos
|
170
|
+
|
171
|
+
|
172
|
+
when :tests #------------------------------------------------------------------------------
|
173
|
+
|
174
|
+
require File.join(Drumherum::directory_main, 'test', '_start_all' )
|
175
|
+
|
176
|
+
|
177
|
+
else #--------------------------------------------------------------------------------------
|
178
|
+
|
179
|
+
see '$run einstellen!'
|
180
|
+
|
181
|
+
|
182
|
+
end # case
|
144
183
|
|
145
|
-
|
146
|
-
|
184
|
+
|
185
|
+
|
147
186
|
|
148
|
-
|
149
|
-
|
187
|
+
end # if
|
188
|
+
|
150
189
|
|
151
190
|
|
152
|
-
include Config
|
153
|
-
see CONFIG.to_a[0..-1].to_h
|
154
|
-
#see CONFIG.to_a[1..5].to_h
|
155
191
|
|
156
|
-
end # if
|
157
192
|
|
158
193
|
|
159
194
|
|
data/lib/perception.rb
CHANGED
@@ -1,18 +1,8 @@
|
|
1
1
|
# ruby encoding: utf-8
|
2
2
|
# ü
|
3
|
-
|
4
|
-
#puts 'Path schon aktuell'
|
5
|
-
else
|
6
|
-
$:.unshift(File.dirname(__FILE__))
|
7
|
-
end
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
module Perception #:nodoc
|
12
|
-
VERSION = '0.3.1'
|
13
|
-
end
|
14
|
-
|
3
|
+
# puts 'Using Perception'
|
15
4
|
|
5
|
+
require 'drumherum'
|
16
6
|
require 'pp'
|
17
7
|
require 'set'
|
18
8
|
require 'kyanite/string/mgsub'
|
@@ -30,4 +20,8 @@ require 'perception/string_spread'
|
|
30
20
|
require 'perception/numeric'
|
31
21
|
require 'perception/date_and_time'
|
32
22
|
require 'perception/logging'
|
23
|
+
|
24
|
+
Drumherum::loaded!
|
25
|
+
|
26
|
+
|
33
27
|
|
data/profile.rb
CHANGED
@@ -1,5 +1,10 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
# ruby encoding: utf-8
|
2
|
+
# ü
|
3
|
+
if $0 == __FILE__
|
4
|
+
require 'drumherum'
|
5
|
+
smart_init
|
6
|
+
require 'perception'
|
7
|
+
end
|
3
8
|
|
4
9
|
$mode = :nothing
|
5
10
|
$mode = :profile
|
@@ -7,7 +12,7 @@ $mode = :tracker
|
|
7
12
|
|
8
13
|
|
9
14
|
if $mode == :tracker
|
10
|
-
require '
|
15
|
+
require 'drumherum/call_tracker'
|
11
16
|
elsif $mode == :profile
|
12
17
|
require 'profile'
|
13
18
|
end
|
data/test/_start_all.rb
CHANGED
@@ -1,12 +1,15 @@
|
|
1
1
|
# ruby encoding: utf-8
|
2
|
-
#!/usr/bin/env ruby
|
3
2
|
#
|
4
3
|
# Führt alle Tests aus
|
5
4
|
#
|
6
5
|
|
7
|
-
|
6
|
+
if $0 == __FILE__
|
7
|
+
require 'drumherum'
|
8
|
+
smart_init
|
9
|
+
end
|
8
10
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
11
|
+
|
12
|
+
# Test-Verzeichnis der Applikation
|
13
|
+
test_verzeichnis = File.join(Drumherum::directory_main, 'test')
|
14
|
+
|
15
|
+
Dir["#{test_verzeichnis}/test_*.rb"].sort.each { |t| require t }
|
data/test/test_date_and_time.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
# ruby encoding: utf-8
|
2
2
|
# ü
|
3
3
|
if $0 == __FILE__
|
4
|
-
require '
|
5
|
-
|
4
|
+
require 'drumherum'
|
5
|
+
smart_init
|
6
6
|
end
|
7
|
+
require 'drumherum/unit_test'
|
7
8
|
require 'perception'
|
8
|
-
require 'kyanite/unit_test'
|
9
9
|
|
10
10
|
|
11
11
|
class TestPerceptionDateAndTime < UnitTest
|
data/test/test_numeric.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
# ruby encoding: utf-8
|
2
2
|
# ü
|
3
3
|
if $0 == __FILE__
|
4
|
-
require '
|
5
|
-
|
4
|
+
require 'drumherum'
|
5
|
+
smart_init
|
6
6
|
end
|
7
|
+
require 'drumherum/unit_test'
|
7
8
|
require 'perception'
|
8
|
-
require 'kyanite/unit_test'
|
9
9
|
|
10
10
|
|
11
11
|
class TestPerceptionNumeric < UnitTest
|
data/test/test_ppp.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
# ruby encoding: utf-8
|
2
2
|
# ü
|
3
3
|
if $0 == __FILE__
|
4
|
-
require '
|
5
|
-
|
4
|
+
require 'drumherum'
|
5
|
+
smart_init
|
6
6
|
end
|
7
|
+
require 'drumherum/unit_test'
|
7
8
|
require 'perception'
|
8
|
-
require 'kyanite/unit_test'
|
9
9
|
|
10
10
|
|
11
11
|
class TestPerceptionPPP < UnitTest
|
@@ -127,10 +127,7 @@ ENDOFSTRING
|
|
127
127
|
assert_equal result1, test.inspect_pp
|
128
128
|
assert_equal "\n" + result2, see_puts(test); setup
|
129
129
|
assert_equal "\n" + result2, see_print(test); setup
|
130
|
-
|
131
|
-
# require File.join(File.dirname(__FILE__), '..', '..', 'klippstein_ruby_extensions', 'lib', 'string' )
|
132
|
-
# pp test.inspect_see.overlapdiff(result3)
|
133
|
-
# puts
|
130
|
+
|
134
131
|
assert_equal result3, test.inspect_see#.gsub("\n",'')
|
135
132
|
assert_equal "\n" + result3, see_pp(test); setup
|
136
133
|
assert_equal "\n" + result3, see(test); setup
|
data/version.rb
ADDED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: perception
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,8 +9,24 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-10-
|
12
|
+
date: 2012-10-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: drumherum
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 0.1.10
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 0.1.10
|
14
30
|
- !ruby/object:Gem::Dependency
|
15
31
|
name: kyanite
|
16
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,11 +102,13 @@ extra_rdoc_files:
|
|
86
102
|
- Manifest.txt
|
87
103
|
- README.txt
|
88
104
|
files:
|
105
|
+
- console.rb
|
89
106
|
- History.txt
|
90
107
|
- License.txt
|
91
108
|
- Manifest.txt
|
92
|
-
- README.txt
|
93
109
|
- Rakefile.rb
|
110
|
+
- README.txt
|
111
|
+
- version.rb
|
94
112
|
- demo/demo_pp.rb
|
95
113
|
- demo/demo_system_info.rb
|
96
114
|
- demo/demo_zz.rb
|
@@ -105,7 +123,6 @@ files:
|
|
105
123
|
- lib/perception/ppp.rb
|
106
124
|
- lib/perception/string_spread.rb
|
107
125
|
- profile.rb
|
108
|
-
- script/console.rb
|
109
126
|
- test/_start_all.rb
|
110
127
|
- test/test_date_and_time.rb
|
111
128
|
- test/test_numeric.rb
|
data/script/console.rb
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# File: script/console
|
3
|
-
irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
|
4
|
-
|
5
|
-
libs = " -r irb/completion"
|
6
|
-
# Perhaps use a console_lib to store any extra methods I may want available in the cosole
|
7
|
-
# libs << " -r #{File.dirname(__FILE__) + '/../lib/console_lib/console_logger.rb'}"
|
8
|
-
libs << " -r #{File.dirname(__FILE__) + '/../lib/perception.rb'}"
|
9
|
-
puts "Welcome to Perception gem"
|
10
|
-
exec "#{irb} #{libs} --simple-prompt --noreadline"
|