rdoba 0.1 → 0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 000e2b10a8728464889da9e1fb18cb1dc12593a6
4
+ data.tar.gz: 9e5d1e6da0d62943247e5158305f87b93016825a
5
+ SHA512:
6
+ metadata.gz: e4b93ed652786a11219857fe012041695722bc23c9fa2560060e40e0e4b56af4b1eab8862b085eb0bca492b6807342f3b489cae1795d9908722b6f88bdc7b3fe
7
+ data.tar.gz: e04e6fddfd18f48c00b0335a6cdab61106e5428bbfa5e31ba54920be388f027a192d65c16b14c18d9d4880ef54da8c4cbef54470d1f36858a7a2126ef5ba4375
data/.gitignore CHANGED
@@ -1,43 +1,21 @@
1
- # rcov generated
2
- coverage
3
-
4
- # rdoc generated
5
- rdoc
6
-
7
- # yard generated
8
- doc
9
- .yardoc
10
-
11
- # bundler
1
+ *.gem
2
+ *.rbc
12
3
  .bundle
13
-
14
- # jeweler generated
15
- pkg
16
-
17
- # Have editor/IDE/OS specific files you need to ignore? Consider using a global gitignore:
18
- #
19
- # * Create a file at ~/.gitignore
20
- # * Include files you want ignored
21
- # * Run: git config --global core.excludesfile ~/.gitignore
22
- #
23
- # After doing this, these files will be ignored in all your git projects,
24
- # saving you from having to 'pollute' every project you touch with them
25
- #
26
- # Not sure what to needs to be ignored for particular editors/OSes? Here's some ideas to get you started. (Remember, remove the leading # of the line)
27
- #
28
- # For MacOS:
29
- #
30
- #.DS_Store
31
- #
32
- # For TextMate
33
- #*.tmproj
34
- #tmtags
35
- #
36
- # For emacs:
37
- #*~
38
- #\#*
39
- #.\#*
40
- #
41
- # For vim:
42
- #*.swp
4
+ .config
5
+ .yardoc
43
6
  Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ *.html
19
+ *.swp
20
+ *~
21
+ .rvmrc
data/LICENSE CHANGED
@@ -1,20 +1,8 @@
1
- Copyright (c) 2011 Malo Skrylevo
1
+ The MIT License (MIT)
2
+ Copyright (c) 2011 Malo Skrylevo (Pavel Skrylev)
2
3
 
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
10
5
 
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
6
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
13
7
 
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
8
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -4,14 +4,14 @@ Rdoba, сирѣчь руби-добавокъ, есть библиотека, р
4
4
  * common - нѣкоторыя простыя методы къ Объекту, Ядру, Пущю, Набору, Строкѣ и Словрю;
5
5
  * a - чтеніе и запись значеній въ Наборъ и Словарь по индексу;
6
6
  * combinations - перечисленіе значеній Набора въ различномъ порядкѣ;
7
- * debug - функціи отладки приложенія;
7
+ * log - функціи сборки отладочныхъ свѣдѣній приложенія;
8
8
  * dup - функціи удвоенія Словаря и Набораъ, включая ихъ вложенія;
9
9
  * hashorder - перечисленіе значеній Словаря въ заданномъ порядкѣ;
10
10
  * numeric - разширенный переводъ числа въ строку и строки въ число;
11
11
  * require - вложенная загрузка файловъ функціею require;
12
12
  * roman - переводъ римскаго числа въ строку и строки въ римское число;
13
13
  * deploy - развёртка YAML-шаблоновъ;
14
- * fenc - исправленіе кодировки въ Строкахъ (будетъ удалено по исправленіи въ ruby);
14
+ * fe - исправленіе кодировки въ Строкахъ (будетъ удалено по исправленіи въ ruby);
15
15
  * io - функціи sscanf и sprintf съ дополнительными свойствами;
16
16
  * re - простое преобразованіе Строки въ Правило;
17
17
  * strings - разширеніе нѣкоторыхъ функцій Строки кириллическими правилами;
@@ -21,7 +21,7 @@ Rdoba, сирѣчь руби-добавокъ, есть библиотека, р
21
21
 
22
22
  ### Общія методы
23
23
 
