glimmer-dsl-libui 0.9.0 → 0.9.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +133 -5
- data/RUBY_VERSION +1 -0
- data/VERSION +1 -1
- data/glimmer-dsl-libui.gemspec +0 -0
- data/icons/scaffold_app.icns +0 -0
- data/icons/scaffold_app.ico +0 -0
- data/icons/scaffold_app.png +0 -0
- data/lib/glimmer/rake_task/scaffold.rb +180 -220
- data/lib/glimmer/rake_task.rb +67 -70
- metadata +66 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f25a73b328f8f3edfab2fba17e5f2561291f6ea0d9138a6114263e1145f3f96b
|
4
|
+
data.tar.gz: a9985350bc4de488d12eeb5aaad8e9b20493d4d1eb911e2c8e247b7b622905f9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da98d3cc5849995f84df95b87081a14abd55df599a420c340a3f780536e574ed2ffce55898a7e61f62cfdcff6c1efd616f1b62b0c58ab3ace4c875db3a7a0dd0
|
7
|
+
data.tar.gz: 8ee6d0c78ba2749e86acd8380888fac51025862e0428ded65532f23b297355cb45e75a9476c15ddea1a311f40bebffe1e4f35b4be8785bdef5210850f68565a0
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## 0.9.1
|
4
|
+
|
5
|
+
- Scaffold an application via Glimmer Command: `glimmer scaffold[app_name]`
|
6
|
+
- Hide unsupported Scaffolding tasks in Glimmer Command
|
7
|
+
- Add missing Glimmer Command gem dependencies: `rake`, `rake-tui`, `text-table`, `puts_debuggerer`
|
8
|
+
|
3
9
|
## 0.9.0
|
4
10
|
|
5
11
|
- Support `glimmer` command to more conveniently run applications (`glimmer app_path`) and examples (`glimmer examples`)
|
data/README.md
CHANGED
@@ -28,7 +28,7 @@ The main trade-off in using [Glimmer DSL for LibUI](https://rubygems.org/gems/gl
|
|
28
28
|
- Requiring the [least amount of syntax](#glimmer-gui-dsl-concepts) possible to build GUI
|
29
29
|
- [Custom Control](#custom-keywords) support
|
30
30
|
- [Bidirectional/Unidirectional Data-Binding](#data-binding) to declaratively wire and automatically synchronize GUI Views with Models
|
31
|
-
- [
|
31
|
+
- [Scaffolding](scaffold-application) for new custom controls, apps, and gems
|
32
32
|
- [Far Future Plan] Native-Executable packaging on Mac, Windows, and Linux.
|
33
33
|
|
34
34
|
Hello, World!
|
@@ -347,6 +347,10 @@ Learn more about the differences between various [Glimmer](https://github.com/An
|
|
347
347
|
- [Experimentation Usage](#experimentation-usage)
|
348
348
|
- [Prototyping Usage](#prototyping-usage)
|
349
349
|
- [Serious Usage](#serious-usage)
|
350
|
+
- [Glimmer Command](#glimmer-command)
|
351
|
+
- [Run Application](#run-application)
|
352
|
+
- [Run Examples](#run-examples)
|
353
|
+
- [Scaffold Application](#scaffold-application)
|
350
354
|
- [Girb (Glimmer IRB)](#girb-glimmer-irb)
|
351
355
|
- [Glimmer GUI DSL Concepts](#glimmer-gui-dsl-concepts)
|
352
356
|
- [API](#api)
|
@@ -417,7 +421,7 @@ gem install glimmer-dsl-libui
|
|
417
421
|
Or install via Bundler `Gemfile`:
|
418
422
|
|
419
423
|
```ruby
|
420
|
-
gem 'glimmer-dsl-libui', '~> 0.9.
|
424
|
+
gem 'glimmer-dsl-libui', '~> 0.9.1'
|
421
425
|
```
|
422
426
|
|
423
427
|
Test that installation worked by running the [Glimmer Meta-Example](#examples):
|
@@ -525,9 +529,7 @@ If you are new to [Glimmer DSL for LibUI](https://rubygems.org/gems/glimmer-dsl-
|
|
525
529
|
|
526
530
|
## Glimmer Command
|
527
531
|
|
528
|
-
The `glimmer` command allows you to conveniently
|
529
|
-
- Run Glimmer DSL for LibUI applications (via `glimmer [app_path]`)
|
530
|
-
- Run Glimmer DSL for LibUI included examples (via `glimmer examples`, which brings up the [Glimmer Meta-Example](https://github.com/AndyObtiva/glimmer-dsl-libui/blob/master/examples/meta_example.rb))
|
532
|
+
The `glimmer` command allows you to conveniently run applications (`glimmer app_path`), run examples (`glimmer examples`), and scaffold applications (`glimmer "scaffold[app_name]"`).
|
531
533
|
|
532
534
|
You can bring up usage instructions by running the `glimmer` command without arguments:
|
533
535
|
|
@@ -581,6 +583,132 @@ On Windows and ARM64 machines, it simply lists the available Glimmer tasks at th
|
|
581
583
|
|
582
584
|
Note: If you encounter an issue running the `glimmer` command, run `bundle exec glimmer` instead.
|
583
585
|
|
586
|
+
### Run Application
|
587
|
+
|
588
|
+
Run Glimmer DSL for LibUI applications via this command:
|
589
|
+
|
590
|
+
```
|
591
|
+
glimmer app_path
|
592
|
+
```
|
593
|
+
|
594
|
+
For example, from a cloned glimmer-dsl-libui repository:
|
595
|
+
|
596
|
+
```
|
597
|
+
glimmer examples/basic_window.rb
|
598
|
+
```
|
599
|
+
|
600
|
+
Mac | Windows | Linux
|
601
|
+
----|---------|------
|
602
|
+
![glimmer-dsl-libui-mac-basic-window.png](/images/glimmer-dsl-libui-mac-basic-window.png) | ![glimmer-dsl-libui-windows-basic-window.png](/images/glimmer-dsl-libui-windows-basic-window.png) | ![glimmer-dsl-libui-linux-basic-window.png](/images/glimmer-dsl-libui-linux-basic-window.png)
|
603
|
+
|
604
|
+
### Run Examples
|
605
|
+
|
606
|
+
Run Glimmer DSL for LibUI included examples via this command:
|
607
|
+
|
608
|
+
```
|
609
|
+
glimmer examples
|
610
|
+
```
|
611
|
+
|
612
|
+
That brings up the [Glimmer Meta-Example](https://github.com/AndyObtiva/glimmer-dsl-libui/blob/master/examples/meta_example.rb))
|
613
|
+
|
614
|
+
Mac | Windows | Linux
|
615
|
+
----|---------|------
|
616
|
+
![glimmer-dsl-libui-mac-meta-example.png](images/glimmer-dsl-libui-mac-meta-example.png) | ![glimmer-dsl-libui-windows-meta-example.png](images/glimmer-dsl-libui-windows-meta-example.png) | ![glimmer-dsl-libui-linux-meta-example.png](images/glimmer-dsl-libui-linux-meta-example.png)
|
617
|
+
|
618
|
+
### Scaffold Application
|
619
|
+
|
620
|
+
Application scaffolding enables automatically generating the directories/files of a new desktop GUI application that follows the MVC architecture and can be packaged as a Ruby gem that includes a binary script for running the app conveniently.
|
621
|
+
|
622
|
+
Scaffold Glimmer DSL for LibUI application with this command:
|
623
|
+
|
624
|
+
```
|
625
|
+
glimmer "scaffold[app_name]"
|
626
|
+
```
|
627
|
+
|
628
|
+
That will generate the general MVC structure of a new Glimmer DSL for LibUI application.
|
629
|
+
|
630
|
+
For example, if we run:
|
631
|
+
|
632
|
+
```
|
633
|
+
glimmer "scaffold[hello_world]"
|
634
|
+
```
|
635
|
+
|
636
|
+
The following files are generated and reported by the `glimmer` command:
|
637
|
+
|
638
|
+
```
|
639
|
+
Created hello_world/.gitignore
|
640
|
+
Created hello_world/.ruby-version
|
641
|
+
Created hello_world/.ruby-gemset
|
642
|
+
Created hello_world/VERSION
|
643
|
+
Created hello_world/LICENSE.txt
|
644
|
+
Created hello_world/Gemfile
|
645
|
+
Created hello_world/Rakefile
|
646
|
+
Created hello_world/app/hello_world.rb
|
647
|
+
Created hello_world/app/hello_world/view/hello_world.rb
|
648
|
+
Created hello_world/icons/windows/Hello World.ico
|
649
|
+
Created hello_world/icons/macosx/Hello World.icns
|
650
|
+
Created hello_world/icons/linux/Hello World.png
|
651
|
+
Created hello_world/app/hello_world/launch.rb
|
652
|
+
Created hello_world/bin/hello_world
|
653
|
+
```
|
654
|
+
|
655
|
+
They include a basic Hello, World! application with menus and about/preferences dialogs.
|
656
|
+
|
657
|
+
Views live under `app/app_name/view` (e.g. `app/hello_world/view`)
|
658
|
+
Models live under `app/app_name/model` (e.g. `app/hello_world/model`)
|
659
|
+
|
660
|
+
Once you step into the application directory, you can run it in one of multiple ways:
|
661
|
+
|
662
|
+
```
|
663
|
+
bin/app_name
|
664
|
+
```
|
665
|
+
|
666
|
+
For example:
|
667
|
+
|
668
|
+
```
|
669
|
+
bin/hello_world
|
670
|
+
```
|
671
|
+
|
672
|
+
Or using the Glimmer generic command for running applications, which will automatically detect the application running script:
|
673
|
+
|
674
|
+
```
|
675
|
+
glimmer run
|
676
|
+
```
|
677
|
+
|
678
|
+
![glimmer-dsl-libui-mac-scaffold-app-initial-screen.png](images/glimmer-dsl-libui-mac-scaffold-app-initial-screen.png)
|
679
|
+
|
680
|
+
![glimmer-dsl-libui-mac-scaffold-app-preferences.png](images/glimmer-dsl-libui-mac-scaffold-app-preferences.png)
|
681
|
+
|
682
|
+
![glimmer-dsl-libui-mac-scaffold-app-changed-greeting.png](images/glimmer-dsl-libui-mac-scaffold-app-changed-greeting.png)
|
683
|
+
|
684
|
+
The application comes with `juwelier` for auto-generating an application gem from its `Rakefile` gem configuration.
|
685
|
+
|
686
|
+
You can package the newly scaffolded app as a Ruby gem by running this command:
|
687
|
+
|
688
|
+
```
|
689
|
+
rake build
|
690
|
+
```
|
691
|
+
|
692
|
+
You can generate the application gemspec explicitly if needed with this command (though it is not needed to build the gem):
|
693
|
+
|
694
|
+
```
|
695
|
+
rake gemspec:generate
|
696
|
+
```
|
697
|
+
|
698
|
+
Once you install the gem (e.g. `gem install hello_world`), you can simply run the app with its binary script:
|
699
|
+
|
700
|
+
```
|
701
|
+
app_name
|
702
|
+
```
|
703
|
+
|
704
|
+
For example:
|
705
|
+
|
706
|
+
```
|
707
|
+
hello_world
|
708
|
+
```
|
709
|
+
|
710
|
+
![glimmer-dsl-libui-mac-scaffold-app-initial-screen.png](images/glimmer-dsl-libui-mac-scaffold-app-initial-screen.png)
|
711
|
+
|
584
712
|
## Girb (Glimmer IRB)
|
585
713
|
|
586
714
|
You can run the `girb` command (`bin/girb` if you cloned the project locally) to do some quick and dirty experimentation and learning:
|
data/RUBY_VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
3.2.2
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.9.
|
1
|
+
0.9.1
|
data/glimmer-dsl-libui.gemspec
CHANGED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -94,9 +94,6 @@ module Glimmer
|
|
94
94
|
# Mac
|
95
95
|
.DS_Store
|
96
96
|
|
97
|
-
# Warbler
|
98
|
-
Jars.lock
|
99
|
-
|
100
97
|
# Gladiator (Glimmer Editor)
|
101
98
|
.gladiator
|
102
99
|
.gladiator-scratchpad
|
@@ -104,7 +101,6 @@ module Glimmer
|
|
104
101
|
# Glimmer
|
105
102
|
/dist/
|
106
103
|
/packages/
|
107
|
-
/vendor/jars/
|
108
104
|
MULTI_LINE_STRING
|
109
105
|
|
110
106
|
GEMFILE_PREFIX = <<~MULTI_LINE_STRING
|
@@ -116,19 +112,17 @@ module Glimmer
|
|
116
112
|
MULTI_LINE_STRING
|
117
113
|
GEMFILE_APP_MIDFIX = <<~MULTI_LINE_STRING
|
118
114
|
|
119
|
-
gem 'glimmer-dsl-
|
115
|
+
gem 'glimmer-dsl-libui', '~> #{VERSION}'
|
120
116
|
MULTI_LINE_STRING
|
121
117
|
GEMFILE_GEM_MIDFIX = <<~MULTI_LINE_STRING
|
122
118
|
|
123
|
-
gem 'glimmer-dsl-
|
119
|
+
gem 'glimmer-dsl-libui', '~> #{VERSION.split('.')[0...2].join('.')}'
|
124
120
|
MULTI_LINE_STRING
|
125
121
|
GEMFILE_SUFFIX = <<~MULTI_LINE_STRING
|
126
122
|
|
127
123
|
group :development do
|
128
|
-
gem 'jar-dependencies', '0.4.1'
|
129
124
|
gem 'rspec', '~> 3.5.0'
|
130
125
|
gem 'juwelier', '2.4.9'
|
131
|
-
gem 'warbler', '2.0.5'
|
132
126
|
gem 'simplecov', '>= 0'
|
133
127
|
end
|
134
128
|
MULTI_LINE_STRING
|
@@ -139,13 +133,13 @@ module Glimmer
|
|
139
133
|
common_app(app_name)
|
140
134
|
end
|
141
135
|
|
142
|
-
def common_app(app_name,
|
136
|
+
def common_app(app_name, window_type = :app, window_options = {})
|
143
137
|
gem_name = file_name(app_name)
|
144
138
|
gem_summary = human_name(app_name)
|
145
139
|
return puts("The directory '#{gem_name}' already exists. Please either remove or pick a different name.") if Dir.exist?(gem_name)
|
146
|
-
|
147
|
-
system "
|
148
|
-
system "
|
140
|
+
# system "ruby -S gem install bundler --no-document" if OS.windows? # resolves freezing issue with warbler and bundler 2.2.29 included in JRuby
|
141
|
+
system "ruby -S gem install juwelier -v2.4.9 --no-document" unless juwelier_exist?
|
142
|
+
system "ruby -S juwelier --markdown --rspec --summary '#{gem_summary}' --description '#{gem_summary}' #{gem_name}"
|
149
143
|
return puts('Your Git user.name and/or github.user are missing! Please add in for Juwelier to help Glimmer with Scaffolding.') if `git config --get github.user`.strip.empty? || `git config --get user.name`.strip.empty?
|
150
144
|
cd gem_name
|
151
145
|
rm_rf 'lib'
|
@@ -154,13 +148,13 @@ module Glimmer
|
|
154
148
|
write '.ruby-gemset', app_name
|
155
149
|
write 'VERSION', '1.0.0'
|
156
150
|
write 'LICENSE.txt', "Copyright (c) #{Time.now.year} #{app_name}"
|
157
|
-
write 'Gemfile', gemfile(
|
151
|
+
write 'Gemfile', gemfile(window_type)
|
158
152
|
write 'Rakefile', gem_rakefile(app_name, nil, gem_name)
|
159
153
|
mkdir 'app'
|
160
154
|
write "app/#{file_name(app_name)}.rb", app_main_file(app_name)
|
161
155
|
mkdir_p "app/#{file_name(app_name)}/model"
|
162
156
|
mkdir_p "app/#{file_name(app_name)}/view"
|
163
|
-
|
157
|
+
custom_window(class_name(app_name), current_dir_name, window_type, custom_window_class_name: 'Application')
|
164
158
|
|
165
159
|
mkdir_p 'icons/windows'
|
166
160
|
icon_file = "icons/windows/#{human_name(app_name)}.ico"
|
@@ -189,31 +183,29 @@ module Glimmer
|
|
189
183
|
system "bash -c '#{RVM_FUNCTION}\n cd .\n bundle\n rspec --init\n'"
|
190
184
|
end
|
191
185
|
write 'spec/spec_helper.rb', spec_helper_file
|
192
|
-
if OS.mac?
|
193
|
-
system "bash -c '#{RVM_FUNCTION}\n cd .\n JRUBY_OPTS=\"$JRUBY_OPTS -J-XstartOnFirstThread\" glimmer run\n'"
|
194
|
-
elsif OS.linux?
|
186
|
+
if OS.mac? || OS.linux?
|
195
187
|
system "bash -c '#{RVM_FUNCTION}\n cd .\n glimmer run\n'"
|
196
188
|
else
|
197
189
|
system "glimmer run"
|
198
190
|
end
|
199
191
|
end
|
200
192
|
|
201
|
-
def
|
193
|
+
def custom_window(custom_window_name, namespace, window_type = nil, window_options = {})
|
202
194
|
namespace ||= current_dir_name
|
203
195
|
root_dir = File.exist?('app') ? 'app' : 'lib'
|
204
196
|
parent_dir = "#{root_dir}/#{file_name(namespace)}/view"
|
205
|
-
return puts("The file '#{parent_dir}/#{file_name(
|
197
|
+
return puts("The file '#{parent_dir}/#{file_name(custom_window_name)}.rb' already exists. Please either remove or pick a different name.") if File.exist?("#{parent_dir}/#{file_name(custom_window_name)}.rb")
|
206
198
|
mkdir_p parent_dir unless File.exist?(parent_dir)
|
207
|
-
write "#{parent_dir}/#{file_name(
|
199
|
+
write "#{parent_dir}/#{file_name(custom_window_name)}.rb", custom_window_file(custom_window_name, namespace, window_type, window_options)
|
208
200
|
end
|
209
201
|
|
210
|
-
def
|
202
|
+
def custom_control(custom_control_name, namespace)
|
211
203
|
namespace ||= current_dir_name
|
212
204
|
root_dir = File.exist?('app') ? 'app' : 'lib'
|
213
205
|
parent_dir = "#{root_dir}/#{file_name(namespace)}/view"
|
214
|
-
return puts("The file '#{parent_dir}/#{file_name(
|
206
|
+
return puts("The file '#{parent_dir}/#{file_name(custom_control_name)}.rb' already exists. Please either remove or pick a different name.") if File.exist?("#{parent_dir}/#{file_name(custom_control_name)}.rb")
|
215
207
|
mkdir_p parent_dir unless File.exist?(parent_dir)
|
216
|
-
write "#{parent_dir}/#{file_name(
|
208
|
+
write "#{parent_dir}/#{file_name(custom_control_name)}.rb", custom_control_file(custom_control_name, namespace)
|
217
209
|
end
|
218
210
|
|
219
211
|
def custom_shape(custom_shape_name, namespace)
|
@@ -225,13 +217,13 @@ module Glimmer
|
|
225
217
|
write "#{parent_dir}/#{file_name(custom_shape_name)}.rb", custom_shape_file(custom_shape_name, namespace)
|
226
218
|
end
|
227
219
|
|
228
|
-
def
|
229
|
-
gem_name = "glimmer-cs-#{compact_name(
|
230
|
-
gem_summary = "#{human_name(
|
220
|
+
def custom_window_gem(custom_window_name, namespace)
|
221
|
+
gem_name = "glimmer-cs-#{compact_name(custom_window_name)}"
|
222
|
+
gem_summary = "#{human_name(custom_window_name)} - Glimmer Custom Window"
|
231
223
|
begin
|
232
|
-
|
233
|
-
MAIN_OBJECT.method(
|
234
|
-
return puts("
|
224
|
+
custom_window_keyword = dsl_control_name(custom_window_name)
|
225
|
+
MAIN_OBJECT.method(custom_window_keyword)
|
226
|
+
return puts("CustomWindow keyword `#{custom_window_keyword}` is unavailable (occupied by a built-in Ruby method)! Please pick a different name.")
|
235
227
|
rescue NameError
|
236
228
|
# No Op (keyword is not taken by a built in Ruby method)
|
237
229
|
end
|
@@ -239,13 +231,13 @@ module Glimmer
|
|
239
231
|
gem_name += "-#{compact_name(namespace)}"
|
240
232
|
gem_summary += " (#{human_name(namespace)})"
|
241
233
|
else
|
242
|
-
return puts('Namespace is required! Usage: glimmer scaffold:gem:
|
234
|
+
return puts('Namespace is required! Usage: glimmer scaffold:gem:customwindow[name,namespace]') unless `git config --get github.user`.to_s.strip == 'AndyObtiva'
|
243
235
|
namespace = 'glimmer'
|
244
236
|
end
|
245
237
|
return puts("The directory '#{gem_name}' already exists. Please either remove or pick a different name.") if Dir.exist?(gem_name)
|
246
|
-
|
247
|
-
system "
|
248
|
-
system "
|
238
|
+
# system "ruby -S gem install bundler --no-document" if OS.windows? # resolves freezing issue with warbler and bundler 2.2.29 included in JRuby
|
239
|
+
system "ruby -S gem install juwelier -v2.4.9 --no-document" unless juwelier_exist?
|
240
|
+
system "ruby -S juwelier --markdown --rspec --summary '#{gem_summary}' --description '#{gem_summary}' #{gem_name}"
|
249
241
|
return puts('Your Git user.name and/or github.user are missing! Please add in for Juwelier to help Glimmer with Scaffolding.') if `git config --get github.user`.strip.empty? && `git config --get user.name`.strip.empty?
|
250
242
|
cd gem_name
|
251
243
|
write '.gitignore', GITIGNORE
|
@@ -253,15 +245,15 @@ module Glimmer
|
|
253
245
|
write '.ruby-gemset', gem_name
|
254
246
|
write 'VERSION', '1.0.0'
|
255
247
|
write 'Gemfile', GEM_GEMFILE
|
256
|
-
write 'Rakefile', gem_rakefile(
|
257
|
-
append "lib/#{gem_name}.rb", gem_main_file(
|
258
|
-
|
248
|
+
write 'Rakefile', gem_rakefile(custom_window_name, namespace, gem_name)
|
249
|
+
append "lib/#{gem_name}.rb", gem_main_file(custom_window_name, namespace)
|
250
|
+
custom_window(custom_window_name, namespace, :gem)
|
259
251
|
|
260
252
|
mkdir_p "lib/#{gem_name}"
|
261
|
-
write "lib/#{gem_name}/launch.rb", gem_launch_file(gem_name,
|
253
|
+
write "lib/#{gem_name}/launch.rb", gem_launch_file(gem_name, custom_window_name, namespace)
|
262
254
|
mkdir_p 'bin'
|
263
|
-
write "bin/#{file_name(
|
264
|
-
FileUtils.chmod 0755, "bin/#{file_name(
|
255
|
+
write "bin/#{file_name(custom_window_name)}", app_bin_command_file(gem_name, custom_window_name, namespace)
|
256
|
+
FileUtils.chmod 0755, "bin/#{file_name(custom_window_name)}"
|
265
257
|
if OS.windows?
|
266
258
|
system "bundle"
|
267
259
|
system "rspec --init"
|
@@ -285,9 +277,7 @@ module Glimmer
|
|
285
277
|
cp File.expand_path('../../../../icons/scaffold_app.png', __FILE__), icon_file
|
286
278
|
puts "Created #{current_dir_name}/#{icon_file}"
|
287
279
|
|
288
|
-
if OS.mac?
|
289
|
-
system "bash -c '#{RVM_FUNCTION}\n cd .\n JRUBY_OPTS=\"$JRUBY_OPTS -J-XstartOnFirstThread\" glimmer run\n'"
|
290
|
-
elsif OS.linux?
|
280
|
+
if OS.mac? || OS.linux?
|
291
281
|
system "bash -c '#{RVM_FUNCTION}\n cd .\n glimmer run\n'"
|
292
282
|
else
|
293
283
|
system "glimmer run"
|
@@ -299,21 +289,21 @@ module Glimmer
|
|
299
289
|
puts 'Run `rake release` to release into rubygems.org once ready.'
|
300
290
|
end
|
301
291
|
|
302
|
-
def
|
303
|
-
gem_name = "glimmer-cw-#{compact_name(
|
304
|
-
gem_summary = "#{human_name(
|
292
|
+
def custom_control_gem(custom_control_name, namespace)
|
293
|
+
gem_name = "glimmer-cw-#{compact_name(custom_control_name)}"
|
294
|
+
gem_summary = "#{human_name(custom_control_name)} - Glimmer Custom Control"
|
305
295
|
if namespace
|
306
296
|
gem_name += "-#{compact_name(namespace)}"
|
307
297
|
gem_summary += " (#{human_name(namespace)})"
|
308
298
|
else
|
309
|
-
return puts('Namespace is required! Usage: glimmer scaffold:
|
299
|
+
return puts('Namespace is required! Usage: glimmer scaffold:custom_control_gem[custom_control_name,namespace]') unless `git config --get github.user`.to_s.strip == 'AndyObtiva'
|
310
300
|
namespace = 'glimmer'
|
311
301
|
end
|
312
302
|
|
313
303
|
return puts("The directory '#{gem_name}' already exists. Please either remove or pick a different name.") if Dir.exist?(gem_name)
|
314
|
-
|
315
|
-
system "
|
316
|
-
system "
|
304
|
+
# system "ruby -S gem install bundler --no-document" if OS.windows? # resolves freezing issue with warbler and bundler 2.2.29 included in JRuby
|
305
|
+
system "ruby -S gem install juwelier -v2.4.9 --no-document" unless juwelier_exist?
|
306
|
+
system "ruby -S juwelier --markdown --rspec --summary '#{gem_summary}' --description '#{gem_summary}' #{gem_name}"
|
317
307
|
return puts('Your Git user.name and/or github.user are missing! Please add in for Juwelier to help Glimmer with Scaffolding.') if `git config --get github.user`.strip.empty? && `git config --get user.name`.strip.empty?
|
318
308
|
cd gem_name
|
319
309
|
write '.gitignore', GITIGNORE
|
@@ -322,8 +312,8 @@ module Glimmer
|
|
322
312
|
write 'VERSION', '1.0.0'
|
323
313
|
write 'Gemfile', GEM_GEMFILE
|
324
314
|
write 'Rakefile', gem_rakefile
|
325
|
-
append "lib/#{gem_name}.rb", gem_main_file(
|
326
|
-
|
315
|
+
append "lib/#{gem_name}.rb", gem_main_file(custom_control_name, namespace)
|
316
|
+
custom_control(custom_control_name, namespace)
|
327
317
|
if OS.windows?
|
328
318
|
system "bundle"
|
329
319
|
system "rspec --init"
|
@@ -350,9 +340,9 @@ module Glimmer
|
|
350
340
|
end
|
351
341
|
|
352
342
|
return puts("The directory '#{gem_name}' already exists. Please either remove or pick a different name.") if Dir.exist?(gem_name)
|
353
|
-
|
354
|
-
system "
|
355
|
-
system "
|
343
|
+
# system "ruby -S gem install bundler --no-document" if OS.windows? # resolves freezing issue with warbler and bundler 2.2.29 included in JRuby
|
344
|
+
system "ruby -S gem install juwelier -v2.4.9 --no-document" unless juwelier_exist?
|
345
|
+
system "ruby -S juwelier --markdown --rspec --summary '#{gem_summary}' --description '#{gem_summary}' #{gem_name}"
|
356
346
|
return puts('Your Git user.name and/or github.user are missing! Please add in for Juwelier to help Glimmer with Scaffolding.') if `git config --get github.user`.strip.empty? && `git config --get user.name`.strip.empty?
|
357
347
|
cd gem_name
|
358
348
|
write '.gitignore', GITIGNORE
|
@@ -406,7 +396,7 @@ module Glimmer
|
|
406
396
|
def file_name(app_name)
|
407
397
|
app_name.underscore
|
408
398
|
end
|
409
|
-
alias
|
399
|
+
alias dsl_control_name file_name
|
410
400
|
|
411
401
|
def human_name(app_name)
|
412
402
|
app_name.underscore.titlecase
|
@@ -416,7 +406,7 @@ module Glimmer
|
|
416
406
|
gem_name.underscore.camelcase.downcase
|
417
407
|
end
|
418
408
|
|
419
|
-
def gemfile(
|
409
|
+
def gemfile(window_type)
|
420
410
|
APP_GEMFILE
|
421
411
|
end
|
422
412
|
|
@@ -427,9 +417,9 @@ module Glimmer
|
|
427
417
|
begin
|
428
418
|
require 'bundler/setup'
|
429
419
|
Bundler.require(:default)
|
430
|
-
rescue
|
420
|
+
rescue StandardError, Gem::LoadError
|
431
421
|
# this runs when packaged as a gem (no bundler)
|
432
|
-
require 'glimmer-dsl-
|
422
|
+
require 'glimmer-dsl-libui'
|
433
423
|
# add more gems if needed
|
434
424
|
end
|
435
425
|
|
@@ -439,25 +429,23 @@ module Glimmer
|
|
439
429
|
APP_ROOT = File.expand_path('../..', __FILE__)
|
440
430
|
VERSION = File.read(File.join(APP_ROOT, 'VERSION'))
|
441
431
|
LICENSE = File.read(File.join(APP_ROOT, 'LICENSE.txt'))
|
442
|
-
Display.app_name = '#{human_name(app_name)}'
|
443
|
-
Display.app_version = VERSION
|
444
432
|
end
|
445
433
|
|
446
|
-
require '#{file_name(app_name)}/view
|
434
|
+
require '#{file_name(app_name)}/view/#{file_name(app_name)}'
|
447
435
|
MULTI_LINE_STRING
|
448
436
|
end
|
449
437
|
|
450
|
-
def gem_main_file(
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
438
|
+
def gem_main_file(custom_control_name, namespace = nil)
|
439
|
+
custom_control_file_path = ''
|
440
|
+
custom_control_file_path += "#{file_name(namespace)}/" if namespace
|
441
|
+
custom_control_file_path += "view"
|
442
|
+
custom_control_file_path += "/#{file_name(custom_control_name)}"
|
455
443
|
|
456
444
|
<<~MULTI_LINE_STRING
|
457
445
|
$LOAD_PATH.unshift(File.expand_path('..', __FILE__))
|
458
446
|
|
459
|
-
require 'glimmer-dsl-
|
460
|
-
require '#{
|
447
|
+
require 'glimmer-dsl-libui'
|
448
|
+
require '#{custom_control_file_path}'
|
461
449
|
MULTI_LINE_STRING
|
462
450
|
end
|
463
451
|
|
@@ -465,67 +453,52 @@ module Glimmer
|
|
465
453
|
<<~MULTI_LINE_STRING
|
466
454
|
require_relative '../#{file_name(app_name)}'
|
467
455
|
|
468
|
-
#{class_name(app_name)}::View
|
456
|
+
#{class_name(app_name)}::View::#{class_name(app_name)}.launch
|
469
457
|
MULTI_LINE_STRING
|
470
458
|
end
|
471
459
|
|
472
|
-
def app_bin_command_file(app_name_or_gem_name,
|
473
|
-
if
|
460
|
+
def app_bin_command_file(app_name_or_gem_name, custom_window_name=nil, namespace=nil)
|
461
|
+
if custom_window_name.nil?
|
474
462
|
runner = "File.expand_path('../../app/#{file_name(app_name_or_gem_name)}/launch.rb', __FILE__)"
|
475
463
|
else
|
476
464
|
runner = "File.expand_path('../../lib/#{app_name_or_gem_name}/launch.rb', __FILE__)"
|
477
465
|
end
|
478
466
|
<<~MULTI_LINE_STRING
|
479
|
-
#!/usr/bin/env
|
467
|
+
#!/usr/bin/env ruby
|
480
468
|
|
481
469
|
runner = #{runner}
|
482
470
|
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
require 'glimmer/launcher'
|
488
|
-
|
489
|
-
launcher = Glimmer::Launcher.new([runner] + ARGV)
|
490
|
-
launcher.launch
|
491
|
-
end
|
471
|
+
require 'glimmer/launcher'
|
472
|
+
|
473
|
+
launcher = Glimmer::Launcher.new([runner] + ARGV)
|
474
|
+
launcher.launch
|
492
475
|
MULTI_LINE_STRING
|
493
476
|
end
|
494
477
|
|
495
|
-
def gem_launch_file(gem_name,
|
478
|
+
def gem_launch_file(gem_name, custom_window_name, namespace)
|
496
479
|
# TODO change this so that it does not mix Glimmer unto the main object
|
497
480
|
<<~MULTI_LINE_STRING
|
498
481
|
require_relative '../#{gem_name}'
|
499
482
|
|
500
|
-
#{class_name(namespace)}::View::#{class_name(
|
483
|
+
#{class_name(namespace)}::View::#{class_name(custom_window_name)}.launch
|
501
484
|
MULTI_LINE_STRING
|
502
485
|
end
|
503
486
|
|
504
|
-
def gem_rakefile(
|
487
|
+
def gem_rakefile(custom_window_name = nil, namespace = nil, gem_name = nil)
|
505
488
|
rakefile_content = File.read('Rakefile')
|
506
489
|
lines = rakefile_content.split("\n")
|
507
490
|
require_rake_line_index = lines.index(lines.detect {|l| l.include?("require 'rake'") })
|
508
491
|
lines.insert(require_rake_line_index, "require 'glimmer/launcher'")
|
509
492
|
gem_files_line_index = lines.index(lines.detect {|l| l.include?('# dependencies defined in Gemfile') })
|
510
|
-
if
|
511
|
-
lines.insert(gem_files_line_index, " gem.files = Dir['VERSION', 'LICENSE.txt', 'app/**/*', 'bin/**/*', 'config/**/*', 'db/**/*', 'docs/**/*', 'fonts/**/*', 'icons/**/*', 'images/**/*', 'lib/**/*', 'script/**/*', 'sounds/**/*', '
|
512
|
-
|
513
|
-
lines.insert(gem_files_line_index+
|
514
|
-
lines.insert(gem_files_line_index+2, " gem.executables = ['#{file_name(custom_shell_name)}']") if custom_shell_name
|
493
|
+
if custom_window_name
|
494
|
+
lines.insert(gem_files_line_index, " gem.files = Dir['VERSION', 'LICENSE.txt', 'app/**/*', 'bin/**/*', 'config/**/*', 'db/**/*', 'docs/**/*', 'fonts/**/*', 'icons/**/*', 'images/**/*', 'lib/**/*', 'script/**/*', 'sounds/**/*', 'videos/**/*']")
|
495
|
+
lines.insert(gem_files_line_index+1, " gem.require_paths = ['lib', 'app']")
|
496
|
+
lines.insert(gem_files_line_index+2, " gem.executables = ['#{file_name(custom_window_name)}']") if custom_window_name
|
515
497
|
else
|
516
498
|
lines.insert(gem_files_line_index, " gem.files = Dir['VERSION', 'LICENSE.txt', 'lib/**/*']")
|
517
499
|
end
|
518
500
|
lines << "\nrequire 'glimmer/rake_task'\n"
|
519
|
-
|
520
|
-
if custom_shell_name
|
521
|
-
file_content << <<~MULTI_LINE_STRING
|
522
|
-
Glimmer::RakeTask::Package.jpackage_extra_args =
|
523
|
-
" --name '#{human_name(custom_shell_name)}'" +
|
524
|
-
" --description '#{human_name(custom_shell_name)}'"
|
525
|
-
# You can add more options from https://docs.oracle.com/en/java/javase/16/jpackage/packaging-tool-user-guide.pdf
|
526
|
-
MULTI_LINE_STRING
|
527
|
-
end
|
528
|
-
file_content
|
501
|
+
lines.join("\n")
|
529
502
|
end
|
530
503
|
|
531
504
|
def spec_helper_file
|
@@ -538,7 +511,7 @@ module Glimmer
|
|
538
511
|
]
|
539
512
|
configure_block_line_index = lines.index(lines.detect {|l| l.include?('RSpec.configure do') }) + 1
|
540
513
|
lines[configure_block_line_index...configure_block_line_index] = [
|
541
|
-
' # The following ensures rspec tests that instantiate and set Glimmer DSL
|
514
|
+
' # The following ensures rspec tests that instantiate and set Glimmer DSL controls in @target get cleaned after',
|
542
515
|
' config.after do',
|
543
516
|
' @target.dispose if @target && @target.respond_to?(:dispose)',
|
544
517
|
' Glimmer::DSL::Engine.reset',
|
@@ -549,197 +522,184 @@ module Glimmer
|
|
549
522
|
lines.join("\n")
|
550
523
|
end
|
551
524
|
|
552
|
-
def
|
525
|
+
def custom_window_file(custom_window_name, namespace, window_type, window_options = {})
|
526
|
+
window_options ||= {}
|
527
|
+
window_options[:custom_window_class_name] ||= 'CustomWindow'
|
553
528
|
namespace_type = class_name(namespace) == class_name(current_dir_name) ? 'class' : 'module'
|
554
529
|
|
555
|
-
|
530
|
+
custom_window_file_content = <<-MULTI_LINE_STRING
|
556
531
|
#{namespace_type} #{class_name(namespace)}
|
557
532
|
module View
|
558
|
-
class #{class_name(
|
559
|
-
include Glimmer::
|
533
|
+
class #{class_name(custom_window_name)}
|
534
|
+
include Glimmer::LibUI::#{window_options[:custom_window_class_name]}
|
560
535
|
|
561
536
|
MULTI_LINE_STRING
|
562
537
|
|
563
|
-
if
|
564
|
-
|
538
|
+
if window_type == :gem
|
539
|
+
custom_window_file_content += <<-MULTI_LINE_STRING
|
565
540
|
APP_ROOT = File.expand_path('../../../..', __FILE__)
|
566
541
|
VERSION = File.read(File.join(APP_ROOT, 'VERSION'))
|
567
542
|
LICENSE = File.read(File.join(APP_ROOT, 'LICENSE.txt'))
|
568
|
-
|
569
|
-
|
543
|
+
MULTI_LINE_STRING
|
544
|
+
end
|
570
545
|
|
546
|
+
if %i[gem app].include?(window_type)
|
547
|
+
custom_window_file_content += <<-MULTI_LINE_STRING
|
548
|
+
GREETINGS = [
|
549
|
+
'Hello, World!',
|
550
|
+
'Howdy, Partner!'
|
551
|
+
]
|
571
552
|
MULTI_LINE_STRING
|
572
553
|
end
|
573
554
|
|
574
|
-
|
575
|
-
|
555
|
+
custom_window_file_content += <<-MULTI_LINE_STRING
|
556
|
+
|
557
|
+
## Add options like the following to configure CustomWindow by outside consumers
|
576
558
|
#
|
577
559
|
# options :title, :background_color
|
578
560
|
# option :width, default: 320
|
579
561
|
# option :height, default: 240
|
580
|
-
|
562
|
+
MULTI_LINE_STRING
|
563
|
+
|
564
|
+
if %i[gem app].include?(window_type)
|
565
|
+
custom_window_file_content += <<-MULTI_LINE_STRING
|
566
|
+
|
567
|
+
# GREETING Array selected index
|
568
|
+
option :greeting_index, default: 0
|
569
|
+
MULTI_LINE_STRING
|
570
|
+
end
|
571
|
+
|
572
|
+
custom_window_file_content += <<-MULTI_LINE_STRING
|
581
573
|
|
582
|
-
## Use before_body block to pre-initialize variables to use in body
|
583
|
-
#
|
574
|
+
## Use before_body block to pre-initialize variables to use in body and
|
575
|
+
# to setup application menu
|
584
576
|
#
|
585
577
|
MULTI_LINE_STRING
|
586
578
|
|
587
|
-
if %i[gem app].include?(
|
588
|
-
|
579
|
+
if %i[gem app].include?(window_type)
|
580
|
+
custom_window_file_content += <<-MULTI_LINE_STRING
|
589
581
|
before_body do
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
582
|
+
menu('File') {
|
583
|
+
menu_item('Preferences...') {
|
584
|
+
on_clicked do
|
585
|
+
display_preferences_dialog
|
586
|
+
end
|
587
|
+
}
|
594
588
|
|
595
|
-
|
596
|
-
|
589
|
+
# Enables quitting with CMD+Q on Mac with Mac Quit menu item
|
590
|
+
quit_menu_item if OS.mac?
|
591
|
+
}
|
592
|
+
menu('Help') {
|
593
|
+
if OS.mac?
|
594
|
+
about_menu_item {
|
595
|
+
on_clicked do
|
596
|
+
display_about_dialog
|
597
|
+
end
|
598
|
+
}
|
597
599
|
end
|
600
|
+
|
601
|
+
menu_item('About') {
|
602
|
+
on_clicked do
|
603
|
+
display_about_dialog
|
604
|
+
end
|
605
|
+
}
|
598
606
|
}
|
599
607
|
end
|
600
608
|
MULTI_LINE_STRING
|
601
609
|
else
|
602
|
-
|
610
|
+
custom_window_file_content += <<-MULTI_LINE_STRING
|
603
611
|
# before_body do
|
604
612
|
#
|
605
613
|
# end
|
606
614
|
MULTI_LINE_STRING
|
607
615
|
end
|
608
616
|
|
609
|
-
|
617
|
+
custom_window_file_content += <<-MULTI_LINE_STRING
|
610
618
|
|
611
|
-
## Use after_body block to setup observers for
|
619
|
+
## Use after_body block to setup observers for controls in body
|
612
620
|
#
|
613
621
|
# after_body do
|
614
622
|
#
|
615
623
|
# end
|
616
624
|
|
617
|
-
## Add
|
618
|
-
## Top-most
|
625
|
+
## Add control content inside custom window body
|
626
|
+
## Top-most control must be a window or another custom window
|
619
627
|
#
|
620
628
|
body {
|
621
|
-
|
622
|
-
# Replace example content below with custom
|
623
|
-
|
624
|
-
|
625
|
-
image File.join(APP_ROOT, 'icons', 'linux', "#{human_name(current_dir_name)}.png") unless OS.windows?
|
626
|
-
text "#{human_name(namespace)}#{' - ' + human_name(custom_shell_name)}"
|
627
|
-
grid_layout
|
628
|
-
label(:center) {
|
629
|
-
text <= [self, :greeting]
|
630
|
-
font height: 40
|
631
|
-
layout_data :fill, :center, true, true
|
632
|
-
}
|
633
|
-
MULTI_LINE_STRING
|
629
|
+
window {
|
630
|
+
# Replace example content below with custom window content
|
631
|
+
content_size 240, 240
|
632
|
+
title '#{human_name(namespace)}'
|
634
633
|
|
635
|
-
|
636
|
-
custom_shell_file_content += <<-MULTI_LINE_STRING
|
634
|
+
margined true
|
637
635
|
|
638
|
-
|
639
|
-
|
640
|
-
text '&File'
|
641
|
-
|
642
|
-
menu_item {
|
643
|
-
text '&Preferences...'
|
644
|
-
|
645
|
-
on_widget_selected do
|
646
|
-
display_preferences_dialog
|
647
|
-
end
|
648
|
-
}
|
649
|
-
}
|
650
|
-
menu {
|
651
|
-
text '&Help'
|
652
|
-
|
653
|
-
menu_item {
|
654
|
-
text '&About...'
|
655
|
-
|
656
|
-
on_widget_selected do
|
657
|
-
display_about_dialog
|
658
|
-
end
|
659
|
-
}
|
660
|
-
}
|
636
|
+
label {
|
637
|
+
text <= [self, :greeting_index, on_read: -> { greeting }]
|
661
638
|
}
|
662
|
-
MULTI_LINE_STRING
|
663
|
-
end
|
664
|
-
|
665
|
-
custom_shell_file_content += <<-MULTI_LINE_STRING
|
666
639
|
}
|
667
640
|
}
|
668
641
|
MULTI_LINE_STRING
|
669
642
|
|
670
|
-
if %i[gem app].include?(
|
671
|
-
|
643
|
+
if %i[gem app].include?(window_type)
|
644
|
+
custom_window_file_content += <<-MULTI_LINE_STRING
|
645
|
+
|
646
|
+
def greeting
|
647
|
+
GREETINGS[greeting_index]
|
648
|
+
end
|
672
649
|
|
673
650
|
def display_about_dialog
|
674
|
-
|
675
|
-
|
676
|
-
message "#{human_name(namespace)}#{" - #{human_name(custom_shell_name)}" if shell_type == :gem} \#{VERSION}\\n\\n\#{LICENSE}"
|
677
|
-
}.open
|
651
|
+
message = "#{human_name(namespace)}#{" - #{human_name(custom_window_name)}" if window_type == :gem} \#{VERSION}\\n\\n\#{LICENSE}"
|
652
|
+
msg_box('About', message)
|
678
653
|
end
|
679
654
|
|
680
655
|
MULTI_LINE_STRING
|
681
656
|
end
|
682
657
|
|
683
|
-
if %i[gem app].include?(
|
684
|
-
|
658
|
+
if %i[gem app].include?(window_type)
|
659
|
+
custom_window_file_content += <<-MULTI_LINE_STRING
|
685
660
|
def display_preferences_dialog
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
margin_width 5
|
690
|
-
}
|
661
|
+
window {
|
662
|
+
title 'Preferences'
|
663
|
+
content_size 200, 100
|
691
664
|
|
692
|
-
|
665
|
+
margined true
|
693
666
|
|
694
|
-
|
695
|
-
|
696
|
-
type :vertical
|
697
|
-
spacing 10
|
698
|
-
}
|
667
|
+
vertical_box {
|
668
|
+
padded true
|
699
669
|
|
700
|
-
|
701
|
-
|
670
|
+
label('Greeting:') {
|
671
|
+
stretchy false
|
672
|
+
}
|
702
673
|
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
width 160
|
710
|
-
}
|
711
|
-
|
712
|
-
text greeting_text
|
713
|
-
selection <= [self, :greeting, on_read: ->(g) { g == greeting_text }]
|
714
|
-
|
715
|
-
on_widget_selected do |event|
|
716
|
-
self.greeting = event.widget.getText
|
717
|
-
end
|
718
|
-
}
|
719
|
-
end
|
674
|
+
radio_buttons {
|
675
|
+
stretchy false
|
676
|
+
|
677
|
+
items GREETINGS
|
678
|
+
selected <=> [self, :greeting_index]
|
679
|
+
}
|
720
680
|
}
|
721
|
-
}.
|
681
|
+
}.show
|
722
682
|
end
|
723
683
|
MULTI_LINE_STRING
|
724
684
|
end
|
725
685
|
|
726
|
-
|
686
|
+
custom_window_file_content += <<-MULTI_LINE_STRING
|
727
687
|
end
|
728
688
|
end
|
729
689
|
end
|
730
690
|
MULTI_LINE_STRING
|
731
691
|
end
|
732
692
|
|
733
|
-
def
|
693
|
+
def custom_control_file(custom_control_name, namespace)
|
734
694
|
namespace_type = class_name(namespace) == class_name(current_dir_name) ? 'class' : 'module'
|
735
695
|
|
736
696
|
<<-MULTI_LINE_STRING
|
737
697
|
#{namespace_type} #{class_name(namespace)}
|
738
698
|
module View
|
739
|
-
class #{class_name(
|
740
|
-
include Glimmer::
|
699
|
+
class #{class_name(custom_control_name)}
|
700
|
+
include Glimmer::LibUI::CustomControl
|
741
701
|
|
742
|
-
## Add options like the following to configure
|
702
|
+
## Add options like the following to configure CustomControl by outside consumers
|
743
703
|
#
|
744
704
|
# options :custom_text, :background_color
|
745
705
|
# option :foreground_color, default: :red
|
@@ -751,21 +711,21 @@ end
|
|
751
711
|
#
|
752
712
|
# end
|
753
713
|
|
754
|
-
## Use after_body block to setup observers for
|
714
|
+
## Use after_body block to setup observers for controls in body
|
755
715
|
#
|
756
716
|
# after_body do
|
757
717
|
#
|
758
718
|
# end
|
759
719
|
|
760
|
-
## Add
|
720
|
+
## Add control content under custom control body
|
761
721
|
##
|
762
|
-
## If you want to add a
|
763
|
-
## consider creating a custom
|
764
|
-
## (Glimmer::
|
722
|
+
## If you want to add a window as the top-most control,
|
723
|
+
## consider creating a custom window instead
|
724
|
+
## (Glimmer::LibUI::CustomWindow offers window convenience methods, like show and hide)
|
765
725
|
#
|
766
726
|
body {
|
767
|
-
# Replace example content below with custom
|
768
|
-
label
|
727
|
+
# Replace example content below with custom control content
|
728
|
+
label {
|
769
729
|
background :red
|
770
730
|
}
|
771
731
|
}
|
@@ -783,7 +743,7 @@ end
|
|
783
743
|
#{namespace_type} #{class_name(namespace)}
|
784
744
|
module View
|
785
745
|
class #{class_name(custom_shape_name)}
|
786
|
-
include Glimmer::
|
746
|
+
include Glimmer::LibUI::CustomShape
|
787
747
|
|
788
748
|
## Add options like the following to configure CustomShape by outside consumers
|
789
749
|
#
|
data/lib/glimmer/rake_task.rb
CHANGED
@@ -72,76 +72,73 @@ namespace :glimmer do
|
|
72
72
|
Glimmer::RakeTask::Scaffold.app(args[:app_name])
|
73
73
|
end
|
74
74
|
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
task :custom_shape_gem, [:name, :namespace] => 'gem:customshape'
|
143
|
-
|
144
|
-
end
|
75
|
+
# namespace :scaffold do
|
76
|
+
# desc 'Scaffold Glimmer::UI::CustomWindow subclass (full window view) under app/views (namespace is optional) [alt: scaffold:cw]'
|
77
|
+
# task :customwindow, [:name, :namespace] do |t, args|
|
78
|
+
# require_relative 'rake_task/scaffold'
|
79
|
+
# Glimmer::RakeTask::Scaffold.custom_window(args[:name], args[:namespace])
|
80
|
+
# end
|
81
|
+
#
|
82
|
+
# task :cw, [:name, :namespace] => :customwindow
|
83
|
+
# task :custom_window, [:name, :namespace] => :customwindow
|
84
|
+
# task :"custom-window", [:name, :namespace] => :customwindow
|
85
|
+
#
|
86
|
+
# desc 'Scaffold Glimmer::UI::CustomControl subclass (part of a view) under app/views (namespace is optional) [alt: scaffold:cc]'
|
87
|
+
# task :customcontrol, [:name, :namespace] do |t, args|
|
88
|
+
# require_relative 'rake_task/scaffold'
|
89
|
+
# Glimmer::RakeTask::Scaffold.custom_control(args[:name], args[:namespace])
|
90
|
+
# end
|
91
|
+
#
|
92
|
+
# task :cc, [:name, :namespace] => :customcontrol
|
93
|
+
# task :custom_control, [:name, :namespace] => :customcontrol
|
94
|
+
# task :"custom-control", [:name, :namespace] => :customcontrol
|
95
|
+
#
|
96
|
+
# desc 'Scaffold Glimmer::UI::CustomShape subclass (part of a view) under app/views (namespace is optional) [alt: scaffold:cs]'
|
97
|
+
# task :customshape, [:name, :namespace] do |t, args|
|
98
|
+
# require_relative 'rake_task/scaffold'
|
99
|
+
# Glimmer::RakeTask::Scaffold.custom_shape(args[:name], args[:namespace])
|
100
|
+
# end
|
101
|
+
#
|
102
|
+
# task :cs, [:name, :namespace] => :customshape
|
103
|
+
# task :custom_shape, [:name, :namespace] => :customshape
|
104
|
+
# task :"custom-shape", [:name, :namespace] => :customshape
|
105
|
+
#
|
106
|
+
# namespace :gem do
|
107
|
+
# desc 'Scaffold Glimmer::UI::CustomWindow subclass (full window view) under its own Ruby gem + app project (namespace is required) [alt: scaffold:gem:cw]'
|
108
|
+
# task :customwindow, [:name, :namespace] do |t, args|
|
109
|
+
# require_relative 'rake_task/scaffold'
|
110
|
+
# Glimmer::RakeTask::Scaffold.custom_window_gem(args[:name], args[:namespace])
|
111
|
+
# end
|
112
|
+
#
|
113
|
+
# task :cw, [:name, :namespace] => :customwindow
|
114
|
+
# task :custom_window, [:name, :namespace] => :customwindow
|
115
|
+
# task :"custom-window", [:name, :namespace] => :customwindow
|
116
|
+
#
|
117
|
+
# desc 'Scaffold Glimmer::UI::CustomControl subclass (part of a view) under its own Ruby gem project (namespace is required) [alt: scaffold:gem:cc]'
|
118
|
+
# task :customcontrol, [:name, :namespace] do |t, args|
|
119
|
+
# require_relative 'rake_task/scaffold'
|
120
|
+
# Glimmer::RakeTask::Scaffold.custom_control_gem(args[:name], args[:namespace])
|
121
|
+
# end
|
122
|
+
#
|
123
|
+
# task :cc, [:name, :namespace] => :customcontrol
|
124
|
+
# task :custom_control, [:name, :namespace] => :customcontrol
|
125
|
+
# task :"custom-control", [:name, :namespace] => :customcontrol
|
126
|
+
#
|
127
|
+
# desc 'Scaffold Glimmer::UI::CustomShape subclass (part of a view) under its own Ruby gem project (namespace is required) [alt: scaffold:gem:cs]'
|
128
|
+
# task :customshape, [:name, :namespace] do |t, args|
|
129
|
+
# require_relative 'rake_task/scaffold'
|
130
|
+
# Glimmer::RakeTask::Scaffold.custom_shape_gem(args[:name], args[:namespace])
|
131
|
+
# end
|
132
|
+
#
|
133
|
+
# task :cs, [:name, :namespace] => :customshape
|
134
|
+
# task :custom_shape, [:name, :namespace] => :customshape
|
135
|
+
# task :"custom-shape", [:name, :namespace] => :customshape
|
136
|
+
# end
|
137
|
+
#
|
138
|
+
# task :custom_window_gem, [:name, :namespace] => 'gem:customwindow'
|
139
|
+
# task :custom_control_gem, [:name, :namespace] => 'gem:customcontrol'
|
140
|
+
# task :custom_shape_gem, [:name, :namespace] => 'gem:customshape'
|
141
|
+
# end
|
145
142
|
|
146
143
|
namespace :list do
|
147
144
|
task :list_require do
|
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.9.
|
4
|
+
version: 0.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Maleh
|
@@ -52,6 +52,46 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 1.4.1
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: puts_debuggerer
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.13.5
|
62
|
+
- - "<"
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: 2.0.0
|
65
|
+
type: :runtime
|
66
|
+
prerelease: false
|
67
|
+
version_requirements: !ruby/object:Gem::Requirement
|
68
|
+
requirements:
|
69
|
+
- - ">="
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: 0.13.5
|
72
|
+
- - "<"
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: 2.0.0
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: rake-tui
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: 0.2.3
|
82
|
+
- - "<"
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: 2.0.0
|
85
|
+
type: :runtime
|
86
|
+
prerelease: false
|
87
|
+
version_requirements: !ruby/object:Gem::Requirement
|
88
|
+
requirements:
|
89
|
+
- - ">="
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: 0.2.3
|
92
|
+
- - "<"
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: 2.0.0
|
55
95
|
- !ruby/object:Gem::Dependency
|
56
96
|
name: os
|
57
97
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,6 +126,26 @@ dependencies:
|
|
86
126
|
- - "~>"
|
87
127
|
- !ruby/object:Gem::Version
|
88
128
|
version: '1.8'
|
129
|
+
- !ruby/object:Gem::Dependency
|
130
|
+
name: rake
|
131
|
+
requirement: !ruby/object:Gem::Requirement
|
132
|
+
requirements:
|
133
|
+
- - ">="
|
134
|
+
- !ruby/object:Gem::Version
|
135
|
+
version: 10.1.0
|
136
|
+
- - "<"
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: 14.0.0
|
139
|
+
type: :runtime
|
140
|
+
prerelease: false
|
141
|
+
version_requirements: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: 10.1.0
|
146
|
+
- - "<"
|
147
|
+
- !ruby/object:Gem::Version
|
148
|
+
version: 14.0.0
|
89
149
|
- !ruby/object:Gem::Dependency
|
90
150
|
name: libui
|
91
151
|
requirement: !ruby/object:Gem::Requirement
|
@@ -244,34 +304,6 @@ dependencies:
|
|
244
304
|
- - "~>"
|
245
305
|
- !ruby/object:Gem::Version
|
246
306
|
version: '3.0'
|
247
|
-
- !ruby/object:Gem::Dependency
|
248
|
-
name: rake-tui
|
249
|
-
requirement: !ruby/object:Gem::Requirement
|
250
|
-
requirements:
|
251
|
-
- - ">="
|
252
|
-
- !ruby/object:Gem::Version
|
253
|
-
version: 0.2.1
|
254
|
-
type: :development
|
255
|
-
prerelease: false
|
256
|
-
version_requirements: !ruby/object:Gem::Requirement
|
257
|
-
requirements:
|
258
|
-
- - ">="
|
259
|
-
- !ruby/object:Gem::Version
|
260
|
-
version: 0.2.1
|
261
|
-
- !ruby/object:Gem::Dependency
|
262
|
-
name: puts_debuggerer
|
263
|
-
requirement: !ruby/object:Gem::Requirement
|
264
|
-
requirements:
|
265
|
-
- - "~>"
|
266
|
-
- !ruby/object:Gem::Version
|
267
|
-
version: 0.13.1
|
268
|
-
type: :development
|
269
|
-
prerelease: false
|
270
|
-
version_requirements: !ruby/object:Gem::Requirement
|
271
|
-
requirements:
|
272
|
-
- - "~>"
|
273
|
-
- !ruby/object:Gem::Version
|
274
|
-
version: 0.13.1
|
275
307
|
- !ruby/object:Gem::Dependency
|
276
308
|
name: coveralls
|
277
309
|
requirement: !ruby/object:Gem::Requirement
|
@@ -336,6 +368,7 @@ files:
|
|
336
368
|
- CHANGELOG.md
|
337
369
|
- LICENSE.txt
|
338
370
|
- README.md
|
371
|
+
- RUBY_VERSION
|
339
372
|
- VERSION
|
340
373
|
- bin/girb
|
341
374
|
- bin/girb_runner.rb
|
@@ -457,6 +490,9 @@ files:
|
|
457
490
|
- glimmer-dsl-libui.gemspec
|
458
491
|
- icons/blank.png
|
459
492
|
- icons/glimmer.png
|
493
|
+
- icons/scaffold_app.icns
|
494
|
+
- icons/scaffold_app.ico
|
495
|
+
- icons/scaffold_app.png
|
460
496
|
- lib/glimmer-dsl-libui.rb
|
461
497
|
- lib/glimmer-dsl-libui/ext/glimmer.rb
|
462
498
|
- lib/glimmer-dsl-libui/ext/rouge/theme/glimmer.rb
|
@@ -597,7 +633,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
597
633
|
- !ruby/object:Gem::Version
|
598
634
|
version: '0'
|
599
635
|
requirements: []
|
600
|
-
rubygems_version: 3.
|
636
|
+
rubygems_version: 3.4.10
|
601
637
|
signing_key:
|
602
638
|
specification_version: 4
|
603
639
|
summary: Glimmer DSL for LibUI (Fukuoka Award Winning Prerequisite-Free Ruby Desktop
|