glimmer 2.7.7 → 2.7.8

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: 6f69d4baf83adc6b4c760ee2be236105fcc4b0f963bd712567d2dcbb345fd319
4
- data.tar.gz: 8ef8a935aaba3edb94d8e6a86ef0c7c3ef3adbab28854910acc58a001f2bc559
3
+ metadata.gz: 9344c9d26e07e46cbc656676e2e9cf172ce9d548f8cdf656feedc8d182b6889b
4
+ data.tar.gz: ed8202f9ec5f451b4a1b9a0cd827199566193a73c1003b254de572db157bf8b1
5
5
  SHA512:
6
- metadata.gz: 8172f3bbaf39711ea2f231281625b17e1059bccde3cde0940c201335bd5a2b9807c2e74be252fbf4db56907125b7cf885d296f98c8ce578931d39653cd494139
7
- data.tar.gz: 0ca9c4f45ed0b7de166bae30b320da8a29592d3e3e34b3074b55665611a99e393deb878eddfcb855a8388ccf3d84d121d1bdd9790d093fe787da51cdba6e449e
6
+ metadata.gz: cda64ce7e21ae4f2ef9bf449c460c406a5bde39b177098f30129031b4c8fa25695966c34dfbfc5c3599e24c374a2240c02f833b5b831df998479102cd40e312b
7
+ data.tar.gz: 2fc3aaad22c7e9f01080ece384dc4740875a1d9c81bd95a9f006316bbe1bccabb2e7fb90e99956bd33e8ac44dbdd8ce2fc16f76198713efe491d8f1e279c7bc4
data/CHANGELOG.md CHANGED
@@ -3,6 +3,13 @@
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
+ ### 2.7.8
7
+
8
+ - Allow passing `BindExpression` only 1 argument (e.g. presenter.todos) or 1 argument + 1 hash (e.g. presenter.todos, on_read: -> {})
9
+ - `ObserveExpression` always uses `ModelBinding` for arguments to leverage its advanced features, like nested/computed/indexed/keyed data-binding
10
+ - In Opal, `ModelBinding` converters/hooks do not require an argument anymore (e.g. can invoke `after_write: -> { do_something }` without block args)
11
+ - Fix issue whereby observing `model, :collection` was not firing on collection changes, but observing `model.collection` was firing on collection changes (now both fire on collection changes)
12
+
6
13
  ### 2.7.7
7
14
 
8
15
  - Relax `array_include_methods` gem dependency to '>= 1.4.0', '< 1.6.0'
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 2.7.7
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 2.7.8
2
2
  ## DSL Framework for Ruby GUI and More
