glimmer 1.0.3 → 1.0.4

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: 6c811a5ad9035fc6c1694381ae4616a733a6b2df5a24d822b081cd6ed2abe0bf
4
- data.tar.gz: 4de150db297d177b2e040dd0026186f44bd0b8536a574a723332f7cf9c012ca6
3
+ metadata.gz: 6a96adb1115f9dc1c50eba4fcfcc83e154de790c72945dca8038d42263093043
4
+ data.tar.gz: d874c3dd3f138b0a726110a8ea5d1099d2aae952b786e2f4efb28c8c7c7fef99
5
5
  SHA512:
6
- metadata.gz: fcac37985eab50d992b68ea5a0068c0a942609f25980d995d6d2221047af14d5635b61fae3c6a5444a831f5a6683a49a4cb60aa8adc8aee23ef77a3e0341f242
7
- data.tar.gz: 2e398c63b3d8c12230ae177dc7ee91e0a98d48c4131d89264b29fa8cb27784727259a9d1ea130d415692a6264c5384145f7a771f7ac8f95f9fd49ced91cdf604
6
+ metadata.gz: ceda055a6ba36a0690eb473863eccb4e118178a800c06751fe32cdad534a51e4449b1bb42dcc354aa191208d634b08d220bf3e62c58ee67db69769487cdf2833
7
+ data.tar.gz: 4ae5d45861735a8a0e4276150aeb3945c9a9f516a5e5938b5fa08465d643f5214ab667f596590c70ec40fa8fff12bdf03faf347ce22771fcba38d4774e62f0e7
@@ -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.4
7
+
8
+ - Ensure that `ObservableModel#remove_observer` clears observer registrations from `Observer` (just like `Observer#unobserve`)
9
+ - `ObservableModel#remove_observers` and `ObservableModel#remove_all_observers` methods
10
+
6
11
  ## 1.0.3
7
12
 
