eclipse-plugin 0.1 → 0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,12 @@
1
+ <project xsi:schemaLocation='http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd' xmlns='http://maven.apache.org/POM/4.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
2
+ <modelVersion> 4.0.0 </modelVersion>
3
+ <parent>
4
+ <groupId> ch.elexis </groupId>
5
+ <artifactId> elexis-3-core </artifactId>
6
+ <version>3.0.0-SNAPSHOT</version>
7
+ </parent>
8
+ <groupId> ch.elexis </groupId>
9
+ <artifactId> ch.elexis.core.application.feature </artifactId>
10
+ <version>3.0.0-SNAPSHOT</version>
11
+ <packaging> eclipse-feature </packaging>
12
+ </project>
@@ -0,0 +1,36 @@
1
+ #encoding : utf-8
2
+ require 'spec_helper'
3
+
4
+ require 'eclipse/feature'
5
+
6
+ describe 'Feature' do
7
+
8
+ FEATURE_NAME = 'ch.elexis.core.application.feature'
9
+
10
+ before :all do
11
+ @dataDir = File.expand_path(File.join(File.dirname(__FILE__), 'data'))
12
+ end
13
+
14
+ it "must be able to analyse a feature.xml" do
15
+ feature = File.join(@dataDir, 'source', FEATURE_NAME)
16
+ f_info = Eclipse::Feature::Info.new(feature)
17
+ f_info.symbolicName.should == FEATURE_NAME
18
+ f_info.included_features.should == ["ch.docbox.elexis.feature"]
19
+ f_info.included_plugins.size.should > 10
20
+ f_info.description.should_not == nil
21
+ f_info.label.should_not == nil
22
+ f_info.license.should_not == nil
23
+ end
24
+
25
+ it "must be able to analyse a feature.jar" do
26
+ feature = Dir.glob(File.join(@dataDir, 'features', FEATURE_NAME+'*.jar'))[0]
27
+ f_info = Eclipse::Feature::Info.new(feature)
28
+ f_info.symbolicName.should == FEATURE_NAME
29
+ f_info.included_features.should == []
30
+ f_info.included_plugins.size.should > 10
31
+ f_info.description.should_not == nil
32
+ f_info.label.should_not == nil
33
+ f_info.license.should_not == nil
34
+ end
35
+
36
+ end
@@ -12,64 +12,66 @@ describe 'Plugin' do
12
12
  IATRIX_JAR = 'org.iatrix_3.0.0.v20140313-1017.jar'
13
13
  JAR_WITHOUT_LOCALIZE = 'ch.elexis.laborimport.hl7.allg-3.0.0-SNAPSHOT.jar'
14
14
  before :all do
15
- @dataDir = File.expand_path(File.join(File.dirname(__FILE__), 'data'))
15
+ @dataDir = File.expand_path(File.join(File.dirname(__FILE__), 'data'))
16
+ @installDir = File.expand_path(File.join(File.dirname(__FILE__), 'data', 'installation'))
17
+ @pluginsDir = File.expand_path(File.join(File.dirname(__FILE__), 'data', 'installation', 'plugins'))
16
18
  end
17
19
 
18
20
  it "must be able to analyse a plugin.xml without localization" do
19
- plugin = File.join(@dataDir, 'plugins', JAR_WITHOUT_LOCALIZE)
21
+ plugin = File.join(@pluginsDir, JAR_WITHOUT_LOCALIZE)
20
22
  info = Eclipse::Plugin::Info.new(plugin)
21
23
  info.preferencePages['ch.elexis.laborimport.hl7.preferences'].should_not be nil
22
- info.workspace.should == @dataDir
24
+ info.workspace.should == @installDir
23
25
  end
24
26
 
25
27
  it "must be able to analyse a plugin.xml with localization" do
26
- plugin = File.join(@dataDir, 'plugins', IATRIX_JAR)
28
+ plugin = File.join(@pluginsDir, IATRIX_JAR)
27
29
  info = Eclipse::Plugin::Info.new(plugin)
28
30
  info.views['org.iatrix.views.JournalView'].should_not be nil
29
31
  info.view_categories['org.iatrix'].should_not be nil
