glimmer 1.0.2 → 1.0.3

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: e227b3d1ae8d0ccf9052ea6b361096bf2642e86263e0248744c565882ead6a7a
4
- data.tar.gz: f166fc97d61c14ed1f57b69ff315d877efe376f20c176fd1594ec66858639315
3
+ metadata.gz: 6c811a5ad9035fc6c1694381ae4616a733a6b2df5a24d822b081cd6ed2abe0bf
4
+ data.tar.gz: 4de150db297d177b2e040dd0026186f44bd0b8536a574a723332f7cf9c012ca6
5
5
  SHA512:
6
- metadata.gz: 39ce7a948dfe263276326d96dd7a3da79b6b048809b81bde4087fca5781269353d3fdc821f6f1b32b4bd1c1e6c3e6e556ddd062eed05e68f15ba72e4a1e53a4e
7
- data.tar.gz: 135fac09cc38d03cccffdb169be39fa5af5b85b0b21ec879f21d892c94d06e77b1cdc4d87775502ab3c3b45179cfbdc5b3ee4a127981f0d7bd8be19359774176
6
+ metadata.gz: fcac37985eab50d992b68ea5a0068c0a942609f25980d995d6d2221047af14d5635b61fae3c6a5444a831f5a6683a49a4cb60aa8adc8aee23ef77a3e0341f242
7
+ data.tar.gz: 2e398c63b3d8c12230ae177dc7ee91e0a98d48c4131d89264b29fa8cb27784727259a9d1ea130d415692a6264c5384145f7a771f7ac8f95f9fd49ced91cdf604
@@ -3,6 +3,10 @@
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.3
7
+
8
+ - Upgraded array_include_methods gem to v1.0.4
9
+
6
10
  ## 1.0.2
7
11
 
8
12
  - Support ObservableArray notifications on `unshift`, `prepend`, and `append`
@@ -30,7 +34,7 @@ Related Change Logs:
30
34
 
31
35
  ## 0.10.1
32
36
 
33
- - excluded_keyword_checkers option for filtering certain keywords from Glimmer DSL processing
37
+ - excluded_keyword_checkers option for filtering certain keywords from Glimmer DSL processing
34
38
  - Updates to logging levels to be more appropriate
35
39
  - Fixed an issue to avoid crashing when calling observer.unregister/unobserve on a non-observable
36
40
 
@@ -92,7 +96,7 @@ Related Change Logs:
92
96
  - Fix verbiage for summary/description in scaffolding custom shell gems (change custom widget reference to custom shell)
93
97
  - Scaffolding builds a proper binary for custom shell gems and includes it in executables in Rakefile
94
98
  - Scaffolding adds about/preferences menu actions to apps/custom-shell-gems
95
- - Make custom widget/shell options writable
99
+ - Make custom widget/shell options writable
96
100
  - Support "dialog" Glimmer DSL keyword
97
101
 
98
102
  ## 0.7.7
@@ -142,7 +146,7 @@ Related Change Logs:
142
146
  - Fix freezing issue upon logging observables and raising observable errors by overriding inspect on Observable to avoid printing nested tree of observers
143
147
  - Added validation for shell widget parentage (accepting a shell or nil) in shell expression
144
148
  - Support bidirectional data-binding of menu item selection (e.g. radio menu item)
145
- - Make shell auto-activate on show with 0.25 delay
149
+ - Make shell auto-activate on show with 0.25 delay
146
150
 
147
151
  ## 0.7.0
148
152
 
data/README.md CHANGED
@@ -1,6 +1,6 @@
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.2 - 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.3 - DSL Framework
2
2
  [![Gem Version](https://badge.fury.io/rb/glimmer.svg)](http://badge.fury.io/rb/glimmer)
3
- [![Travis CI](https://travis-ci.com/AndyObtiva/glimmer.svg?branch=master)](https://travis-ci.com/github/AndyObtiva/glimmer)
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)
5
5
  [![Maintainability](https://api.codeclimate.com/v1/badges/38fbc278022862794414/maintainability)](https://codeclimate.com/github/AndyObtiva/glimmer/maintainability)
6
6
  [![Join the chat at https://gitter.im/AndyObtiva/glimmer](https://badges.gitter.im/AndyObtiva/glimmer.svg)](https://gitter.im/AndyObtiva/glimmer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
@@ -15,7 +15,7 @@
15
15
 
16
16
  [**Glimmer**](https://rubygems.org/gems/glimmer) started out as [GUI Library](https://github.com/AndyObtiva/glimmer-dsl-swt) and grew into a full-fledged [DSL Framework](#multi-dsl-support). Glimmer's namesake is referring to the Glimmer of Ruby in Graphical User Interfaces (contrary to popular myth perpetrated by [Charles Nutter](http://blog.headius.com/2007/11/tab-sweep.html), Glimmer has nothing to do with the ill-fated Whitney Houston movie, which does not in fact share the same name)
17
17
 
18
- [**Glimmer**](https://rubygems.org/gems/glimmer) supports the following DSLs:
18
+ [**Glimmer**](https://rubygems.org/gems/glimmer) supports the following DSLs:
19
19
  - [glimmer-dsl-swt](https://github.com/AndyObtiva/glimmer-dsl-swt): Glimmer DSL for SWT (JRuby Desktop Development GUI Library)
20
20
  - [glimmer-dsl-tk](https://github.com/AndyObtiva/glimmer-dsl-tk): Glimmer DSL for Tk (Ruby Desktop Development GUI Library)
21
21
  - [glimmer-dsl-opal](https://github.com/AndyObtiva/glimmer-dsl-opal): Glimmer DSL for Opal (Web GUI Adapter for Desktop Apps)
@@ -24,12 +24,12 @@
24
24
 
25
25
  [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.
26
26
 
27
- [<img src="https://covers.oreillystatic.com/images/9780596519650/lrg.jpg" width=105 /><br />
27
+ [<img src="https://covers.oreillystatic.com/images/9780596519650/lrg.jpg" width=105 /><br />
28
28
  Featured in<br />JRuby Cookbook](http://shop.oreilly.com/product/9780596519650.do)
29
29
 
30
30
  ## Table of contents
31
31
 
32
- - [Glimmer 1.0.2](#-glimmer-102)
32
+ - [Glimmer 1.0.3](#-glimmer-103)
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)
@@ -44,8 +44,7 @@ Featured in<br />JRuby Cookbook](http://shop.oreilly.com/product/9780596519650.d
44
44
  - [Glimmer DSL for Opal (Web GUI Adapter for Desktop Apps)](#glimmer-dsl-for-opal-web-gui-adapter-for-desktop-apps)
45
45
  - [Glimmer DSL for Opal Samples](#glimmer-dsl-for-opal-samples)
46
46
  - [Hello, Computed!](#hello-computed)
47
- - [Hello, List Single Selection!](#hello-list-single-selection)
48
- - [Hello, List Multi Selection!](#hello-list-multi-selection)
47
+ - [Glimmer Calculator](#glimmer-calculator)
49
48
  - [Glimmer DSL for XML (& HTML)](#glimmer-dsl-for-xml--html)
50
49
  - [XML DSL](#xml-dsl)
51
50
  - [Glimmer DSL for CSS](#glimmer-dsl-for-css)
@@ -324,7 +323,7 @@ Glimmer code (from [samples/hello/hello_tab.rb](https://github.com/AndyObtiva/gl
324
323
  ```ruby
325
324
  include Glimmer
326
325
 
327
- root {
326
+ root {
328
327
  title 'Hello, Tab!'
329
328
 
330
329
  notebook {
@@ -364,7 +363,7 @@ root {
364
363
  title 'Hello, Combo!'
365
364
 
366
365
  combobox { |proxy|
367
- state 'readonly'
366
+ state 'readonly'
368
367
  text bind(person, :country)
369
368
  }
370
369
 
@@ -391,7 +390,7 @@ Glimmer app:
391
390
 
392
391
  ## Glimmer DSL for Opal (Web GUI Adapter for Desktop Apps)
393
392
 
394
- [Glimmer DSL for Opal](https://github.com/AndyObtiva/glimmer-dsl-opal) is an experimental proof-of-concept web GUI adapter for [Glimmer](https://github.com/AndyObtiva/glimmer) desktop apps (i.e. apps built with [Glimmer DSL for SWT](https://github.com/AndyObtiva/glimmer-dsl-swt)). It webifies them via [Rails](https://rubyonrails.org/), allowing Ruby desktop apps to run on the web via [Opal Ruby](https://opalrb.com/) without changing a line of code. Apps may then be custom-styled for the web with standard CSS.
393
+ [Glimmer DSL for Opal](https://github.com/AndyObtiva/glimmer-dsl-opal) is an experimental proof-of-concept web GUI adapter for [Glimmer](https://github.com/AndyObtiva/glimmer) desktop apps (i.e. apps built with [Glimmer DSL for SWT](https://github.com/AndyObtiva/glimmer-dsl-swt)). It webifies them via [Rails](https://rubyonrails.org/), allowing Ruby desktop apps to run on the web via [Opal Ruby](https://opalrb.com/) without changing a line of code. Apps may then be custom-styled for the web with standard CSS.
395
394
 
396
395
  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.
397
396
 
@@ -516,129 +515,63 @@ You should see "Hello, Computed!"
516
515
 
517
516
  ![Glimmer DSL for Opal Hello Computed](https://raw.githubusercontent.com/AndyObtiva/glimmer-dsl-opal/master/images/glimmer-dsl-opal-hello-computed.png)
518
517
 
519
- #### Hello, List Single Selection!
520
-
521
- Add the following require statement to `app/assets/javascripts/application.rb`
522
-
523
-
524
- ```ruby
525
- require 'samples/hello/hello_list_single_selection'
526
- ```
527
-
528
- Or add the Glimmer code directly if you prefer to play around with it:
529
-
530
- ```ruby
531
- class Person
532
- attr_accessor :country, :country_options
533
-
534
- def initialize
535
- self.country_options=["", "Canada", "US", "Mexico"]
536
- self.country = "Canada"
537
- end
538
-
539
- def reset_country
540
- self.country = "Canada"
541
- end
542
- end
543
-
544
- class HelloListSingleSelection
545
- include Glimmer
546
- def launch
547
- person = Person.new
548
- shell {
549
- composite {
550
- list {
551
- selection bind(person, :country)
552
- }
553
- button {
554
- text "Reset"
555
- on_widget_selected do
556
- person.reset_country
557
- end
558
- }
559
- }
560
- }.open
561
- end
562
- end
518
+ #### Glimmer Calculator
563
519
 
564
- HelloListSingleSelection.new.launch
565
- ```
566
- Glimmer app on the desktop (using [`glimmer-dsl-swt`](https://github.com/AndyObtiva/glimmer-dsl-swt) gem):
520
+ Add the [glimmer-cs-calculator](https://github.com/AndyObtiva/glimmer-cs-calculator) gem to `Gemfile` (without requiring):
567
521
 
568
- ![Glimmer DSL for SWT Hello List Single Selection](https://github.com/AndyObtiva/glimmer/raw/master/images/glimmer-hello-list-single-selection.png)
569
-
570
- Glimmer app on the web (using `glimmer-dsl-opal` gem):
571
-
572
- Start the Rails server:
573
522
  ```
574
- rails s
523
+ gem 'glimmer-cs-calculator', require: false
575
524
  ```
576
525
 
577
- Visit `http://localhost:3000`
578
-
579
- You should see "Hello, List Single Selection!"
580
-
581
- ![Glimmer DSL for Opal Hello List Single Selection](https://raw.githubusercontent.com/AndyObtiva/glimmer-dsl-opal/master/images/glimmer-dsl-opal-hello-list-single-selection.png)
582
-
583
- #### Hello, List Multi Selection!
584
-
585
526
  Add the following require statement to `app/assets/javascripts/application.rb`
586
527
 
587
528
  ```ruby
588
- require 'samples/hello/hello_list_multi_selection'
529
+ require 'glimmer-cs-calculator/launch'
589
530
  ```
590
531
 
591
- Or add the Glimmer code directly if you prefer to play around with it:
532
+ Sample GUI code (relies on custom widgets `command_button`, `operation_button`, and `number_button`):
592
533
 
593
534
  ```ruby
594
- class Person
595
- attr_accessor :provinces, :provinces_options
596
-
597
- def initialize
598
- self.provinces_options=[
599
- "",
600
- "Quebec",
601
- "Ontario",
602
- "Manitoba",
603
- "Saskatchewan",
604
- "Alberta",
605
- "British Columbia",
606
- "Nova Skotia",
607
- "Newfoundland"
608
- ]
609
- self.provinces = ["Quebec", "Manitoba", "Alberta"]
610
- end
611
-
612
- def reset_provinces
613
- self.provinces = ["Quebec", "Manitoba", "Alberta"]
614
- end
615
- end
616
-
617
- class HelloListMultiSelection
618
- include Glimmer
619
- def launch
620
- person = Person.new
621
- shell {
622
- composite {
623
- list(:multi) {
624
- selection bind(person, :provinces)
625
- }
626
- button {
627
- text "Reset"
628
- on_widget_selected do
629
- person.reset_provinces
630
- end
631
- }
632
- }
633
- }.open
634
- end
635
- end
636
-
637
- HelloListMultiSelection.new.launch
535
+ shell {
536
+ minimum_size (OS.mac? ? 320 : (OS.windows? ? 390 : 520)), 240
537
+ image File.join(APP_ROOT, 'package', 'windows', "Glimmer Calculator.ico") if OS.windows?
538
+ text "Glimmer - Calculator"
539
+ grid_layout 4, true
540
+ # Setting styled_text to multi in order for alignment options to activate
541
+ styled_text(:multi, :wrap, :border) {
542
+ text bind(@presenter, :result)
543
+ alignment swt(:right)
544
+ right_margin 5
545
+ font height: 40
546
+ layout_data(:fill, :fill, true, true) {
547
+ horizontal_span 4
548
+ }
549
+ editable false
550
+ caret nil
551
+ }
552
+ command_button('AC')
553
+ operation_button('÷')
554
+ operation_button('×')
555
+ operation_button('−')
556
+ (7..9).each { |number|
557
+ number_button(number)
558
+ }
559
+ operation_button('+', font: @button_font_big, vertical_span: 2)
560
+ (4..6).each { |number|
561
+ number_button(number)
562
+ }
563
+ (1..3).each { |number|
564
+ number_button(number)
565
+ }
566
+ command_button('=', font: @button_font_big, vertical_span: 2)
567
+ number_button(0, horizontal_span: 2)
568
+ operation_button('.')
569
+ }
638
570
  ```
639
- Glimmer app on the desktop (using [`glimmer-dsl-swt`](https://github.com/AndyObtiva/glimmer-dsl-swt) gem):
640
571
 
641
- ![Glimmer DSL for SWT Hello List Multi Selection](https://github.com/AndyObtiva/glimmer/raw/master/images/glimmer-hello-list-multi-selection.png)
572
+ Glimmer app on the desktop (using the [`glimmer-dsl-swt`](https://github.com/AndyObtiva/glimmer-dsl-swt) gem):
573
+
574
+ ![Glimmer Calculator Linux](https://raw.githubusercontent.com/AndyObtiva/glimmer-cs-calculator/master/glimmer-cs-calculator-screenshot-linux.png)
642
575
 
643
576
  Glimmer app on the web (using `glimmer-dsl-opal` gem):
644
577
 
@@ -648,10 +581,19 @@ rails s
648
581
  ```
649
582
 
650
583
  Visit `http://localhost:3000`
584
+ (or visit: http://glimmer-cs-calculator-server.herokuapp.com)
585
+
586
+ You should see "Glimmer Calculator"
587
+
588
+ ![Glimmer Calculator Opal](https://raw.githubusercontent.com/AndyObtiva/glimmer-cs-calculator/master/glimmer-cs-calculator-screenshot-opal.png)
589
+
590
+ 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
+
592
+ Visit http://glimmer-cs-calculator-server.herokuapp.com/welcomes/apple
651
593
 
652
- You should see "Hello, List Multi Selection!"
594
+ You should see "Apple Calculator Theme"
653
595
 
654
- ![Glimmer DSL for Opal Hello List Multi Selection](https://raw.githubusercontent.com/AndyObtiva/glimmer-dsl-opal/master/images/glimmer-dsl-opal-hello-list-multi-selection.png)
596
+ ![Glimmer Calculator Opal Apple Calculator Theme](https://raw.githubusercontent.com/AndyObtiva/glimmer-cs-calculator/master/glimmer-cs-calculator-screenshot-opal-apple.png)
655
597
 
656
598
  ## Glimmer DSL for XML (& HTML)
657
599
 
@@ -760,7 +702,7 @@ Here is a list of notable 3rd party gems used by Glimmer and Glimmer DSLs:
760
702
 
761
703
  ## Glimmer Process
762
704
 
763
- [Glimmer Process](PROCESS.md) is the lightweight software development process used for building Glimmer libraries and Glimmer apps, which goes beyond Agile, rendering all Agile processes obsolete. [Glimmer Process](PROCESS.md) is simply made up of 7 guidelines to pick and choose as necessary until software development needs are satisfied.
705
+ [Glimmer Process](PROCESS.md) is the lightweight software development process used for building Glimmer libraries and Glimmer apps, which goes beyond Agile, rendering all Agile processes obsolete. [Glimmer Process](PROCESS.md) is simply made up of 7 guidelines to pick and choose as necessary until software development needs are satisfied.
764
706
 
765
707
  Learn more by reading the [GPG](PROCESS.md) (Glimmer Process Guidelines)
766
708
 
@@ -783,7 +725,7 @@ You may submit [issues](https://github.com/AndyObtiva/glimmer/issues) on [GitHub
783
725
 
784
726
  ### Chat
785
727
 
786
- If you need live help, try to [![Join the chat at https://gitter.im/AndyObtiva/glimmer](https://badges.gitter.im/AndyObtiva/glimmer.svg)](https://gitter.im/AndyObtiva/glimmer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
728
+ If you need live help, try to [![Join the chat at https://gitter.im/AndyObtiva/glimmer](https://badges.gitter.im/AndyObtiva/glimmer.svg)](https://gitter.im/AndyObtiva/glimmer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
787
729
 
788
730
  ## Feature Suggestions
789
731
 
@@ -831,7 +773,7 @@ If your company would like to invest fulltime in further development of the Glim
831
773
 
832
774
  [MIT](LICENSE.txt)
833
775
 
834
- Copyright (c) 2007-2020 - Andy Maleh.
776
+ Copyright (c) 2007-2020 - Andy Maleh.
835
777
 
836
778
  --
837
779
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.2
1
+ 1.0.3
@@ -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 1.0.2 ruby lib
5
+ # stub: glimmer 1.0.3 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "glimmer".freeze
9
- s.version = "1.0.2"
9
+ s.version = "1.0.3"
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-10-27"
15
- s.description = "Glimmer is a Ruby DSL engine with support for 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
14
+ s.date = "2020-11-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 = [
18
18
  "CHANGELOG.md",
@@ -53,7 +53,7 @@ Gem::Specification.new do |s|
53
53
  end
54
54
 
55
55
  if s.respond_to? :add_runtime_dependency then
56
- s.add_runtime_dependency(%q<array_include_methods>.freeze, [">= 1.0.3", "< 2.0.0"])
56
+ s.add_runtime_dependency(%q<array_include_methods>.freeze, [">= 1.0.4", "< 2.0.0"])
57
57
  s.add_runtime_dependency(%q<facets>.freeze, [">= 3.1.0", "< 4.0.0"])
58
58
  s.add_development_dependency(%q<rspec-mocks>.freeze, ["~> 3.5.0"])
59
59
  s.add_development_dependency(%q<rspec>.freeze, ["~> 3.5.0"])
@@ -66,7 +66,7 @@ Gem::Specification.new do |s|
66
66
  s.add_development_dependency(%q<simplecov-lcov>.freeze, ["~> 0.7.0"])
67
67
  s.add_development_dependency(%q<rake-tui>.freeze, [">= 0"])
68
68
  else
69
- s.add_dependency(%q<array_include_methods>.freeze, [">= 1.0.3", "< 2.0.0"])
69
+ s.add_dependency(%q<array_include_methods>.freeze, [">= 1.0.4", "< 2.0.0"])
70
70
  s.add_dependency(%q<facets>.freeze, [">= 3.1.0", "< 4.0.0"])
71
71
  s.add_dependency(%q<rspec-mocks>.freeze, ["~> 3.5.0"])
72
72
  s.add_dependency(%q<rspec>.freeze, ["~> 3.5.0"])
@@ -1,5 +1,5 @@
1
1
  # Copyright (c) 2007-2020 Andy Maleh
2
- #
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
@@ -81,9 +81,9 @@ module Glimmer
81
81
  end
82
82
 
83
83
  def apply_converter(converter, value)
84
- return value if converter.nil?
85
- return value.send(converter) if (converter.is_a?(String) || converter.is_a?(Symbol)) && value.respond_to?(converter)
86
- return converter.call(value) if converter.respond_to?(:call, value)
84
+ return value if converter.nil?
85
+ return value.send(converter) if (converter.is_a?(String) || converter.is_a?(Symbol)) && value.respond_to?(converter)
86
+ return converter.call(value) if converter.respond_to?(:call, value)
87
87
  raise Glimmer::Error, "Unsupported bind converter: #{converter.inspect}"
88
88
  end
89
89
 
@@ -213,7 +213,7 @@ module Glimmer
213
213
  end
214
214
 
215
215
  def evaluate_property
216
- value = nil
216
+ value = nil
217
217
  value = invoke_property_reader(model, property_name) unless model.nil?
218
218
  convert_on_read(value)
219
219
  end
@@ -1,5 +1,5 @@
1
1
  # Copyright (c) 2007-2020 Andy Maleh
2
- #
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
@@ -48,7 +48,7 @@ module Glimmer
48
48
  def add_element_observer(element, observer)
49
49
  element_properties_for(observer).each do |property|
50
50
  observer.observe(element, property)
51
- end
51
+ end
52
52
  end
53
53
 
54
54
  def remove_observer(observer, *element_properties)
@@ -62,20 +62,20 @@ module Glimmer
62
62
  property_observer_list.delete(observer)
63
63
  observer_element_properties.delete(observer)
64
64
  each { |element| remove_element_observer(element, observer) }
65
- end
65
+ end
66
66
  observer
67
67
  end
68
68
 
69
69
  def remove_element_observers(element)
70
70
  property_observer_list.each do |observer|
71
71
  remove_element_observer(element, observer)
72
- end
72
+ end
73
73
  end
74
74
 
75
75
  def remove_element_observer(element, observer)
76
76
  element_properties_for(observer).each do |property|
77
77
  observer.unobserve(element, property)
78
- end
78
+ end
79
79
  end
80
80
 
81
81
  def has_observer?(observer)
@@ -104,7 +104,7 @@ module Glimmer
104
104
 
105
105
  def <<(element)
106
106
  super(element).tap do
107
- add_element_observers(element)
107
+ add_element_observers(element)
108
108
  notify_observers
109
109
  end
110
110
  end
@@ -115,7 +115,7 @@ module Glimmer
115
115
  old_value = self[index]
116
116
  unregister_dependent_observers(old_value)
117
117
  remove_element_observers(old_value)
118
- add_element_observers(value)
118
+ add_element_observers(value)
119
119
  super(index, value).tap do
120
120
  notify_observers
121
121
  end
@@ -151,7 +151,7 @@ module Glimmer
151
151
  if block_given?
152
152
  old_array = Array.new(self)
153
153
  super(&block).tap do |new_array|
154
- (old_array - new_array).each do |element|
154
+ (old_array - new_array).each do |element|
155
155
  unregister_dependent_observers(element)
156
156
  remove_element_observers(element)
157
157
  end
@@ -264,7 +264,7 @@ module Glimmer
264
264
 
265
265
  def unshift(element)
266
266
  super(element).tap do
267
- add_element_observers(element)
267
+ add_element_observers(element)
268
268
  notify_observers
269
269
  end
270
270
  end
@@ -1,5 +1,5 @@
1
1
  # Copyright (c) 2007-2020 Andy Maleh
2
- #
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
@@ -97,7 +97,7 @@ module Glimmer
97
97
  end
98
98
 
99
99
  def property_writer_method(property_writer_name)
100
- self.class.instance_method(property_writer_name) rescue self.method(property_writer_name)
100
+ self.class.instance_method(property_writer_name) rescue self.method(property_writer_name)
101
101
  end
102
102
 
103
103
  def unregister_dependent_observers(property_name, old_value)
@@ -118,7 +118,7 @@ module Glimmer
118
118
  end
119
119
 
120
120
  def array_object_observer_for(property_name)
121
- @array_object_observers ||= {}
121
+ @array_object_observers ||= {}
122
122
  @array_object_observers[property_name] = ObservableModel::Notifier.new(self, property_name) unless @array_object_observers.has_key?(property_name)
123
123
  @array_object_observers[property_name]
124
124
  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.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - AndyMaleh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-27 00:00:00.000000000 Z
11
+ date: 2020-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: array_include_methods
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 1.0.3
19
+ version: 1.0.4
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: 2.0.0
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 1.0.3
29
+ version: 1.0.4
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 2.0.0
@@ -208,10 +208,11 @@ dependencies:
208
208
  - - ">="
209
209
  - !ruby/object:Gem::Version
210
210
  version: '0'
211
- description: Glimmer is a Ruby DSL engine with support for the Glimmer DSL for SWT
212
- (JRuby Desktop Development GUI Library), the Glimmer DSL for Tk (Ruby Desktop Development
213
- GUI Library), the Glimmer DSL for Opal (Web GUI Adapter for Desktop Apps), the Glimmer
214
- DSL for XML (& HTML), and the Glimmer DSL for CSS.
211
+ description: Glimmer is a Ruby DSL Framework consisting of a DSL Engine and Observable/Observer/Data-Binding
212
+ Library. Used in the Glimmer DSL for SWT (JRuby Desktop Development GUI Library),
213
+ the Glimmer DSL for Tk (Ruby Desktop Development GUI Library), the Glimmer DSL for
214
+ Opal (Web GUI Adapter for Desktop Apps), the Glimmer DSL for XML (& HTML), and the
215
+ Glimmer DSL for CSS.
215
216
  email: andy.am@gmail.com
216
217
  executables: []
217
218
  extensions: []