24
- Добавляетъ нѣкоторыя простыя методы къ Объекту, Ядру, Пущю, Набору, Строкѣ и Словрю;
24
+ Добавляетъ нѣкоторыя простыя методы къ Объекту, Ядру, Пущю, Набору, Строкѣ и Словарю;
25
25
 
26
26
  require 'rdoba/common'
27
27
 
@@ -74,36 +74,16 @@ Rdoba, сирѣчь руби-добавокъ, есть библиотека, р
74
74
 
75
75
  Оладочныя функціи позволяютъ для выбранного класса выполнять заданныя куски кода или выводить на терминалъ опредѣлённый текстъ въ зависимости отъ уровня отладки.
76
76
 
77
- require 'rdoba/debug'
77
+ require 'rdoba'
78
78
 
79
79
  class A
80
+ rdoba :log => { :functions => :basic }
80
81
  def initialize
81
- dbp11 "Low-level initialize debug"
82
- end
83
-
84
- def method
85
- @k = 0
86
- dbp22 "Upper-level method debug"
87
- dbg21 "@k = 1"
88
- @k
82
+ log > "This is the Log"
89
83
  end
90
84
  end
91
85
 
92
- $debug_A = 0x11
93
-
94
- a = A.new
95
- # выводъ
96
- # Low-level initialize debug
97
-
98
- a.method # => 0
99
-
100
- a.debug = 0x21
101
- a.method # => 1
102
-
103
- a.debug = 0x33
104
- a.method # => 1
105
- # выводъ
106
- # Upper-level method debug
86
+ A.new # » This is the Log
107
87
 
108
88
  ### Одвоеніе Словаря и Набора
109
89
 
@@ -233,12 +213,12 @@ Rdoba, сирѣчь руби-добавокъ, есть библиотека, р
233
213
 
234
214
  !!! будетъ удалено по исправленіи въ ruby
235
215
 
236
- require 'rdoba/fenc'
216
+ require 'rdoba/fe'
237
217
 
238
218
  s = 'eee'
239
219
  s.encoding # => #<Encoding:US/ASCII>
240
220
 
241
- s.fenc
221
+ s.fe
242
222
  s.encoding # => #<Encoding:UTF-8>
243
223
 
244
224
  ### Новыя функціи sscanf, sprintf и consolize
