glimmer-dsl-libui 0.8.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -1
- data/README.md +230 -125
- data/VERSION +1 -1
- data/bin/girb +1 -1
- data/bin/glimmer +30 -0
- data/glimmer-dsl-libui.gemspec +0 -0
- data/lib/glimmer/Rakefile +26 -0
- data/lib/glimmer/launcher.rb +231 -0
- data/lib/glimmer/rake_task/list.rb +105 -0
- data/lib/glimmer/rake_task/scaffold.rb +839 -0
- data/lib/glimmer/rake_task.rb +192 -0
- metadata +41 -12
@@ -0,0 +1,192 @@
|
|
1
|
+
# Copyright (c) 2021-2023 Andy Maleh
|
2
|
+
#
|
3
|
+
# Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
# a copy of this software and associated documentation files (the
|
5
|
+
# "Software"), to deal in the Software without restriction, including
|
6
|
+
# without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
# distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
# permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
# the following conditions:
|
10
|
+
#
|
11
|
+
# The above copyright notice and this permission notice shall be
|
12
|
+
# included in all copies or substantial portions of the Software.
|
13
|
+
#
|
14
|
+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
21
|
+
|
22
|
+
module Glimmer
|
23
|
+
module RakeTask
|
24
|
+
RVM_FUNCTION = <<~MULTI_LINE_STRING
|
25
|
+
# Load RVM into a shell session *as a function*
|
26
|
+
if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then
|
27
|
+
|
28
|
+
# First try to load from a user install
|
29
|
+
source "$HOME/.rvm/scripts/rvm"
|
30
|
+
|
31
|
+
elif [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then
|
32
|
+
|
33
|
+
# Then try to load from a root install
|
34
|
+
source "/usr/local/rvm/scripts/rvm"
|
35
|
+
|
36
|
+
fi
|
37
|
+
MULTI_LINE_STRING
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
require 'rake'
|
42
|
+
|
43
|
+
ENV['GLIMMER_LOGGER_ENABLED'] = 'false'
|
44
|
+
require 'puts_debuggerer' if ("#{ENV['pd']}#{ENV['PD']}").to_s.downcase.include?('true')
|
45
|
+
|
46
|
+
namespace :glimmer do
|
47
|
+
desc 'Runs Glimmer app or custom window gem in the current directory, unless app_path is specified, then runs it instead (app_path is optional)'
|
48
|
+
task :run, [:app_path] do |t, args|
|
49
|
+
require_relative 'launcher'
|
50
|
+
if args[:app_path].nil?
|
51
|
+
require 'fileutils'
|
52
|
+
current_directory_name = File.basename(FileUtils.pwd)
|
53
|
+
assumed_shell_script = File.join('.', 'bin', current_directory_name)
|
54
|
+
assumed_shell_script = Dir.glob('./bin/*').detect {|f| File.file?(f)} if !File.exist?(assumed_shell_script)
|
55
|
+
Glimmer::Launcher.new([assumed_shell_script]).launch
|
56
|
+
else
|
57
|
+
Glimmer::Launcher.new([args[:app_path]]).launch
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
desc 'Brings up the Glimmer Meta-Sample app to allow browsing, running, and viewing code of Glimmer samples'
|
62
|
+
task :examples do
|
63
|
+
Glimmer::Launcher.new([File.expand_path('../../../examples/meta_example.rb', __FILE__)]).launch
|
64
|
+
end
|
65
|
+
task :samples do
|
66
|
+
Glimmer::Launcher.new([File.expand_path('../../../examples/meta_example.rb', __FILE__)]).launch
|
67
|
+
end
|
68
|
+
|
69
|
+
desc 'Scaffold Glimmer application directory structure to build a new app'
|
70
|
+
task :scaffold, [:app_name] do |t, args|
|
71
|
+
require_relative 'rake_task/scaffold'
|
72
|
+
Glimmer::RakeTask::Scaffold.app(args[:app_name])
|
73
|
+
end
|
74
|
+
|
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
|
+
# legacy support
|
139
|
+
|
140
|
+
task :custom_window_gem, [:name, :namespace] => 'gem:customwindow'
|
141
|
+
task :custom_control_gem, [:name, :namespace] => 'gem:customcontrol'
|
142
|
+
task :custom_shape_gem, [:name, :namespace] => 'gem:customshape'
|
143
|
+
|
144
|
+
end
|
145
|
+
|
146
|
+
namespace :list do
|
147
|
+
task :list_require do
|
148
|
+
require_relative 'rake_task/list'
|
149
|
+
end
|
150
|
+
|
151
|
+
namespace :gems do
|
152
|
+
desc 'List Glimmer custom control gems available at rubygems.org (query is optional) [alt: list:gems:cc]'
|
153
|
+
task :customcontrol, [:query] => :list_require do |t, args|
|
154
|
+
Glimmer::RakeTask::List.custom_control_gems(args[:query])
|
155
|
+
end
|
156
|
+
|
157
|
+
task :cc, [:query] => :customcontrol
|
158
|
+
task :custom_control, [:query] => :customcontrol
|
159
|
+
task :"custom-control", [:query] => :customcontrol
|
160
|
+
|
161
|
+
desc 'List Glimmer custom window gems available at rubygems.org (query is optional) [alt: list:gems:cw]'
|
162
|
+
task :customwindow, [:query] => :list_require do |t, args|
|
163
|
+
Glimmer::RakeTask::List.custom_window_gems(args[:query])
|
164
|
+
end
|
165
|
+
|
166
|
+
task :cw, [:query] => :customwindow
|
167
|
+
task :custom_window, [:query] => :customwindow
|
168
|
+
task :"custom-window", [:query] => :customwindow
|
169
|
+
|
170
|
+
desc 'List Glimmer custom shape gems available at rubygems.org (query is optional) [alt: list:gems:cs]'
|
171
|
+
task :customshape, [:query] => :list_require do |t, args|
|
172
|
+
Glimmer::RakeTask::List.custom_shape_gems(args[:query])
|
173
|
+
end
|
174
|
+
|
175
|
+
task :cs, [:query] => :customshape
|
176
|
+
task :custom_shape, [:query] => :customshape
|
177
|
+
task :"custom-shape", [:query] => :customshape
|
178
|
+
|
179
|
+
desc 'List Glimmer DSL gems available at rubygems.org (query is optional)'
|
180
|
+
task :dsl, [:query] => :list_require do |t, args|
|
181
|
+
Glimmer::RakeTask::List.dsl_gems(args[:query])
|
182
|
+
end
|
183
|
+
|
184
|
+
end
|
185
|
+
|
186
|
+
# legacy support
|
187
|
+
|
188
|
+
task :custom_window_gems, [:name, :namespace] => 'gems:customwindow'
|
189
|
+
task :custom_control_gems, [:name, :namespace] => 'gems:customcontrol'
|
190
|
+
|
191
|
+
end
|
192
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glimmer-dsl-libui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Maleh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-10-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: glimmer
|
@@ -148,6 +148,26 @@ dependencies:
|
|
148
148
|
- - "<"
|
149
149
|
- !ruby/object:Gem::Version
|
150
150
|
version: 4.0.0
|
151
|
+
- !ruby/object:Gem::Dependency
|
152
|
+
name: text-table
|
153
|
+
requirement: !ruby/object:Gem::Requirement
|
154
|
+
requirements:
|
155
|
+
- - ">="
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
version: 1.2.4
|
158
|
+
- - "<"
|
159
|
+
- !ruby/object:Gem::Version
|
160
|
+
version: 2.0.0
|
161
|
+
type: :runtime
|
162
|
+
prerelease: false
|
163
|
+
version_requirements: !ruby/object:Gem::Requirement
|
164
|
+
requirements:
|
165
|
+
- - ">="
|
166
|
+
- !ruby/object:Gem::Version
|
167
|
+
version: 1.2.4
|
168
|
+
- - "<"
|
169
|
+
- !ruby/object:Gem::Version
|
170
|
+
version: 2.0.0
|
151
171
|
- !ruby/object:Gem::Dependency
|
152
172
|
name: juwelier
|
153
173
|
requirement: !ruby/object:Gem::Requirement
|
@@ -294,16 +314,18 @@ dependencies:
|
|
294
314
|
- - "~>"
|
295
315
|
- !ruby/object:Gem::Version
|
296
316
|
version: 0.7.0
|
297
|
-
description: Glimmer DSL for LibUI (Prerequisite-Free Ruby Desktop
|
298
|
-
Library) - Winner of Fukuoka Ruby Award Competition
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
317
|
+
description: Glimmer DSL for LibUI (Fukuoka Award Winning Prerequisite-Free Ruby Desktop
|
318
|
+
Development Cross-Platform Native GUI Library) - Winner of Fukuoka Ruby Award Competition
|
319
|
+
2022 Special Award (http://www.digitalfukuoka.jp/topics/187?locale=ja) - No need
|
320
|
+
to pre-install any prerequisites. Just install the gem and have cross-platform native
|
321
|
+
GUI that just works on Mac, Windows, and Linux! Glimmer DSL for LibUI aims to provide
|
322
|
+
declarative DSL syntax that visually maps to GUI control hierarchy, convention over
|
323
|
+
configuration via smart defaults, automation of low-level details, requiring the
|
324
|
+
least amount of syntax possible to build GUI, bidirectional data-binding, and custom
|
325
|
+
keyword support. If you liked Shoes, You'll love Glimmer!
|
305
326
|
email: andy.am@gmail.com
|
306
327
|
executables:
|
328
|
+
- glimmer
|
307
329
|
- girb
|
308
330
|
extensions: []
|
309
331
|
extra_rdoc_files:
|
@@ -317,6 +339,7 @@ files:
|
|
317
339
|
- VERSION
|
318
340
|
- bin/girb
|
319
341
|
- bin/girb_runner.rb
|
342
|
+
- bin/glimmer
|
320
343
|
- docs/examples/GLIMMER-DSL-LIBUI-ADVANCED-EXAMPLES.md
|
321
344
|
- docs/examples/GLIMMER-DSL-LIBUI-BASIC-EXAMPLES.md
|
322
345
|
- examples/area_based_custom_controls.rb
|
@@ -437,6 +460,7 @@ files:
|
|
437
460
|
- lib/glimmer-dsl-libui.rb
|
438
461
|
- lib/glimmer-dsl-libui/ext/glimmer.rb
|
439
462
|
- lib/glimmer-dsl-libui/ext/rouge/theme/glimmer.rb
|
463
|
+
- lib/glimmer/Rakefile
|
440
464
|
- lib/glimmer/dsl/libui/bind_expression.rb
|
441
465
|
- lib/glimmer/dsl/libui/control_expression.rb
|
442
466
|
- lib/glimmer/dsl/libui/custom_control_expression.rb
|
@@ -455,6 +479,7 @@ files:
|
|
455
479
|
- lib/glimmer/dsl/libui/string_expression.rb
|
456
480
|
- lib/glimmer/dsl/libui/tab_item_expression.rb
|
457
481
|
- lib/glimmer/fiddle_consumer.rb
|
482
|
+
- lib/glimmer/launcher.rb
|
458
483
|
- lib/glimmer/libui.rb
|
459
484
|
- lib/glimmer/libui/attributed_string.rb
|
460
485
|
- lib/glimmer/libui/control_proxy.rb
|
@@ -543,6 +568,9 @@ files:
|
|
543
568
|
- lib/glimmer/libui/shape/rectangle.rb
|
544
569
|
- lib/glimmer/libui/shape/square.rb
|
545
570
|
- lib/glimmer/proc_tracker.rb
|
571
|
+
- lib/glimmer/rake_task.rb
|
572
|
+
- lib/glimmer/rake_task/list.rb
|
573
|
+
- lib/glimmer/rake_task/scaffold.rb
|
546
574
|
- sounds/AlanWalker-Faded.mid
|
547
575
|
- sounds/AlanWalker-SingMeToSleep.mid
|
548
576
|
- sounds/CalvinHarris-Blame.mid
|
@@ -569,8 +597,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
569
597
|
- !ruby/object:Gem::Version
|
570
598
|
version: '0'
|
571
599
|
requirements: []
|
572
|
-
rubygems_version: 3.
|
600
|
+
rubygems_version: 3.3.1
|
573
601
|
signing_key:
|
574
602
|
specification_version: 4
|
575
|
-
summary: Glimmer DSL for LibUI
|
603
|
+
summary: Glimmer DSL for LibUI (Fukuoka Award Winning Prerequisite-Free Ruby Desktop
|
604
|
+
Development Cross-Platform Native GUI Library)
|
576
605
|
test_files: []
|