visualruby 3.0.2 → 3.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.vr_settings.yaml +27 -0
- data/bin/editor/VR_Document.rb +156 -156
- data/bin/editor/VR_TabSearch.rb +37 -37
- data/bin/editor/VR_Tabs.rb +82 -82
- data/bin/editor/VR_TextShell.rb +49 -52
- data/bin/editor/VR_TextViewCommon.rb +31 -31
- data/bin/main/GemTree.rb +14 -14
- data/bin/main/NewProjectGUI.rb +24 -24
- data/bin/main/OpenProject.rb +53 -53
- data/bin/main/ProjectChooserView.rb +31 -31
- data/bin/main/ProjectTree.rb +17 -17
- data/bin/main/RubygemsAPI.rb +73 -63
- data/bin/main/VR_ENV.rb +29 -29
- data/bin/main/VR_ENV_GLOBAL.rb +52 -52
- data/bin/main/VR_File_Tree.rb +88 -88
- data/bin/main/VR_Local_Gem_Tree.rb +53 -53
- data/bin/main/VR_Main.rb +240 -238
- data/bin/main/VR_Remote_Gem_Tree.rb +41 -41
- data/bin/main/glade/Splash.glade +19 -0
- data/bin/tools/VR_Tools.rb +72 -72
- data/examples/active_record/.vr_settings.yaml +50 -0
- data/examples/active_record/active_record.rb +2 -2
- data/examples/active_record/bin/ChoosePerson.rb +10 -10
- data/examples/active_record/bin/Person.rb +6 -6
- data/examples/active_record2/.vr_settings.yaml +23 -0
- data/examples/active_record2/bin/CompanyGUI.rb +42 -42
- data/examples/active_record2/bin/Employee.rb +13 -13
- data/examples/active_record2/bin/Employer.rb +5 -5
- data/examples/active_record2/bin/Paycheck.rb +5 -5
- data/examples/active_record2/main.rb +4 -4
- data/examples/alert_box/bin/AlertBoxDemo.rb +40 -50
- data/examples/alert_box/bin/glade/AlertBoxDemo.glade +14 -45
- data/examples/all_widgets/.vr_settings.yaml +18 -0
- data/examples/all_widgets/bin/AllWidgets.rb +19 -16
- data/examples/calculator/.vr_settings.yaml +18 -0
- data/examples/calculator/bin/Calculator.rb +22 -22
- data/examples/child_window/.vr_settings.yaml +21 -0
- data/examples/child_window/bin/ChildWindowDemo.rb +10 -10
- data/examples/child_window/bin/ModalWindow.rb +4 -4
- data/examples/child_window/bin/ModelessWindow.rb +4 -4
- data/examples/child_window/bin/MyChildClass.rb +10 -10
- data/examples/drag_drop/.vr_settings.yaml +16 -0
- data/examples/drag_drop/bin/DragDropDemo.rb +28 -28
- data/examples/filetreeview/.vr_settings.yaml +20 -0
- data/examples/filetreeview/bin/ProjectTree.rb +13 -23
- data/examples/filetreeview/bin/ProjectTreeGUI.rb +18 -17
- data/examples/listview/.vr_settings.yaml +19 -0
- data/examples/listview/bin/SongListView.rb +72 -72
- data/examples/listview/bin/SongListViewGUI.rb +52 -52
- data/examples/listview_objects/.vr_settings.yaml +19 -0
- data/examples/listview_objects/bin/DataObject.rb +23 -23
- data/examples/listview_objects/bin/ListViewObjects.rb +29 -29
- data/examples/listview_objects/bin/ListViewObjectsGUI.rb +12 -12
- data/examples/settings_file/bin/MainApp.rb +25 -25
- data/examples/settings_file/bin/SavableSettings.rb +25 -26
- data/examples/settings_file/settings.yaml +1 -1
- data/examples/simple_ruby_gui/.vr_settings.yaml +20 -0
- data/examples/simple_ruby_gui/bin/DataObjectGUI.rb +12 -12
- data/examples/treeview/.vr_settings.yaml +17 -0
- data/examples/treeview/bin/MyClass.rb +18 -17
- data/examples/treeview/bin/glade/MyClass.glade +61 -6
- data/skeleton/document/NewWindow.rb +8 -8
- data/skeleton/project/.vr_settings.yaml +15 -0
- data/skeleton/project/bin/MyClass.rb +7 -7
- data/vr +38 -41
- data/vrlib/doc/images/add.png +0 -0
- data/vrlib/doc/images/arrow_up.png +0 -0
- data/vrlib/doc/images/brick.png +0 -0
- data/vrlib/doc/images/brick_link.png +0 -0
- data/vrlib/doc/images/bug.png +0 -0
- data/vrlib/doc/images/bullet_black.png +0 -0
- data/vrlib/doc/images/bullet_toggle_minus.png +0 -0
- data/vrlib/doc/images/bullet_toggle_plus.png +0 -0
- data/vrlib/doc/images/date.png +0 -0
- data/vrlib/doc/images/delete.png +0 -0
- data/vrlib/doc/images/find.png +0 -0
- data/vrlib/doc/images/macFFBgHack.png +0 -0
- data/vrlib/doc/images/package.png +0 -0
- data/vrlib/doc/images/page_green.png +0 -0
- data/vrlib/doc/images/page_white_text.png +0 -0
- data/vrlib/doc/images/page_white_width.png +0 -0
- data/vrlib/doc/images/plugin.png +0 -0
- data/vrlib/doc/images/ruby.png +0 -0
- data/vrlib/doc/images/tag_blue.png +0 -0
- data/vrlib/doc/images/tag_green.png +0 -0
- data/vrlib/doc/images/transparent.png +0 -0
- data/vrlib/doc/images/wrench.png +0 -0
- data/vrlib/doc/images/wrench_orange.png +0 -0
- data/vrlib/doc/images/zoom.png +0 -0
- data/vrlib/lib/Alert.rb +98 -55
- data/vrlib/lib/DragDrop.rb +43 -43
- data/vrlib/lib/GladeGUI.rb +207 -207
- data/vrlib/lib/IconHash.rb +10 -10
- data/vrlib/lib/SavableClass.rb +38 -38
- data/vrlib/lib/SimpleComboBoxEntry.rb +3 -3
- data/vrlib/lib/treeview/FileTreeView.rb +71 -70
- data/vrlib/lib/treeview/IterMethods.rb +35 -35
- data/vrlib/lib/treeview/ListView.rb +25 -25
- data/vrlib/lib/treeview/TreeView.rb +15 -15
- data/vrlib/lib/treeview/ViewCommon.rb +134 -131
- data/vrlib/lib/treeview/columns/CalendarCol.rb +48 -48
- data/vrlib/lib/treeview/columns/CellRendererCombo.rb +26 -26
- data/vrlib/lib/treeview/columns/CellRendererDate.rb +25 -25
- data/vrlib/lib/treeview/columns/CellRendererObject.rb +37 -37
- data/vrlib/lib/treeview/columns/CellRendererPhone.rb +25 -25
- data/vrlib/lib/treeview/columns/CellRendererPixbuf.rb +8 -8
- data/vrlib/lib/treeview/columns/CellRendererProgress.rb +8 -8
- data/vrlib/lib/treeview/columns/CellRendererSpin.rb +17 -17
- data/vrlib/lib/treeview/columns/CellRendererText.rb +18 -18
- data/vrlib/lib/treeview/columns/CellRendererToggle.rb +25 -25
- data/vrlib/lib/treeview/columns/ComboCol.rb +12 -12
- data/vrlib/lib/treeview/columns/CurrencyCol.rb +13 -13
- data/vrlib/lib/treeview/columns/DateCol.rb +10 -10
- data/vrlib/lib/treeview/columns/ImageCol.rb +16 -16
- data/vrlib/lib/treeview/columns/SpinCol.rb +5 -5
- data/vrlib/lib/treeview/columns/TextCol.rb +24 -24
- data/vrlib/lib/treeview/columns/TreeViewColumn.rb +71 -76
- data/vrlib/rdoc_replace.yaml +36 -36
- metadata +43 -6
- data/Splash.rb +0 -40
data/bin/main/VR_File_Tree.rb
CHANGED
|
@@ -1,92 +1,92 @@
|
|
|
1
1
|
|
|
2
2
|
class VR_File_Tree < VR::FileTreeView
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
include GladeGUI
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
#
|
|
6
|
+
def initialize(main, icon_path)
|
|
7
|
+
super(Dir.pwd,icon_path)
|
|
8
|
+
@main = main
|
|
9
|
+
@api = RubygemsAPI.new
|
|
10
|
+
load_glade()
|
|
11
|
+
# set_show_expanders(false)
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
def self__row_activated(*args)
|
|
15
|
+
return unless rows = selected_rows
|
|
16
|
+
file_name = rows.first[:path]
|
|
17
17
|
if File.extname(file_name) == ".glade"
|
|
18
|
-
VR_Tools.popen("#{$VR_ENV_GLOBAL.glade_path} #{file_name} ")
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
VR_Tools.popen("#{$VR_ENV_GLOBAL.glade_path} #{file_name} ")
|
|
19
|
+
elsif File.directory?(file_name)
|
|
20
|
+
expand_or_collapse_folder()
|
|
21
|
+
else
|
|
22
|
+
@main.tabs.load_tab(file_name)
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
def menuPushGem_clicked
|
|
27
|
+
file_name = get_selected_path()
|
|
28
|
+
@main.shell.buffer.text = @api.push_gem(file_name)
|
|
29
|
+
end
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
#
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
#
|
|
39
|
-
#
|
|
40
|
-
#
|
|
41
|
-
#
|
|
42
|
-
|
|
43
|
-
|
|
31
|
+
def popInstallGem_clicked()
|
|
32
|
+
file_name = get_selected_path()
|
|
33
|
+
# begin
|
|
34
|
+
inst = Gem::Installer.new(file_name, :wrappers => true, :ignore_dependencies => true)
|
|
35
|
+
inst.install().to_s
|
|
36
|
+
txt = "Installed Gem: " + file_name
|
|
37
|
+
txt += "\nNo check was made for dependencies"
|
|
38
|
+
# rescue
|
|
39
|
+
# command = "gem install #{file_name} --local 2>&1"
|
|
40
|
+
# txt = VR_Tools.sudo_command(command)
|
|
41
|
+
# end
|
|
42
|
+
@main.shell.buffer.text = txt
|
|
43
|
+
end
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
45
|
+
def menuRDoc_clicked
|
|
46
|
+
return unless @main.tabs.try_to_save_all(:ask => false)
|
|
47
|
+
fn = get_selected_path()
|
|
48
|
+
old_dir = Dir.pwd
|
|
49
|
+
FileUtils.cd(fn)
|
|
50
|
+
@main.shell.buffer.text = $VR_ENV.rdoc_command_line + fn + "\n"
|
|
51
|
+
@main.shell.buffer.text += `#{$VR_ENV.rdoc_command_line} 2>&1`
|
|
52
|
+
VR_Tools.replace_html_in_docs()
|
|
53
|
+
FileUtils.cd(old_dir)
|
|
54
|
+
VR_Tools.popen("#{$VR_ENV_GLOBAL.browser} #{fn}/doc/index.html")
|
|
55
|
+
@main.file_tree.refresh()
|
|
56
|
+
end
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
58
|
+
def popBuildGem_clicked
|
|
59
|
+
file_name = get_selected_path()
|
|
60
|
+
root = File.dirname(file_name)
|
|
61
|
+
unless root == Dir.pwd
|
|
62
|
+
alert("You must create gems from the root folder.")
|
|
63
|
+
return
|
|
64
|
+
end
|
|
65
|
+
@main.tabs.try_to_save_all(:ask => false)
|
|
66
|
+
gem_builder = "Loading .gemspec file: " + file_name + "\n"
|
|
67
|
+
begin
|
|
68
68
|
Gem::Specification.reset
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
69
|
+
spec = Gem::Specification.load(file_name)
|
|
70
|
+
gem_file_name = Gem::Package.build(spec)
|
|
71
|
+
gem_builder = gem_builder + "Built Gem: " + gem_file_name + "\n"
|
|
72
|
+
gem_path = File.join(root, gem_file_name)
|
|
73
|
+
add_file(gem_path) if File.exists?(gem_path)
|
|
74
|
+
rescue
|
|
75
75
|
gem_builder = gem_builder + "Error: " + gem_file_name.to_s
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
end
|
|
77
|
+
@main.shell.buffer.text = gem_builder
|
|
78
|
+
end
|
|
79
79
|
|
|
80
80
|
def popGlade_clicked
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
path = get_selected_path()
|
|
82
|
+
source_code = File.open(path, "r").read
|
|
83
|
+
class_name = VR_Document.get_class_title(source_code).gsub(".rb", "")
|
|
84
84
|
# glade_file = File.dirname(path) + "/glade/" + File.basename(path, ".rb") + ".glade"
|
|
85
85
|
glade_file = File.dirname(path) + "/glade/" + class_name + ".glade"
|
|
86
86
|
if not File.file?(glade_file)
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
path = File.dirname(glade_file)
|
|
88
|
+
FileUtils.makedirs(path) if not File.directory?(path)
|
|
89
|
+
FileUtils.cp File.expand_path(File.dirname(__FILE__)+"/../../skeleton/document/New.glade"), glade_file
|
|
90
90
|
VR_Tools.popen("#{$VR_ENV_GLOBAL.glade_path} #{glade_file}")
|
|
91
91
|
sleep(2) #must do it this way because different thread
|
|
92
92
|
File.delete(glade_file)
|
|
@@ -95,31 +95,31 @@ class VR_File_Tree < VR::FileTreeView
|
|
|
95
95
|
end
|
|
96
96
|
end
|
|
97
97
|
|
|
98
|
-
def self__button_release_event(w, event)
|
|
98
|
+
def self__button_release_event(w, event) # right click
|
|
99
99
|
return unless path = get_selected_path() and event.button == 3
|
|
100
100
|
if File.file?(path) and (File.extname(path) == ".rb" or File.extname(path) == "")
|
|
101
|
-
|
|
101
|
+
@builder['popFile'].popup(nil, nil, event.button, event.time)
|
|
102
102
|
elsif File.extname(path) == ".gemspec"
|
|
103
|
-
|
|
103
|
+
@builder['popGemspec'].popup(nil, nil, event.button, event.time)
|
|
104
104
|
elsif File.extname(path) == ".gem"
|
|
105
|
-
|
|
105
|
+
@builder['popGemFile'].popup(nil, nil, event.button, event.time)
|
|
106
106
|
elsif File.directory?(path)
|
|
107
|
-
|
|
107
|
+
@builder['popFolder'].popup(nil, nil, event.button, event.time)
|
|
108
108
|
end
|
|
109
109
|
end
|
|
110
110
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
111
|
+
def self__key_press_event(view, evt)
|
|
112
|
+
return unless evt.keyval == 65535 #delete
|
|
113
|
+
return unless file_name = get_selected_path()
|
|
114
|
+
return unless alert("Delete: <b>" + File.basename(file_name) + "</b> ?" , :button_yes => "Delete", :button_no=>"Cancel", :parent=>self, :headline => "Delete FIle?")
|
|
115
|
+
if File.file?(file_name)
|
|
116
|
+
@main.tabs.destroy_file_tab(file_name)
|
|
117
|
+
File.delete(file_name)
|
|
118
|
+
elsif File.directory?(file_name) and file_name != Dir.pwd #root!
|
|
119
|
+
FileUtils.remove_dir(file_name, true)
|
|
120
|
+
end
|
|
121
|
+
delete_selected()
|
|
122
|
+
end
|
|
123
123
|
|
|
124
124
|
|
|
125
125
|
end
|
|
@@ -1,65 +1,65 @@
|
|
|
1
1
|
|
|
2
2
|
class VR_Local_Gem_Tree < GemTree
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
4
|
+
include GladeGUI
|
|
5
|
+
|
|
6
|
+
def initialize(main)
|
|
7
|
+
super()
|
|
8
|
+
@main = main
|
|
9
|
+
load_glade()
|
|
10
|
+
parse_signals()
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def refresh()
|
|
14
|
+
self.model.clear
|
|
15
|
+
result = `gem list`
|
|
16
|
+
result.each_line do |line|
|
|
17
|
+
gem, versions = get_name_ver(line)
|
|
18
|
+
versions.split(",").each do |v|
|
|
19
|
+
add_row( :pix => RUBY_ICON, :gem => "#{gem} (#{v})" )
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
#todo
|
|
25
|
+
def popViewSpec_clicked
|
|
26
|
+
gem, ver = selected_gem()
|
|
27
|
+
spec = `gem specification #{gem} -v #{ver}`
|
|
28
|
+
@main.tabs.load_tab()
|
|
29
|
+
@main.tabs.set_contents(spec)
|
|
30
|
+
end
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
def popOpenRubygemsPage_clicked
|
|
33
|
+
gem, ver = selected_gem()
|
|
34
|
+
VR_Tools.popen("#{$VR_ENV_GLOBAL.browser} http://rubygems.org/gems/#{gem}")
|
|
35
|
+
end
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
def popOpenHomepage_clicked
|
|
38
|
+
gem, ver = selected_gem()
|
|
39
|
+
spec = `gem specification #{gem} -v #{ver}`
|
|
40
|
+
match = /^homepage:\s+(.*)$/.match(spec)
|
|
41
|
+
VR_Tools.popen("#{$VR_ENV_GLOBAL.browser} #{match[1]}")
|
|
42
|
+
end
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
#
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
#
|
|
50
|
-
#
|
|
51
|
-
#
|
|
52
|
-
#
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
44
|
+
def popUninstall_clicked
|
|
45
|
+
gem, ver = selected_gem()
|
|
46
|
+
# begin
|
|
47
|
+
Gem::Uninstaller.new(gem, {:version => ver, :executables => true }).uninstall()
|
|
48
|
+
txt = "Uninstalled Gem: #{gem} #{ver}"
|
|
49
|
+
# rescue
|
|
50
|
+
# command = "gem uninstall #{gem} -x -v '#{ver}' 2>&1"
|
|
51
|
+
# txt = VR_Tools.sudo_command(command)
|
|
52
|
+
# end
|
|
53
|
+
@main.shell.buffer.text = txt
|
|
54
|
+
refresh()
|
|
55
|
+
end
|
|
56
56
|
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
def selected_gem
|
|
59
|
+
row = self.selection.selected[1].split(" (")
|
|
60
|
+
ver = row[1].gsub(")","")
|
|
61
|
+
return row[0], ver
|
|
62
|
+
end
|
|
63
63
|
|
|
64
64
|
end
|
|
65
65
|
|