data/Rakefile CHANGED
@@ -1,3 +1,38 @@
1
- require 'rubygems'
2
- require 'bundler'
3
- Bundler::GemHelper.install_tasks
1
+ #!/usr/bin/env rake
2
+
3
+ desc "Prepare bundler"
4
+ task :prebundle do
5
+ sh 'gem install bundler --version "~> 1.3.1" --no-ri --no-rdoc'
6
+ end
7
+
8
+ desc "Prepare bundle environment"
9
+ task :pre do
10
+ sh 'bundle install'
11
+ end
12
+
13
+ desc "Generate gem"
14
+ namespace :gem do
15
+ task :build do
16
+ sh 'gem build rdoba.gemspec'
17
+ end
18
+
19
+ task :install do
20
+ require File.expand_path( '../lib/rdoba/_version_', __FILE__ )
21
+ sh "gem install rdoba-#{Rdoba::VERSION}.gem"
22
+ end
23
+
24
+ task :publish do
25
+ require File.expand_path( '../lib/rdoba/_version_', __FILE__ )
26
+ sh "git tag v#{Rdoba::VERSION}"
27
+ sh "git push"
28
+ sh "git push --tag"
29
+ sh "gem push rdoba-#{Rdoba::VERSION}.gem"
30
+ end
31
+
32
+ task :make => [ :build, :install, :publish ]
33
+ task :default => :make
34
+ end
35
+
36
+ task(:default).clear
37
+ task :default => :pre
38
+ task :all => [ :prebundle, :pre ]
@@ -0,0 +1,29 @@
1
+ Feature: Rdoba BCD testing
2
+ Scenario: Simple BCD creation scenario
3
+ Given Apply Rdoba bcd module
4
+ When Rdoba applied in a code
5
+ Then Create a new simple BCD string
6
+ Scenario: Simple BCD creation scenario
7
+ Given Apply Rdoba bcd module
8
+ When Rdoba applied in a code
9
+ Then Parse an integer
10
+ Then Check class to BCD of parsed integer
11
+ Scenario: Try to parse a negative integer scenario
12
+ Given Apply Rdoba bcd module
13
+ When Rdoba applied in a code
14
+ Then Parse a negative integer
15
+ Scenario: Converting BCD to an integer scenario
16
+ Given Apply Rdoba bcd module
17
+ When Rdoba applied in a code
18
+ When Create a new simple BCD string
19
+ Then Convert the simple BCD to an integer
20
+ Scenario: Bignum BCD creation scenario
21
+ Given Apply Rdoba bcd module
22
+ When Rdoba applied in a code
23
+ When Create a new bignum BCD string
24
+ Then Convert the BCD to a Bignum integer
25
+ Scenario: Erroneous BCD scenario
26
+ Given Apply Rdoba bcd module
27
+ When Rdoba applied in a code
28
+ Then Try to create a BCD class with an erroneous argument
29
+
@@ -0,0 +1,206 @@
1
+ Feature: Rdoba Log
2
+ In order to check proper logging facility
3
+ Rdoba Log should work with various settings
4
+
5
+ Scenario: Rdoba Log default settings
6
+ Given applied Rdoba Log module
7
+ When we issue an output of a variable
8
+ And look into stdout
9
+ Then we see the variable output
10
+
11
+ Scenario: Rdoba Debug backward compatibility with warning
12
+ Given applied Rdoba Debug module
13
+ When we issue an output of a variable
14
+ And we look into stderr
15
+ Then we see a warning
16
+ When look into stdout
17
+ Then we see the variable output
18
+
19
+ Scenario: Rdoba Log :io option
20
+ Given applied Rdoba Log module with set a file name for :io option
21
+ When we issue an output of a variable
22
+ And look into the file
23
+ Then we see the variable output
24
+ When look into stdout
25
+ Then we see nothing
26
+
27
+ Scenario: Rdoba Log :as option
28
+ Given applied Rdoba Log module with set a keyword for :as option
29
+ When we issue an output of a variable
30
+ And look into stdout
31
+ Then we see nothing
32
+ When we look into stderr
33
+ And see the no method error exception
34
+
35
+ When we issue an output of a variable using a keyword
36
+ And look into stdout
37
+ Then we see the variable output
38
+
39
+ When we issue an output of a variable using an invalid keyword
40
+ And look into stdout
41
+ Then we see nothing
42
+ When we look into stderr
43
+ Then see the name error exception
44
+
45
+ Scenario: Rdoba Log :in option
46
+ Given applied Rdoba Log module with set Cls keyword for :in option
47
+ When we issue an output of a variable
48
+ And look into stdout
49
+ Then we see nothing
50
+ When we look into stderr
51
+ Then see the no method error exception
52
+
53
+ When issue a creation of the class
54
+ And look into stdout
55
+ Then we see the variable output
56
+
57
+ Scenario: Rdoba Log :functions option
58
+ Given applied Rdoba Log module with set :extended keyword for :functions option
59
+ When we issue an :extended output of a variable
60
+ And look into stdout
61
+ Then we see the variable output with the :extended notice
62
+
63
+ When we remove :extended keyword out of :functions option
64
+ And we issue an :extended output of a variable
65
+ And look into stdout
66
+ Then we see nothing
67
+
68
+ When we issue an :enter output of a variable
69
+ And look into stdout
70
+ Then we see nothing
71
+ When we add :enter keyword out of :functions option
72
+ And we issue an :enter output of a variable
73
+ And look into stdout
74
+ Then we see the variable output with the :enter notice
75
+
76
+ When we issue a :leave output of a variable
77
+ And look into stdout
78
+ Then we see nothing
79
+ When we add :leave keyword out of :functions option
80
+ And issue a :leave output of a variable
81
+ And look into stdout
82
+ Then we see the 'true' value output with the :leave notice
83
+
84
+ When we issue an :info output of a variable
85
+ And look into stdout
86
+ Then we see nothing
87
+ When we add :info keyword out of :functions option
88
+ And we issue an :info output of a variable
89
+ And look into stdout
90
+ Then we see the variable output with the :info notice
91
+
92
+ When we issue an :warn output of a variable
93
+ And look into stdout
94
+ Then we see nothing
95
+ When we add :warn keyword out of :functions option
96
+ And we issue an :warn output of a variable
97
+ And look into stdout
98
+ Then we see the variable output with the :warn notice
99
+
100
+ When we issue a :compat output of a variable
101
+ And look into stdout
102
+ Then we see nothing
103
+ When we look into stderr
104
+ Then see the no method error exception
105
+
106
+ When we add :compat keyword out of :functions option
107
+ And issue a :compat output of a variable
108
+ And look into stdout
109
+ Then we see the variable output
110
+
111
+ When we clear the :functions option
112
+ And we issue an output of a variable
113
+ And look into stdout
114
+ Then we see nothing
115
+
116
+ Scenario: Rdoba Log :prefix option
117
+ Given applied Rdoba Log module with set :timestamp keyword for :prefix option
118
+ When we issue an output of a variable
119
+ And look into stdout
120
+ Then we see the variable output preficed with the :timestamp
121
+
122
+ When we apply Rdoba Log module with set :timestamp, and :pid keyword for :prefix option
123
+ And issue an output of a variable
124
+ And look into stdout
125
+ Then we see the variable output preficed with the :timestamp, and :pid
126
+
127
+ When we apply Rdoba Log module with set :timestamp, :pid, and :function_name keyword for :prefix option
128
+ And issue an output of a variable
129
+ And look into stdout
130
+ Then we see the variable output preficed with the :timestamp, :pid, and :function_name
131
+
132
+ When we apply Rdoba Log module with set :timestamp, :pid, :function_name, and :function_line keyword for :prefix option
133
+ And issue an output of a variable
134
+ And look into stdout
135
+ Then we see the variable output preficed with the :timestamp, :pid, :function_name, and :function_line
136
+
137
+ When we apply Rdoba Log module with set :timestamp, :pid, and :function_line keyword for :prefix option
138
+ And issue an output of a variable
139
+ And look into stdout
140
+ Then we see the variable output preficed with the :timestamp, :pid
141
+
142
+ Scenario: Rdoba Log parameter processing
143
+ Given applied Rdoba Log module
144
+ When we issue an output of a string
145
+ And look into stdout
146
+ Then we see the string output
147
+
148
+ When we issue an output of a number
149
+ And look into stdout
150
+ Then we see the number output
151
+
152
+ When we issue an output of an array
153
+ And look into stdout
154
+ Then we see the array output
155
+
156
+ Scenario: Rdoba Exception information output
157
+ Given applied Rdoba Log module
158
+ When we issue an output of the thrown exception
159
+ And look into stderr
160
+ Then we see the exception info
161
+
162
+ When we issue an output of the thrown exception to the stdout
163
+ And look into stderr
164
+ Then we see nothing
165
+ When we look into stdout
166
+ Then we see the exception info
167
+
168
+ When we issue an output of the thrown standard error
169
+ And look into stderr
170
+ Then we see the standard error info
171
+
172
+ When we issue an output of the thrown standard error with a notification
173
+ And look into stderr
174
+ Then we see the standard error info with a notification
175
+
176
+ Scenario: Rdoba Log class implementation
177
+ Given applied Rdoba Log module inside a class
178
+ When we issue an output of a variable
179
+ And look into stdout
180
+ Then we see the variable output
181
+
182
+ When define an output of a variable inside an initializer
183
+ And issue a creation of the class
184
+ And look into stdout
185
+ Then we see the variable output
186
+
187
+ When we define an output of a variable inside a singleton function
188
+ And issue a call to the function
189
+ And look into stdout
190
+ Then we see the variable output
191
+
192
+ When we apply Rdoba Log module with set a keyword for :as option inside a class
193
+ And issue an output of a variable using a keyword
194
+ And look into stdout
195
+ Then we see the variable output
196
+
197
+ When define an output of a variable inside an initializer using a keyword
198
+ And issue a creation of the class
199
+ And look into stdout
200
+ Then we see the variable output
201
+
202
+ When we define an output of a variable inside a singleton function using a keyword
203
+ And issue a call to the function
204
+ And look into stdout
205
+ Then we see the variable output
206
+