3
3
  [![Gem Version](https://badge.fury.io/rb/glimmer.svg)](http://badge.fury.io/rb/glimmer)
4
4
  [![rspec](https://github.com/AndyObtiva/glimmer/workflows/rspec/badge.svg)](https://github.com/AndyObtiva/glimmer/actions?query=workflow%3Arspec)
@@ -43,6 +43,7 @@ Featured in JRuby Cookbook](http://shop.oreilly.com/product/9780596519650.do) an
43
43
  Start by checking out:
44
44
  - [Glimmer DSL for SWT](https://github.com/AndyObtiva/glimmer-dsl-swt), Glimmer's original GUI DSL (for [JRuby](https://www.jruby.org/)), which got extracted into its own [Ruby gem](https://rubygems.org/gems/glimmer-dsl-swt).
45
45
  - [Glimmer DSL for LibUI](https://github.com/AndyObtiva/glimmer-dsl-libui), Glimmer's GUI DSL for standard [Ruby](https://www.ruby-lang.org/) (aka MRI Ruby or CRuby), which has no prerequisites beyond installing the [Ruby gem](https://rubygems.org/gems/glimmer-dsl-libui), and has won a [Fukuoka Ruby 2022 Special Award](https://andymaleh.blogspot.com/2022/02/glimmer-dsl-for-libui-wins-fukuoka-ruby.html).
46
+ - [Glimmer DSL for Web](https://github.com/AndyObtiva/glimmer-dsl-web) enables using all the advanced data-binding features of Glimmer in Web Frontends by providing a Ruby HTML DSL and a Ruby CSS DSL.
46
47
 
47
48
  ## [Glimmer](https://rubygems.org/gems/glimmer) DSL Comparison Table:
48
49
  DSL | Platforms | Native? | Vector Graphics? | Pros | Cons | Prereqs
@@ -267,7 +268,7 @@ end
267
268
  ### Setup
268
269
 
269
270
  Follow these steps to author a [Glimmer](https://rubygems.org/gems/glimmer) DSL:
270
- - Add `gem 'glimmer', '~> 2.7.7'` to `Gemfile` and run `bundle` or run `gem install glimmer -v2.7.7` and add `require 'glimmer'`
271
+ - Add `gem 'glimmer', '~> 2.7.8'` to `Gemfile` and run `bundle` or run `gem install glimmer -v2.7.8` and add `require 'glimmer'`
271
272
  - Create `glimmer/dsl/[dsl_name]/dsl.rb`, which requires and adds all dynamic expressions for the [dsl_name] Glimmer DSL module as per the code shown in the previous section (or [Official DSLs](#official-dsls) as examples)
272
273
  - Create `glimmer/dsl/[dsl_name]/[expresion_name]_expresion.rb` for every [expresion_name] expression needed, whether dynamic or static
273
274
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.7.7
1
+ 2.7.8
data/glimmer.gemspec CHANGED
@@ -2,17 +2,17 @@
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 2.7.7 ruby lib
5
+ # stub: glimmer 2.7.8 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "glimmer".freeze
9
- s.version = "2.7.7".freeze
9
+ s.version = "2.7.8"
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 = "2024-01-10"
15
- s.description = "Glimmer is a Ruby DSL Framework for Ruby GUI and More, consisting of a DSL Engine and a Data-Binding Library (including Observer Design Pattern, Observable Model, Observable Array, and Observable Hash). Used in Glimmer DSL for SWT (JRuby Desktop Development GUI Framework), Glimmer DSL for Opal (Pure Ruby Web GUI and Auto-Webifier of Desktop Apps), Glimmer DSL for LibUI (Prerequisite-Free Ruby Desktop Development GUI Library and Winner of Fukuoka Ruby Award Competition 2022 Special Award), Glimmer DSL for Tk (Ruby Tk Desktop Development GUI Library), Glimmer DSL for GTK (Ruby-GNOME Desktop Development GUI Library), Glimmer DSL for FX (FOX Toolkit Ruby Desktop Development GUI Library), Glimmer DSL for WX (wxWidgets Ruby Desktop Development GUI Library), Glimmer DSL for Swing (JRuby Swing Desktop Development GUI Library), Glimmer DSL for JFX (JRuby JavaFX Desktop Development GUI Library), Glimmer DSL for XML (& HTML), and Glimmer DSL for CSS.".freeze
14
+ s.date = "2024-07-01"
15
+ s.description = "Glimmer is a Ruby DSL Framework for Ruby GUI and More, consisting of a DSL Engine and a Data-Binding Library (including Observer Design Pattern, Observable Model, Observable Array, and Observable Hash). Used in Glimmer DSL for SWT (JRuby Desktop Development GUI Framework), Glimmer DSL for Web (Ruby in the Browser Web Frontend Framework), Glimmer DSL for LibUI (Prerequisite-Free Ruby Desktop Development GUI Library and Winner of Fukuoka Ruby Award Competition 2022 Special Award), Glimmer DSL for Tk (Ruby Tk Desktop Development GUI Library), Glimmer DSL for GTK (Ruby-GNOME Desktop Development GUI Library), Glimmer DSL for FX (FOX Toolkit Ruby Desktop Development GUI Library), Glimmer DSL for WX (wxWidgets Ruby Desktop Development GUI Library), Glimmer DSL for Swing (JRuby Swing Desktop Development GUI Library), Glimmer DSL for JFX (JRuby JavaFX Desktop Development GUI Library), Glimmer DSL for XML (& HTML), and Glimmer DSL for CSS.".freeze
16
16
  s.email = "andy.am@gmail.com".freeze
17
17
  s.extra_rdoc_files = [
18
18
  "CHANGELOG.md",
@@ -53,22 +53,22 @@ Gem::Specification.new do |s|
53
53
  ]
54
54
  s.homepage = "http://github.com/AndyObtiva/glimmer".freeze
55
55
  s.licenses = ["MIT".freeze]
56
- s.rubygems_version = "3.5.3".freeze
56
+ s.rubygems_version = "3.4.10".freeze
57
57
  s.summary = "Glimmer (DSL Framework for Ruby GUI and More)".freeze
58
58
 
59
59
  s.specification_version = 4
60
60
 
61
- s.add_runtime_dependency(%q<array_include_methods>.freeze, [">= 1.4.0".freeze, "< 1.6.0".freeze])
62
- s.add_runtime_dependency(%q<facets>.freeze, [">= 3.1.0".freeze, "< 4.0.0".freeze])
63
- s.add_development_dependency(%q<rspec-mocks>.freeze, ["~> 3.5.0".freeze])
64
- s.add_development_dependency(%q<rspec>.freeze, ["~> 3.5.0".freeze])
65
- s.add_development_dependency(%q<puts_debuggerer>.freeze, ["~> 0.13".freeze])
66
- s.add_development_dependency(%q<rake>.freeze, [">= 10.1.0".freeze, "< 14.0.0".freeze])
67
- s.add_development_dependency(%q<jeweler>.freeze, [">= 2.0.0".freeze, "< 3.0.0".freeze])
68
- s.add_development_dependency(%q<rdoc>.freeze, [">= 6.2.1".freeze, "< 7.0.0".freeze])
69
- s.add_development_dependency(%q<coveralls>.freeze, [">= 0".freeze])
70
- s.add_development_dependency(%q<simplecov>.freeze, ["~> 0.16.1".freeze])
71
- s.add_development_dependency(%q<simplecov-lcov>.freeze, ["~> 0.7.0".freeze])
72
- s.add_development_dependency(%q<rake-tui>.freeze, ["> 0".freeze])
61
+ s.add_runtime_dependency(%q<array_include_methods>.freeze, [">= 1.4.0", "< 1.6.0"])
62
+ s.add_runtime_dependency(%q<facets>.freeze, [">= 3.1.0", "< 4.0.0"])
63
+ s.add_development_dependency(%q<rspec-mocks>.freeze, ["~> 3.5.0"])
64
+ s.add_development_dependency(%q<rspec>.freeze, ["~> 3.5.0"])
65
+ s.add_development_dependency(%q<puts_debuggerer>.freeze, [">= 1.0.1"])
66
+ s.add_development_dependency(%q<rake>.freeze, [">= 10.1.0", "< 14.0.0"])
67
+ s.add_development_dependency(%q<jeweler>.freeze, [">= 2.0.0", "< 3.0.0"])
68
+ s.add_development_dependency(%q<rdoc>.freeze, [">= 6.2.1", "< 7.0.0"])
69
+ s.add_development_dependency(%q<coveralls>.freeze, [">= 0"])
70
+ s.add_development_dependency(%q<simplecov>.freeze, ["~> 0.16.1"])
71
+ s.add_development_dependency(%q<simplecov-lcov>.freeze, ["~> 0.7.0"])
72
+ s.add_development_dependency(%q<rake-tui>.freeze, ["> 0"])
73
73
  end
74
74
 
@@ -131,6 +131,8 @@ module Glimmer
131
131
  end
132
132
 
133
133
  def add_observer(observer, extra_options = {})
134
+ # TODO couldn't we have a scenario where it is both computed? and nested_property? at the same time?
135
+ # or computed and not nested at the same time (else statement)?
134
136
  if computed?
135
137
  add_computed_observers(observer)
136
138
  elsif nested_property?
@@ -252,12 +254,7 @@ module Glimmer
252
254
 
253
255
  def invoke_proc_with_exact_parameters(proc_object, *args)
254
256
  return if proc_object.nil?
255
- if RUBY_ENGINE == 'opal'
256
- # opal doesn't support proc_object.parameters.size properly it seems
257
- args = Concurrent::Array.new(args[0...1])
258
- else
259
- args = Concurrent::Array.new(args[0...proc_object.parameters.size])
260
- end
257
+ args = Concurrent::Array.new(args[0...proc_object.parameters.size])
261
258
  proc_object.call(*args)
262
259
  end
263
260
 
@@ -54,6 +54,7 @@ module Glimmer
54
54
  initialize_observer_options(options)
55
55
  return observer if has_observer?(observer, property_name)
56
56
  property_observer_list(property_name) << observer
57
+ # if property writer does not exist, add_property_writer_observers will ensure_array_object_observer only
57
58
  add_property_writer_observers(property_name, options)
58
59
  open_struct_loaded = !!::OpenStruct rescue false
59
60
  add_key_writer_observer(property_name, options) if is_a?(Struct) || (open_struct_loaded && is_a?(OpenStruct))
@@ -116,8 +117,8 @@ module Glimmer
116
117
  options[:attribute_writer_type].each do |attribute_writer_type|
117
118
  begin
118
119
  property_writer_name = attribute_writer_type.to_s.gsub('attribute', property_name.to_s)
119
- method(property_writer_name)
120
120
  ensure_array_object_observer(property_name, send(property_name), nil, options)
121
+ method(property_writer_name)
121
122
  begin
122
123
  method("__original__#{property_writer_name}")
123
124
  rescue
@@ -31,9 +31,16 @@ module Glimmer
31
31
  (
32
32
  keyword == 'bind' and
33
33
  (
34
+ (
35
+ (args.size == 1)
36
+ ) ||
34
37
  (
35
38
  (args.size == 2) and
36
39
  textual?(args[1])
40
+ ) ||
41
+ (
42
+ (args.size == 2) and
43
+ (args[1].is_a?(Hash))
37
44
  ) ||
38
45
  (
39
46
  (args.size == 3) and
@@ -43,11 +50,12 @@ module Glimmer
43
50
  )
44
51
  )
45
52
  end
53
+
46
54
 
47
55
  def interpret(parent, keyword, *args, &block)
48
- binding_options = args[2] || {}
56
+ binding_options = args.last.is_a?(Hash) ? args.pop : {}
49
57
  binding_options[:on_read] = binding_options.delete(:on_read) || binding_options.delete('on_read') || block
50
- DataBinding::ModelBinding.new(args[0], args[1].to_s, binding_options)
58
+ DataBinding::ModelBinding.new(*args, binding_options)
51
59
  end
52
60
  end
53
61
  end
@@ -36,11 +36,7 @@ module Glimmer
36
36
 
37
37
  def interpret(parent, keyword, *args, &block)
38
38
  observer = DataBinding::Observer.proc(&block)
39
- if args[1].to_s.match(REGEX_NESTED_OR_INDEXED_PROPERTY)
40
- observer_registration = observer.observe(DataBinding::ModelBinding.new(*args))
41
- else
42
- observer_registration = observer.observe(*args)
43
- end
39
+ observer_registration = observer.observe(DataBinding::ModelBinding.new(*args))
44
40
  observer_registration
45
41
  end
46
42
  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: 2.7.7
4
+ version: 2.7.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - AndyMaleh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-10 00:00:00.000000000 Z
11
+ date: 2024-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: array_include_methods
@@ -82,16 +82,16 @@ dependencies:
82
82
  name: puts_debuggerer
83
83
  requirement: !ruby/object:Gem::Requirement
84
84
  requirements:
85
- - - "~>"
85
+ - - ">="
86
86
  - !ruby/object:Gem::Version
87
- version: '0.13'
87
+ version: 1.0.1
88
88
  type: :development
89
89
  prerelease: false
90
90
  version_requirements: !ruby/object:Gem::Requirement
91
91
  requirements:
92
- - - "~>"
92
+ - - ">="
93
93
  - !ruby/object:Gem::Version
94
- version: '0.13'
94
+ version: 1.0.1
95
95
  - !ruby/object:Gem::Dependency
96
96
  name: rake
97
97
  requirement: !ruby/object:Gem::Requirement
@@ -211,15 +211,15 @@ dependencies:
211
211
  description: Glimmer is a Ruby DSL Framework for Ruby GUI and More, consisting of
212
212
  a DSL Engine and a Data-Binding Library (including Observer Design Pattern, Observable
213
213
  Model, Observable Array, and Observable Hash). Used in Glimmer DSL for SWT (JRuby
214
- Desktop Development GUI Framework), Glimmer DSL for Opal (Pure Ruby Web GUI and
215
- Auto-Webifier of Desktop Apps), Glimmer DSL for LibUI (Prerequisite-Free Ruby Desktop
216
- Development GUI Library and Winner of Fukuoka Ruby Award Competition 2022 Special
217
- Award), Glimmer DSL for Tk (Ruby Tk Desktop Development GUI Library), Glimmer DSL
218
- for GTK (Ruby-GNOME Desktop Development GUI Library), Glimmer DSL for FX (FOX Toolkit
219
- Ruby Desktop Development GUI Library), Glimmer DSL for WX (wxWidgets Ruby Desktop
220
- Development GUI Library), Glimmer DSL for Swing (JRuby Swing Desktop Development
221
- GUI Library), Glimmer DSL for JFX (JRuby JavaFX Desktop Development GUI Library),
222
- Glimmer DSL for XML (& HTML), and Glimmer DSL for CSS.
214
+ Desktop Development GUI Framework), Glimmer DSL for Web (Ruby in the Browser Web
215
+ Frontend Framework), Glimmer DSL for LibUI (Prerequisite-Free Ruby Desktop Development
216
+ GUI Library and Winner of Fukuoka Ruby Award Competition 2022 Special Award), Glimmer
217
+ DSL for Tk (Ruby Tk Desktop Development GUI Library), Glimmer DSL for GTK (Ruby-GNOME
218
+ Desktop Development GUI Library), Glimmer DSL for FX (FOX Toolkit Ruby Desktop Development
219
+ GUI Library), Glimmer DSL for WX (wxWidgets Ruby Desktop Development GUI Library),
220
+ Glimmer DSL for Swing (JRuby Swing Desktop Development GUI Library), Glimmer DSL
221
+ for JFX (JRuby JavaFX Desktop Development GUI Library), Glimmer DSL for XML (& HTML),
222
+ and Glimmer DSL for CSS.
223
223
  email: andy.am@gmail.com
224
224
  executables: []
225
225
  extensions: []
@@ -277,7 +277,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
277
277
  - !ruby/object:Gem::Version
278
278
  version: '0'
279
279
  requirements: []
280
- rubygems_version: 3.5.3
280
+ rubygems_version: 3.4.10
281
281
  signing_key:
282
282
  specification_version: 4
283
283
  summary: Glimmer (DSL Framework for Ruby GUI and More)