8
13
  - Upgraded array_include_methods gem to v1.0.4
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.3 - DSL Framework
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.4 - DSL Framework
2
2
  [![Gem Version](https://badge.fury.io/rb/glimmer.svg)](http://badge.fury.io/rb/glimmer)
3
3
  [![Travis CI](https://travis-ci.com/AndyObtiva/glimmer.svg?branch=master)](https://travis-ci.com/github/AndyObtiva/glimmer)
4
4
  [![Coverage Status](https://coveralls.io/repos/github/AndyObtiva/glimmer/badge.svg?branch=master)](https://coveralls.io/github/AndyObtiva/glimmer?branch=master)
@@ -29,7 +29,7 @@ Featured in<br />JRuby Cookbook](http://shop.oreilly.com/product/9780596519650.d
29
29
 
30
30
  ## Table of contents
31
31
 
32
- - [Glimmer 1.0.3](#-glimmer-103)
32
+ - [Glimmer 1.0.4](#-glimmer-104)
33
33
  - [Glimmer DSL for SWT (JRuby Desktop Development GUI Library)](#glimmer-dsl-for-swt-jruby-desktop-development-gui-library)
34
34
  - [Glimmer DSL for SWT Samples](#glimmer-dsl-for-swt-samples)
35
35
  - [Hello, World!](#hello-world)
@@ -67,6 +67,8 @@ Featured in<br />JRuby Cookbook](http://shop.oreilly.com/product/9780596519650.d
67
67
 
68
68
  [Glimmer DSL for SWT](https://github.com/AndyObtiva/glimmer-dsl-swt) is a native-GUI cross-platform desktop development library written in [JRuby](https://www.jruby.org/), an OS-threaded faster version of [Ruby](https://www.ruby-lang.org/en/). [Glimmer](https://rubygems.org/gems/glimmer)'s main innovation is a declarative [Ruby DSL](https://github.com/AndyObtiva/glimmer-dsl-swt#glimmer-dsl-syntax) that enables productive and efficient authoring of desktop application user-interfaces while relying on the robust [Eclipse SWT library](https://www.eclipse.org/swt/). [Glimmer DSL for SWT](https://github.com/AndyObtiva/glimmer-dsl-swt) additionally innovates by having built-in [data-binding](https://github.com/AndyObtiva/glimmer-dsl-swt#data-binding) support, which greatly facilitates synchronizing the GUI with domain models, thus achieving true decoupling of object oriented components and enabling developers to solve business problems (test-first) without worrying about GUI concerns. To get started quickly, [Glimmer DSL for SWT](https://github.com/AndyObtiva/glimmer-dsl-swt) offers [scaffolding](https://github.com/AndyObtiva/glimmer-dsl-swt#scaffolding) options for [Apps](https://github.com/AndyObtiva/glimmer-dsl-swt#in-production), [Gems](https://github.com/AndyObtiva/glimmer-dsl-swt#custom-shell-gem), and [Custom Widgets](https://github.com/AndyObtiva/glimmer-dsl-swt#custom-widgets). [Glimmer DSL for SWT](https://github.com/AndyObtiva/glimmer-dsl-swt) also includes native-executable [packaging](https://github.com/AndyObtiva/glimmer-dsl-swt#packaging--distribution) support, sorely lacking in other libraries, thus enabling the delivery of desktop apps written in [Ruby](https://www.ruby-lang.org/en/) as truly native DMG/PKG/APP files on the [Mac](https://www.apple.com/ca/macos) + [App Store](https://developer.apple.com/macos/distribution/) and MSI/EXE files on [Windows](https://www.microsoft.com/en-ca/windows).
69
69
 
70
+ To get started, visit the [Glimmer DSL for SWT project page](https://github.com/AndyObtiva/glimmer-dsl-swt#pre-requisites) for instructions on installing the [glimmer-dsl-swt gem](https://rubygems.org/gems/glimmer-dsl-swt).
71
+
70
72
  ### Glimmer DSL for SWT Samples
71
73
 
72
74
  #### Hello, World!
@@ -290,6 +292,8 @@ The trade-off is that while [SWT](https://www.eclipse.org/swt/) provides a pleth
290
292
  - Scaffolding for new custom widgets, apps, and gems
291
293
  - Native-Executable packaging on Mac, Windows, and Linux
292
294
 
295
+ To get started, visit the [Glimmer DSL for Tk project page](https://github.com/AndyObtiva/glimmer-dsl-tk#pre-requisites) for instructions on installing the [glimmer-dsl-tk gem](https://rubygems.org/gems/glimmer-dsl-tk).
296
+
293
297
  ### Glimmer DSL for Tk Samples
294
298
 
295
299
  #### Hello, World!
@@ -394,6 +398,8 @@ Glimmer app:
394
398
 
395
399
  Glimmer DSL for Opal webifier successfully reuses the entire [Glimmer](https://github.com/AndyObtiva/glimmer) core DSL engine in [Opal Ruby](https://opalrb.com/) inside a web browser, and as such inherits the full range of powerful Glimmer desktop [data-binding](https://github.com/AndyObtiva/glimmer#data-binding) capabilities for the web.
396
400
 
401
+ To get started, visit the [Glimmer DSL for Opal project page](https://github.com/AndyObtiva/glimmer-dsl-opal) for instructions on installing the [glimmer-dsl-opal gem](https://rubygems.org/gems/glimmer-dsl-opal).
402
+
397
403
  ### Glimmer DSL for Opal Samples
398
404
 
399
405
  #### Hello, Computed!
@@ -585,7 +591,7 @@ Visit `http://localhost:3000`
585
591
 
586
592
  You should see "Glimmer Calculator"
587
593
 
588
- ![Glimmer Calculator Opal](https://raw.githubusercontent.com/AndyObtiva/glimmer-cs-calculator/master/glimmer-cs-calculator-screenshot-opal.png)
594
+ [![Glimmer Calculator Opal](https://raw.githubusercontent.com/AndyObtiva/glimmer-cs-calculator/master/glimmer-cs-calculator-screenshot-opal.png)](http://glimmer-cs-calculator-server.herokuapp.com)
589
595
 
590
596
  Here is an Apple Calculator CSS themed version (with [CSS only](https://github.com/AndyObtiva/glimmer-cs-calculator/blob/master/server/glimmer-cs-calculator-server/app/assets/stylesheets/welcomes_apple.scss), no app code changes):
591
597
 
@@ -593,7 +599,7 @@ Visit http://glimmer-cs-calculator-server.herokuapp.com/welcomes/apple
593
599
 
594
600
  You should see "Apple Calculator Theme"
595
601
 
596
- ![Glimmer Calculator Opal Apple Calculator Theme](https://raw.githubusercontent.com/AndyObtiva/glimmer-cs-calculator/master/glimmer-cs-calculator-screenshot-opal-apple.png)
602
+ [![Glimmer Calculator Opal Apple Calculator Theme](https://raw.githubusercontent.com/AndyObtiva/glimmer-cs-calculator/master/glimmer-cs-calculator-screenshot-opal-apple.png)](http://glimmer-cs-calculator-server.herokuapp.com/welcomes/apple)
597
603
 
598
604
  ## Glimmer DSL for XML (& HTML)
599
605
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.3
1
+ 1.0.4
@@ -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.3 ruby lib
5
+ # stub: glimmer 1.0.4 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "glimmer".freeze
9
- s.version = "1.0.3"
9
+ s.version = "1.0.4"
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 = "2020-11-15"
14
+ s.date = "2020-11-21"
15
15
  s.description = "Glimmer is a Ruby DSL Framework consisting of a DSL Engine and Observable/Observer/Data-Binding Library. Used in the Glimmer DSL for SWT (JRuby Desktop Development GUI Library), the Glimmer DSL for Tk (Ruby Desktop Development GUI Library), the Glimmer DSL for Opal (Web GUI Adapter for 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 = [
@@ -1,3 +1,4 @@
1
+
1
2
  # Copyright (c) 2007-2020 Andy Maleh
2
3
  #
3
4
  # Permission is hereby granted, free of charge, to any person obtaining
@@ -57,7 +58,26 @@ module Glimmer
57
58
  end
58
59
 
59
60
  def remove_observer(observer, property_name)
60
- property_observer_list(property_name).delete(observer)
61
+ if has_observer?(observer, property_name)
62
+ property_observer_list(property_name).delete(observer)
63
+ observer.unobserve(self, property_name)
64
+ end
65
+ end
66
+
67
+ def remove_observers(property_name)
68
+ property_observer_hash[property_name.to_sym].each do |observer|
69
+ remove_observer(observer, property_name)
70
+ end
71
+ property_observer_hash.delete(property_name.to_sym)
72
+ end
73
+
74
+ def remove_all_observers
75
+ all_observers = property_observer_hash.clone
76
+ property_observer_hash.keys.each do |property_name|
77
+ remove_observers(property_name)
78
+ end
79
+ property_observer_hash.clear
80
+ all_observers
61
81
  end
62
82
 
63
83
  def has_observer?(observer, property_name)
@@ -1,5 +1,5 @@
1
+ #
1
2
  # Copyright (c) 2007-2020 Andy Maleh
2
- #
3
3
  # Permission is hereby granted, free of charge, to any person obtaining
4
4
  # a copy of this software and associated documentation files (the
5
5
  # "Software"), to deal in the Software without restriction, including
@@ -7,10 +7,10 @@
7
7
  # distribute, sublicense, and/or sell copies of the Software, and to
8
8
  # permit persons to whom the Software is furnished to do so, subject to
9
9
  # the following conditions:
10
- #
10
+ #
11
11
  # The above copyright notice and this permission notice shall be
12
12
  # included in all copies or substantial portions of the Software.
13
- #
13
+ #
14
14
  # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
15
  # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
16
  # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -99,13 +99,14 @@ module Glimmer
99
99
  def unregister(observable, property = nil)
100
100
  return unless observable.is_a?(Observable)
101
101
  # TODO optimize performance in the future via indexing and/or making a registration official object/class
102
- observable.remove_observer(*[self, property].compact)
103
102
  registration = registration_for(observable, property)
104
103
  dependents_for(registration).each do |dependent|
105
104
  dependent.unregister
106
105
  remove_dependent(registration => dependent)
107
106
  end
108
- registrations.delete(registration)
107
+ registrations.delete(registration).tap do |registration|
108
+ observable.remove_observer(*[self, property].compact)
109
+ end
109
110
  end
110
111
  alias unobserve unregister
111
112
 
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.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - AndyMaleh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-15 00:00:00.000000000 Z
11
+ date: 2020-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: array_include_methods