30
- info.workspace.should == @dataDir
32
+ info.workspace.should == @installDir
31
33
  end
32
34
 
33
35
  it "must return the perspectives" do
34
- plugin = File.join(@dataDir, 'plugins', APP_JAR)
36
+ plugin = File.join(@pluginsDir, APP_JAR)
35
37
  info = Eclipse::Plugin::Info.new(plugin)
36
38
  info.perspectives[CHECK_4_PERSPECTIVE].should_not be nil
37
39
  end
38
40
 
39
41
  it "must return the preferencePages" do
40
- plugin = File.join(@dataDir, 'plugins', IATRIX_JAR)
42
+ plugin = File.join(@pluginsDir, IATRIX_JAR)
41
43
  info = Eclipse::Plugin::Info.new(plugin)
42
44
  info.preferencePages[CHECK_4_PREFERENCE_PAGE].should_not be nil
43
45
  end
44
46
 
45
47
  it "must return the correct translation for a view" do
46
- plugin = File.join(@dataDir, 'plugins', APP_JAR)
48
+ plugin = File.join(@pluginsDir, APP_JAR)
47
49
  info = Eclipse::Plugin::Info.new(plugin)
48
50
  info.views[CHECK_4_VIEW].should_not be nil
49
51
  german = 'Vorlage Drucken'
50
52
  info.views[CHECK_4_VIEW].translation.should == german
51
53
  pp info.getTranslatedViews.find_all{ |item| item.match(german) }
52
- info.workspace.should == @dataDir
54
+ info.workspace.should == @installDir
53
55
  info.getTranslatedViews.find_all{ |item| item.match(german) }.should_not be nil
54
56
  end
55
57
 
56
58
  it "must return the correct translation for a preferencePage" do
57
- plugin = File.join(@dataDir, 'plugins', IATRIX_JAR)
59
+ plugin = File.join(@pluginsDir, IATRIX_JAR)
58
60
  info = Eclipse::Plugin::Info.new(plugin)
59
61
  info.preferencePages[CHECK_4_PREFERENCE_PAGE].should_not be nil
60
62
  german = 'Iatrix'
61
63
  info.preferencePages[CHECK_4_PREFERENCE_PAGE].translation.should == german
62
- info.workspace.should == @dataDir
64
+ info.workspace.should == @installDir
63
65
  info.getTranslatedPreferencePages.find_all{ |item| item.match(german) }.should_not be nil
64
66
  end
65
67
 
66
68
  it "must return the correct translation for a perspective" do
67
- plugin = File.join(@dataDir, 'plugins', APP_JAR)
69
+ plugin = File.join(@pluginsDir, APP_JAR)
68
70
  info = Eclipse::Plugin::Info.new(plugin)
69
71
  info.perspectives[CHECK_4_PERSPECTIVE].should_not be nil
70
72
  german = 'Artikel'
71
73
  info.perspectives[CHECK_4_PERSPECTIVE].translation.should == german
72
- info.workspace.should == @dataDir
74
+ info.workspace.should == @installDir
73
75
  info.getTranslatedPerspectives.find_all{ |item| item.match(german) }.should_not be nil
74
76
  end
75
77
 
@@ -10,32 +10,54 @@ describe 'workspace' do
10
10
  end
11
11
 
12
12
  it "should run the readme example" do
13
- require 'eclipse/plugin'
14
- workspace = Eclipse::Workspace.new(@dataDir)
15
- workspace.parsePluginDir
16
- workspace.views.first {|view| puts view.id }
17
- workspace.views.size.should == 49
18
- workspace.view_categories.size.should == 7
19
- workspace.preferencePages.size.should == 3
20
- workspace.preferencePage_categories.size.should == 1
21
- workspace.perspectives.size.should == 7
13
+ installation = File.expand_path(File.join(@dataDir, 'installation'))
14
+ File.directory?(installation).should == true
15
+ workspace = Eclipse::Workspace.new(installation)
16
+ workspace.parse
17
+ workspace.views.size.should == 49
18
+ workspace.view_categories.size.should == 7
19
+ workspace.preferencePages.size.should == 3
20
+ workspace.preferencePage_categories.size.should == 1
21
+ workspace.perspectives.size.should == 7
22
22
  end
