eclipse-plugin 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c8f527c95cba2316d028d916775b9ab0cc4d9fe0
4
- data.tar.gz: 7898baca4dcca5b98d3b87743d813d344bf6c6ec
3
+ metadata.gz: f46dc29b489d672aeaf25e05ea464f151cbc8e5d
4
+ data.tar.gz: de1ab43480da94d4850381e5762bd1a0ce520ca4
5
5
  SHA512:
6
- metadata.gz: bbff3538bdd1598bad0591c48e6cb3cf0e1519b56bea4d6af38565aacdb6080d63e04c6f4b28ef9d6bde266f3dc95bdddefba0b60efe51706aa24bd7ba2f28dd
7
- data.tar.gz: 1426505f81b9acdc72aa5cf6c42eef5ccb1188b947cf03a1ba7572f25537e9838c76fcacf24c9edc3673c4ecf1f249443265b34a7e83e9e6358548a69729cb7f
6
+ metadata.gz: 1572c7c86b10a161f98a0750105bb1faa6ddbbcbad55c38ca2c33181f92ec39772ad4730029396be9f4ad7f919ef3cd8e9ce5816520b34f1690891ba9221056d
7
+ data.tar.gz: f47ae70514682a0ba74b66c679abc6f676339218b4e5f043831fa9cb312f582cf7c60efbe237d98063393c4fb29c7da8b759d1042e111b14ffbe12043ceabcf3
@@ -4,7 +4,7 @@ script:
4
4
  - bundle exec rspec
5
5
  - bundle exec rake install
6
6
 
7
- install: bundle install --deployment --without debugger
7
+ install: bundle install --without debugger
8
8
 
9
9
  rvm:
10
10
  # - 2.2.x or earlier cannot run because mediawiki-butt requires at least Ruby 2.3
@@ -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')
@@ -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.exists?(mfName)
61
+ if File.exist?(mfName)
62
62
  getSymbolicNameFrom(File.read(mfName))
63
- elsif File.exists?(featureName)
63
+ elsif File.exist?(featureName)
64
64
  @feature = Feature::Info.new(jar_or_src)
65
- elsif File.exists?(featureName)
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.exists?(name)
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.exists?(plugin_xml)
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
@@ -1,5 +1,5 @@
1
1
  module Eclipse
2
2
  module Plugin
3
- VERSION = "0.4.2"
3
+ VERSION = "0.4.3"
4
4
  end
5
5
  end
@@ -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.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
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.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
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
@@ -15,7 +15,7 @@ describe 'Helpers' do
15
15
  |line|
16
16
  next unless line.index('Add_Recurring_Appointment')
17
17
  unescaped = Eclipse::Helpers.unescape(line)
18
- unescaped.should match /hinzufügen/
18
+ expect(unescaped).to match /hinzufügen/
19
19
  }
20
20
  end
21
21
  end
@@ -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'].should_not be nil
24
- info.workspace.should == @installDir
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'].should_not be nil
31
- info.view_categories['org.iatrix'].should_not be nil
32
- info.workspace.should == @installDir
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].should_not be nil
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].should_not be nil
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].should_not be nil
50
+ expect(info.views[CHECK_4_VIEW]).not_to be nil
51
51
  german = 'Vorlage Drucken'
52
- info.views[CHECK_4_VIEW].translation.should == german
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.should == @installDir
55
- info.getTranslatedViews.find_all{ |item| item.match(german) }.should_not be nil
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].should_not be nil
61
+ expect(info.preferencePages[CHECK_4_PREFERENCE_PAGE]).not_to be nil
62
62
  german = 'Iatrix'
63
- info.preferencePages[CHECK_4_PREFERENCE_PAGE].translation.should == german
64
- info.workspace.should == @installDir
65
- info.getTranslatedPreferencePages.find_all{ |item| item.match(german) }.should_not be nil
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].should_not be nil
71
+ expect(info.perspectives[CHECK_4_PERSPECTIVE]).not_to be nil
72
72
  german = 'Artikel'
73
- info.perspectives[CHECK_4_PERSPECTIVE].translation.should == german
74
- info.workspace.should == @installDir
75
- info.getTranslatedPerspectives.find_all{ |item| item.match(german) }.should_not be nil
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.should_not be nil
81
- info.views.first.should_not be nil
82
- info.perspectives.first.should_not be nil
83
- info.preferencePages.first.should_not be nil
84
- info.view_categories.first.should_not be nil
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
 
@@ -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).should == true
14
+ expect(File.directory?(installation)).to eq(true)
15
15
  workspace = Eclipse::Workspace.new(installation)
16
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
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).should == true
26
+ expect(File.directory?(installation)).to eq(true)
27
27
  workspace = Eclipse::Workspace.new(installation)
28
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
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.should == id
39
- value.symbolicName.should == id
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).should == true
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.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
55
- workspace.perspectives.first.should_not be nil
56
- workspace.preferencePages.first.should_not be nil
57
- workspace.view_categories.first.should_not be nil
58
- workspace.preferencePage_categories.first.should be nil
59
- workspace.views.size.should == 52
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.2
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-09 00:00:00.000000000 Z
11
+ date: 2018-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip