glimmer-dsl-swt 0.2.0 → 0.2.1

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
  SHA256:
3
- metadata.gz: 70cb97f3e5f058b49cb24ddbe87281e9db925f6708e03d9d520545878608a3e7
4
- data.tar.gz: 73ad3cf16e2a30f4227135ce0eed679a40d3ca222780b1f9b998535274eed720
3
+ metadata.gz: 0d324a6327e85a840d2a980ba78a47fa9c50e927b409f128c60d9b2ac38f2124
4
+ data.tar.gz: ace770a87429cbaca623310837618e14f12e8375221c433751e1feb13e768eff
5
5
  SHA512:
6
- metadata.gz: 0f0842bb53f0f8703970924e6f21374d1e64c955fd7a7135b4c864d7158221285a5ef9c89b7e01508d1393a5130388d79659672ad0fa4e1c35b4363bb772c47a
7
- data.tar.gz: 65c239a07dd7a216873fbe6f56842c5b2e15ea9d6aa3a77ac301b3e064f2c6521afcb07731ba0a5df20fe7ea877f25716581386621ac987c00a73c77da0988a3
6
+ metadata.gz: 0d7e8c740b9fb6a8993e906a485cdc50241ea5a12664ff4f9ec128de2b2f77ad9718ae41fb0e9bd391546127273769769a1ac259870f2327bd29bba18d40afe3
7
+ data.tar.gz: 56406b25d9ab52e5af2043f33860cbd8cc0a5681b4e7eeba77325122c71cf9897c7bcd6f19ea68e3b3171f1e0dfa07c8d8dc501297fce2e8c83cc37ba3ed024b
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # <img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=85 /> Glimmer DSL for SWT 0.2.0 (Desktop GUI)
1
+ # <img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=85 /> Glimmer DSL for SWT 0.2.1 (Desktop GUI)
2
2
  [![Gem Version](https://badge.fury.io/rb/glimmer-dsl-swt.svg)](http://badge.fury.io/rb/glimmer-dsl-swt)
3
3
  [![Travis CI](https://travis-ci.com/AndyObtiva/glimmer-dsl-swt.svg?branch=master)](https://travis-ci.com/github/AndyObtiva/glimmer-dsl-swt)
4
4
  [![Coverage Status](https://coveralls.io/repos/github/AndyObtiva/glimmer-dsl-swt/badge.svg?branch=master)](https://coveralls.io/github/AndyObtiva/glimmer-dsl-swt?branch=master)
@@ -1 +1 @@
1
- jruby-9.2.11.1
1
+ jruby-9.2.12.0
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.0
1
+ 0.2.1
@@ -3,11 +3,18 @@ require 'glimmer/swt/packages'
3
3
  module Glimmer
4
4
  class << self
5
5
  def included(klass)
6
+ if Object.const_defined?(:ActiveSupport) && ActiveSupport.const_defined?(:Dependencies)
7
+ begin
8
+ ActiveSupport::Dependencies.unhook!
9
+ rescue => e
10
+ # noop TODO support logging unimportant details below debug level
11
+ end
12
+ end
6
13
  if Config.import_swt_packages
7
14
  klass.include(SWT::Packages)
8
15
  klass.extend(SWT::Packages)
9
- klass.extend(Glimmer)
10
16
  end
17
+ klass.extend(Glimmer)
11
18
  end
12
19
  end
13
20
  end
@@ -1,16 +1,24 @@
1
1
  module Glimmer
2
2
  module Config
3
+ DEFAULT_IMPORT_SWT_PACKAGES = [
4
+ 'org.eclipse.swt',
5
+ 'org.eclipse.swt.widgets',
6
+ 'org.eclipse.swt.layout',
7
+ 'org.eclipse.swt.graphics',
8
+ 'org.eclipse.swt.browser',
9
+ 'org.eclipse.swt.custom',
10
+ 'org.eclipse.swt.dnd',
11
+ ]
12
+
3
13
  class << self
4
14
  # Tells Glimmer to import SWT packages into including class (default: true)
5
15
  def import_swt_packages=(value)
6
- @@import_swt_packages = !!value
16
+ @@import_swt_packages = value
7
17
  end
8
18
 
9
19
  # Returns whether Glimmer will import SWT packages into including class
10
20
  def import_swt_packages
11
- unless defined? @@import_swt_packages
12
- @@import_swt_packages = true
13
- end
21
+ @@import_swt_packages = DEFAULT_IMPORT_SWT_PACKAGES if !defined?(@@import_swt_packages) || (defined?(@@import_swt_packages) && @@import_swt_packages == true)
14
22
  @@import_swt_packages
15
23
  end
16
24
  end
@@ -22,14 +22,14 @@ module Glimmer
22
22
  @table.body_root.column_properties = @column_properties
23
23
  end
24
24
  call(@model_binding.evaluate_property)
25
- model = model_binding.base_model
26
- observe(model, model_binding.property_name_expression)
25
+ observe(model_binding)
27
26
  @table.on_widget_disposed do |dispose_event|
28
27
  unregister_all_observables
29
28
  end
30
29
  end
31
30
 
32
31
  def call(new_model_collection=nil)
32
+ new_model_collection = @model_binding.evaluate_property # this ensures applying converters (e.g. :on_read)
33
33
  if new_model_collection and new_model_collection.is_a?(Array)
34
34
  observe(new_model_collection, @column_properties)
35
35
  @model_collection = new_model_collection
@@ -1,14 +1,16 @@
1
+ require 'ext/glimmer/config'
2
+
1
3
  module Glimmer
2
4
  module SWT
3
5
  # This contains Java imports of SWT Java packages
4
6
  module Packages
5
- include_package 'org.eclipse.swt'
6
- include_package 'org.eclipse.swt.widgets'
7
- include_package 'org.eclipse.swt.layout'
8
- include_package 'org.eclipse.swt.graphics'
9
- include_package 'org.eclipse.swt.browser'
10
- include_package 'org.eclipse.swt.custom'
11
- include_package 'org.eclipse.swt.dnd'
7
+ class << self
8
+ def included(klass)
9
+ Glimmer::Config.import_swt_packages.to_a.each do |package|
10
+ include_package(package) if package.is_a?(String)
11
+ end
12
+ end
13
+ end
12
14
  end
13
15
  end
14
16
  end
@@ -75,7 +75,18 @@ module Glimmer
75
75
  if @arg_extractor_mapping[underscored_widget_name]
76
76
  @arg_extractor_mapping[underscored_widget_name].call(args)
77
77
  else
78
- [args, []]
78
+ extra_options = []
79
+ style_args = args.select {|arg| arg.is_a?(Symbol) || arg.is_a?(String)}
80
+ if style_args.any?
81
+ style_arg_start_index = args.index(style_args.first)
82
+ style_arg_last_index = args.index(style_args.last)
83
+ extra_options = args[style_arg_last_index+1..-1]
84
+ args = args[style_arg_start_index..style_arg_last_index]
85
+ elsif args.first.is_a?(Integer)
86
+ extra_options = args[1..-1]
87
+ args = args[0..0]
88
+ end
89
+ [args, extra_options]
79
90
  end
80
91
  end
81
92
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glimmer-dsl-swt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - AndyMaleh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-30 00:00:00.000000000 Z
11
+ date: 2020-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement