glimmer-dsl-libui 0.0.11 → 0.0.12

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: 22947befdd94073071547600efd1434fe98babc87c1fb35a169c9133e7979653
4
- data.tar.gz: c7733269d49a56c24c13c3df6df4efc680882f12e62926a9169f5114a412af0a
3
+ metadata.gz: 8be478e9d224fabeac6b2d42b7ccae6f7063491c88b1ea14e90cf1665e379bdf
4
+ data.tar.gz: b8b9b58fe072ec1973263ae20dbbe5407d7dceb30290420dd6734397cd850918
5
5
  SHA512:
6
- metadata.gz: d0c881484a837ddc71738e8e91f75881da6de87773703d88172f6d2a13626382d7eaee749ba6ef09f175e90f937a91d248462268780783d34b1a6e65584097da
7
- data.tar.gz: f484ecb4e1b16c21899b3263d18d736925752519e6271c611c8ac2ef4639884e8cc057661a7440824cc1df1dacb595226563b9a1343f2b25586358c0340c92cd
6
+ metadata.gz: 534bf3ffa94019746c5a1291af5d8a676766221ea299e627cbb38dd1e3814f941688b8cf0182f243b942e73180f2f642c93598ca4d03a3a2df36cc249459316a
7
+ data.tar.gz: 3d6a77dcaffdedc6149d2efdb05df1e01f6499114054d5d43f83d576abeed0791d7cc6138335087fbfbd4d29bd481b1c016e71fe4c40af963218fd6e5227b3be
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Change Log
2
2
 
3
+ ## 0.0.12
4
+
5
+ - Have examples/meta_example.rb allow code editing to enable experimentation and learning
6
+ - Fix issue with examples/meta_example using puts_debuggerer (a development gem)
7
+
3
8
  ## 0.0.11
4
9
 
5
10
  - New examples/basic_color.rb
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 />](https://github.com/AndyObtiva/glimmer) Glimmer DSL for LibUI 0.0.11
1
+ # [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=85 />](https://github.com/AndyObtiva/glimmer) Glimmer DSL for LibUI 0.0.12
2
2
  ## Prerequisite-Free Ruby Desktop Development GUI Library
3
3
  [![Gem Version](https://badge.fury.io/rb/glimmer-dsl-libui.svg)](http://badge.fury.io/rb/glimmer-dsl-libui)
4
4
  [![Maintainability](https://api.codeclimate.com/v1/badges/ce2853efdbecf6ebdc73/maintainability)](https://codeclimate.com/github/AndyObtiva/glimmer-dsl-libui/maintainability)
@@ -43,7 +43,7 @@ Other [Glimmer](https://rubygems.org/gems/glimmer) DSL gems you might be interes
43
43
 
44
44
  ## Table of Contents
45
45
 
46
- - [Glimmer DSL for LibUI 0.0.11](#-glimmer-dsl-for-libui-0011)
46
+ - [Glimmer DSL for LibUI 0.0.12](#-glimmer-dsl-for-libui-0012)
47
47
  - [Glimmer GUI DSL Concepts](#glimmer-gui-dsl-concepts)
48
48
  - [Usage](#usage)
49
49
  - [API](#api)
@@ -152,7 +152,7 @@ gem install glimmer-dsl-libui
152
152
  Or install via Bundler `Gemfile`:
153
153
 
154
154
  ```ruby
155
- gem 'glimmer-dsl-libui', '~> 0.0.11'
155
+ gem 'glimmer-dsl-libui', '~> 0.0.12'
156
156
  ```
157
157
 
158
158
  Add `require 'glimmer-dsl-libui'` at the top, and then `include Glimmer` into the top-level main object for testing or into an actual class for serious usage.
@@ -315,7 +315,7 @@ Gotcha: On the Mac, when you close a window opened in `girb`, it remains open un
315
315
 
316
316
  These examples include reimplementions of the examples in the [LibUI](https://github.com/kojix2/LibUI) project utilizing the [Glimmer GUI DSL](#glimmer-gui-dsl-concepts) as well as brand new examples.
317
317
 
318
- To browse all examples, simply launch the [Meta-Example](examples/meta_example.rb), which lists all examples and displays each example's code when selected.
318
+ To browse all examples, simply launch the [Meta-Example](examples/meta_example.rb), which lists all examples and displays each example's code when selected. It also enables code editing to facilitate experimentation and learning.
319
319
 
320
320
  [examples/meta_example.rb](examples/meta_example.rb)
321
321
 
@@ -362,11 +362,11 @@ class MetaExample
362
362
  File.join(File.expand_path('.', __dir__), "#{example.underscore}.rb")
363
363
  end
364
364
 
365
+ def glimmer_dsl_libui_file
366
+ File.expand_path('../lib/glimmer-dsl-libui', __dir__)
367
+ end
368
+
365
369
  def launch
366
- menu('File') {
367
- quit_menu_item
368
- }
369
-
370
370
  window('Meta-Example', 700, 500) { |w|
371
371
  margined true
372
372
 
@@ -385,13 +385,20 @@ class MetaExample
385
385
  stretchy false
386
386
 
387
387
  on_clicked do
388
- system "ruby -r puts_debuggerer -r #{File.expand_path('../lib/glimmer-dsl-libui', __dir__)} #{file_path_for(@examples[@rbs.selected])}"
388
+ begin
389
+ meta_example_file = File.join(Dir.home, '.meta_example.rb')
390
+ File.write(meta_example_file, @nwme.text)
391
+ result = `ruby -r #{glimmer_dsl_libui_file} #{meta_example_file} 2>&1`
392
+ msg_box(w, 'Error Running Example', result) if result.include?('error')
393
+ rescue => e
394
+ puts 'Unable to write code changes! Running original example...'
395
+ system "ruby -r #{glimmer_dsl_libui_file} #{file_path_for(@examples[@rbs.selected])}"
396
+ end
389
397
  end
390
398
  }
391
399
  }
392
400
  vertical_box {
393
401
  @nwme = non_wrapping_multiline_entry {
394
- read_only true
395
402
  text File.read(file_path_for(@examples[@rbs.selected]))
396
403
  }
397
404
  }
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.11
1
+ 0.0.12
@@ -20,6 +20,10 @@ class MetaExample
20
20
  File.join(File.expand_path('.', __dir__), "#{example.underscore}.rb")
21
21
  end
22
22
 
23
+ def glimmer_dsl_libui_file
24
+ File.expand_path('../lib/glimmer-dsl-libui', __dir__)
25
+ end
26
+
23
27
  def launch
24
28
  window('Meta-Example', 700, 500) { |w|
25
29
  margined true
@@ -39,13 +43,20 @@ class MetaExample
39
43
  stretchy false
40
44
 
41
45
  on_clicked do
42
- system "ruby -r puts_debuggerer -r #{File.expand_path('../lib/glimmer-dsl-libui', __dir__)} #{file_path_for(@examples[@rbs.selected])}"
46
+ begin
47
+ meta_example_file = File.join(Dir.home, '.meta_example.rb')
48
+ File.write(meta_example_file, @nwme.text)
49
+ result = `ruby -r #{glimmer_dsl_libui_file} #{meta_example_file} 2>&1`
50
+ msg_box(w, 'Error Running Example', result) if result.include?('error')
51
+ rescue => e
52
+ puts 'Unable to write code changes! Running original example...'
53
+ system "ruby -r #{glimmer_dsl_libui_file} #{file_path_for(@examples[@rbs.selected])}"
54
+ end
43
55
  end
44
56
  }
45
57
  }
46
58
  vertical_box {
47
59
  @nwme = non_wrapping_multiline_entry {
48
- read_only true
49
60
  text File.read(file_path_for(@examples[@rbs.selected]))
50
61
  }
51
62
  }
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glimmer-dsl-libui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Maleh