stats_package_syntax_file_generator 1.0.1 → 1.0.2
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/README +2 -2
- data/lib/stats_package_syntax_file_generator.rb +1 -1
- data/lib/{stats_package_syntax_file_generator → syntax_file}/controller.rb +2 -2
- data/lib/{stats_package_syntax_file_generator → syntax_file}/maker.rb +1 -1
- data/lib/{stats_package_syntax_file_generator → syntax_file}/maker_sas.rb +1 -1
- data/lib/{stats_package_syntax_file_generator → syntax_file}/maker_spss.rb +1 -1
- data/lib/{stats_package_syntax_file_generator → syntax_file}/maker_stata.rb +1 -1
- data/lib/{stats_package_syntax_file_generator → syntax_file}/maker_sts.rb +1 -1
- data/lib/{stats_package_syntax_file_generator → syntax_file}/value.rb +1 -1
- data/lib/{stats_package_syntax_file_generator → syntax_file}/variable.rb +1 -1
- data/tests/setup.rb +5 -5
- data/tests/tc_controller.rb +2 -2
- data/tests/tc_maker.rb +1 -1
- data/tests/tc_maker_sas.rb +1 -1
- data/tests/tc_maker_spss.rb +1 -1
- data/tests/tc_maker_stata.rb +1 -1
- data/tests/tc_maker_sts.rb +8 -8
- data/tests/tc_value.rb +3 -3
- data/tests/tc_variable.rb +2 -2
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2825f64f27073bc1884c3639e86263e98b35ae8
|
4
|
+
data.tar.gz: 9011f6ba496d85ef7d7db790f26e42fc3923313f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a6cd8ac043666184d52f30670a5fe1e377dc0a5e4ccbba64ab9e535cf23d0c8e2cb8baed8f6aa65d57c2453098cceb743cbbf9c4b859b781b9800752b334ccb
|
7
|
+
data.tar.gz: 5df556700885c2ee67771abab4bc5cadcc79391838185aab699a59295c8a15261352150e65bc4758f9f55b9ff004253048f0a1721590658d9abd68eaab698b6c
|
data/README
CHANGED
@@ -19,10 +19,10 @@ Basic usage:
|
|
19
19
|
require 'stats_package_syntax_file_generator'
|
20
20
|
|
21
21
|
# Supply metadata via one YAML file.
|
22
|
-
sfc =
|
22
|
+
sfc = SyntaxFile::Controller.new(:yaml_files => 'metadata.yaml')
|
23
23
|
|
24
24
|
# Or via multiple YAML files.
|
25
|
-
sfc =
|
25
|
+
sfc = SyntaxFile::Controller.new(:yaml_files => ['md1.yaml', 'md2.yaml'])
|
26
26
|
|
27
27
|
# Or programmatically.
|
28
28
|
# For a working example, see devel/api_example.rb.
|
@@ -3,10 +3,10 @@
|
|
3
3
|
# in this project's top-level directory, and also on-line at:
|
4
4
|
# https://github.com/mnpopcenter/stats_package_syntax_file_generator
|
5
5
|
|
6
|
-
module
|
6
|
+
module SyntaxFile
|
7
7
|
class Controller
|
8
8
|
|
9
|
-
VERSION = "1.0.
|
9
|
+
VERSION = "1.0.2"
|
10
10
|
|
11
11
|
ATTR = {
|
12
12
|
:project => { :req => false, :rw => 'rw', :def => '', :yaml => true },
|
data/tests/setup.rb
CHANGED
@@ -9,7 +9,7 @@ require File.expand_path(File.join(File.dirname(__FILE__), '../lib/stats_package
|
|
9
9
|
|
10
10
|
module StatsPackageSyntaxFileGeneratorTestSetup
|
11
11
|
|
12
|
-
# YAML metadata used to initialize new
|
12
|
+
# YAML metadata used to initialize new SyntaxFile::Controller objects.
|
13
13
|
|
14
14
|
PATH = File.expand_path(File.dirname(__FILE__))
|
15
15
|
YAML_FILES = [
|
@@ -20,19 +20,19 @@ YAML_FILES = [
|
|
20
20
|
# Methods to create new objects with known values.
|
21
21
|
|
22
22
|
def new_controller
|
23
|
-
|
23
|
+
SyntaxFile::Controller.new(:yaml_files => YAML_FILES)
|
24
24
|
end
|
25
25
|
|
26
26
|
def new_variable
|
27
|
-
|
27
|
+
SyntaxFile::Variable.new params_variable()
|
28
28
|
end
|
29
29
|
|
30
30
|
def new_value
|
31
|
-
|
31
|
+
SyntaxFile::Value.new params_value()
|
32
32
|
end
|
33
33
|
|
34
34
|
def new_maker (syntax_type = '')
|
35
|
-
maker_class = '
|
35
|
+
maker_class = 'SyntaxFile::Maker' + syntax_type.upcase
|
36
36
|
eval(maker_class).new(new_controller, syntax_type)
|
37
37
|
end
|
38
38
|
|
data/tests/tc_controller.rb
CHANGED
@@ -18,7 +18,7 @@ include StatsPackageSyntaxFileGeneratorTestSetup
|
|
18
18
|
def test_create_controller
|
19
19
|
msg = 'Try to create an object.'
|
20
20
|
sfc = new_controller()
|
21
|
-
assert_instance_of
|
21
|
+
assert_instance_of SyntaxFile::Controller, sfc, msg
|
22
22
|
end
|
23
23
|
|
24
24
|
def test_add_variable
|
@@ -30,7 +30,7 @@ def test_add_variable
|
|
30
30
|
assert_equal n + 1, sfc.variables.size, msg
|
31
31
|
|
32
32
|
msg = 'The method should return the added variable.'
|
33
|
-
assert_instance_of
|
33
|
+
assert_instance_of SyntaxFile::Variable, var, msg
|
34
34
|
assert_equal params_variable_lookup(:name), var.name, msg
|
35
35
|
assert_equal params_variable_lookup(:label), var.label, msg
|
36
36
|
end
|
data/tests/tc_maker.rb
CHANGED
@@ -13,7 +13,7 @@ include StatsPackageSyntaxFileGeneratorTestSetup
|
|
13
13
|
def test_create_maker
|
14
14
|
msg = 'Try to create an object.'
|
15
15
|
mk = new_maker()
|
16
|
-
assert_instance_of
|
16
|
+
assert_instance_of SyntaxFile::Maker, mk, msg
|
17
17
|
end
|
18
18
|
|
19
19
|
def test_syntax_end
|
data/tests/tc_maker_sas.rb
CHANGED
@@ -13,7 +13,7 @@ include StatsPackageSyntaxFileGeneratorTestSetup
|
|
13
13
|
def test_create_maker_sas
|
14
14
|
msg = 'Try to create an object.'
|
15
15
|
mk = new_maker('sas')
|
16
|
-
assert_instance_of
|
16
|
+
assert_instance_of SyntaxFile::MakerSAS, mk, msg
|
17
17
|
end
|
18
18
|
|
19
19
|
def test_syn_fmt_big_nums
|
data/tests/tc_maker_spss.rb
CHANGED
@@ -13,7 +13,7 @@ include StatsPackageSyntaxFileGeneratorTestSetup
|
|
13
13
|
def test_create_maker_spss
|
14
14
|
msg = 'Try to create an object.'
|
15
15
|
mk = new_maker('spss')
|
16
|
-
assert_instance_of
|
16
|
+
assert_instance_of SyntaxFile::MakerSPSS, mk, msg
|
17
17
|
end
|
18
18
|
|
19
19
|
def test_syn_dfh_file_type
|
data/tests/tc_maker_stata.rb
CHANGED
@@ -13,7 +13,7 @@ include StatsPackageSyntaxFileGeneratorTestSetup
|
|
13
13
|
def test_create_maker_stata
|
14
14
|
msg = 'Try to create an object.'
|
15
15
|
mk = new_maker('stata')
|
16
|
-
assert_instance_of
|
16
|
+
assert_instance_of SyntaxFile::MakerSTATA, mk, msg
|
17
17
|
end
|
18
18
|
|
19
19
|
def test_syn_infix_start
|
data/tests/tc_maker_sts.rb
CHANGED
@@ -13,7 +13,7 @@ include StatsPackageSyntaxFileGeneratorTestSetup
|
|
13
13
|
def test_create_maker_sts
|
14
14
|
msg = 'Try to create an object.'
|
15
15
|
mk = new_maker('sts')
|
16
|
-
assert_instance_of
|
16
|
+
assert_instance_of SyntaxFile::MakerSTS, mk, msg
|
17
17
|
end
|
18
18
|
|
19
19
|
def test_syn_quoting
|
@@ -61,43 +61,43 @@ def test_supported_val
|
|
61
61
|
msg = 'Incompat value label -- empty label'
|
62
62
|
mk = new_maker('sts')
|
63
63
|
expected = false
|
64
|
-
actual = mk.supported_val?(
|
64
|
+
actual = mk.supported_val?(SyntaxFile::Value.new(:value => 'FOO', :label => ''))
|
65
65
|
assert_equal expected, actual, msg
|
66
66
|
|
67
67
|
msg = 'Incompat value label -- pure whitespace label'
|
68
68
|
mk = new_maker('sts')
|
69
69
|
expected = false
|
70
|
-
actual = mk.supported_val?(
|
70
|
+
actual = mk.supported_val?(SyntaxFile::Value.new(:value => 'FOO', :label => ' '))
|
71
71
|
assert_equal expected, actual, msg
|
72
72
|
|
73
73
|
msg = 'Incompat value value -- pure whitespace value'
|
74
74
|
mk = new_maker('sts')
|
75
75
|
expected = false
|
76
|
-
actual = mk.supported_val?(
|
76
|
+
actual = mk.supported_val?(SyntaxFile::Value.new(:value => ' ', :label => 'FOO'))
|
77
77
|
assert_equal expected, actual, msg
|
78
78
|
|
79
79
|
msg = 'Incompat value value -- blank value'
|
80
80
|
mk = new_maker('sts')
|
81
81
|
expected = false
|
82
|
-
actual = mk.supported_val?(
|
82
|
+
actual = mk.supported_val?(SyntaxFile::Value.new(:value => '', :label => 'FOO'))
|
83
83
|
assert_equal expected, actual, msg
|
84
84
|
|
85
85
|
msg = 'Incompat value value -- nonalphanumeric value'
|
86
86
|
mk = new_maker('sts')
|
87
87
|
expected = false
|
88
|
-
actual = mk.supported_val?(
|
88
|
+
actual = mk.supported_val?(SyntaxFile::Value.new(:value => '@#(BAR)', :label => 'FOO'))
|
89
89
|
assert_equal expected, actual, msg
|
90
90
|
|
91
91
|
msg = 'Incompat value value -- value with space'
|
92
92
|
mk = new_maker('sts')
|
93
93
|
expected = false
|
94
|
-
actual = mk.supported_val?(
|
94
|
+
actual = mk.supported_val?(SyntaxFile::Value.new(:value => 'a thing', :label => 'FOO'))
|
95
95
|
assert_equal expected, actual, msg
|
96
96
|
|
97
97
|
msg = 'Compat value'
|
98
98
|
mk = new_maker('sts')
|
99
99
|
expected = true
|
100
|
-
actual = mk.supported_val?(
|
100
|
+
actual = mk.supported_val?(SyntaxFile::Value.new(:value => 'BAR', :label => 'FOO'))
|
101
101
|
assert_equal expected, actual, msg
|
102
102
|
end
|
103
103
|
|
data/tests/tc_value.rb
CHANGED
@@ -12,11 +12,11 @@ include StatsPackageSyntaxFileGeneratorTestSetup
|
|
12
12
|
|
13
13
|
def test_create_value
|
14
14
|
msg = 'Try to create an object.'
|
15
|
-
v =
|
16
|
-
assert_instance_of
|
15
|
+
v = SyntaxFile::Value.new(:value => 1234)
|
16
|
+
assert_instance_of SyntaxFile::Value, v, msg
|
17
17
|
|
18
18
|
msg = 'Try to create an object with required parameters missing.'
|
19
|
-
assert_raise(ArgumentError, msg) {
|
19
|
+
assert_raise(ArgumentError, msg) { SyntaxFile::Value.new }
|
20
20
|
end
|
21
21
|
|
22
22
|
end
|
data/tests/tc_variable.rb
CHANGED
@@ -13,10 +13,10 @@ include StatsPackageSyntaxFileGeneratorTestSetup
|
|
13
13
|
def test_create_variable
|
14
14
|
msg = 'Try to create an object.'
|
15
15
|
v = new_variable()
|
16
|
-
assert_instance_of
|
16
|
+
assert_instance_of SyntaxFile::Variable, v, msg
|
17
17
|
|
18
18
|
msg = 'Try to create an object with required parameters missing.'
|
19
|
-
assert_raise(ArgumentError, msg) {
|
19
|
+
assert_raise(ArgumentError, msg) { SyntaxFile::Variable.new }
|
20
20
|
end
|
21
21
|
|
22
22
|
def test_column_locations_as_s
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stats_package_syntax_file_generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Monty Hindman, Marcus Peterson, Colin Davis, Dan Elbert, Jayandra Pokharel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A tool for producing statistical package syntax files for fixed-column data files
|
14
14
|
email: mpcit@umn.edu
|
@@ -19,14 +19,14 @@ extra_rdoc_files:
|
|
19
19
|
files:
|
20
20
|
- README
|
21
21
|
- lib/stats_package_syntax_file_generator.rb
|
22
|
-
- lib/
|
23
|
-
- lib/
|
24
|
-
- lib/
|
25
|
-
- lib/
|
26
|
-
- lib/
|
27
|
-
- lib/
|
28
|
-
- lib/
|
29
|
-
- lib/
|
22
|
+
- lib/syntax_file/controller.rb
|
23
|
+
- lib/syntax_file/maker.rb
|
24
|
+
- lib/syntax_file/maker_sas.rb
|
25
|
+
- lib/syntax_file/maker_spss.rb
|
26
|
+
- lib/syntax_file/maker_stata.rb
|
27
|
+
- lib/syntax_file/maker_sts.rb
|
28
|
+
- lib/syntax_file/value.rb
|
29
|
+
- lib/syntax_file/variable.rb
|
30
30
|
- tests/input_all_vars.yaml
|
31
31
|
- tests/input_controller.yaml
|
32
32
|
- tests/setup.rb
|