jrubyfx-fxmlloader 0.3-java → 0.4-java

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6dba6126b3ed56424fa13ae880b4f8dda4aed7a5
4
+ data.tar.gz: 21a8be844a4f3d22b1c22462542d01330a856431
5
+ SHA512:
6
+ metadata.gz: c1d0ed616f268fb7727a8bc29d21113d4dd003d86e321f10bda791506baee80d0f0568714418ccc876525866674fc08bfa8562ce96ff215356f1133cd0c10ea1
7
+ data.tar.gz: fa25ff79a1f5311cfa094d900ba057ca3607f7aaa62f03d4c68cadb29662e3e6a261b3ce96a3fbaa1efd627b5147c4a57b9071e26b3478afe14985ddc7091266
data/Rakefile CHANGED
@@ -45,7 +45,7 @@ task :gem => :jar
45
45
 
46
46
  spec = Gem::Specification.new do |s|
47
47
  s.name = 'jrubyfx-fxmlloader'
48
- s.version = '0.3'
48
+ s.version = '0.4'
49
49
  s.platform = 'java'
50
50
  s.has_rdoc = true
51
51
  s.extra_rdoc_files = ['README', 'LICENSE']
@@ -59,6 +59,7 @@ spec = Gem::Specification.new do |s|
59
59
  s.files = %w(LICENSE README Rakefile lib/FXMLLoader-j8.jar) + Dir.glob("{bin,lib,spec}/**/*")
60
60
  s.require_path = "lib"
61
61
  s.bindir = "bin"
62
+ s.license = "GPL-2.0-with-classpath-exception"
62
63
  end
63
64
 
64
65
  Gem::PackageTask.new(spec) do |p|
@@ -68,4 +69,4 @@ Gem::PackageTask.new(spec) do |p|
68
69
  end
69
70
 
70
71
 
71
- task :default => :gem
72
+ task :default => :gem
Binary file
@@ -79,10 +79,6 @@ javax.xml.stream.XMLStreamReader
79
79
  javax.xml.stream.util.StreamReaderDelegate
80
80
 
81
81
  com.sun.javafx.beans.IDProperty
82
- com.sun.javafx.fxml.LoadListener
83
- com.sun.javafx.fxml.ObservableListChangeEvent
84
- com.sun.javafx.fxml.ObservableMapChangeEvent
85
- com.sun.javafx.fxml.PropertyChangeEvent
86
82
  java.net.MalformedURLException
87
83
  java.security.AccessController
88
84
  java.security.PrivilegedAction
@@ -309,12 +305,15 @@ class FxmlLoader
309
305
 
310
306
  @script_engine = nil
311
307
 
312
- $DEBUG_IT_FXML_RB = jit_info.should_jit?
308
+ difx = $DEBUG_IT_FXML_RB # TODO: hack to make this somewhat better at recursion
313
309
  # if we have it cached, use the jitted method
314
310
  if jit_info.compiled?
315
311
  begin
316
312
  return :dont_load if @jruby_ext[:dont_load]
317
- return jit_info.__build_via_jit(@controller, @namespace, @jruby_ext)
313
+ $DEBUG_IT_FXML_RB = jit_info.should_jit?
314
+ res = jit_info.__build_via_jit(@controller, @namespace, @jruby_ext)
315
+ $DEBUG_IT_FXML_RB = difx # restore
316
+ return res
318
317
  rescue Exception, java.lang.Throwable
319
318
  puts "JIT compiled method for #{@location.to_s} FAILED with error:"
320
319
  puts $!
@@ -324,6 +323,8 @@ class FxmlLoader
324
323
  jit_info.decompile
325
324
  end
326
325
  end
326
+
327
+ $DEBUG_IT_FXML_RB = jit_info.should_jit?
327
328
 
328
329
  begin
329
330
  xmlInputFactory = XMLInputFactory.newFactory
@@ -376,6 +377,7 @@ class FxmlLoader
376
377
  $RB_SCRIPT_ENGINE_MAPPINGS = {}
377
378
 
378
379
  @xmlStreamReader = nil
380
+ $DEBUG_IT_FXML_RB = difx # restore
379
381
  return @root
380
382
  end
381
383
 
@@ -663,8 +665,16 @@ class FxmlLoader
663
665
 
664
666
  def loadTypeForPackage(packageName, className=nil)
665
667
  packageName = (packageName + "." + className.gsub('.', '$')) if className
