activefacts-compositions 1.9.20 → 1.9.21

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 074d060502e336f08e6e114ace5990b6d890f890
4
- data.tar.gz: 4ddff75043dc0ce04ef5651fe69b105bee492827
3
+ metadata.gz: 844f00a51607447cf1d629f514f7afe06d20a996
4
+ data.tar.gz: 6274fe0597c71587a0102637e2f83540b907919d
5
5
  SHA512:
6
- metadata.gz: cfb954b0e3a018ca4bfc959644e2b8780e98789f500dbc9891629c299a8bc3e641c5830a9ae796938f57be90e65909487154fce22e70700b0bac03a653cf2152
7
- data.tar.gz: e17f5f23cffeecd28f859a2a71bccfd1306dc2da94aa2a79b2eb34f29c5e121746156fe6fb63b6c2e275290c5b36081bf48834b65825eea71d327d4de29c0d95
6
+ metadata.gz: fd447a4faf7b38663e95bce5b1576f6097ac3ecee9779f0e5a63ef15119ce9983445916e02371579ab3dca77115fdf175eca01ba6d571e85a4f5783ded448a55
7
+ data.tar.gz: 1ebdb686870e87e07287f66a770d4711b5f7b0bf72e9e7cc271f5e13f2e94e5ac26c0b1c0b58e7631dee787323683c9e3ecd203af08a93e8eb19861df839a638
data/bin/afcomp CHANGED
@@ -62,11 +62,11 @@ class SchemaCompositor
62
62
  option = compositor
63
63
  end
64
64
 
65
- if action = ActiveFacts::Compositions.compositors[option]
65
+ if action, helptext = ActiveFacts::Compositions.compositors[option]
66
66
  options.delete(option)
67
67
  check_options(action, modes)
68
68
  @compositors << [action, modes, option]
69
- elsif action = ActiveFacts::Generators.generators[option]
69
+ elsif action, helptext = ActiveFacts::Generators.generators[option]
70
70
  options.delete(option)
71
71
  check_options(action, modes)
72
72
  @generators << [action, modes, option]
@@ -36,16 +36,19 @@ class SchemaCompositor
36
36
  trace :loading, "Enumerating under #{path.inspect}" do
37
37
  Loadable.new(path).
38
38
  enumerate.
39
- select do |filename|
39
+ map do |filename|
40
40
  begin
41
41
  require(pathname = path+"/"+filename)
42
42
  trace :loading, "Loaded #{pathname}"
43
+ filename
43
44
  rescue LoadError => e
44
45
  trace :loading, "Can't load #{pathname}: #{e.class}: #{e.message} #{e.backtrace[0]}"
46
+ nil
45
47
  rescue Exception => e
46
48
  $stderr.puts "Can't load #{pathname}: #{e.class}: #{e.message} #{e.backtrace[0]}"
49
+ nil
47
50
  end
48
- end
51
+ end.compact
49
52
  end
50
53
  end
51
54
 
@@ -70,6 +73,8 @@ class SchemaCompositor
70
73
  options.delete(option)
71
74
  check_options(action, modes)
72
75
  @generators << [action, modes, option]
76
+ elsif option == 'help'
77
+ # Finish, then help
73
78
  else
74
79
  $stderr.puts "Action --#{option} is not recognised"
75
80
  exit 1
@@ -184,12 +189,18 @@ end
184
189
  sc = SchemaCompositor.new(ARGV)
185
190
  sc.enumerate_available('activefacts/compositions')
186
191
  sc.enumerate_available('activefacts/generator')
