Top Level Namespace
Defined Under Namespace
Modules: ApplicationHelper, DemoInstaller, Enumerable, IteratorOrSingleElement, Kernel, Mcore_Product, Mmtk_Profil, Mmtk_helper, Mrdf_Property, Mrdf_Repository, Mrdf_Resource, Mrdfs_Class, Mrdfs_Literal, Mrdfs_Resource, MtkHelper, Mtk_xslt, Ontomde, Rails Classes: ApplicationController, ArrayOrSingleElement, ArrayOrSingleElementEmpty, Ccore_Product, Class, Crdf_Property, Crdf_Repository, Crdf_Resource, Crdf_Ressource, Crdf_loader, Crdfs_Class, Crdfs_Literal, CustomERB, Delayed2, FileType, FileTypeJSP, FileTypeJava, FileTypeJavaProperties, FileTypeXML, FileTypeXSD, LoadModelLazyWriter, Module, MtkController, NTriple, NullFileWriter, Object, ProfilDefault, ProfilDefaultSingleton, SetOrSingleElement, String, StringOutputStream, UriNamespace, Warning, WarningHash, WarningReverseBadOrMissingEnd, WarningRubyTypeUndefined, WarningURIundefined, WarningUnknownFileType
Constant Summary collapse
- MDA_LOG_ALREADY_DISPLAYED =
List of error message keys already displayed
Array.new
- PLATFORM_IS_JAVA =
!(RUBY_PLATFORM.index('java').nil?)
- OS_IS_WINDOWS =
!(ENV['OS'].nil? ? true : ENV['OS'].index('Windows').nil?)
- TEMP_FILE_TO_ERASE =
[]
- RDF_TRUE =
Core RDF resource management
'true'
- RDF_FALSE =
'false'
- SC2 =
Semicolumn (root)
""
- RAILS_ROOT =
Don’t change this file! Configure your app in config/environment.rb and config/environments/*.rb
"#{File.dirname(__FILE__)}/.."
Instance Method Summary collapse
-
#getCompletionFile(&loadModules) ⇒ Object
returns a completion file for methods, class and modules created by loadModule.
- #log_already_displayed?(key) ⇒ Boolean
- #method_missing(methId, args = nil) ⇒ Object
- #mtk_addTempFileToDelete(fileName) ⇒ Object
-
#mtk_delay(&block) ⇒ Object
Example usage: i=45 c=mtk_delay { i + 5 } i=35 puts c.to_s.
- #mtk_deleteTempFiles ⇒ Object
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(methId, args = nil) ⇒ Object
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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/ontomde-core/custom_method_missing.rb', line 8 def method_missing(methId,args=nil) objinfo='-' if self.kind_of?(Mrdf_Resource) objinfo= <<END **** For ressource of type #{self.class.name} **** and uri=#{rdf_uri} **** **** This model element is related to these other model elements: #{} END end msg=respond_to?(:rdf_uri) ? "#{rdf_uri}" : 'nil' log.error { "method #{methId} not available for object of class #{self.class.name}, (uri=#{msg})(to_s=#{self}) #{objinfo}" } if msg=='ukb_null' log.error { <<END ********** INVALID MODEL DETECTED ********** ********** INVALID MODEL DETECTED ********** **** An invalid source model was used (an ukb_null was found). **** Probable cause is that you are using a RSM modeler, and **** one of your model contains an invalid reference somewhere. **** **** Because RSM does not tell you where this error is located, **** you have to use your .nt export file : **** **** 1) open .nt export file with a text editor. **** 2) locate <http://kb#null> string. **** 3) locate left member refering to this null element. **** 4) This element is the key of RSM invalid element. **** 5) Locate this element in RSM and fix it (or delete it). **** 6) Re-export your model and check for null uris. **** ********** INVALID MODEL DETECTED ********** END } end log.debug { msg='' self.methods.sort{|a,b| a<=>b}.each {|m| msg="#{msg}, #{m}" } "Available methods are: #{msg}" } #self.included_modules.each { |m| # #puts "include #{m}" # } puts 'end of custom method_missing' #TODO: l'appel au stock method_missing genere des temps de traitements infinis. (cpu a 100%, conso memoire enorme) #super puts 'exiting' throw NoMethodError.new("method missing '#{methId}' for object '#{self.class.name}'",methId,args) #exit end |
Instance Method Details
#getCompletionFile(&loadModules) ⇒ Object
returns a completion file for methods, class and modules created by loadModule
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/ontomde-core/completion.rb', line 20 def getCompletionFile(&loadModules) b=Array.new ObjectSpace.each_object(Class) { |o| b.push(o.to_s) } yield() ObjectSpace.each_object(Class) { |o| next if b.include?(o.to_s) next unless o.to_s.index('#').nil? s=String.new c=Class.new puts <<TPL module #{o.name.gsub(/^C/,'M') }#{o.getAddedMethods.collect {|m| %{ def #{m.to_s} ; end} }} end TPL } end |
#log_already_displayed?(key) ⇒ Boolean
407 408 409 410 411 |
# File 'lib/ontomde-core/meta.rb', line 407 def log_already_displayed?(key) return true if MDA_LOG_ALREADY_DISPLAYED.include?(key) MDA_LOG_ALREADY_DISPLAYED<< key return false end |
#mtk_addTempFileToDelete(fileName) ⇒ Object
691 692 693 |
# File 'lib/ontomde-core/helper.rb', line 691 def mtk_addTempFileToDelete(fileName) TEMP_FILE_TO_ERASE<<(fileName.to_s) end |
#mtk_delay(&block) ⇒ Object
Example usage: i=45 c=mtk_delay { i + 5 } i=35 puts c.to_s
15 16 17 |
# File 'lib/ontomde-core/delayed.rb', line 15 def mtk_delay (&block) return Delayed2.new(&block) end |
#mtk_deleteTempFiles ⇒ Object
695 696 697 |
# File 'lib/ontomde-core/helper.rb', line 695 def mtk_deleteTempFiles FileUtils.rm TEMP_FILE_TO_ERASE end |