params 0.0.9 → 1.0.0
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/lib/params.rb +315 -230
- data/lib/params/version.rb +2 -4
- data/test/params/params_spec.rb +226 -228
- data/test/params/params_test.rb +28 -30
- metadata +4 -4
data/test/params/params_test.rb
CHANGED
@@ -7,39 +7,37 @@ require 'params'
|
|
7
7
|
require 'test/unit'
|
8
8
|
require_relative '../../lib/params.rb'
|
9
9
|
|
10
|
-
module BBFS
|
11
10
|
|
12
|
-
|
11
|
+
class TestLog < Test::Unit::TestCase
|
13
12
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
13
|
+
def test_parsing_of_the_defined_parameters
|
14
|
+
# Define options
|
15
|
+
Params.integer('remote_server1', 3333,
|
16
|
+
'Listening port for backup server content data.')
|
17
|
+
Params.string('backup_username1', 'tmp', 'Backup server username.')
|
18
|
+
Params.string('backup_password1', 'tmp', 'Backup server password.')
|
19
|
+
Params.string('backup_destination_folder1', '',
|
20
|
+
'Backup server destination folder, default is the relative local folder.')
|
21
|
+
Params.string('content_data_path1', File.expand_path('~/.bbfs/var/content.data'),
|
22
|
+
'ContentData file path.')
|
23
|
+
Params.string('monitoring_config_path1', File.expand_path('~/.bbfs/etc/file_monitoring.yml'),
|
24
|
+
'Configuration file for monitoring.')
|
25
|
+
Params.float('time_to_start1', 0.03,
|
26
|
+
'Time to start monitoring')
|
28
27
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
end
|
28
|
+
cmd = ['--remote_server1=2222', '--backup_username1=rami', '--backup_password1=kavana',
|
29
|
+
'--backup_destination_folder1=C:\Users\Alexey\Backup',
|
30
|
+
'--content_data_path1=C:\Users\Alexey\Content',
|
31
|
+
'--monitoring_config_path1=C:\Users\Alexey\Config',
|
32
|
+
'--time_to_start1=1.5']
|
33
|
+
Params.init cmd
|
34
|
+
assert_equal(2222, Params['remote_server1'])
|
35
|
+
assert_equal('rami', Params['backup_username1'])
|
36
|
+
assert_equal('kavana', Params['backup_password1'])
|
37
|
+
assert_equal('C:\Users\Alexey\Backup', Params['backup_destination_folder1'])
|
38
|
+
assert_equal('C:\Users\Alexey\Content', Params['content_data_path1'])
|
39
|
+
assert_equal('C:\Users\Alexey\Config', Params['monitoring_config_path1'])
|
40
|
+
assert_equal(1.5, Params['time_to_start1'])
|
43
41
|
end
|
44
42
|
end
|
45
43
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: params
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,10 +10,10 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2013-05-01 00:00:00.000000000 Z
|
14
14
|
dependencies: []
|
15
15
|
description: Dynamically stores, parses and providers params. Uses module local readers.
|
16
|
-
email:
|
16
|
+
email: bbfsdev@gmail.com
|
17
17
|
executables: []
|
18
18
|
extensions: []
|
19
19
|
extra_rdoc_files: []
|
@@ -22,7 +22,7 @@ files:
|
|
22
22
|
- lib/params/version.rb
|
23
23
|
- test/params/params_spec.rb
|
24
24
|
- test/params/params_test.rb
|
25
|
-
homepage: http://github.com/
|
25
|
+
homepage: http://github.com/bbfsdev/bbfs
|
26
26
|
licenses: []
|
27
27
|
post_install_message:
|
28
28
|
rdoc_options: []
|