23
23
 
24
- it "should work with a source workspace" do
25
- plugin = File.join('/opt/src/elexis-3-core')
26
- workspace = Eclipse::Workspace.new(File.join(@dataDir, 'source'))
27
- workspace.parse_sub_dirs
28
- workspace.views.first.should_not be nil
24
+ it "should find feature from an installed application" do
25
+ installation = File.expand_path(File.join(@dataDir, 'installation'))
26
+ File.directory?(installation).should == true
27
+ workspace = Eclipse::Workspace.new(installation)
28
+ workspace.parse
29
+ workspace.views.size.should == 49
30
+ workspace.view_categories.size.should == 7
31
+ workspace.preferencePages.size.should == 3
32
+ workspace.preferencePage_categories.size.should == 1
33
+ workspace.perspectives.size.should == 7
34
+ workspace.features.size.should == 1
35
+ id = 'ch.elexis.core.application.feature'
36
+ workspace.features.each{
37
+ |key, value|
38
+ key.should == id
39
+ value.symbolicName.should == id
40
+ }
41
+ end
42
+
43
+ it "should work with a simulated checkout of the elexis-3-core" do
44
+ elexis_core = File.expand_path(File.join(@dataDir, 'source'))
45
+ File.directory?(elexis_core).should == true
46
+ workspace = Eclipse::Workspace.new(elexis_core)
47
+ workspace.parse
48
+ workspace.features.size.should == 2
49
+ workspace.view_categories.size.should == 8
50
+ workspace.preferencePage_categories.size.should == 0
51
+ workspace.perspectives.size.should == 9
52
+ workspace.plugins.size.should == 3
53
+ workspace.preferencePages.size.should == 1
54
+ workspace.views.size.should > 3
29
55
  workspace.perspectives.first.should_not be nil
30
56
  workspace.preferencePages.first.should_not be nil
31
57
  workspace.view_categories.first.should_not be nil
32
58
  workspace.preferencePage_categories.first.should be nil
33
59
  workspace.views.size.should == 52
34
- workspace.view_categories.size.should == 8
35
- workspace.preferencePages.size.should == 1
36
- workspace.preferencePage_categories.size.should == 0
37
- workspace.perspectives.size.should == 9
38
- workspace.plugins.size.should == 3
39
60
  end
40
61
 
62
+
41
63
  end
metadata CHANGED
@@ -1,18 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eclipse-plugin
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.1'
4
+ version: '0.3'
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Niklaus Giger
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2014-03-22 00:00:00.000000000 Z
12
+ date: 2015-07-29 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: rubyzip
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
19
  - - <
18
20
  - !ruby/object:Gem::Version
@@ -20,13 +22,31 @@ dependencies:
20
22
  type: :runtime
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
27
  - - <
25
28
  - !ruby/object:Gem::Version
26
29
  version: 1.0.0
30
+ - !ruby/object:Gem::Dependency
31
+ name: nokogiri
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
27
46
  - !ruby/object:Gem::Dependency
28
47
  name: bundler
29
48
  requirement: !ruby/object:Gem::Requirement
49
+ none: false
30
50
  requirements:
31
51
  - - ~>
32
52
  - !ruby/object:Gem::Version
@@ -34,6 +54,7 @@ dependencies:
34
54
  type: :development
35
55
  prerelease: false
36
56
  version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
37
58
  requirements:
38
59
  - - ~>
39
60
  - !ruby/object:Gem::Version
@@ -41,6 +62,7 @@ dependencies:
41
62
  - !ruby/object:Gem::Dependency
42
63
  name: rake
43
64
  requirement: !ruby/object:Gem::Requirement
65
+ none: false
44
66
  requirements:
45
67
  - - ! '>='
46
68
  - !ruby/object:Gem::Version
@@ -48,6 +70,7 @@ dependencies:
48
70
  type: :development
49
71
  prerelease: false
50
72
  version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
51
74
  requirements:
52
75
  - - ! '>='
53
76
  - !ruby/object:Gem::Version
