eclipse-plugin 0.4.2 → 0.4.3
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.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/lib/eclipse/feature.rb +2 -1
- data/lib/eclipse/plugin.rb +5 -5
- data/lib/eclipse/plugin/version.rb +1 -1
- data/spec/feature_spec.rb +12 -12
- data/spec/helpers_spec.rb +1 -1
- data/spec/plugin_spec.rb +24 -24
- data/spec/workspace_spec.rb +28 -28
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f46dc29b489d672aeaf25e05ea464f151cbc8e5d
|
4
|
+
data.tar.gz: de1ab43480da94d4850381e5762bd1a0ce520ca4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1572c7c86b10a161f98a0750105bb1faa6ddbbcbad55c38ca2c33181f92ec39772ad4730029396be9f4ad7f919ef3cd8e9ce5816520b34f1690891ba9221056d
|
7
|
+
data.tar.gz: f47ae70514682a0ba74b66c679abc6f676339218b4e5f043831fa9cb312f582cf7c60efbe237d98063393c4fb29c7da8b759d1042e111b14ffbe12043ceabcf3
|
data/.travis.yml
CHANGED
data/lib/eclipse/feature.rb
CHANGED
@@ -8,7 +8,7 @@ module Eclipse
|
|
8
8
|
module Feature
|
9
9
|
class Info
|
10
10
|
attr_reader :included_plugins, :included_features
|
11
|
-
attr_reader :symbolicName, :id, :label, :version, :provider, :description, :license, :copyright
|
11
|
+
attr_reader :symbolicName, :id, :label, :version, :provider, :description, :license, :copyright, :workspace
|
12
12
|
|
13
13
|
def getFeatureInfo(content)
|
14
14
|
@included_plugins = []
|
@@ -28,6 +28,7 @@ module Eclipse
|
|
28
28
|
featureXml = File.join(jar_or_src_dir, 'feature.xml')
|
29
29
|
if File.directory?(jar_or_src_dir)
|
30
30
|
getFeatureInfo(File.read(featureXml))
|
31
|
+
@workspace = File.dirname(featureXml)
|
31
32
|
elsif File.exists?(jar_or_src_dir)
|
32
33
|
@jarfile = Zip::File.open(jar_or_src_dir)
|
33
34
|
if @jarfile.find_entry('feature.xml')
|
data/lib/eclipse/plugin.rb
CHANGED
@@ -58,11 +58,11 @@ module Eclipse
|
|
58
58
|
readPluginXML(jar_or_src)
|
59
59
|
mfName = File.join(jar_or_src, 'META-INF', 'MANIFEST.MF')
|
60
60
|
featureName = File.join(jar_or_src, 'feature.xml')
|
61
|
-
if File.
|
61
|
+
if File.exist?(mfName)
|
62
62
|
getSymbolicNameFrom(File.read(mfName))
|
63
|
-
elsif File.
|
63
|
+
elsif File.exist?(featureName)
|
64
64
|
@feature = Feature::Info.new(jar_or_src)
|
65
|
-
elsif File.
|
65
|
+
elsif File.exist?(featureName)
|
66
66
|
@feature = Feature::Info.new(featureName)
|
67
67
|
else
|
68
68
|
# puts "Skipping #{jar_or_src} #{featureName}"
|
@@ -156,7 +156,7 @@ module Eclipse
|
|
156
156
|
content = @jarfile.read(properties) if @jarfile.find_entry(properties)
|
157
157
|
else
|
158
158
|
name = File.join(@jar_or_src, "plugin.properties")
|
159
|
-
properties = File.new(name).read if File.
|
159
|
+
properties = File.new(name).read if File.exist?(name)
|
160
160
|
end
|
161
161
|
return look_for unless content
|
162
162
|
line_nr = 0
|
@@ -186,7 +186,7 @@ module Eclipse
|
|
186
186
|
doc = Document.new @jarfile.read('plugin.xml')
|
187
187
|
else
|
188
188
|
plugin_xml = File.join(plugin, 'plugin.xml')
|
189
|
-
return unless File.
|
189
|
+
return unless File.exist?(plugin_xml)
|
190
190
|
doc = Document.new File.new(plugin_xml).read
|
191
191
|
end
|
192
192
|
# Get all perspectives
|
data/spec/feature_spec.rb
CHANGED
@@ -14,23 +14,23 @@ describe 'Feature' do
|
|
14
14
|
it "must be able to analyse a feature.xml" do
|
15
15
|
feature = File.join(@dataDir, 'source', 'features', FEATURE_NAME)
|
16
16
|
f_info = Eclipse::Feature::Info.new(feature)
|
17
|
-
f_info.symbolicName.
|
18
|
-
f_info.included_features.
|
19
|
-
f_info.included_plugins.size.
|
20
|
-
f_info.description.
|
21
|
-
f_info.label.
|
22
|
-
f_info.license.
|
17
|
+
expect(f_info.symbolicName).to eq(FEATURE_NAME)
|
18
|
+
expect(f_info.included_features).to eq(["ch.docbox.elexis.feature"])
|
19
|
+
expect(f_info.included_plugins.size).to be > 10
|
20
|
+
expect(f_info.description).not_to eq(nil)
|
21
|
+
expect(f_info.label).not_to eq(nil)
|
22
|
+
expect(f_info.license).not_to eq(nil)
|
23
23
|
end
|
24
24
|
|
25
25
|
it "must be able to analyse a feature.jar" do
|
26
26
|
feature = Dir.glob(File.join(@dataDir, 'features', FEATURE_NAME+'*.jar'))[0]
|
27
27
|
f_info = Eclipse::Feature::Info.new(feature)
|
28
|
-
f_info.symbolicName.
|
29
|
-
f_info.included_features.
|
30
|
-
f_info.included_plugins.size.
|
31
|
-
f_info.description.
|
32
|
-
f_info.label.
|
33
|
-
f_info.license.
|
28
|
+
expect(f_info.symbolicName).to eq(FEATURE_NAME)
|
29
|
+
expect(f_info.included_features).to eq([])
|
30
|
+
expect(f_info.included_plugins.size).to be > 10
|
31
|
+
expect(f_info.description).not_to eq(nil)
|
32
|
+
expect(f_info.label).not_to eq(nil)
|
33
|
+
expect(f_info.license).not_to eq(nil)
|
34
34
|
end
|
35
35
|
|
36
36
|
end
|
data/spec/helpers_spec.rb
CHANGED
data/spec/plugin_spec.rb
CHANGED
@@ -20,68 +20,68 @@ describe 'Plugin' do
|
|
20
20
|
it "must be able to analyse a plugin.xml without localization" do
|
21
21
|
plugin = File.join(@pluginsDir, JAR_WITHOUT_LOCALIZE)
|
22
22
|
info = Eclipse::Plugin::Info.new(plugin)
|
23
|
-
info.preferencePages['ch.elexis.laborimport.hl7.preferences'].
|
24
|
-
info.workspace.
|
23
|
+
expect(info.preferencePages['ch.elexis.laborimport.hl7.preferences']).not_to be nil
|
24
|
+
expect(info.workspace).to eq(@installDir)
|
25
25
|
end
|
26
26
|
|
27
27
|
it "must be able to analyse a plugin.xml with localization" do
|
28
28
|
plugin = File.join(@pluginsDir, IATRIX_JAR)
|
29
29
|
info = Eclipse::Plugin::Info.new(plugin)
|
30
|
-
info.views['org.iatrix.views.JournalView'].
|
31
|
-
info.view_categories['org.iatrix'].
|
32
|
-
info.workspace.
|
30
|
+
expect(info.views['org.iatrix.views.JournalView']).not_to be nil
|
31
|
+
expect(info.view_categories['org.iatrix']).not_to be nil
|
32
|
+
expect(info.workspace).to eq(@installDir)
|
33
33
|
end
|
34
34
|
|
35
35
|
it "must return the perspectives" do
|
36
36
|
plugin = File.join(@pluginsDir, APP_JAR)
|
37
37
|
info = Eclipse::Plugin::Info.new(plugin)
|
38
|
-
info.perspectives[CHECK_4_PERSPECTIVE].
|
38
|
+
expect(info.perspectives[CHECK_4_PERSPECTIVE]).not_to be nil
|
39
39
|
end
|
40
40
|
|
41
41
|
it "must return the preferencePages" do
|
42
42
|
plugin = File.join(@pluginsDir, IATRIX_JAR)
|
43
43
|
info = Eclipse::Plugin::Info.new(plugin)
|
44
|
-
info.preferencePages[CHECK_4_PREFERENCE_PAGE].
|
44
|
+
expect(info.preferencePages[CHECK_4_PREFERENCE_PAGE]).not_to be nil
|
45
45
|
end
|
46
46
|
|
47
47
|
it "must return the correct translation for a view" do
|
48
48
|
plugin = File.join(@pluginsDir, APP_JAR)
|
49
49
|
info = Eclipse::Plugin::Info.new(plugin)
|
50
|
-
info.views[CHECK_4_VIEW].
|
50
|
+
expect(info.views[CHECK_4_VIEW]).not_to be nil
|
51
51
|
german = 'Vorlage Drucken'
|
52
|
-
info.views[CHECK_4_VIEW].translation.
|
52
|
+
expect(info.views[CHECK_4_VIEW].translation).to eq(german)
|
53
53
|
puts info.getTranslatedViews.find_all{ |item| item.match(german) }
|
54
|
-
info.workspace.
|
55
|
-
info.getTranslatedViews.find_all{ |item| item.match(german) }.
|
54
|
+
expect(info.workspace).to eq(@installDir)
|
55
|
+
expect(info.getTranslatedViews.find_all{ |item| item.match(german) }).not_to be nil
|
56
56
|
end
|
57
57
|
|
58
58
|
it "must return the correct translation for a preferencePage" do
|
59
59
|
plugin = File.join(@pluginsDir, IATRIX_JAR)
|
60
60
|
info = Eclipse::Plugin::Info.new(plugin)
|
61
|
-
info.preferencePages[CHECK_4_PREFERENCE_PAGE].
|
61
|
+
expect(info.preferencePages[CHECK_4_PREFERENCE_PAGE]).not_to be nil
|
62
62
|
german = 'Iatrix'
|
63
|
-
info.preferencePages[CHECK_4_PREFERENCE_PAGE].translation.
|
64
|
-
info.workspace.
|
65
|
-
info.getTranslatedPreferencePages.find_all{ |item| item.match(german) }.
|
63
|
+
expect(info.preferencePages[CHECK_4_PREFERENCE_PAGE].translation).to eq(german)
|
64
|
+
expect(info.workspace).to eq(@installDir)
|
65
|
+
expect(info.getTranslatedPreferencePages.find_all{ |item| item.match(german) }).not_to be nil
|
66
66
|
end
|
67
67
|
|
68
68
|
it "must return the correct translation for a perspective" do
|
69
69
|
plugin = File.join(@pluginsDir, APP_JAR)
|
70
70
|
info = Eclipse::Plugin::Info.new(plugin)
|
71
|
-
info.perspectives[CHECK_4_PERSPECTIVE].
|
71
|
+
expect(info.perspectives[CHECK_4_PERSPECTIVE]).not_to be nil
|
72
72
|
german = 'Artikel'
|
73
|
-
info.perspectives[CHECK_4_PERSPECTIVE].translation.
|
74
|
-
info.workspace.
|
75
|
-
info.getTranslatedPerspectives.find_all{ |item| item.match(german) }.
|
73
|
+
expect(info.perspectives[CHECK_4_PERSPECTIVE].translation).to eq(german)
|
74
|
+
expect(info.workspace).to eq(@installDir)
|
75
|
+
expect(info.getTranslatedPerspectives.find_all{ |item| item.match(german) }).not_to be nil
|
76
76
|
end
|
77
77
|
|
78
78
|
it "should work with a source plugin" do
|
79
79
|
info = Eclipse::Plugin::Info.new(File.join(@dataDir, 'source', 'bundles', 'ch.elexis.core.ui.contacts'))
|
80
|
-
info.jar_or_src.
|
81
|
-
info.views.first.
|
82
|
-
info.perspectives.first.
|
83
|
-
info.preferencePages.first.
|
84
|
-
info.view_categories.first.
|
80
|
+
expect(info.jar_or_src).not_to be nil
|
81
|
+
expect(info.views.first).not_to be nil
|
82
|
+
expect(info.perspectives.first).not_to be nil
|
83
|
+
expect(info.preferencePages.first).not_to be nil
|
84
|
+
expect(info.view_categories.first).not_to be nil
|
85
85
|
# info.preferencePage_categories.first.should_not be nil
|
86
86
|
end
|
87
87
|
|
data/spec/workspace_spec.rb
CHANGED
@@ -11,52 +11,52 @@ describe 'workspace' do
|
|
11
11
|
|
12
12
|
it "should run the readme example" do
|
13
13
|
installation = File.expand_path(File.join(@dataDir, 'installation'))
|
14
|
-
File.directory?(installation).
|
14
|
+
expect(File.directory?(installation)).to eq(true)
|
15
15
|
workspace = Eclipse::Workspace.new(installation)
|
16
16
|
workspace.parse
|
17
|
-
workspace.views.size.
|
18
|
-
workspace.view_categories.size.
|
19
|
-
workspace.preferencePages.size.
|
20
|
-
workspace.preferencePage_categories.size.
|
21
|
-
workspace.perspectives.size.
|
17
|
+
expect(workspace.views.size).to eq(49)
|
18
|
+
expect(workspace.view_categories.size).to eq(7)
|
19
|
+
expect(workspace.preferencePages.size).to eq(3)
|
20
|
+
expect(workspace.preferencePage_categories.size).to eq(1)
|
21
|
+
expect(workspace.perspectives.size).to eq(7)
|
22
22
|
end
|
23
23
|
|
24
24
|
it "should find feature from an installed application" do
|
25
25
|
installation = File.expand_path(File.join(@dataDir, 'installation'))
|
26
|
-
File.directory?(installation).
|
26
|
+
expect(File.directory?(installation)).to eq(true)
|
27
27
|
workspace = Eclipse::Workspace.new(installation)
|
28
28
|
workspace.parse
|
29
|
-
workspace.views.size.
|
30
|
-
workspace.view_categories.size.
|
31
|
-
workspace.preferencePages.size.
|
32
|
-
workspace.preferencePage_categories.size.
|
33
|
-
workspace.perspectives.size.
|
34
|
-
workspace.features.size.
|
29
|
+
expect(workspace.views.size).to eq(49)
|
30
|
+
expect(workspace.view_categories.size).to eq(7)
|
31
|
+
expect(workspace.preferencePages.size).to eq(3)
|
32
|
+
expect(workspace.preferencePage_categories.size).to eq(1)
|
33
|
+
expect(workspace.perspectives.size).to eq(7)
|
34
|
+
expect(workspace.features.size).to eq(1)
|
35
35
|
id = 'ch.elexis.core.application.feature'
|
36
36
|
workspace.features.each{
|
37
37
|
|key, value|
|
38
|
-
key.
|
39
|
-
value.symbolicName.
|
38
|
+
expect(key).to eq(id)
|
39
|
+
expect(value.symbolicName).to eq(id)
|
40
40
|
}
|
41
41
|
end
|
42
42
|
|
43
43
|
it "should work with a simulated checkout of the elexis-3-core" do
|
44
44
|
elexis_core = File.expand_path(File.join(@dataDir, 'source'))
|
45
|
-
File.directory?(elexis_core).
|
45
|
+
expect(File.directory?(elexis_core)).to eq(true)
|
46
46
|
workspace = Eclipse::Workspace.new(elexis_core)
|
47
47
|
workspace.parse
|
48
|
-
workspace.features.size.
|
49
|
-
workspace.view_categories.size.
|
50
|
-
workspace.preferencePage_categories.size.
|
51
|
-
workspace.perspectives.size.
|
52
|
-
workspace.plugins.size.
|
53
|
-
workspace.preferencePages.size.
|
54
|
-
workspace.views.size.
|
55
|
-
workspace.perspectives.first.
|
56
|
-
workspace.preferencePages.first.
|
57
|
-
workspace.view_categories.first.
|
58
|
-
workspace.preferencePage_categories.first.
|
59
|
-
workspace.views.size.
|
48
|
+
expect(workspace.features.size).to eq(2)
|
49
|
+
expect(workspace.view_categories.size).to eq(8)
|
50
|
+
expect(workspace.preferencePage_categories.size).to eq(0)
|
51
|
+
expect(workspace.perspectives.size).to eq(9)
|
52
|
+
expect(workspace.plugins.size).to eq(3)
|
53
|
+
expect(workspace.preferencePages.size).to eq(1)
|
54
|
+
expect(workspace.views.size).to be > 3
|
55
|
+
expect(workspace.perspectives.first).not_to be nil
|
56
|
+
expect(workspace.preferencePages.first).not_to be nil
|
57
|
+
expect(workspace.view_categories.first).not_to be nil
|
58
|
+
expect(workspace.preferencePage_categories.first).to be nil
|
59
|
+
expect(workspace.views.size).to eq(52)
|
60
60
|
end
|
61
61
|
|
62
62
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eclipse-plugin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Niklaus Giger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-08-
|
11
|
+
date: 2018-08-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubyzip
|