mimosa 0.1
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.
- data/lib/mimosa.rb +30 -0
- data/lib/mimosa/ccom.rb +0 -0
- metadata +57 -0
data/lib/mimosa.rb
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# require 'nokogiri'
|
2
|
+
# require 'yaml'
|
3
|
+
#
|
4
|
+
# file = File.open(ARGV[0])
|
5
|
+
# $doc = Nokogiri::XML.parse(file)
|
6
|
+
# $xpath_root = "/rdf:RDF/dm:DifferenceModel/dm:forwardDifferences/"
|
7
|
+
#
|
8
|
+
# $entity_types = $doc.xpath($xpath_root + "cim:*").map do |node|
|
9
|
+
# node.namespace.prefix + ':' + node.name unless node.name =~ /Connection/
|
10
|
+
# end
|
11
|
+
# $entity_types.uniq!.compact!
|
12
|
+
#
|
13
|
+
# def get_children(entity_id)
|
14
|
+
# hash = {}
|
15
|
+
# paths = $entity_types.map{ |type| $xpath_root + "#{type}[*[@rdf:resource='##{entity_id}']]" }
|
16
|
+
# $doc.xpath(paths.join(" | ")).each do |node|
|
17
|
+
# hash[node["rdf:ID"]] = get_children(node["rdf:ID"])
|
18
|
+
# end
|
19
|
+
# return hash
|
20
|
+
# end
|
21
|
+
#
|
22
|
+
# def print_type(hash, output, indent = 0)
|
23
|
+
# hash.keys.sort.each do |key|
|
24
|
+
# next if key == 'abstract'
|
25
|
+
# output.write "#{' '*indent}#{key}: #{'abstract' if hash[key]['abstract']}\n"
|
26
|
+
# print_type(hash[key], output, indent + 2)
|
27
|
+
# end
|
28
|
+
# end
|
29
|
+
#
|
30
|
+
# print_type(get_children("Petro.EP.1"), STDOUT)
|
data/lib/mimosa/ccom.rb
ADDED
File without changes
|
metadata
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: mimosa
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease:
|
5
|
+
version: "0.1"
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Brandon Mathis
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
|
13
|
+
date: 2011-03-10 00:00:00 -05:00
|
14
|
+
default_executable:
|
15
|
+
dependencies: []
|
16
|
+
|
17
|
+
description: This is a gemfile used to build MIMOSA XML
|
18
|
+
email: Brandon@KeysetTS.com
|
19
|
+
executables: []
|
20
|
+
|
21
|
+
extensions: []
|
22
|
+
|
23
|
+
extra_rdoc_files: []
|
24
|
+
|
25
|
+
files:
|
26
|
+
- lib/mimosa.rb
|
27
|
+
- lib/mimosa/ccom.rb
|
28
|
+
has_rdoc: true
|
29
|
+
homepage: https://github.com/KeysetTS/mimosa
|
30
|
+
licenses: []
|
31
|
+
|
32
|
+
post_install_message:
|
33
|
+
rdoc_options: []
|
34
|
+
|
35
|
+
require_paths:
|
36
|
+
- lib
|
37
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
38
|
+
none: false
|
39
|
+
requirements:
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: "0"
|
43
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
44
|
+
none: false
|
45
|
+
requirements:
|
46
|
+
- - ">="
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: "0"
|
49
|
+
requirements: []
|
50
|
+
|
51
|
+
rubyforge_project:
|
52
|
+
rubygems_version: 1.5.0
|
53
|
+
signing_key:
|
54
|
+
specification_version: 3
|
55
|
+
summary: A gem for converting XML files to the mimosa standard
|
56
|
+
test_files: []
|
57
|
+
|