@@ -55,6 +78,7 @@ dependencies:
55
78
  - !ruby/object:Gem::Dependency
56
79
  name: rspec
57
80
  requirement: !ruby/object:Gem::Requirement
81
+ none: false
58
82
  requirements:
59
83
  - - ! '>='
60
84
  - !ruby/object:Gem::Version
@@ -62,6 +86,7 @@ dependencies:
62
86
  type: :development
63
87
  prerelease: false
64
88
  version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
65
90
  requirements:
66
91
  - - ! '>='
67
92
  - !ruby/object:Gem::Version
@@ -69,6 +94,7 @@ dependencies:
69
94
  - !ruby/object:Gem::Dependency
70
95
  name: simplecov
71
96
  requirement: !ruby/object:Gem::Requirement
97
+ none: false
72
98
  requirements:
73
99
  - - ! '>='
74
100
  - !ruby/object:Gem::Version
@@ -76,6 +102,7 @@ dependencies:
76
102
  type: :development
77
103
  prerelease: false
78
104
  version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
79
106
  requirements:
80
107
  - - ! '>='
81
108
  - !ruby/object:Gem::Version
@@ -96,14 +123,21 @@ files:
96
123
  - README.textile
97
124
  - Rakefile
98
125
  - eclipse-plugin.gemspec
126
+ - lib/eclipse/feature.rb
99
127
  - lib/eclipse/helpers.rb
100
128
  - lib/eclipse/plugin.rb
101
129
  - lib/eclipse/plugin/version.rb
102
130
  - lib/eclipse/workspace.rb
131
+ - spec/data/features/ch.elexis.core.application.feature_3.0.0.v20140328-2023.jar
132
+ - spec/data/installation/features/ch.elexis.core.application.feature_3.0.0.a20140711-1651.jar
133
+ - spec/data/installation/plugins/ch.elexis.core.application_3.0.0.v20140314-1352.jar
134
+ - spec/data/installation/plugins/ch.elexis.laborimport.hl7.allg-3.0.0-SNAPSHOT.jar
135
+ - spec/data/installation/plugins/org.iatrix_3.0.0.v20140313-1017.jar
103
136
  - spec/data/plugin_de.properties
104
- - spec/data/plugins/ch.elexis.core.application_3.0.0.v20140314-1352.jar
105
- - spec/data/plugins/ch.elexis.laborimport.hl7.allg-3.0.0-SNAPSHOT.jar
106
- - spec/data/plugins/org.iatrix_3.0.0.v20140313-1017.jar
137
+ - spec/data/source/ch.elexis.core.application.feature/.project
138
+ - spec/data/source/ch.elexis.core.application.feature/build.properties
139
+ - spec/data/source/ch.elexis.core.application.feature/feature.xml
140
+ - spec/data/source/ch.elexis.core.application.feature/pom.xml
107
141
  - spec/data/source/ch.elexis.core.application/.project
108
142
  - spec/data/source/ch.elexis.core.application/META-INF/MANIFEST.MF
109
143
  - spec/data/source/ch.elexis.core.application/plugin.properties
@@ -125,6 +159,7 @@ files:
125
159
  - spec/data/source/ch.elexis.icpc/.project
126
160
  - spec/data/source/ch.elexis.icpc/META-INF/MANIFEST.MF
127
161
  - spec/data/source/ch.elexis.icpc/plugin.xml
162
+ - spec/feature_spec.rb
128
163
  - spec/helpers_spec.rb
129
164
  - spec/plugin_spec.rb
130
165
  - spec/spec_helper.rb
@@ -132,33 +167,46 @@ files:
132
167
  homepage: ''
133
168
  licenses:
134
169
  - GPLv3
135
- metadata: {}
136
170
  post_install_message:
137
171
  rdoc_options: []
138
172
  require_paths:
139
173
  - lib
140
174
  required_ruby_version: !ruby/object:Gem::Requirement
175
+ none: false
141
176
  requirements:
142
177
  - - ! '>='
143
178
  - !ruby/object:Gem::Version
144
179
  version: '0'
180
+ segments:
181
+ - 0
182
+ hash: 2370195788507813306
145
183
  required_rubygems_version: !ruby/object:Gem::Requirement
