swt 0.13 → 0.15

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -2,19 +2,35 @@
2
2
  SWT
3
3
  ===
4
4
 
5
- This gem contains the SWT jars needed to run SWT applications.
5
+ This gem contains everything required to write cross-platform desktop applications with JRuby and SWT.
6
6
 
7
- ## Example
7
+ Features:
8
+
9
+ * Includes all the jar files needed.
10
+ * Selects and loads the correct SWT jar for the platform.
11
+ * Imports of many swt Java classes into a 1-1 mapped Ruby class hierarchy.
12
+ * Examples to get you started. (For more see [this SWT cookbook](https://github.com/danlucraft/jruby-swt-cookbook))
13
+
14
+ ## Why JRuby/SWT?
15
+
16
+ * Fast, compatible Ruby implementation.
17
+ * JRuby and SWT are flawlessly cross-platform.
18
+ * SWT has native widgets (for the most part).
19
+ * SWT powers Eclipse, so there's nothing you need that it doesn't do.
20
+ * You don't need to touch Java! Write everything in Ruby.
21
+
22
+ ## Usage
23
+
24
+ require 'java'
25
+ require 'swt'
26
+
27
+ ## Running the Example
8
28
 
9
29
  Linux / windows:
10
30
 
11
- jruby examples/button.rb
31
+ jruby examples/button.rb
12
32
 
13
33
  On OSX:
14
34
 
15
- jruby -J-XstartOnFirstThread examples/button.rb
35
+ jruby -J-XstartOnFirstThread examples/button.rb
16
36
 
17
- ## Usage
18
-
19
- require 'java'
20
- require 'swt'
data/lib/swt/full.rb CHANGED
@@ -79,6 +79,8 @@ module Swt
79
79
  import org.eclipse.swt.events.KeyEvent
80
80
  import org.eclipse.swt.events.MouseListener
81
81
  import org.eclipse.swt.events.MouseTrackListener
82
+ import org.eclipse.swt.events.SelectionListener
83
+ import org.eclipse.swt.events.KeyListener
82
84
  end
83
85
 
84
86
  import org.eclipse.swt.browser.Browser
@@ -99,7 +101,7 @@ module Swt
99
101
  end
100
102
 
101
103
  module JFace
102
- Dir[File.dirname(__FILE__) + "/../../vendor/jface/*.jar"].each do |jar_fn|
104
+ Dir[File.expand_path "../../../vendor/jface/*.jar", __FILE__].each do |jar_fn|
103
105
  require jar_fn
104
106
  end
105
107
 
@@ -1,26 +1,29 @@
1
1
  require 'rbconfig'
2
2
 
3
3
  module Swt
4
+
5
+ X64_BIT_CPUS = %w(amd64 x86_64)
6
+
4
7
  def self.jar_path
5
- File.expand_path(relative_jar_path, __FILE__)
8
+ @jar_path ||= File.expand_path(relative_jar_path, __FILE__)
6
9
  end
7
-
10
+
8
11
  def self.relative_jar_path
9
- case Config::CONFIG["host_os"]
12
+ case RbConfig::CONFIG["host_os"]
10
13
  when /darwin/i
11
- if Config::CONFIG["host_cpu"] == "x86_64"
14
+ if x64_bit_cpu?
12
15
  '../../../vendor/swt/swt-osx64'
13
16
  else
14
17
  '../../../vendor/swt/swt-osx32'
15
18
  end
16
19
  when /linux/i
17
- if %w(amd64 x84_64).include? Config::CONFIG["host_cpu"]
20
+ if x64_bit_cpu?
18
21
  '../../../vendor/swt/swt-linux64'
19
22
  else
20
23
  '../../../vendor/swt/swt-linux32'
21
24
  end
22
25
  when /windows|mswin/i
23
- if %w(amd64 x84_64).include? Config::CONFIG["host_cpu"]
26
+ if x64_bit_cpu?
24
27
  '../../../vendor/swt/swt-win64'
25
28
  else
26
29
  '../../../vendor/swt/swt-win32'
@@ -28,9 +31,13 @@ module Swt
28
31
  end
29
32
  end
30
33
 
34
+ def self.x64_bit_cpu?
35
+ X64_BIT_CPUS.include? RbConfig::CONFIG["host_cpu"]
36
+ end
37
+
31
38
  if File.exist?(jar_path + ".jar")
32
39
  require jar_path
33
40
  else
34
41
  raise "swt jar file required: #{jar_path}.jar"
35
42
  end
36
- end
43
+ end
data/lib/swt/minimal.rb CHANGED
@@ -4,7 +4,7 @@ require 'swt/event_loop'
4
4
  require 'swt/cucumber_runner'
5
5
 
6
6
  module Swt
7
- VERSION = "0.13" # also change in swt.gemspec
7
+ VERSION = "0.15" # also change in swt.gemspec
8
8
 
9
9
  import org.eclipse.swt.SWT
10
10
 
metadata CHANGED
@@ -1,82 +1,90 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: swt
3
- version: !ruby/object:Gem::Version
4
- version: '0.13'
3
+ version: !ruby/object:Gem::Version
5
4
  prerelease:
5
+ version: "0.15"
6
6
  platform: ruby
7
- authors:
8
- - Daniel Lucraft
7
+ authors:
8
+ - Daniel Lucraft
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-31 00:00:00.000000000 Z
12
+
13
+ date: 2012-12-02 00:00:00 Z
13
14
  dependencies: []
14
- description: Includes SWT jars and imports SWT classes into Ruby.
15
- email:
16
- - dan@fluentradical.com
17
- executables:
18
- - swt_cucumber
15
+
16
+ description: Contains everything required to write cross-platform desktop applications with JRuby and SWT.
17
+ email:
18
+ - dan@fluentradical.com
19
+ executables:
20
+ - swt_cucumber
19
21
  extensions: []
22
+
20
23
  extra_rdoc_files: []
21
- files:
22
- - bin/swt_cucumber
23
- - lib/swt/cucumber_patches.rb
24
- - lib/swt/cucumber_runner.rb
25
- - lib/swt/event_loop.rb
26
- - lib/swt/full.rb
27
- - lib/swt/grid_data.rb
28
- - lib/swt/jar_loader.rb
29
- - lib/swt/minimal.rb
30
- - lib/swt/swt_bot_extensions.rb
31
- - lib/swt.rb
32
- - LICENSE
33
- - README.md
34
- - vendor/jface/org.eclipse.core.commands.jar
35
- - vendor/jface/org.eclipse.core.jobs.jar
36
- - vendor/jface/org.eclipse.core.resources.jar
37
- - vendor/jface/org.eclipse.core.runtime_3.5.0.v20090525.jar
38
- - vendor/jface/org.eclipse.equinox.common.jar
39
- - vendor/jface/org.eclipse.jface.databinding_1.3.0.I20090525-2000.jar
40
- - vendor/jface/org.eclipse.jface.jar
41
- - vendor/jface/org.eclipse.jface.text_3.5.0.jar
42
- - vendor/jface/org.eclipse.osgi.jar
43
- - vendor/jface/org.eclipse.text_3.5.0.v20090513-2000.jar
44
- - vendor/swt/swt-linux32.jar
45
- - vendor/swt/swt-linux64.jar
46
- - vendor/swt/swt-osx32.jar
47
- - vendor/swt/swt-osx64.jar
48
- - vendor/swt/swt-win32.jar
49
- - vendor/swt/swt-win64.jar
50
- - vendor/swtbot/org.apache.log4j_1.2.13.v200903072027.jar
51
- - vendor/swtbot/org.eclipse.swtbot.junit4_x_2.0.4.20110304_0338-e5aff47-dev-e36.jar
52
- - vendor/swtbot/org.eclipse.swtbot.swt.finder_2.0.4.20110304_0338-e5aff47-dev-e36.jar
53
- - vendor/swtbot/org.hamcrest.core_1.1.0.v20090501071000.jar
54
- - vendor/swtbot/org.hamcrest.integration_1.1.0.v20090501071000.jar
55
- - vendor/swtbot/org.hamcrest.library_1.1.0.v20090501071000.jar
56
- - vendor/swtbot/org.hamcrest.text_1.1.0.v20090501071000.jar
57
- - vendor/swtbot/org.hamcrest_1.1.0.v20090501071000.jar
24
+
25
+ files:
26
+ - bin/swt_cucumber
27
+ - lib/swt.rb
28
+ - lib/swt/cucumber_patches.rb
29
+ - lib/swt/cucumber_runner.rb
30
+ - lib/swt/event_loop.rb
31
+ - lib/swt/full.rb
32
+ - lib/swt/grid_data.rb
33
+ - lib/swt/jar_loader.rb
34
+ - lib/swt/minimal.rb
35
+ - lib/swt/swt_bot_extensions.rb
36
+ - LICENSE
37
+ - README.md
38
+ - vendor/jface/org.eclipse.core.commands.jar
39
+ - vendor/jface/org.eclipse.core.jobs.jar
40
+ - vendor/jface/org.eclipse.core.resources.jar
41
+ - vendor/jface/org.eclipse.core.runtime_3.5.0.v20090525.jar
42
+ - vendor/jface/org.eclipse.equinox.common.jar
43
+ - vendor/jface/org.eclipse.jface.databinding_1.3.0.I20090525-2000.jar
44
+ - vendor/jface/org.eclipse.jface.jar
45
+ - vendor/jface/org.eclipse.jface.text_3.5.0.jar
46
+ - vendor/jface/org.eclipse.osgi.jar
47
+ - vendor/jface/org.eclipse.text_3.5.0.v20090513-2000.jar
48
+ - vendor/swt/swt-linux32.jar
49
+ - vendor/swt/swt-linux64.jar
50
+ - vendor/swt/swt-osx32.jar
51
+ - vendor/swt/swt-osx64.jar
52
+ - vendor/swt/swt-win32.jar
53
+ - vendor/swt/swt-win64.jar
54
+ - vendor/swtbot/org.apache.log4j_1.2.13.v200903072027.jar
55
+ - vendor/swtbot/org.eclipse.swtbot.junit4_x_2.0.4.20110304_0338-e5aff47-dev-e36.jar
56
+ - vendor/swtbot/org.eclipse.swtbot.swt.finder_2.0.4.20110304_0338-e5aff47-dev-e36.jar
57
+ - vendor/swtbot/org.hamcrest.core_1.1.0.v20090501071000.jar
58
+ - vendor/swtbot/org.hamcrest.integration_1.1.0.v20090501071000.jar
59
+ - vendor/swtbot/org.hamcrest.library_1.1.0.v20090501071000.jar
60
+ - vendor/swtbot/org.hamcrest.text_1.1.0.v20090501071000.jar
61
+ - vendor/swtbot/org.hamcrest_1.1.0.v20090501071000.jar
58
62
  homepage: http://github.com/danlucraft/swt
59
63
  licenses: []
64
+
60
65
  post_install_message:
61
66
  rdoc_options: []
62
- require_paths:
63
- - lib
64
- required_ruby_version: !ruby/object:Gem::Requirement
67
+
68
+ require_paths:
69
+ - lib
70
+ required_ruby_version: !ruby/object:Gem::Requirement
65
71
  none: false
66
- requirements:
67
- - - ! '>='
68
- - !ruby/object:Gem::Version
69
- version: '0'
70
- required_rubygems_version: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: "0"
76
+ required_rubygems_version: !ruby/object:Gem::Requirement
71
77
  none: false
72
- requirements:
73
- - - ! '>='
74
- - !ruby/object:Gem::Version
75
- version: '0'
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: "0"
76
82
  requirements: []
83
+
77
84
  rubyforge_project:
78
- rubygems_version: 1.8.10
85
+ rubygems_version: 1.8.24
79
86
  signing_key:
80
87
  specification_version: 3
81
- summary: The SWT library available to JRuby.
88
+ summary: The SWT toolkit for JRuby.
82
89
  test_files: []
90
+