ruber 0.0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (166) hide show
  1. data/COPYING +339 -0
  2. data/INSTALL +137 -0
  3. data/LICENSE +8 -0
  4. data/bin/ruber +65 -0
  5. data/data/share/apps/ruber/core_components.yaml +31 -0
  6. data/data/share/apps/ruber/ruberui.rc +109 -0
  7. data/data/share/icons/ruber.png +0 -0
  8. data/data/share/pixmaps/ruby.png +0 -0
  9. data/icons/ruber-16.png +0 -0
  10. data/icons/ruber-32.png +0 -0
  11. data/icons/ruber-48.png +0 -0
  12. data/icons/ruber-8.png +0 -0
  13. data/lib/ruber/application/application.rb +288 -0
  14. data/lib/ruber/application/plugin.yaml +11 -0
  15. data/lib/ruber/component_manager.rb +899 -0
  16. data/lib/ruber/config/config.rb +82 -0
  17. data/lib/ruber/config/plugin.yaml +3 -0
  18. data/lib/ruber/document_project.rb +209 -0
  19. data/lib/ruber/documents/document_list.rb +416 -0
  20. data/lib/ruber/documents/plugin.yaml +4 -0
  21. data/lib/ruber/editor/document.rb +506 -0
  22. data/lib/ruber/editor/editor_view.rb +167 -0
  23. data/lib/ruber/editor/ktexteditor_wrapper.rb +202 -0
  24. data/lib/ruber/exception_widgets.rb +245 -0
  25. data/lib/ruber/external_program_plugin.rb +397 -0
  26. data/lib/ruber/filtered_output_widget.rb +342 -0
  27. data/lib/ruber/gui_states_handler.rb +231 -0
  28. data/lib/ruber/kde_config_option_backend.rb +167 -0
  29. data/lib/ruber/kde_sugar.rb +249 -0
  30. data/lib/ruber/main_window/choose_plugins_dlg.rb +353 -0
  31. data/lib/ruber/main_window/main_window.rb +524 -0
  32. data/lib/ruber/main_window/main_window_actions.rb +537 -0
  33. data/lib/ruber/main_window/main_window_internal.rb +239 -0
  34. data/lib/ruber/main_window/open_file_in_project_dlg.rb +212 -0
  35. data/lib/ruber/main_window/output_color_widget.rb +35 -0
  36. data/lib/ruber/main_window/plugin.yaml +58 -0
  37. data/lib/ruber/main_window/save_modified_files_dlg.rb +89 -0
  38. data/lib/ruber/main_window/status_bar.rb +156 -0
  39. data/lib/ruber/main_window/ui/choose_plugins_widget.rb +90 -0
  40. data/lib/ruber/main_window/ui/choose_plugins_widget.ui +77 -0
  41. data/lib/ruber/main_window/ui/main_window_settings_widget.rb +108 -0
  42. data/lib/ruber/main_window/ui/main_window_settings_widget.ui +89 -0
  43. data/lib/ruber/main_window/ui/new_project_widget.rb +119 -0
  44. data/lib/ruber/main_window/ui/new_project_widget.ui +178 -0
  45. data/lib/ruber/main_window/ui/open_file_in_project_dlg.rb +109 -0
  46. data/lib/ruber/main_window/ui/open_file_in_project_dlg.ui +168 -0
  47. data/lib/ruber/main_window/ui/output_color_widget.rb +241 -0
  48. data/lib/ruber/main_window/ui/output_color_widget.ui +204 -0
  49. data/lib/ruber/main_window/workspace.rb +442 -0
  50. data/lib/ruber/output_widget.rb +1093 -0
  51. data/lib/ruber/plugin.rb +264 -0
  52. data/lib/ruber/plugin_like.rb +589 -0
  53. data/lib/ruber/plugin_specification.rb +106 -0
  54. data/lib/ruber/plugin_specification_reader.rb +451 -0
  55. data/lib/ruber/project.rb +493 -0
  56. data/lib/ruber/project_backend.rb +105 -0
  57. data/lib/ruber/projects/plugin.yaml +11 -0
  58. data/lib/ruber/projects/project_files_list.rb +314 -0
  59. data/lib/ruber/projects/project_files_widget.rb +301 -0
  60. data/lib/ruber/projects/project_list.rb +314 -0
  61. data/lib/ruber/projects/ui/project_files_rule_chooser_widget.rb +74 -0
  62. data/lib/ruber/projects/ui/project_files_rule_chooser_widget.ui +61 -0
  63. data/lib/ruber/projects/ui/project_files_widget.rb +117 -0
  64. data/lib/ruber/projects/ui/project_files_widget.ui +123 -0
  65. data/lib/ruber/qt_sugar.rb +673 -0
  66. data/lib/ruber/settings_container.rb +515 -0
  67. data/lib/ruber/settings_dialog.rb +244 -0
  68. data/lib/ruber/settings_dialog_manager.rb +503 -0
  69. data/lib/ruber/utils.rb +414 -0
  70. data/lib/ruber/yaml_option_backend.rb +159 -0
  71. data/outsider_files +15 -0
  72. data/plugins/autosave/autosave.rb +404 -0
  73. data/plugins/autosave/plugin.yaml +16 -0
  74. data/plugins/autosave/ui/autosave_config_widget.rb +83 -0
  75. data/plugins/autosave/ui/autosave_config_widget.ui +68 -0
  76. data/plugins/command/command.png +0 -0
  77. data/plugins/command/command.rb +74 -0
  78. data/plugins/command/plugin.yaml +11 -0
  79. data/plugins/find_in_files/find_in_files.rb +337 -0
  80. data/plugins/find_in_files/find_in_files_dlg.rb +411 -0
  81. data/plugins/find_in_files/find_in_files_ui.rc +11 -0
  82. data/plugins/find_in_files/find_in_files_widgets.rb +485 -0
  83. data/plugins/find_in_files/plugin.yaml +23 -0
  84. data/plugins/find_in_files/ui/config_widget.rb +58 -0
  85. data/plugins/find_in_files/ui/config_widget.ui +41 -0
  86. data/plugins/find_in_files/ui/find_in_files_widget.rb +260 -0
  87. data/plugins/find_in_files/ui/find_in_files_widget.ui +324 -0
  88. data/plugins/project_browser/plugin.yaml +10 -0
  89. data/plugins/project_browser/project_browser.rb +245 -0
  90. data/plugins/rake/plugin.yaml +39 -0
  91. data/plugins/rake/rake.png +0 -0
  92. data/plugins/rake/rake.rb +567 -0
  93. data/plugins/rake/rake_extension.rb +153 -0
  94. data/plugins/rake/rake_widgets.rb +615 -0
  95. data/plugins/rake/rakeui.rc +27 -0
  96. data/plugins/rake/ui/add_quick_task_widget.rb +71 -0
  97. data/plugins/rake/ui/add_quick_task_widget.ui +59 -0
  98. data/plugins/rake/ui/choose_task_widget.rb +77 -0
  99. data/plugins/rake/ui/choose_task_widget.ui +72 -0
  100. data/plugins/rake/ui/config_widget.rb +127 -0
  101. data/plugins/rake/ui/config_widget.ui +123 -0
  102. data/plugins/rake/ui/project_widget.rb +217 -0
  103. data/plugins/rake/ui/project_widget.ui +246 -0
  104. data/plugins/rspec/plugin.yaml +30 -0
  105. data/plugins/rspec/rspec.png +0 -0
  106. data/plugins/rspec/rspec.rb +945 -0
  107. data/plugins/rspec/rspec.svg +90 -0
  108. data/plugins/rspec/rspecui.rc +20 -0
  109. data/plugins/rspec/ruber_rspec_formatter.rb +312 -0
  110. data/plugins/rspec/ui/rspec_project_widget.rb +170 -0
  111. data/plugins/rspec/ui/rspec_project_widget.ui +193 -0
  112. data/plugins/ruby_development/plugin.yaml +27 -0
  113. data/plugins/ruby_development/ruby_development.png +0 -0
  114. data/plugins/ruby_development/ruby_development.rb +453 -0
  115. data/plugins/ruby_development/ruby_developmentui.rc +19 -0
  116. data/plugins/ruby_development/ui/project_widget.rb +112 -0
  117. data/plugins/ruby_development/ui/project_widget.ui +108 -0
  118. data/plugins/ruby_runner/config_widget.rb +116 -0
  119. data/plugins/ruby_runner/plugin.yaml +26 -0
  120. data/plugins/ruby_runner/project_widget.rb +62 -0
  121. data/plugins/ruby_runner/ruby.png +0 -0
  122. data/plugins/ruby_runner/ruby_interpretersui.rc +26 -0
  123. data/plugins/ruby_runner/ruby_runner.rb +411 -0
  124. data/plugins/ruby_runner/ui/config_widget.rb +92 -0
  125. data/plugins/ruby_runner/ui/config_widget.ui +91 -0
  126. data/plugins/ruby_runner/ui/project_widget.rb +60 -0
  127. data/plugins/ruby_runner/ui/project_widget.ui +48 -0
  128. data/plugins/ruby_runner/ui/ruby_runnner_plugin_option_widget.rb +59 -0
  129. data/plugins/ruby_runner/ui/ruby_runnner_plugin_option_widget.ui +44 -0
  130. data/plugins/state/plugin.yaml +28 -0
  131. data/plugins/state/state.rb +520 -0
  132. data/plugins/state/ui/config_widget.rb +92 -0
  133. data/plugins/state/ui/config_widget.ui +89 -0
  134. data/plugins/syntax_checker/plugin.yaml +18 -0
  135. data/plugins/syntax_checker/syntax_checker.rb +662 -0
  136. data/ruber.desktop +10 -0
  137. data/spec/annotation_model_spec.rb +174 -0
  138. data/spec/common.rb +119 -0
  139. data/spec/component_manager_spec.rb +1259 -0
  140. data/spec/document_list_spec.rb +626 -0
  141. data/spec/document_project_spec.rb +373 -0
  142. data/spec/document_spec.rb +779 -0
  143. data/spec/editor_view_spec.rb +167 -0
  144. data/spec/external_program_plugin_spec.rb +676 -0
  145. data/spec/filtered_output_widget_spec.rb +642 -0
  146. data/spec/gui_states_handler_spec.rb +304 -0
  147. data/spec/kde_config_option_backend_spec.rb +214 -0
  148. data/spec/kde_sugar_spec.rb +101 -0
  149. data/spec/ktexteditor_wrapper_spec.rb +305 -0
  150. data/spec/output_widget_spec.rb +1703 -0
  151. data/spec/plugin_spec.rb +1393 -0
  152. data/spec/plugin_specification_reader_spec.rb +1765 -0
  153. data/spec/plugin_specification_spec.rb +401 -0
  154. data/spec/project_backend_spec.rb +172 -0
  155. data/spec/project_files_list_spec.rb +401 -0
  156. data/spec/project_list_spec.rb +511 -0
  157. data/spec/project_spec.rb +990 -0
  158. data/spec/qt_sugar_spec.rb +328 -0
  159. data/spec/settings_container_spec.rb +617 -0
  160. data/spec/settings_dialog_manager_spec.rb +773 -0
  161. data/spec/settings_dialog_spec.rb +419 -0
  162. data/spec/state_spec.rb +991 -0
  163. data/spec/utils_spec.rb +406 -0
  164. data/spec/workspace_spec.rb +869 -0
  165. data/spec/yaml_option_backend_spec.rb +246 -0
  166. metadata +284 -0
@@ -0,0 +1,19 @@
1
+ <!DOCTYPE kpartgui SYSTEM 'kpartgui.dtd'>
2
+ <kpartgui version="1" name="ruber-ruby_runner_plugin" >
3
+ <MenuBar>
4
+ <Menu noMerge="1" name="ruby" >
5
+ <text>&amp;Ruby</text>
6
+ <Separator/>
7
+ <Action name="ruby_runner-run" />
8
+ <Action name="ruby_runner-run_current_file" text="Run current file" />
9
+ <Action name="ruby_runner-run_file" />
10
+ <Separator/>
11
+ <Action name="ruby_runner-stop" />
12
+ <Separator/>
13
+ <Action name="ruby_runner-run_in_terminal"/>
14
+ <DefineGroup name="ruby_tools"/>
15
+ <Merge/>
16
+ </Menu>
17
+ </MenuBar>
18
+ <ActionProperties/>
19
+ </kpartgui>
@@ -0,0 +1,112 @@
1
+ =begin
2
+ ** Form generated from reading ui file 'project_widget.ui'
3
+ **
4
+ ** Created: ven ott 29 17:39:04 2010
5
+ ** by: Qt User Interface Compiler version 4.7.0
6
+ **
7
+ ** WARNING! All changes made in this file will be lost when recompiling ui file!
8
+ =end
9
+
10
+ class Ui_FilesRunnerProjectWidget
11
+ attr_reader :gridLayout
12
+ attr_reader :_ruby__ruby_options
13
+ attr_reader :program_box
14
+ attr_reader :gridLayout_2
15
+ attr_reader :main_program_label
16
+ attr_reader :_ruby__main_program
17
+ attr_reader :_ruby__options
18
+ attr_reader :_ruby__working_dir
19
+ attr_reader :working_dir_label
20
+ attr_reader :label_6
21
+ attr_reader :_ruby__run_in_terminal
22
+
23
+ def setupUi(filesRunnerProjectWidget)
24
+ if filesRunnerProjectWidget.objectName.nil?
25
+ filesRunnerProjectWidget.objectName = "filesRunnerProjectWidget"
26
+ end
27
+ filesRunnerProjectWidget.resize(464, 188)
28
+ @gridLayout = Qt::GridLayout.new(filesRunnerProjectWidget)
29
+ @gridLayout.objectName = "gridLayout"
30
+ @_ruby__ruby_options = RubyOptionsWidget.new(filesRunnerProjectWidget)
31
+ @_ruby__ruby_options.objectName = "_ruby__ruby_options"
32
+ @_ruby__ruby_options.focusPolicy = Qt::StrongFocus
33
+
34
+ @gridLayout.addWidget(@_ruby__ruby_options, 0, 1, 1, 1)
35
+
36
+ @program_box = Qt::GroupBox.new(filesRunnerProjectWidget)
37
+ @program_box.objectName = "program_box"
38
+ @gridLayout_2 = Qt::GridLayout.new(@program_box)
39
+ @gridLayout_2.objectName = "gridLayout_2"
40
+ @main_program_label = Qt::Label.new(@program_box)
41
+ @main_program_label.objectName = "main_program_label"
42
+
43
+ @gridLayout_2.addWidget(@main_program_label, 0, 0, 1, 1)
44
+
45
+ @_ruby__main_program = KDE::UrlRequester.new(@program_box)
46
+ @_ruby__main_program.objectName = "_ruby__main_program"
47
+
48
+ @gridLayout_2.addWidget(@_ruby__main_program, 0, 1, 1, 1)
49
+
50
+ @_ruby__options = KDE::LineEdit.new(@program_box)
51
+ @_ruby__options.objectName = "_ruby__options"
52
+ @_ruby__options.focusPolicy = Qt::StrongFocus
53
+
54
+ @gridLayout_2.addWidget(@_ruby__options, 1, 1, 1, 1)
55
+
56
+ @_ruby__working_dir = KDE::UrlRequester.new(@program_box)
57
+ @_ruby__working_dir.objectName = "_ruby__working_dir"
58
+
59
+ @gridLayout_2.addWidget(@_ruby__working_dir, 2, 1, 1, 1)
60
+
61
+ @working_dir_label = Qt::Label.new(@program_box)
62
+ @working_dir_label.objectName = "working_dir_label"
63
+
64
+ @gridLayout_2.addWidget(@working_dir_label, 2, 0, 1, 1)
65
+
66
+ @label_6 = Qt::Label.new(@program_box)
67
+ @label_6.objectName = "label_6"
68
+
69
+ @gridLayout_2.addWidget(@label_6, 1, 0, 1, 1)
70
+
71
+ @_ruby__run_in_terminal = Qt::CheckBox.new(@program_box)
72
+ @_ruby__run_in_terminal.objectName = "_ruby__run_in_terminal"
73
+
74
+ @gridLayout_2.addWidget(@_ruby__run_in_terminal, 3, 0, 1, 1)
75
+
76
+
77
+ @gridLayout.addWidget(@program_box, 1, 0, 1, 2)
78
+
79
+ @main_program_label.buddy = @_ruby__main_program
80
+ @working_dir_label.buddy = @_ruby__working_dir
81
+ @label_6.buddy = @_ruby__options
82
+
83
+ retranslateUi(filesRunnerProjectWidget)
84
+
85
+ Qt::MetaObject.connectSlotsByName(filesRunnerProjectWidget)
86
+ end # setupUi
87
+
88
+ def setup_ui(filesRunnerProjectWidget)
89
+ setupUi(filesRunnerProjectWidget)
90
+ end
91
+
92
+ def retranslateUi(filesRunnerProjectWidget)
93
+ filesRunnerProjectWidget.windowTitle = Qt::Application.translate("FilesRunnerProjectWidget", "Form", nil, Qt::Application::UnicodeUTF8)
94
+ @program_box.title = Qt::Application.translate("FilesRunnerProjectWidget", "Script", nil, Qt::Application::UnicodeUTF8)
95
+ @main_program_label.text = Qt::Application.translate("FilesRunnerProjectWidget", "&Path", nil, Qt::Application::UnicodeUTF8)
96
+ @_ruby__options.setProperty("access", Qt::Variant.new(Qt::Application.translate("FilesRunnerProjectWidget", "$program_options", nil, Qt::Application::UnicodeUTF8)))
97
+ @working_dir_label.text = Qt::Application.translate("FilesRunnerProjectWidget", "&Working directory", nil, Qt::Application::UnicodeUTF8)
98
+ @label_6.text = Qt::Application.translate("FilesRunnerProjectWidget", "&Options", nil, Qt::Application::UnicodeUTF8)
99
+ @_ruby__run_in_terminal.text = Qt::Application.translate("FilesRunnerProjectWidget", "&Run in terminal", nil, Qt::Application::UnicodeUTF8)
100
+ end # retranslateUi
101
+
102
+ def retranslate_ui(filesRunnerProjectWidget)
103
+ retranslateUi(filesRunnerProjectWidget)
104
+ end
105
+
106
+ end
107
+
108
+ module Ui
109
+ class FilesRunnerProjectWidget < Ui_FilesRunnerProjectWidget
110
+ end
111
+ end # module Ui
112
+
@@ -0,0 +1,108 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <ui version="4.0">
3
+ <class>FilesRunnerProjectWidget</class>
4
+ <widget class="QWidget" name="FilesRunnerProjectWidget">
5
+ <property name="geometry">
6
+ <rect>
7
+ <x>0</x>
8
+ <y>0</y>
9
+ <width>464</width>
10
+ <height>188</height>
11
+ </rect>
12
+ </property>
13
+ <property name="windowTitle">
14
+ <string>Form</string>
15
+ </property>
16
+ <layout class="QGridLayout" name="gridLayout">
17
+ <item row="0" column="1">
18
+ <widget class="RubyOptionsWidget" name="_ruby__ruby_options" native="true">
19
+ <property name="focusPolicy">
20
+ <enum>Qt::StrongFocus</enum>
21
+ </property>
22
+ </widget>
23
+ </item>
24
+ <item row="1" column="0" colspan="2">
25
+ <widget class="QGroupBox" name="program_box">
26
+ <property name="title">
27
+ <string>Script</string>
28
+ </property>
29
+ <layout class="QGridLayout" name="gridLayout_2">
30
+ <item row="0" column="0">
31
+ <widget class="QLabel" name="main_program_label">
32
+ <property name="text">
33
+ <string>&amp;Path</string>
34
+ </property>
35
+ <property name="buddy">
36
+ <cstring>_ruby__main_program</cstring>
37
+ </property>
38
+ </widget>
39
+ </item>
40
+ <item row="0" column="1">
41
+ <widget class="KUrlRequester" name="_ruby__main_program"/>
42
+ </item>
43
+ <item row="1" column="1">
44
+ <widget class="KLineEdit" name="_ruby__options">
45
+ <property name="focusPolicy">
46
+ <enum>Qt::StrongFocus</enum>
47
+ </property>
48
+ <property name="access" stdset="0">
49
+ <string>$program_options</string>
50
+ </property>
51
+ </widget>
52
+ </item>
53
+ <item row="2" column="1">
54
+ <widget class="KUrlRequester" name="_ruby__working_dir"/>
55
+ </item>
56
+ <item row="2" column="0">
57
+ <widget class="QLabel" name="working_dir_label">
58
+ <property name="text">
59
+ <string>&amp;Working directory</string>
60
+ </property>
61
+ <property name="buddy">
62
+ <cstring>_ruby__working_dir</cstring>
63
+ </property>
64
+ </widget>
65
+ </item>
66
+ <item row="1" column="0">
67
+ <widget class="QLabel" name="label_6">
68
+ <property name="text">
69
+ <string>&amp;Options</string>
70
+ </property>
71
+ <property name="buddy">
72
+ <cstring>_ruby__options</cstring>
73
+ </property>
74
+ </widget>
75
+ </item>
76
+ <item row="3" column="0">
77
+ <widget class="QCheckBox" name="_ruby__run_in_terminal">
78
+ <property name="text">
79
+ <string>&amp;Run in terminal</string>
80
+ </property>
81
+ </widget>
82
+ </item>
83
+ </layout>
84
+ </widget>
85
+ </item>
86
+ </layout>
87
+ </widget>
88
+ <customwidgets>
89
+ <customwidget>
90
+ <class>KUrlRequester</class>
91
+ <extends>QFrame</extends>
92
+ <header>kurlrequester.h</header>
93
+ </customwidget>
94
+ <customwidget>
95
+ <class>KLineEdit</class>
96
+ <extends>QLineEdit</extends>
97
+ <header>klineedit.h</header>
98
+ </customwidget>
99
+ <customwidget>
100
+ <class>RubyOptionsWidget</class>
101
+ <extends>QWidget</extends>
102
+ <header>rubyoptionswidget.h</header>
103
+ <container>1</container>
104
+ </customwidget>
105
+ </customwidgets>
106
+ <resources/>
107
+ <connections/>
108
+ </ui>
@@ -0,0 +1,116 @@
1
+ =begin
2
+ Copyright (C) 2010 by Stefano Crocco
3
+ stefano.crocco@alice.it
4
+
5
+ This program is free software; you can redistribute it andor modify
6
+ it under the terms of the GNU General Public License as published by
7
+ the Free Software Foundation; either version 2 of the License, or
8
+ (at your option) any later version.
9
+
10
+ This program is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ GNU General Public License for more details.
14
+
15
+ You should have received a copy of the GNU General Public License
16
+ along with this program; if not, write to the
17
+ Free Software Foundation, Inc.,
18
+ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
+ =end
20
+
21
+ require 'shellwords'
22
+
23
+ require_relative 'ui/config_widget'
24
+
25
+ module Ruber
26
+
27
+ module RubyRunner
28
+
29
+ =begin rdoc
30
+ Config widget for the ruby runner plugin
31
+ =end
32
+ class ConfigWidget < Qt::Widget
33
+
34
+ slots :update_default_interpreter
35
+
36
+ =begin rdoc
37
+ Creates a new widget
38
+
39
+ @param [Qt::Widget] parent the widget's parent
40
+ =end
41
+ def initialize parent = nil
42
+ super
43
+ @ui = Ui::RubyRunnerConfigWidget.new
44
+ @ui.setupUi self
45
+ connect @ui._ruby__interpreters, SIGNAL(:changed), self, SLOT(:update_default_interpreter)
46
+ end
47
+
48
+ =begin rdoc
49
+ Writer for the @ruby/ruby_options@ setting
50
+
51
+ @return [nil]
52
+ =end
53
+ def read_ruby_options val
54
+ @ui._ruby__ruby_options.text = val.join ' '
55
+ nil
56
+ end
57
+
58
+ =begin rdoc
59
+ Reader for the @ruby/ruby_options@ setting
60
+
61
+ @return [<String>] with an entry per option. Options containing spaces are quoted
62
+ =end
63
+ def store_ruby_options
64
+ Shellwords.split_with_quotes @ui._ruby__ruby_options.text
65
+ end
66
+
67
+ =begin rdoc
68
+ Writer for the @ruby/ruby@ setting
69
+
70
+ @param [String] the path of the default interpreter
71
+ @return [nil]
72
+ =end
73
+ def default_interpreter= value
74
+ it = @ui._ruby__ruby.each_with_index.find{|txt, i| txt == value}
75
+ @ui._ruby__ruby.current_index = it ? it[1] : 0
76
+ nil
77
+ end
78
+
79
+ private
80
+
81
+ =begin rdoc
82
+ Fills the "Ruby interpreters widget"
83
+
84
+ Before filling the widget, clears it. After filling the widget, it updates the
85
+ "Default interpreter" widget.
86
+
87
+ @param [<String>] a list of the paths of the availlable interpreters
88
+ =end
89
+ def fill_interpreters value
90
+ @ui._ruby__interpreters.clear
91
+ @ui._ruby__interpreters.insert_string_list value
92
+ update_default_interpreter
93
+ end
94
+
95
+ =begin rdoc
96
+ Fills the "Default interpreter" combo box according to the availlable interpreters
97
+
98
+ This method attempts to preserve the current entry if possible. This means that
99
+ if an entry with the same text still exists, it will become current.
100
+
101
+ @return [nil]
102
+ =end
103
+ def update_default_interpreter
104
+ old_current = @ui._ruby__ruby.current_text
105
+ @ui._ruby__ruby.clear
106
+ @ui._ruby__ruby.add_items @ui._ruby__interpreters.items
107
+ idx = @ui._ruby__ruby.items.index old_current
108
+ @ui._ruby__ruby.current_index = idx ? idx : 0
109
+ nil
110
+ end
111
+
112
+ end
113
+
114
+ end
115
+
116
+ end
@@ -0,0 +1,26 @@
1
+ name: ruby_runner
2
+ version: 0.0.1
3
+ about:
4
+ authors: [Stefano Crocco, stefano.crocco@alice.it]
5
+ license: gpl
6
+ description: Provides an infrastructure to execute ruby programs
7
+ bug_address: http://github.com/stcrocco/ruber/issues
8
+ icon: ruby.png
9
+ class: Ruber::RubyRunner::RubyInterpretersPlugin
10
+ require: ruby_runner
11
+ ui_file: ruby_interpretersui.rc
12
+ features: [ruby_interpreters]
13
+ config_widgets:
14
+ - {caption: Ruby, pixmap: ruby.png, class: 'Ruber::RubyRunner::ConfigWidget'}
15
+ config_options:
16
+ ruby:
17
+ interpreters: {default: Ruber[:ruby_runner].send(:find_interpreters), order: 0}
18
+ ruby: {:default: "Ruber[:config][:ruby,:interpreters][0]", order: 1}
19
+ ruby_options: {:default: [-w]}
20
+ project_options:
21
+ ruby:
22
+ ruby: {default: 'Ruber[:config][:ruby, :ruby]', scope: [global, document], mimetype: 'application/x-ruby', file_extension: [*.rb, Rakefile, rakefile]}
23
+ project_widgets:
24
+ - {caption: Ruby, pixmap: ruby.png, class: 'Ruber::RubyRunner::ProjectWidget', scope: [global, document], mimetype: 'application/x-ruby', file_extension: [*.rb, Rakefile, rakefile]}
25
+ actions:
26
+ ruby_runner-configured_interpreter: {text: Standard &Interpreter, class: KDE::ToggleAction}
@@ -0,0 +1,62 @@
1
+ =begin
2
+ Copyright (C) 2010 by Stefano Crocco
3
+ stefano.crocco@alice.it
4
+
5
+ This program is free software; you can redistribute it andor modify
6
+ it under the terms of the GNU General Public License as published by
7
+ the Free Software Foundation; either version 2 of the License, or
8
+ (at your option) any later version.
9
+
10
+ This program is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ GNU General Public License for more details.
14
+
15
+ You should have received a copy of the GNU General Public License
16
+ along with this program; if not, write to the
17
+ Free Software Foundation, Inc.,
18
+ 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
+ =end
20
+
21
+ require_relative 'ui/project_widget'
22
+
23
+ module Ruber
24
+
25
+ module RubyRunner
26
+
27
+ =begin rdoc
28
+ Project widget for the ruby runner plugin
29
+ =end
30
+ class ProjectWidget < ProjectConfigWidget
31
+
32
+ =begin rdoc
33
+ Creates a new instance
34
+
35
+ @param [Ruber::AbstractProject] prj the project the widget is for
36
+ =end
37
+ def initialize prj
38
+ super
39
+ @ui = Ui::RubyRunnerProjectWidget.new
40
+ @ui.setupUi self
41
+ @ui._ruby__ruby.add_items Ruber[:config][:ruby, :interpreters]
42
+ end
43
+
44
+ =begin rdoc
45
+ Reader for the @ruby/ruby@ option
46
+
47
+ It selects the entry having text equal to _value_ in the combo box (or the first
48
+ entry if there's no entry with text _value_)
49
+
50
+ @param [String] value the path of the interpreter to use
51
+ =end
52
+ def interpreter= value
53
+ item = @ui._ruby__ruby.each_with_index.find{|txt, i| txt == value}
54
+ idx = item ? item[1] : 0
55
+ @ui._ruby__ruby.current_index = idx
56
+ end
57
+
58
+ end
59
+
60
+ end
61
+
62
+ end