Top Level Namespace
Defined Under Namespace
Modules: Mrdf_Repository, Mrdf_Resource, Muml_Association, Muml_Class, Muml_Classifier, Muml_Component, Muml_DataType, Muml_Element, Muml_Enumeration, Muml_Generalization, Muml_Implementation, Muml_Interface, Muml_LiteralInteger, Muml_LiteralString, Muml_LiteralUnlimitedNatural, Muml_Model, Muml_NamedElement, Muml_Namespace, Muml_Operation, Muml_Package, Muml_Parameter, Muml_Property, Muml_TypedElement, Muml_UseCase, Mumlx_EnumeratedValue, Ontomde Classes: Crdf_Repository, Cuml_AggregationKind, Cuml_CallConcurrencyKind, Cuml_ConnectorKind, Cuml_ExpansionKind, Cuml_InteractionOperator, Cuml_MessageKind, Cuml_MessageSort, Cuml_ObjectNodeOrderingKind, Cuml_ParameterDirectionKind, Cuml_ParameterEffectKind, Cuml_PseudostateKind, Cuml_TransitionKind, Cuml_VisibilityKind, DatatypeMapping, DatatypeMappingBLOB, DatatypeMappingBoolean, DatatypeMappingCalendar, DatatypeMappingEmailAddress, DatatypeMappingFile, DatatypeMappingGRAPHVIZ, DatatypeMappingGenericClass, DatatypeMappingGenericEnum, DatatypeMappingIMG, DatatypeMappingInteger, DatatypeMappingLargeText, DatatypeMappingLong, DatatypeMappingLongObject, DatatypeMappingMimeType, DatatypeMappingOrdinal, DatatypeMappingPassword, DatatypeMappingSimpleUnixPath, DatatypeMappingText, DatatypeMappingTimeStamp, DatatypeMappingURL, Object, String
Constant Summary collapse
- UML2_RDFS_NT_FILE =
"#{here}/uml2.rdfs.nt"
- DOT_NODE_COLOR_SECONDARY =
"color=lightblue2, style=filled"
- DOT_NODE_COLOR_PRIMARY =
"color=darkolivegreen1, style=filled"
Instance Method Summary collapse
-
#addDataTypeMapping(umlDataTypeName, baseMapping, regexp = nil, &block) ⇒ Object
wrapper to easylly create a new datatype mapping * umlDataTypeName is the name of the data type in source uml model * baseMapping is the base definition mapping to derive from * regexp is the string regexp used for display.
-
#removeVersionInARGV ⇒ Object
Rubygems allow a specific script version to be passed on command line.
- #say(x) ⇒ Object
Instance Method Details
#addDataTypeMapping(umlDataTypeName, baseMapping, regexp = nil, &block) ⇒ Object
wrapper to easylly create a new datatype mapping
-
umlDataTypeName is the name of the data type in source uml model
-
baseMapping is the base definition mapping to derive from
-
regexp is the string regexp used for display
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/ontomde-uml2/UMLdatatypeMapping.rb', line 7 def addDataTypeMapping(umlDataTypeName,baseMapping,regexp=nil,&block) if !baseMapping.kind_of?(Class) raise Exception.new(%{Bad parameter type used for baseMapping got "#{baseMapping.class}" and expected "Class"}) end rubyName=umlDataTypeName.tr('^a-zA-Z0-9','_') s=%{ class DatatypeMapping#{rubyName} < #{baseMapping.name} include Singleton def appliesTo?(datatype) return datatype.uml_name.to_s=="#{umlDataTypeName}" end #{regexp.nil? ? "" : %{ def getValidationRegexp return /#{regexp.source}/ end } } end DatatypeMapping#{rubyName}.class_eval( &block ) unless block.nil? DatatypeMapping#{rubyName}.instance.register #register } t=eval s puts "Added datatype '#{umlDataTypeName}'" end |
#removeVersionInARGV ⇒ Object
Rubygems allow a specific script version to be passed on command line. Version is passed as a first parameter like : 1.0.1
For testing purposes, this script may be called directly (not through gem). We have to remove the version number which was not removed by gem.
12 13 14 15 16 17 |
# File 'lib/ontomde-uml2/kb/command.rb', line 12 def removeVersionInARGV return if ARGV.empty? return unless ARGV[0]=~/^_[.0-9]*_$/ puts "** WARNING: command line parameter #{ARGV[0]} ignored.\n" ARGV.delete_at(0) end |
#say(x) ⇒ Object
122 123 124 |
# File 'lib/ontomde-uml2/kb/command.rb', line 122 def say(x) puts("# #{File.basename(__FILE__)} #{x}") end |