187
- if sc.options['help']
188
- puts "Available compositors:\n\t#{ActiveFacts::Compositions.compositors.keys.sort*"\n\t"}\n\n"
189
- puts "Available generators:\n\t#{ActiveFacts::Generators.generators.keys.sort*"\n\t"}\n\n"
192
+ inputs = sc.enumerate_available('activefacts/input')
193
+ sc.arrange_actions
194
+ if sc.options['help'] || (sc.generators.empty? && sc.compositors.empty?)
195
+ compositors = (c = ActiveFacts::Compositions.compositors).keys.sort.map{|k| "%-15s %s" % [k, c[k][1]]}
196
+ generators = (c = ActiveFacts::Generators.generators).keys.sort.map{|k| "%-15s %s" % [k, c[k][1]]}
197
+ puts "You need to use a compositor to create the right kind of schema, and at least one generator to get output."
198
+ puts "Use '#{$PROGRAM_NAME} --<compositorname> --<generatorname> inputfile.ext'"
199
+ puts "Available input formats (file extensions):\n\t#{inputs*"\n\t"}\n\n"
200
+ puts "Available compositors:\n\t#{compositors*"\n\t"}\n\n"
201
+ puts "Available generators:\n\t#{generators*"\n\t"}\n\n"
190
202
  puts "To get help for a particular action, follow it by =help, e.g. --relational:help"
191
203
  exit
192
204
  end
193
205
 
194
- sc.arrange_actions
195
206
  sc.process_files ARGV
@@ -8,8 +8,8 @@ module ActiveFacts
8
8
  @@compositors ||= {}
9
9
  end
10
10
 
11
- def self.publish_compositor klass
12
- compositors[klass.name.sub(/^ActiveFacts::Compositions::/,'').gsub(/::/, '/').downcase] = klass
11
+ def self.publish_compositor klass, helptext = ''
12
+ compositors[klass.name.sub(/^ActiveFacts::Compositions::/,'').gsub(/::/, '/').downcase] = [klass, helptext]
13
13
  end
14
14
  end
15
15
  end
@@ -38,6 +38,6 @@ module ActiveFacts
38
38
 
39
39
  end
40
40
  end
41
- publish_compositor(Binary)
41
+ publish_compositor Binary, "A composition reduced to binary relationships, suitable for object-oriented programming"
42
42
  end
43
43
  end
@@ -717,6 +717,6 @@ module ActiveFacts
717
717
 
718
718
  end
719
719
 
720
- publish_compositor(DataVault)
720
+ publish_compositor DataVault, "A relational composition suitable for full-history storage along Data Vault lines"
721
721
  end
722
722
  end
@@ -970,6 +970,6 @@ module ActiveFacts
970
970
 
971
971
  end
972
972
 
973
- publish_compositor(Relational)
973
+ publish_compositor Relational, "A relational composition for operational databases in optimal normal form"
974
974
  end
975
975
  end
@@ -161,6 +161,6 @@ module ActiveFacts
161
161
 
162
162
  end
163
163
 
164
- publish_compositor(Staging)
164
+ publish_compositor Staging, "A relational composition augmented with audit attributes for staging data transformations"
165
165
  end
166
166
  end
@@ -1,5 +1,5 @@
1
1
  module ActiveFacts
2
2
  module Compositions
3
- VERSION = "1.9.20"
3
+ VERSION = "1.9.21"
4
4
  end
5
5
  end
@@ -7,8 +7,8 @@ module ActiveFacts
7
7
  @@generators ||= {}
8
8
  end
9
9
 
10
- def self.publish_generator klass
11
- generators[klass.name.sub(/^ActiveFacts::Generators::/,'').gsub(/::/, '/').downcase] = klass
10
+ def self.publish_generator klass, helptext = ''
11
+ generators[klass.name.sub(/^ActiveFacts::Generators::/,'').gsub(/::/, '/').downcase] = [klass, helptext]
12
12
  end
13
13
  end
14
14
  end
@@ -1,7 +1,7 @@
1
1
  #
2
2
  # ActiveFacts Common Warehouse Metamodel Generator
3
3
  #
4
- # This generator produces an CWM XMI-formated model of a Composition.
4
+ # This generator produces an CWM XMI-formatted model of a Composition.
5
5
  #
6
6
  # Copyright (c) 2016 Infinuendo. Read the LICENSE file.
7
7
  #
@@ -519,6 +519,6 @@ module ActiveFacts
519
519
 
520
520
  end
521
521
  end
522
- publish_generator Doc::CWM
522
+ publish_generator Doc::CWM, "Common Warehouse Metamodel represented as an XMI file. Use a relational compositor"
523
523
  end
524
524
  end
@@ -128,7 +128,7 @@ END
128
128
  end
129
129
 
130
130
  end
131
- publish_generator Doc::Graphviz
131
+ publish_generator Doc::Graphviz, "Input file for graphvis automated diagram layout"
132
132
  end
133
133
  end
134
134
 
@@ -693,6 +693,6 @@ module ActiveFacts
693
693
  MM = ActiveFacts::Metamodel unless const_defined?(:MM)
694
694
  end
695
695
  end
696
- publish_generator Doc::LDM
696
+ publish_generator Doc::LDM, "Logical Data Model documentation in HTML. Use a relational compositor"
697
697
  end
698
698
  end
@@ -369,6 +369,6 @@ module ActiveFacts
369
369
 
370
370
  end
371
371
  end
372
- publish_generator ETL::Unidex
372
+ publish_generator ETL::Unidex, "Generate SQL views to populate a Unified Index, steered by Search parameters on the value types"
373
373
  end
374
374
  end
@@ -250,6 +250,6 @@ module ActiveFacts
250
250
  MM = ActiveFacts::Metamodel unless const_defined?(:MM)
251
251
  end
252
252
  end
253
- publish_generator Rails::Models
253
+ publish_generator Rails::Models, "Generate models in Ruby for use with ActiveRecord and Rails. Use a relational compositor"
254
254
  end
255
255
  end
@@ -298,7 +298,7 @@ module ActiveFacts
298
298
 
299
299
  end
300
300
  end
301
- publish_generator Rails::Schema
301
+ publish_generator Rails::Schema, "Generate schema.rb in Ruby for use with ActiveRecord and Rails. Use a relational compositor"
302
302
  end
303
303
  end
304
304
 
@@ -126,6 +126,6 @@ module ActiveFacts
126
126
  super
127
127
  end
128
128
  end
129
- publish_generator Ruby
129
+ publish_generator Ruby, "Generate Ruby code for fact-based programming with the activefacts-api. Use the binary compositor"
130
130
  end
131
131
  end
@@ -179,6 +179,6 @@ module ActiveFacts
179
179
  end
180
180
  end
181
181
 
182
- publish_generator SQL
182
+ publish_generator SQL, "Generate a schema in standard SQL-99 using any relational compositor"
183
183
  end
184
184
  end
@@ -20,6 +20,6 @@ module ActiveFacts
20
20
  end
21
21
 
22
22
  end
23
- publish_generator SQL::MySQL
23
+ publish_generator SQL::MySQL, "Generate a schema for MySQL using any relational compositor"
24
24
  end
25
25
  end
@@ -20,6 +20,6 @@ module ActiveFacts
20
20
  end
21
21
 
22
22
  end
23
- publish_generator SQL::Oracle
23
+ publish_generator SQL::Oracle, "Generate a schema for Oracle using any relational compositor"
24
24
  end
25
25
  end
@@ -20,6 +20,6 @@ module ActiveFacts
20
20
  end
21
21
 
22
22
  end
23
- publish_generator SQL::Postgres
23
+ publish_generator SQL::Postgres, "Generate a schema for Postgres using any relational compositor"
24
24
  end
25
25
  end
@@ -20,6 +20,6 @@ module ActiveFacts
20
20
  end
21
21
 
22
22
  end
23
- publish_generator SQL::Server
23
+ publish_generator SQL::Server, "Generate a schema for SQL Server using any relational compositor"
24
24
  end
25
25
  end
@@ -115,6 +115,6 @@ module ActiveFacts
115
115
  @composition.summary
116
116
  end
117
117
  end
118
- publish_generator Summary
118
+ publish_generator Summary, "Succinctly display the full structure of any composition"
119
119
  end
120
120
  end
@@ -139,6 +139,6 @@ module ActiveFacts
139
139
  # regenerate_compound_matching(composite.mapping, 0, '') + ";\n"
140
140
  end
141
141
  end
142
- publish_generator TransGen
142
+ publish_generator TransGen, "Generate a transform between two related fact-based schemas"
143
143
  end
144
144
  end
@@ -38,6 +38,6 @@ module ActiveFacts
38
38
  nil
39
39
  end
40
40
  end
41
- publish_generator Validate
41
+ publish_generator Validate, "Perform a thorough validation to check that a compositor is working correctly"
42
42
  end
43
43
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activefacts-compositions
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.20
4
+ version: 1.9.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Clifford Heath