glimmer-cs-gladiator 0.7.2 → 0.7.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/README.md +22 -8
- data/VERSION +1 -1
- data/bin/gladiator +22 -1
- data/bin/gladiator-setup +80 -0
- data/bin/glimmer-cs-gladiator +22 -0
- data/glimmer-cs-gladiator.gemspec +13 -5
- data/lib/glimmer-cs-gladiator.rb +1 -0
- data/lib/glimmer-cs-gladiator/launch.rb +6 -0
- data/lib/views/glimmer/gladiator.rb +384 -502
- data/lib/views/glimmer/gladiator/gladiator_menu_bar.rb +181 -0
- data/lib/views/glimmer/gladiator/progress_shell.rb +31 -0
- metadata +27 -4
- data/bin/gladiator_runner.rb +0 -6
@@ -0,0 +1,181 @@
|
|
1
|
+
# Copyright (c) 2020-2021 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
|
+
class Gladiator
|
24
|
+
class GladiatorMenuBar
|
25
|
+
include Glimmer::UI::CustomWidget
|
26
|
+
|
27
|
+
options :gladiator, :editing
|
28
|
+
|
29
|
+
body {
|
30
|
+
menu_bar {
|
31
|
+
menu {
|
32
|
+
text '&File'
|
33
|
+
|
34
|
+
menu_item {
|
35
|
+
text 'New &Scratchpad'
|
36
|
+
accelerator COMMAND_KEY, :shift, :s
|
37
|
+
enabled editing
|
38
|
+
on_widget_selected {
|
39
|
+
project_dir.selected_child_path = ''
|
40
|
+
}
|
41
|
+
}
|
42
|
+
menu_item {
|
43
|
+
text 'Open &Project...'
|
44
|
+
accelerator COMMAND_KEY, :o
|
45
|
+
on_widget_selected {
|
46
|
+
gladiator.open_project
|
47
|
+
}
|
48
|
+
}
|
49
|
+
menu_item(:separator)
|
50
|
+
menu_item {
|
51
|
+
text '&Quit Project'
|
52
|
+
accelerator COMMAND_KEY, :alt, :q
|
53
|
+
on_widget_selected {
|
54
|
+
gladiator.save_config
|
55
|
+
project_dir.selected_child&.write_dirty_content
|
56
|
+
gladiator.body_root.close
|
57
|
+
}
|
58
|
+
}
|
59
|
+
}
|
60
|
+
if editing
|
61
|
+
menu {
|
62
|
+
text '&View'
|
63
|
+
menu {
|
64
|
+
text '&Split Pane'
|
65
|
+
menu { |menu_proxy|
|
66
|
+
text '&Orientation'
|
67
|
+
menu_item(:radio) {
|
68
|
+
text '&Horizontal'
|
69
|
+
selection bind(gladiator, :split_orientation,
|
70
|
+
on_read: ->(o) { gladiator.split_pane? && o == swt(:horizontal) },
|
71
|
+
on_write: ->(b) { b.nil? ? nil : (b ? swt(:horizontal) : swt(:vertical)) })
|
72
|
+
}
|
73
|
+
menu_item(:radio) {
|
74
|
+
text '&Vertical'
|
75
|
+
selection bind(gladiator, :split_orientation,
|
76
|
+
on_read: ->(o) { gladiator.split_pane? && o == swt(:vertical) },
|
77
|
+
on_write: ->(b) { b.nil? ? nil : (b ? swt(:vertical) : swt(:horizontal)) })
|
78
|
+
}
|
79
|
+
}
|
80
|
+
menu_item(:check) {
|
81
|
+
text '&Maximize Pane'
|
82
|
+
enabled bind(gladiator, :tab_folder2)
|
83
|
+
accelerator COMMAND_KEY, :shift, :m
|
84
|
+
selection bind(gladiator, :maximized_pane)
|
85
|
+
}
|
86
|
+
menu_item {
|
87
|
+
text 'Reset &Panes'
|
88
|
+
enabled bind(gladiator, :tab_folder2)
|
89
|
+
accelerator COMMAND_KEY, :shift, :p
|
90
|
+
on_widget_selected {
|
91
|
+
if gladiator.tab_folder2
|
92
|
+
gladiator.maximized_pane = false
|
93
|
+
gladiator.tab_folder_sash_form.weights = [1, 1]
|
94
|
+
end
|
95
|
+
}
|
96
|
+
}
|
97
|
+
menu_item {
|
98
|
+
text '&Unsplit'
|
99
|
+
enabled bind(gladiator, :tab_folder2)
|
100
|
+
accelerator COMMAND_KEY, :shift, :u
|
101
|
+
on_widget_selected {
|
102
|
+
if gladiator.tab_folder2
|
103
|
+
gladiator.maximized_pane = false
|
104
|
+
gladiator.navigate_to_next_tab_folder if gladiator.current_tab_folder != gladiator.tab_folder2
|
105
|
+
gladiator.close_all_tabs(gladiator.tab_folder2)
|
106
|
+
gladiator.split_orientation = nil
|
107
|
+
gladiator.body_root.pack_same_size
|
108
|
+
end
|
109
|
+
}
|
110
|
+
}
|
111
|
+
}
|
112
|
+
menu_item(:check) {
|
113
|
+
text '&Maximize Editor'
|
114
|
+
accelerator COMMAND_KEY, :ctrl, :m
|
115
|
+
selection bind(gladiator, :maximized_editor)
|
116
|
+
}
|
117
|
+
menu_item {
|
118
|
+
text '&Reset All'
|
119
|
+
accelerator COMMAND_KEY, :ctrl, :r
|
120
|
+
on_widget_selected {
|
121
|
+
gladiator.tab_folder_sash_form.maximized_editor = false
|
122
|
+
gladiator.tab_folder_sash_form.file_area_and_editor_area_sash_form.weights = [1, 5]
|
123
|
+
gladiator.tab_folder_sash_form.side_bar_sash_form.weights = [1, 1]
|
124
|
+
}
|
125
|
+
}
|
126
|
+
}
|
127
|
+
menu {
|
128
|
+
text '&Run'
|
129
|
+
# menu_item {
|
130
|
+
# text 'Launch Glimmer &App'
|
131
|
+
# on_widget_selected {
|
132
|
+
# parent_path = project_dir.path
|
133
|
+
## current_directory_name = ::File.basename(parent_path)
|
134
|
+
## assumed_shell_script = ::File.join(parent_path, 'bin', current_directory_name)
|
135
|
+
## assumed_shell_script = ::Dir.glob(::File.join(parent_path, 'bin', '*')).detect {|f| ::File.file?(f) && !::File.read(f).include?('#!/usr/bin/env')} if !::File.exist?(assumed_shell_script)
|
136
|
+
## load assumed_shell_script
|
137
|
+
# FileUtils.cd(parent_path) do
|
138
|
+
# system 'glimmer run'
|
139
|
+
# end
|
140
|
+
# }
|
141
|
+
# }
|
142
|
+
menu_item {
|
143
|
+
text '&Ruby'
|
144
|
+
accelerator COMMAND_KEY, :shift, :r
|
145
|
+
on_widget_selected {
|
146
|
+
begin
|
147
|
+
project_dir.selected_child.run
|
148
|
+
rescue Exception => e
|
149
|
+
dialog {
|
150
|
+
text 'Run - Ruby - Error Encountered!'
|
151
|
+
label {
|
152
|
+
text e.full_message
|
153
|
+
}
|
154
|
+
}.open
|
155
|
+
end
|
156
|
+
}
|
157
|
+
}
|
158
|
+
}
|
159
|
+
end
|
160
|
+
menu {
|
161
|
+
text '&Help'
|
162
|
+
menu_item {
|
163
|
+
text '&About'
|
164
|
+
accelerator COMMAND_KEY, :shift, :a
|
165
|
+
on_widget_selected {
|
166
|
+
gladiator.display_about_dialog
|
167
|
+
}
|
168
|
+
}
|
169
|
+
}
|
170
|
+
}
|
171
|
+
}
|
172
|
+
|
173
|
+
def project_dir
|
174
|
+
gladiator.project_dir
|
175
|
+
end
|
176
|
+
|
177
|
+
end
|
178
|
+
|
179
|
+
end
|
180
|
+
|
181
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module Glimmer
|
2
|
+
class Gladiator
|
3
|
+
class ProgressShell
|
4
|
+
include Glimmer::UI::CustomShell
|
5
|
+
|
6
|
+
option :gladiator
|
7
|
+
option :progress_text, default: 'Work In Progress'
|
8
|
+
|
9
|
+
body {
|
10
|
+
shell(gladiator.body_root, :title) {
|
11
|
+
fill_layout(:vertical) {
|
12
|
+
margin_width 15
|
13
|
+
margin_height 15
|
14
|
+
spacing 5
|
15
|
+
}
|
16
|
+
|
17
|
+
text 'Gladiator'
|
18
|
+
|
19
|
+
gladiator_menu_bar(gladiator: gladiator, editing: true)
|
20
|
+
|
21
|
+
label(:center) {
|
22
|
+
text progress_text
|
23
|
+
font height: 20
|
24
|
+
}
|
25
|
+
# @progress_bar = progress_bar(:horizontal, :indeterminate)
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glimmer-cs-gladiator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Maleh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-01-
|
11
|
+
date: 2021-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,6 +86,20 @@ dependencies:
|
|
86
86
|
- - '='
|
87
87
|
- !ruby/object:Gem::Version
|
88
88
|
version: 2.3.9
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
requirement: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - '='
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: 2.0.5
|
95
|
+
name: warbler
|
96
|
+
type: :development
|
97
|
+
prerelease: false
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - '='
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: 2.0.5
|
89
103
|
- !ruby/object:Gem::Dependency
|
90
104
|
requirement: !ruby/object:Gem::Requirement
|
91
105
|
requirements:
|
@@ -108,7 +122,9 @@ description: Gladiator (short for Glimmer Editor) is a Glimmer sample project un
|
|
108
122
|
use Glimmer one day.
|
109
123
|
email: andy.am@gmail.com
|
110
124
|
executables:
|
125
|
+
- glimmer-cs-gladiator
|
111
126
|
- gladiator
|
127
|
+
- gladiator-setup
|
112
128
|
extensions: []
|
113
129
|
extra_rdoc_files:
|
114
130
|
- LICENSE.txt
|
@@ -119,22 +135,29 @@ files:
|
|
119
135
|
- README.md
|
120
136
|
- VERSION
|
121
137
|
- bin/gladiator
|
122
|
-
- bin/
|
138
|
+
- bin/gladiator-setup
|
139
|
+
- bin/glimmer-cs-gladiator
|
123
140
|
- glimmer-cs-gladiator.gemspec
|
124
141
|
- images/glimmer-cs-gladiator-logo.png
|
125
142
|
- lib/glimmer-cs-gladiator.rb
|
143
|
+
- lib/glimmer-cs-gladiator/launch.rb
|
126
144
|
- lib/models/glimmer/gladiator/command.rb
|
127
145
|
- lib/models/glimmer/gladiator/dir.rb
|
128
146
|
- lib/models/glimmer/gladiator/file.rb
|
129
147
|
- lib/views/glimmer/gladiator.rb
|
130
148
|
- lib/views/glimmer/gladiator/file_explorer_tree.rb
|
131
149
|
- lib/views/glimmer/gladiator/file_lookup_list.rb
|
150
|
+
- lib/views/glimmer/gladiator/gladiator_menu_bar.rb
|
151
|
+
- lib/views/glimmer/gladiator/progress_shell.rb
|
132
152
|
- lib/views/glimmer/gladiator/text_editor.rb
|
133
153
|
homepage: http://github.com/AndyObtiva/glimmer-cs-gladiator
|
134
154
|
licenses:
|
135
155
|
- MIT
|
136
156
|
metadata: {}
|
137
|
-
post_install_message:
|
157
|
+
post_install_message: |2+
|
158
|
+
|
159
|
+
To make the gladiator command available system-wide (especially with RVM), make sure you run this command with jruby in path: gladiator-setup
|
160
|
+
|
138
161
|
rdoc_options: []
|
139
162
|
require_paths:
|
140
163
|
- lib
|