184
+ none: false
146
185
  requirements:
147
186
  - - ! '>='
148
187
  - !ruby/object:Gem::Version
149
188
  version: '0'
189
+ segments:
190
+ - 0
191
+ hash: 2370195788507813306
150
192
  requirements: []
151
193
  rubyforge_project:
152
- rubygems_version: 2.2.1
194
+ rubygems_version: 1.8.23.2
153
195
  signing_key:
154
- specification_version: 4
196
+ specification_version: 3
155
197
  summary: Extract information about views, properties and perspectives from an eclipse
156
198
  plugin
157
199
  test_files:
200
+ - spec/data/features/ch.elexis.core.application.feature_3.0.0.v20140328-2023.jar
201
+ - spec/data/installation/features/ch.elexis.core.application.feature_3.0.0.a20140711-1651.jar
202
+ - spec/data/installation/plugins/ch.elexis.core.application_3.0.0.v20140314-1352.jar
203
+ - spec/data/installation/plugins/ch.elexis.laborimport.hl7.allg-3.0.0-SNAPSHOT.jar
204
+ - spec/data/installation/plugins/org.iatrix_3.0.0.v20140313-1017.jar
158
205
  - spec/data/plugin_de.properties
159
- - spec/data/plugins/ch.elexis.core.application_3.0.0.v20140314-1352.jar
160
- - spec/data/plugins/ch.elexis.laborimport.hl7.allg-3.0.0-SNAPSHOT.jar
161
- - spec/data/plugins/org.iatrix_3.0.0.v20140313-1017.jar
206
+ - spec/data/source/ch.elexis.core.application.feature/.project
207
+ - spec/data/source/ch.elexis.core.application.feature/build.properties
208
+ - spec/data/source/ch.elexis.core.application.feature/feature.xml
209
+ - spec/data/source/ch.elexis.core.application.feature/pom.xml
162
210
  - spec/data/source/ch.elexis.core.application/.project
163
211
  - spec/data/source/ch.elexis.core.application/META-INF/MANIFEST.MF
164
212
  - spec/data/source/ch.elexis.core.application/plugin.properties
@@ -180,6 +228,7 @@ test_files:
180
228
  - spec/data/source/ch.elexis.icpc/.project
181
229
  - spec/data/source/ch.elexis.icpc/META-INF/MANIFEST.MF
182
230
  - spec/data/source/ch.elexis.icpc/plugin.xml
231
+ - spec/feature_spec.rb
183
232
  - spec/helpers_spec.rb
184
233
  - spec/plugin_spec.rb
185
234
  - spec/spec_helper.rb
checksums.yaml DELETED
@@ -1,15 +0,0 @@
1
- ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MzUzZGViZjE0MjlkNWExY2FmOThlMjQzMTg0NjhmMDc0ZWE3ZjJlMw==
5
- data.tar.gz: !binary |-
6
- NDJlNDVmYWIwOGU1OWNjZjAyMGIyNTE3YjkyZjE0OTQ4NzgwZDYwOA==
7
- SHA512:
8
- metadata.gz: !binary |-
9
- YTBhNWNjZWJmMWNhNmMzYTZkMDgyNjI4MjU3YjMxNDFlMThjYzcyYzBkNTBh
10
- NjViMzBlMDc1ZTNjNmRlN2VhYTAyMzVhNzk3ZjFkMmY5OTJjM2YyZGZkYzM2
11
- ZjA3NDhkNWE2MjVhZDdjOWZjMWQ4OGNlNTM5MTkwYzk5ZGYwZTM=
12
- data.tar.gz: !binary |-
13
- MGRlODc3N2RjN2NjMjIxNjFjYTcxZmZjODJjM2Q1Zjc2OTA4YTljYTAzMWY3
14
- ZmI3MmE0MjJiMjFiZjVhMzUyNjY0Zjg5YzhjY2Q1YmRkZWU0OGUxMWNlMzcx
15
- OTkwNzlhMGI4M2M5MWI4ZTIwZjRkODIzMGQ1NGJkYTA4MWEzNjE=