glimmer 1.0.10 → 1.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +8 -8
- data/VERSION +1 -1
- data/glimmer.gemspec +4 -3
- data/lib/glimmer.rb +4 -1
- data/lib/glimmer/data_binding/observable_array.rb +1 -0
- data/lib/glimmer/data_binding/observable_model.rb +1 -0
- data/lib/glimmer/data_binding/observer.rb +4 -0
- data/lib/glimmer/ext/module.rb +11 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3eeec678c8abf8158b8c5e2aae601ac5b948b8afb439f3ce38e9bacfe52b7e6
|
4
|
+
data.tar.gz: c1f3f723b52186e4fbdb887c7ac64a94b169438c0ad76ac2e17799477d69829f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7a486ae6ac0997c1bc766e98971c566073a2db945b53c9a44b6769d8b43c16d9f6d0bb701c771ad9c724b0eb327f9bd9161e7afe0b7127ebf76bb58a1444673
|
7
|
+
data.tar.gz: 4e95589b1c6f396828382274634e7b54650d709b8184e182273373cbc87478350fdec00f22071fd35f94d2695985c939932ee7e103a532c41afadcb554dacd4a
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,11 @@
|
|
3
3
|
Related Change Logs:
|
4
4
|
- [glimmer-dsl-swt/CHANGELOG.md](https://github.com/AndyObtiva/glimmer-dsl-swt/blob/master/CHANGELOG.md)
|
5
5
|
|
6
|
+
## 1.0.11
|
7
|
+
|
8
|
+
- Alias unregister as deregister everywhere
|
9
|
+
- Optimize performance of `Glimmer::Config.excluded_keyword_checkers` in glimmer method_missing
|
10
|
+
|
6
11
|
## 1.0.10
|
7
12
|
|
8
13
|
- Avoid using concurrent-ruby in Opal
|
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 style="position: relative; top: 20px;" />](https://rubygems.org/gems/glimmer) Glimmer 1.0.
|
1
|
+
# [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=85 style="position: relative; top: 20px;" />](https://rubygems.org/gems/glimmer) Glimmer 1.0.11 - DSL Framework
|
2
2
|
[![Gem Version](https://badge.fury.io/rb/glimmer.svg)](http://badge.fury.io/rb/glimmer)
|
3
3
|
[![rspec](https://github.com/AndyObtiva/glimmer/workflows/rspec/badge.svg)](https://github.com/AndyObtiva/glimmer/actions?query=workflow%3Arspec)
|
4
4
|
[![Coverage Status](https://coveralls.io/repos/github/AndyObtiva/glimmer/badge.svg?branch=master)](https://coveralls.io/github/AndyObtiva/glimmer?branch=master)
|
@@ -32,19 +32,19 @@ Featured in JRuby Cookbook](http://shop.oreilly.com/product/9780596519650.do) an
|
|
32
32
|
- [glimmer-dsl-opal](https://github.com/AndyObtiva/glimmer-dsl-opal): Glimmer DSL for Opal (Pure Ruby Web GUI and Auto-Webifier of Desktop Apps)
|
33
33
|
- [glimmer-dsl-xml](https://github.com/AndyObtiva/glimmer-dsl-xml): Glimmer DSL for XML (& HTML)
|
34
34
|
- [glimmer-dsl-css](https://github.com/AndyObtiva/glimmer-dsl-css): Glimmer DSL for CSS
|
35
|
-
- [glimmer-dsl-tk](https://github.com/AndyObtiva/glimmer-dsl-tk): Glimmer DSL for Tk (Ruby Desktop Development GUI Library)
|
35
|
+
- [glimmer-dsl-tk](https://github.com/AndyObtiva/glimmer-dsl-tk): Glimmer DSL for Tk (MRI Ruby Desktop Development GUI Library)
|
36
36
|
|
37
37
|
[Glimmer and/or Glimmer DSLs receive two updates per month](https://rubygems.org/gems/glimmer-dsl-swt/versions). You can trust [Glimmer](https://rubygems.org/gems/glimmer) with your Ruby development needs.
|
38
38
|
|
39
39
|
## Table of Contents
|
40
40
|
|
41
|
-
- [Glimmer 1.0.
|
41
|
+
- [Glimmer 1.0.11](#-glimmer-1011---dsl-framework)
|
42
42
|
- [Official DSLs](#official-dsls)
|
43
43
|
- [Glimmer DSL for SWT (JRuby Desktop Development GUI Framework)](#glimmer-dsl-for-swt-jruby-desktop-development-gui-framework)
|
44
44
|
- [Glimmer DSL for Opal (Pure Ruby Web GUI and Auto-Webifier of Desktop Apps)](#glimmer-dsl-for-opal-pure-ruby-web-gui-and-auto-webifier-of-desktop-apps)
|
45
45
|
- [Glimmer DSL for XML (& HTML)](#glimmer-dsl-for-xml--html)
|
46
46
|
- [Glimmer DSL for CSS](#glimmer-dsl-for-css)
|
47
|
-
- [Glimmer DSL for Tk (Ruby Desktop Development GUI Library)](#glimmer-dsl-for-tk-ruby-desktop-development-gui-library)
|
47
|
+
- [Glimmer DSL for Tk (MRI Ruby Desktop Development GUI Library)](#glimmer-dsl-for-tk-mri-ruby-desktop-development-gui-library)
|
48
48
|
- [DSL Engine](#dsl-engine)
|
49
49
|
- [Multi-DSL Support](#multi-dsl-support)
|
50
50
|
- [Data-Binding Library](#data-binding-library)
|
@@ -540,13 +540,13 @@ Output:
|
|
540
540
|
body{font-size:1.1em;background:white}body > h1{background-color:red;font-size:2em}
|
541
541
|
```
|
542
542
|
|
543
|
-
### Glimmer DSL for Tk (Ruby Desktop Development GUI Library)
|
543
|
+
### Glimmer DSL for Tk (MRI Ruby Desktop Development GUI Library)
|
544
544
|
|
545
545
|
[Tcl/Tk](https://www.tcl.tk/) has evolved into a practical desktop GUI toolkit due to gaining truely native looking widgets on Mac, Windows, and Linux in [Tk version 8.5](https://www.tcl.tk/software/tcltk/8.5.html#:~:text=Highlights%20of%20Tk%208.5&text=Font%20rendering%3A%20Now%20uses%20anti,and%20window%20layout%2C%20and%20more.).
|
546
546
|
|
547
547
|
Additionally, [Ruby](https://www.ruby-lang.org/en/) 3.0 Ractor (formerly known as [Guilds](https://olivierlacan.com/posts/concurrency-in-ruby-3-with-guilds/)) supports truly parallel multi-threading, making both [MRI](https://github.com/ruby/ruby) and [Tk](https://www.tcl.tk/) finally viable for support in [Glimmer](https://github.com/AndyObtiva/glimmer) (Ruby Desktop Development GUI Library) as an alternative to [JRuby on SWT](https://github.com/AndyObtiva/glimmer-dsl-swt).
|
548
548
|
|
549
|
-
The trade-off is that while [SWT](https://www.eclipse.org/swt/) provides a plethora of high quality reusable widgets for the Enterprise (such as [Nebula](https://www.eclipse.org/nebula/)), [Tk](https://www.tcl.tk/) enables very fast app startup time via [MRI Ruby](https://www.ruby-lang.org/en/).
|
549
|
+
The trade-off is that while [SWT](https://www.eclipse.org/swt/) provides a plethora of high quality reusable widgets for the Enterprise (such as [Nebula](https://www.eclipse.org/nebula/)), [Tk](https://www.tcl.tk/) enables very fast app startup time and a small memory footprint via [MRI Ruby](https://www.ruby-lang.org/en/).
|
550
550
|
|
551
551
|
[Glimmer DSL for Tk](https://github.com/AndyObtiva/glimmer-dsl-tk) aims to provide a DSL similar to the [Glimmer DSL for SWT](https://github.com/AndyObtiva/glimmer-dsl-swt) to enable more productive desktop development in Ruby with:
|
552
552
|
- Declarative DSL syntax that visually maps to the GUI widget hierarchy
|
@@ -914,8 +914,8 @@ If you would like to contribute to Glimmer, please study up on Glimmer and [SWT]
|
|
914
914
|
|
915
915
|
You may apply for contributing to any of these Glimmer DSL gems whether you prefer to focus on the desktop or web:
|
916
916
|
- [glimmer-dsl-swt](https://github.com/AndyObtiva/glimmer-dsl-swt): Glimmer DSL for SWT (JRuby Desktop Development GUI Framework)
|
917
|
-
- [glimmer-dsl-tk](https://github.com/AndyObtiva/glimmer-dsl-tk): Glimmer DSL for Tk (Ruby Desktop Development GUI Library)
|
918
|
-
- [glimmer-dsl-opal](https://github.com/AndyObtiva/glimmer-dsl-opal): Glimmer DSL for Opal (Web GUI
|
917
|
+
- [glimmer-dsl-tk](https://github.com/AndyObtiva/glimmer-dsl-tk): Glimmer DSL for Tk (MRI Ruby Desktop Development GUI Library)
|
918
|
+
- [glimmer-dsl-opal](https://github.com/AndyObtiva/glimmer-dsl-opal): Glimmer DSL for Opal (Pure Ruby Web GUI and Auto-Webifier of Desktop Apps)
|
919
919
|
- [glimmer-dsl-xml](https://github.com/AndyObtiva/glimmer-dsl-xml): Glimmer DSL for XML (& HTML)
|
920
920
|
- [glimmer-dsl-css](https://github.com/AndyObtiva/glimmer-dsl-css): Glimmer DSL for CSS
|
921
921
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.11
|
data/glimmer.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: glimmer 1.0.
|
5
|
+
# stub: glimmer 1.0.11 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "glimmer".freeze
|
9
|
-
s.version = "1.0.
|
9
|
+
s.version = "1.0.11"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib".freeze]
|
13
13
|
s.authors = ["AndyMaleh".freeze]
|
14
|
-
s.date = "2021-01-
|
14
|
+
s.date = "2021-01-27"
|
15
15
|
s.description = "Glimmer is a Ruby DSL Framework consisting of a DSL Engine and an Observable/Observer/Data-Binding Library. Used in the Glimmer DSL for SWT (JRuby Desktop Development GUI Framework), the Glimmer DSL for Tk (Ruby Desktop Development GUI Library), the Glimmer DSL for Opal (Pure Ruby Web GUI and Auto-Webifier of Desktop Apps), the Glimmer DSL for XML (& HTML), and the Glimmer DSL for CSS.".freeze
|
16
16
|
s.email = "andy.am@gmail.com".freeze
|
17
17
|
s.extra_rdoc_files = [
|
@@ -40,6 +40,7 @@ Gem::Specification.new do |s|
|
|
40
40
|
"lib/glimmer/dsl/static_expression.rb",
|
41
41
|
"lib/glimmer/dsl/top_level_expression.rb",
|
42
42
|
"lib/glimmer/error.rb",
|
43
|
+
"lib/glimmer/ext/module.rb",
|
43
44
|
"lib/glimmer/invalid_keyword_error.rb"
|
44
45
|
]
|
45
46
|
s.homepage = "http://github.com/AndyObtiva/glimmer".freeze
|
data/lib/glimmer.rb
CHANGED
@@ -35,6 +35,7 @@ end
|
|
35
35
|
$LOAD_PATH.unshift(File.expand_path('..', __FILE__))
|
36
36
|
|
37
37
|
require 'glimmer/config'
|
38
|
+
require 'glimmer/ext/module'
|
38
39
|
|
39
40
|
# Glimmer provides a JRuby Desktop UI DSL + Data-Binding functionality
|
40
41
|
#
|
@@ -65,7 +66,9 @@ module Glimmer
|
|
65
66
|
|
66
67
|
def method_missing(method_symbol, *args, &block)
|
67
68
|
# This if statement speeds up Glimmer in girb or whenever directly including on main object
|
68
|
-
is_excluded = Config.excluded_keyword_checkers.
|
69
|
+
is_excluded = Config.excluded_keyword_checkers.any? do |checker|
|
70
|
+
instance_exec(method_symbol, *args, &checker)
|
71
|
+
end
|
69
72
|
if is_excluded
|
70
73
|
Glimmer::Config.logger.debug "Glimmer excluded keyword: #{method_symbol}" if Glimmer::Config.log_excluded_keywords?
|
71
74
|
super(method_symbol, *args, &block)
|
@@ -289,6 +289,7 @@ module Glimmer
|
|
289
289
|
return unless old_value.is_a?(ObservableModel) || old_value.is_a?(ObservableArray)
|
290
290
|
property_observer_list.each { |observer| observer.unregister_dependents_with_observable(observer.registration_for(self), old_value) }
|
291
291
|
end
|
292
|
+
alias deregister_dependent_observers unregister_dependent_observers
|
292
293
|
end
|
293
294
|
end
|
294
295
|
end
|
@@ -124,6 +124,7 @@ module Glimmer
|
|
124
124
|
return unless old_value.is_a?(ObservableModel) || old_value.is_a?(ObservableArray)
|
125
125
|
property_observer_list(property_name).each { |observer| observer.unregister_dependents_with_observable(observer.registration_for(self, property_name), old_value) }
|
126
126
|
end
|
127
|
+
alias deregister_dependent_observers unregister_dependent_observers
|
127
128
|
|
128
129
|
def ensure_array_object_observer(property_name, object, old_object = nil)
|
129
130
|
return unless object&.is_a?(Array)
|
@@ -110,6 +110,7 @@ module Glimmer
|
|
110
110
|
end
|
111
111
|
end
|
112
112
|
alias unobserve unregister
|
113
|
+
alias deregister unregister
|
113
114
|
|
114
115
|
def unregister_dependents_with_observable(registration, dependent_observable)
|
115
116
|
thedependents = dependents_for(registration).select do |thedependent|
|
@@ -117,12 +118,15 @@ module Glimmer
|
|
117
118
|
end
|
118
119
|
thedependents.each(&:unregister)
|
119
120
|
end
|
121
|
+
alias unobserve_dependents_with_observable unregister_dependents_with_observable
|
122
|
+
alias deregister_dependents_with_observable unregister_dependents_with_observable
|
120
123
|
|
121
124
|
# cleans up all registrations in observables
|
122
125
|
def unregister_all_observables
|
123
126
|
registrations.each(&:unregister)
|
124
127
|
end
|
125
128
|
alias unobserve_all_observables unregister_all_observables
|
129
|
+
alias deregister_all_observables unregister_all_observables
|
126
130
|
|
127
131
|
# add dependent observer to unregister when unregistering observer
|
128
132
|
def add_dependent(parent_to_dependent_hash)
|
@@ -0,0 +1,11 @@
|
|
1
|
+
class Module
|
2
|
+
alias append_features_without_glimmer append_features
|
3
|
+
def append_features(mod)
|
4
|
+
if self == Glimmer && mod == Object
|
5
|
+
Glimmer::Config.logger.debug { 'Appending Glimmer to Singleton Class of main object (not appending to Object everywhere to avoid method pollution)' }
|
6
|
+
TOPLEVEL_BINDING.receiver.singleton_class.include(self)
|
7
|
+
else
|
8
|
+
append_features_without_glimmer(mod)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glimmer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- AndyMaleh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-01-
|
11
|
+
date: 2021-01-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: array_include_methods
|
@@ -261,6 +261,7 @@ files:
|
|
261
261
|
- lib/glimmer/dsl/static_expression.rb
|
262
262
|
- lib/glimmer/dsl/top_level_expression.rb
|
263
263
|
- lib/glimmer/error.rb
|
264
|
+
- lib/glimmer/ext/module.rb
|
264
265
|
- lib/glimmer/invalid_keyword_error.rb
|
265
266
|
homepage: http://github.com/AndyObtiva/glimmer
|
266
267
|
licenses:
|