666
- #TODO: fix for ruby stuff
667
- return Java.java.lang.Class::forName(packageName, true, FXL::default_class_loader);
668
+ begin
669
+ return Java.java.lang.Class::forName(packageName, true, FXL::default_class_loader);
670
+ rescue ClassNotFoundException => ex
671
+ # probably ruby class
672
+ begin
673
+ return packageName.constantize_by(".")
674
+ rescue
675
+ raise ex # nope, not our issue anymore
676
+ end
677
+ end
668
678
  end
669
679
  def compareJFXVersions(rtVer, nsVer)
670
680
 
@@ -741,56 +751,6 @@ class FxmlLoader
741
751
  end
742
752
  end
743
753
 
744
- class String
745
-
746
- # steal handy methods from activesupport
747
- # Tries to find a constant with the name specified in the argument string.
748
- #
749
- # 'Module'.constantize # => Module
750
- # 'Test::Unit'.constantize # => Test::Unit
751
- #
752
- # The name is assumed to be the one of a top-level constant, no matter
753
- # whether it starts with "::" or not. No lexical context is taken into
754
- # account:
755
- #
756
- # C = 'outside'
757
- # module M
758
- # C = 'inside'
759
- # C # => 'inside'
760
- # 'C'.constantize # => 'outside', same as ::C
761
- # end
762
- #
763
- # NameError is raised when the name is not in CamelCase or the constant is
764
- # unknown.
765
- def constantize_by(splitter="::")
766
- camel_cased_word = self
767
- names = camel_cased_word.split(splitter)
768
- names.shift if names.empty? || names.first.empty?
769
-
770
- names.inject(Object) do |constant, name|
771
- if constant == Object
772
- constant.const_get(name)
773
- else
774
- candidate = constant.const_get(name)
775
- next candidate if constant.const_defined?(name, false)
776
- next candidate unless Object.const_defined?(name)
777
-
778
- # Go down the ancestors to check it it's owned
779
- # directly before we reach Object or the end of ancestors.
780
- constant = constant.ancestors.inject do |const, ancestor|
781
- break const if ancestor == Object
782
- break ancestor if ancestor.const_defined?(name, false)
783
- const
784
- end
785
-
786
- # owner is in Object, so raise
787
- constant.const_get(name, false)
788
- end
789
- end
790
- end
791
- end
792
-
793
-
794
754
  class SRDelegateClass < StreamReaderDelegate
795
755
  def getPrefix()
796
756
 
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jrubyfx-fxmlloader
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.3'
5
- prerelease:
4
+ version: '0.4'
6
5
  platform: java
7
6
  authors:
8
7
  - Patrick Plenefisch & JRubyFX team & Oracle
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-09-28 00:00:00.000000000 Z
11
+ date: 2014-11-05 00:00:00.000000000 Z
13
12
  dependencies: []
14
13
  description: JRubyFX FxmlLoader gem bits
15
14
  email: simonpatp@gmail.com
@@ -24,15 +23,17 @@ files:
24
23
  - Rakefile
25
24
  - lib/FXMLLoader-j8.jar
26
25
  - lib/jrubyfx-fxmlloader.rb
27
- - lib/fxmlloader/j8_expression_value.rb
28
- - lib/fxmlloader/rrba.rb
29
- - lib/fxmlloader/value_elts.rb
30
- - lib/fxmlloader/fxml_jit_info.rb
31
26
  - lib/fxmlloader/elts.rb
27
+ - lib/fxmlloader/fxml_jit_info.rb
28
+ - lib/fxmlloader/j8_expression_value.rb
32
29
  - lib/fxmlloader/real_elts.rb
33
30
  - lib/fxmlloader/rorba.rb
31
+ - lib/fxmlloader/rrba.rb
32
+ - lib/fxmlloader/value_elts.rb
34
33
  homepage: https://github.com/byteit101/JRubyFX-FXMLLoader
35
- licenses: []
34
+ licenses:
35
+ - GPL-2.0-with-classpath-exception
36
+ metadata: {}
36
37
  post_install_message:
37
38
  rdoc_options: []
38
39
  require_paths:
@@ -42,17 +43,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
42
43
  - - '>='
43
44
  - !ruby/object:Gem::Version
44
45
  version: '0'
45
- none: false
46
46
  required_rubygems_version: !ruby/object:Gem::Requirement
47
47
  requirements:
48
48
  - - '>='
49
49
  - !ruby/object:Gem::Version
50
50
  version: '0'
51
- none: false
52
51
  requirements: []
53
52
  rubyforge_project:
54
- rubygems_version: 1.8.24
53
+ rubygems_version: 2.1.9
55
54
  signing_key:
56
- specification_version: 3
55
+ specification_version: 4
57
56
  summary: GPL'd JavaFX FXMLLoder class in Ruby for JRubyFX
58
57
  test_files: []