fmpvc 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +8 -0
- data/RELEASE_NOTES.md +46 -0
- data/exe/fmpvc +3 -0
- data/lib/fmpvc/FMPReport.rb +12 -2
- data/lib/fmpvc/configuration.rb +2 -1
- data/lib/fmpvc/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6375927885c92d53b9e49ab8e2de3955e62b1994
|
4
|
+
data.tar.gz: a7af50f77aae4c3d9981b55385b7d088ade3b391
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f28fb3116aec19ad61c68833a966b9986fe604a03911ace19d30eaec817986bc04c58aa6398740094233489e67f095f1bff031857d89d58ad1ab2b86c102f49
|
7
|
+
data.tar.gz: 98ade21fcdf20bb15970a32895966741d27362d07d6090349ec74b79fb6f570d18b0ef0b67de1c03e5cedaa5bb6b3bb48b93916dcb7fc1f68ea280987af5e381
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -58,6 +58,7 @@ Command-line options:
|
|
58
58
|
-d, --ddr-dir <directory> Look for DDR files in directory named <directory>.
|
59
59
|
-D, --text-dir <directory> Write text files in directory named <directory>.
|
60
60
|
-q, --quiet Suppress progress messages.
|
61
|
+
-R, --no-record-info Suppress record specific information in Table YAML
|
61
62
|
-s, --summary-file <filename> Look for Summary file named <filename>.
|
62
63
|
-t, --tree-file <filename> Set tree file name.
|
63
64
|
-T, --no-tree Don't create a tree file.
|
@@ -69,6 +70,13 @@ By default, `fmpvc` appends a [YAML](http://www.yaml.org/spec/1.2/spec.html) rep
|
|
69
70
|
|
70
71
|
YAML generation can be suppressed with the `-Y` command-line option.
|
71
72
|
|
73
|
+
The DDR includes record specific info in the Tables section:
|
74
|
+
|
75
|
+
- count of records in the table
|
76
|
+
- next value for serial number (auto-increment) fields.
|
77
|
+
|
78
|
+
This information appears in the YAML and causes the Tables files to change even with no changes to the database schema, and therefore, it's undesireable when using these files with a version control system. This record info (in the YAML) can be suppressed with the `-R` command-line option (the default behavior is to include all information).
|
79
|
+
|
72
80
|
### tree command
|
73
81
|
|
74
82
|
The tree command creates a textual representation of a directory and its filesystem objects. By default, `fmpvc` searches for `tree` in the shell's path and if it finds, one, uses it to create the file, `./fmp_text/tree.txt`.
|
data/RELEASE_NOTES.md
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
# FMPVC Release Notes
|
2
|
+
|
3
|
+
## v0.3.4 (2015-07-02)
|
4
|
+
|
5
|
+
### New Features
|
6
|
+
|
7
|
+
- Command-line option to suppress record specific info
|
8
|
+
- in Tables files
|
9
|
+
- `-R` or `--no-record-info`
|
10
|
+
- Added release notes file (`RELEASE_NOTES.md`)
|
11
|
+
|
12
|
+
### Bugs Fixed
|
13
|
+
|
14
|
+
- Missing BaseMenu bug (issue #3)
|
15
|
+
|
16
|
+
## v0.3.3 (2015-06-20)
|
17
|
+
|
18
|
+
### Bugs Fixed
|
19
|
+
|
20
|
+
- Options file bug (issue #1)
|
21
|
+
- Fixes to allow DDRs from FMPA versions 11-14
|
22
|
+
|
23
|
+
## v0.3.2 (2015-06-14)
|
24
|
+
|
25
|
+
Initial public release on rubygems and github
|
26
|
+
|
27
|
+
## v0.3.0
|
28
|
+
|
29
|
+
Added configuration mechanism with defaults and command-line options
|
30
|
+
|
31
|
+
## v0.2.4
|
32
|
+
|
33
|
+
Executable fixes (progress indicators and Summary file)
|
34
|
+
|
35
|
+
## v0.2.2
|
36
|
+
|
37
|
+
Verbose progress indication added
|
38
|
+
|
39
|
+
## v0.2.0
|
40
|
+
|
41
|
+
Separated file creation from DDR and FMPReport objects
|
42
|
+
|
43
|
+
## v0.1.0
|
44
|
+
|
45
|
+
Initial working gem with parsing code
|
46
|
+
|
data/exe/fmpvc
CHANGED
@@ -25,6 +25,9 @@ OptionParser.new do |opts|
|
|
25
25
|
opts.on('-q', '--quiet', 'Suppress progress messages.') do
|
26
26
|
FMPVC.configuration.quiet = true
|
27
27
|
end
|
28
|
+
opts.on('-R', '--no-record-info', 'Suppress record specific information in Table YAML.') do
|
29
|
+
FMPVC.configuration.show_record_info = false
|
30
|
+
end
|
28
31
|
opts.on('-s', '--summary-file <filename>', 'Look for Summary file named <filename>.') do |s|
|
29
32
|
FMPVC.configuration.ddr_filename = s
|
30
33
|
end
|
data/lib/fmpvc/FMPReport.rb
CHANGED
@@ -11,7 +11,7 @@ module FMPVC
|
|
11
11
|
|
12
12
|
class FMPReport
|
13
13
|
|
14
|
-
attr_reader :content, :type, :text_dir, :text_filename, :report_dirpath, :named_objects
|
14
|
+
attr_reader :content, :type, :text_dir, :text_filename, :report_dirpath, :named_objects, :tables
|
15
15
|
|
16
16
|
def initialize(report_filename, ddr)
|
17
17
|
report_dirpath = "#{ddr.base_dir_ddr}/#{report_filename}" # location of the fmpfilename.xml file
|
@@ -34,6 +34,7 @@ module FMPVC
|
|
34
34
|
### single folder with files
|
35
35
|
@value_lists = parse_fmp_obj( "/FMPReport/File/ValueListCatalog", "/*[name()='ValueList']", @value_list_content )
|
36
36
|
@tables = parse_fmp_obj( "/FMPReport/File/BaseTableCatalog", "/*[name()='BaseTable']", @table_content )
|
37
|
+
suppress_record_info if FMPVC.configuration.show_record_info == false
|
37
38
|
@custom_functions = parse_fmp_obj( "/FMPReport/File/CustomFunctionCatalog", "/*[name()='CustomFunction']", @custom_function_content )
|
38
39
|
@menu_sets = parse_fmp_obj( "/FMPReport/File/CustomMenuSetCatalog", "/*[name()='CustomMenuSet']", @menu_sets_content )
|
39
40
|
@custom_menus = parse_fmp_obj( "/FMPReport/File/CustomMenuCatalog", "/*[name()='CustomMenu']", @custom_menus_content )
|
@@ -116,6 +117,15 @@ module FMPVC
|
|
116
117
|
$stdout.puts [verb, object].join(" ") unless FMPVC.configuration.quiet
|
117
118
|
end
|
118
119
|
|
120
|
+
def suppress_record_info()
|
121
|
+
@tables.each do |a_table|
|
122
|
+
current_yaml = a_table[:yaml]
|
123
|
+
yaml_serial_number_fixed = current_yaml.gsub(%r{(nextValue:.*\D)(\d+)(\D*?)(?=\n)}, '\1\3') # e.g. nextValue: 123serial456 or nextValue: 123serial
|
124
|
+
yaml_record_count_fixed = yaml_serial_number_fixed.gsub(%r{(BaseTable: \s+ id:\ '\d+' \s+ records:\ '.*?)(\d+)'}mx, '\1\'') # e.g. records: '234'
|
125
|
+
a_table[:yaml] = yaml_record_count_fixed
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
119
129
|
|
120
130
|
def parse_fmp_obj(object_base, object_nodes, obj_content, one_file = false)
|
121
131
|
post_notification(object_base.gsub(%r{\/FMPReport\/File\/},''), ' Parsing')
|
@@ -265,7 +275,7 @@ module FMPVC
|
|
265
275
|
content = ''
|
266
276
|
menu_name = a_menu['name']
|
267
277
|
menu_id = a_menu['id']
|
268
|
-
menu_base = a_menu.xpath('./BaseMenu').first['name']
|
278
|
+
menu_base = a_menu.xpath('./BaseMenu').empty? ? "" : a_menu.xpath('./BaseMenu').first['name']
|
269
279
|
menu_comment = a_menu.xpath('./Comment').text
|
270
280
|
menu_format = "%17s %-35s\n"
|
271
281
|
|
data/lib/fmpvc/configuration.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module FMPVC
|
2
2
|
class Configuration
|
3
3
|
|
4
|
-
attr_accessor :quiet, :yaml, :ddr_dirname, :ddr_filename, :ddr_basedir, :text_dirname, :tree_filename
|
4
|
+
attr_accessor :quiet, :yaml, :ddr_dirname, :ddr_filename, :ddr_basedir, :text_dirname, :tree_filename, :show_record_info
|
5
5
|
|
6
6
|
def initialize
|
7
7
|
# set default config settings
|
@@ -12,6 +12,7 @@ module FMPVC
|
|
12
12
|
@ddr_basedir = './' # base directory (containing fmp_ddr, fmp_text)
|
13
13
|
@text_dirname = 'fmp_text' # text file base directory
|
14
14
|
@tree_filename = 'tree.txt' # set to nil to disable tree file generation
|
15
|
+
@show_record_info = true # show record info in DDR by default
|
15
16
|
end
|
16
17
|
|
17
18
|
end
|
data/lib/fmpvc/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fmpvc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin S. Boswell
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -97,6 +97,7 @@ files:
|
|
97
97
|
- Gemfile
|
98
98
|
- LICENSE.txt
|
99
99
|
- README.md
|
100
|
+
- RELEASE_NOTES.md
|
100
101
|
- Rakefile
|
101
102
|
- bin/console
|
102
103
|
- bin/run_current
|