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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0f9197c10adf1e85ad5b72ddf53aa414b9e38c08
4
- data.tar.gz: c77ce671f48ee5eaa923ce8ea5f21c875f456aa8
3
+ metadata.gz: b2825f64f27073bc1884c3639e86263e98b35ae8
4
+ data.tar.gz: 9011f6ba496d85ef7d7db790f26e42fc3923313f
5
5
  SHA512:
6
- metadata.gz: c092c5f3ef02f13d9819a78831fd56817a4d753e0bfba16646732845a70488fed496204647fa834e0c02a094b47f5558a31d7c6529f381092bc74e34271df86b
7
- data.tar.gz: 0836c59716068a5f5e87e62d6eb6665a69e9152c00b2ed1a2c1dd52c2d0131f04459ed349a495cf659f0933f06b98b26ff9a8e730ceb737c5939868242e05b1a
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 = StatsPackageSyntaxFileGenerator::Controller.new(:yaml_files => 'metadata.yaml')
22
+ sfc = SyntaxFile::Controller.new(:yaml_files => 'metadata.yaml')
23
23
 
24
24
  # Or via multiple YAML files.
25
- sfc = StatsPackageSyntaxFileGenerator::Controller.new(:yaml_files => ['md1.yaml', 'md2.yaml'])
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.
@@ -15,5 +15,5 @@ require 'yaml'
15
15
  maker_stata
16
16
  maker_sts
17
17
  ).each do |f|
18
- require File.expand_path(File.join(File.dirname(__FILE__), 'stats_package_syntax_file_generator', f))
18
+ require File.expand_path(File.join(File.dirname(__FILE__), 'syntax_file', f))
19
19
  end
@@ -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 StatsPackageSyntaxFileGenerator
6
+ module SyntaxFile
7
7
  class Controller
8
8
 
9
- VERSION = "1.0.1"
9
+ VERSION = "1.0.2"
10
10
 
11
11
  ATTR = {
12
12
  :project => { :req => false, :rw => 'rw', :def => '', :yaml => true },
@@ -3,7 +3,7 @@
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 StatsPackageSyntaxFileGenerator
6
+ module SyntaxFile
7
7
  class Maker
8
8
 
9
9
  attr_reader :sfc, :syntax_type
@@ -3,7 +3,7 @@
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 StatsPackageSyntaxFileGenerator
6
+ module SyntaxFile
7
7
  class MakerSAS < Maker
8
8
 
9
9
  def initialize (sfc, syntax_type)
@@ -3,7 +3,7 @@
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 StatsPackageSyntaxFileGenerator
6
+ module SyntaxFile
7
7
  class MakerSPSS < Maker
8
8
 
9
9
  def initialize (sfc, syntax_type)
@@ -3,7 +3,7 @@
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 StatsPackageSyntaxFileGenerator
6
+ module SyntaxFile
7
7
  class MakerSTATA < Maker
8
8
 
9
9
  def initialize (sfc, syntax_type)
@@ -3,7 +3,7 @@
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 StatsPackageSyntaxFileGenerator
6
+ module SyntaxFile
7
7
  class MakerSTS < Maker
8
8
 
9
9
  def initialize (sfc, syntax_type)
@@ -3,7 +3,7 @@
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 StatsPackageSyntaxFileGenerator
6
+ module SyntaxFile
7
7
  class Value
8
8
 
9
9
  ATTR = {
@@ -3,7 +3,7 @@
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 StatsPackageSyntaxFileGenerator
6
+ module SyntaxFile
7
7
  class Variable
8
8
 
9
9
  ATTR = {
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 StatsPackageSyntaxFileGenerator::Controller objects.
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
- StatsPackageSyntaxFileGenerator::Controller.new(:yaml_files => YAML_FILES)
23
+ SyntaxFile::Controller.new(:yaml_files => YAML_FILES)
24
24
  end
25
25
 
26
26
  def new_variable
27
- StatsPackageSyntaxFileGenerator::Variable.new params_variable()
27
+ SyntaxFile::Variable.new params_variable()
28
28
  end
29
29
 
30
30
  def new_value
31
- StatsPackageSyntaxFileGenerator::Value.new params_value()
31
+ SyntaxFile::Value.new params_value()
32
32
  end
33
33
 
34
34
  def new_maker (syntax_type = '')
35
- maker_class = 'StatsPackageSyntaxFileGenerator::Maker' + syntax_type.upcase
35
+ maker_class = 'SyntaxFile::Maker' + syntax_type.upcase
36
36
  eval(maker_class).new(new_controller, syntax_type)
37
37
  end
38
38
 
@@ -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 StatsPackageSyntaxFileGenerator::Controller, sfc, msg
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 StatsPackageSyntaxFileGenerator::Variable, var, msg
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 StatsPackageSyntaxFileGenerator::Maker, mk, msg
16
+ assert_instance_of SyntaxFile::Maker, mk, msg
17
17
  end
18
18
 
19
19
  def test_syntax_end
@@ -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 StatsPackageSyntaxFileGenerator::MakerSAS, mk, msg
16
+ assert_instance_of SyntaxFile::MakerSAS, mk, msg
17
17
  end
18
18
 
19
19
  def test_syn_fmt_big_nums
@@ -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 StatsPackageSyntaxFileGenerator::MakerSPSS, mk, msg
16
+ assert_instance_of SyntaxFile::MakerSPSS, mk, msg
17
17
  end
18
18
 
19
19
  def test_syn_dfh_file_type
@@ -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 StatsPackageSyntaxFileGenerator::MakerSTATA, mk, msg
16
+ assert_instance_of SyntaxFile::MakerSTATA, mk, msg
17
17
  end
18
18
 
19
19
  def test_syn_infix_start
@@ -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 StatsPackageSyntaxFileGenerator::MakerSTS, mk, msg
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?(StatsPackageSyntaxFileGenerator::Value.new(:value => 'FOO', :label => ''))
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?(StatsPackageSyntaxFileGenerator::Value.new(:value => 'FOO', :label => ' '))
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?(StatsPackageSyntaxFileGenerator::Value.new(:value => ' ', :label => 'FOO'))
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?(StatsPackageSyntaxFileGenerator::Value.new(:value => '', :label => 'FOO'))
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?(StatsPackageSyntaxFileGenerator::Value.new(:value => '@#(BAR)', :label => 'FOO'))
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?(StatsPackageSyntaxFileGenerator::Value.new(:value => 'a thing', :label => 'FOO'))
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?(StatsPackageSyntaxFileGenerator::Value.new(:value => 'BAR', :label => 'FOO'))
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 = StatsPackageSyntaxFileGenerator::Value.new(:value => 1234)
16
- assert_instance_of StatsPackageSyntaxFileGenerator::Value, v, msg
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) { StatsPackageSyntaxFileGenerator::Value.new }
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 StatsPackageSyntaxFileGenerator::Variable, v, msg
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) { StatsPackageSyntaxFileGenerator::Variable.new }
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.1
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-26 00:00:00.000000000 Z
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/stats_package_syntax_file_generator/controller.rb
23
- - lib/stats_package_syntax_file_generator/maker.rb
24
- - lib/stats_package_syntax_file_generator/maker_sas.rb
25
- - lib/stats_package_syntax_file_generator/maker_spss.rb
26
- - lib/stats_package_syntax_file_generator/maker_stata.rb
27
- - lib/stats_package_syntax_file_generator/maker_sts.rb
28
- - lib/stats_package_syntax_file_generator/value.rb
29
- - lib/stats_package_syntax_file_generator/variable.rb
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