emf_jruby 0.2.1-java → 0.2.2-java

Sign up to get free protection for your applications and to get access to all the features.
data/lib/emf/emf_nav.rb CHANGED
@@ -65,6 +65,12 @@ module Java::OrgEclipseEmfEcore::EObject
65
65
  eSet(a,value)
66
66
  end
67
67
 
68
+ def set_ref_value(ref_name,value)
69
+ r = get_ref(ref_name)
70
+ raise 'Ref not found' unless r
71
+ eSet(r,value)
72
+ end
73
+
68
74
  def get_attr_value(attr_name)
69
75
  eGet(get_attr(attr_name))
70
76
  end
data/lib/emf/emf_utils.rb CHANGED
@@ -28,6 +28,14 @@ module EMF
28
28
  create_eattribute(name,EcoreLiterals::ESTRING)
29
29
  end
30
30
 
31
+ def self.create_eattribute_int(name)
32
+ create_eattribute(name,EcoreLiterals::EINT)
33
+ end
34
+
35
+ def self.create_eattribute_long(name)
36
+ create_eattribute(name,EcoreLiterals::ELONG)
37
+ end
38
+
31
39
  def self.create_ereference(type=nil, name=nil, params=[])
32
40
  r = EcoreFactory.eINSTANCE.createEReference #(type, type.ePackage.next_id)
33
41
  r.set_etype(type)
data/lib/emf/rgen_ext.rb CHANGED
@@ -92,6 +92,41 @@ class RGen::MetamodelBuilder::MMBase
92
92
  send getter
93
93
  end
94
94
 
95
+ def children
96
+ arr = []
97
+ ecore = self.class.ecore
98
+ ecore.eAllReferences.select {|r| r.containment}.each do |ref|
99
+ res = self.send(ref.name.to_sym)
100
+ if res.is_a? Array
101
+ arr.concat(res)
102
+ elsif res
103
+ arr << res
104
+ end
105
+ end
106
+ arr
107
+ end
108
+
109
+ def children_deep
110
+ arr = []
111
+ children.each do |c|
112
+ arr << c
113
+ arr.concat(c.children_deep)
114
+ end
115
+ arr
116
+ end
117
+
118
+ def only_child_of_type(type)
119
+ selected = children.select {|c| c.is_a?(type)}
120
+ raise "Exactly one child of type #{type} expected, #{selected.count} found on #{self}" unless selected.count==1
121
+ selected
122
+ end
123
+
124
+ def only_child_deep_of_type(type)
125
+ selected = children_deep.select {|c| c.is_a?(type)}
126
+ raise "Exactly one child of type #{type} expected, #{selected.count} found on #{self}" unless selected.count==1
127
+ selected
128
+ end
129
+
95
130
  end
96
131
 
97
132
  class << self
metadata CHANGED
@@ -1,29 +1,32 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: emf_jruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ prerelease:
5
+ version: 0.2.2
5
6
  platform: java
6
7
  authors:
7
8
  - Federico Tomassetti
8
- autorequire:
9
+ autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2013-08-30 00:00:00.000000000 Z
12
+ date: 2013-09-13 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: json
15
- requirement: !ruby/object:Gem::Requirement
16
+ version_requirements: !ruby/object:Gem::Requirement
16
17
  requirements:
17
18
  - - '>='
18
19
  - !ruby/object:Gem::Version
19
20
  version: '0'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
21
+ none: false
22
+ requirement: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '>='
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ none: false
28
+ prerelease: false
29
+ type: :runtime
27
30
  description: EMF support for JRuby
28
31
  email: f.tomassetti@gmail.com
29
32
  executables: []
@@ -31,20 +34,25 @@ extensions: []
31
34
  extra_rdoc_files: []
32
35
  files:
33
36
  - lib/emf_jruby.rb
37
+ - ./lib/emf/rgen_to_emf.rb
34
38
  - ./lib/emf/emf_nav.rb
35
- - ./lib/emf/emf_utils.rb
36
39
  - ./lib/emf/exceptions.rb
37
- - ./lib/emf/rgen_ext.rb
38
- - ./lib/emf/rgen_to_emf.rb
39
40
  - ./lib/emf/xmi.rb
41
+ - ./lib/emf/emf_utils.rb
42
+ - ./lib/emf/rgen_ext.rb
43
+ - ./lib/jars/org.eclipse.equinox.common_3.6.200.v20130402-1505.jar
44
+ - ./lib/jars/org.eclipse.core.runtime.compatibility_3.2.200.v20130326-1255.jar
40
45
  - ./lib/jars/org.antlr.runtime_3.0.0.v200803061811.jar
46
+ - ./lib/jars/org.eclipse.emf.ecore_2.8.3.v20130125-0546.jar
47
+ - ./lib/jars/org.eclipse.core.resources_3.8.100.v20130521-2026.jar
48
+ - ./lib/jars/org.eclipse.osgi_3.9.0.v20130529-1710.jar
49
+ - ./lib/jars/org.eclipse.core.runtime_3.9.0.v20130326-1255.jar
41
50
  - ./lib/jars/org.eclipse.emf.common_2.8.0.v20130125-0546.jar
42
51
  - ./lib/jars/org.eclipse.emf.ecore.xmi_2.8.1.v20130125-0546.jar
43
- - ./lib/jars/org.eclipse.emf.ecore_2.8.3.v20130125-0546.jar
52
+ - ./lib/jars/org.eclipse.core.jobs_3.5.300.v20130429-1813.jar
44
53
  homepage: http://federico-tomassetti.it
45
54
  licenses: []
46
- metadata: {}
47
- post_install_message:
55
+ post_install_message:
48
56
  rdoc_options: []
49
57
  require_paths:
50
58
  - lib
@@ -52,16 +60,24 @@ required_ruby_version: !ruby/object:Gem::Requirement
52
60
  requirements:
53
61
  - - '>='
54
62
  - !ruby/object:Gem::Version
63
+ segments:
64
+ - 0
65
+ hash: 2
55
66
  version: '0'
67
+ none: false
56
68
  required_rubygems_version: !ruby/object:Gem::Requirement
57
69
  requirements:
58
70
  - - '>='
59
71
  - !ruby/object:Gem::Version
72
+ segments:
73
+ - 0
74
+ hash: 2
60
75
  version: '0'
76
+ none: false
61
77
  requirements: []
62
- rubyforge_project:
63
- rubygems_version: 2.0.3
64
- signing_key:
65
- specification_version: 4
78
+ rubyforge_project:
79
+ rubygems_version: 1.8.24
80
+ signing_key:
81
+ specification_version: 3
66
82
  summary: EMF support for JRuby
67
83
  test_files: []
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: e8e713a0aa61b88d3aa9a8e509e716b1f68f88c5
4
- data.tar.gz: e22dee2786146cb18fb4a9695e5f4ccf4b94401a
5
- SHA512:
6
- metadata.gz: 8d61f10493087b9f1acd73ee91693dfd8c178c8f586e46715d3d086ddad6049c0e12f4fa523f00cbc58890d32c9f82cdf982f1fdfce40756531ee58d16cce5d1
7
- data.tar.gz: e8961391a63d44654a60b85678689c0fed10940772bd8564ab33aec46dec2cc315c6115bc30443967edc05b9cdfbe08f4d699bd8df10c8b706a59a6c0d86ed28