ruber 0.0.9 → 0.0.10
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.
- data/CHANGES +42 -1
- data/lib/ruber/application/application.rb +25 -5
- data/lib/ruber/application/plugin.yaml +2 -10
- data/lib/ruber/component_manager.rb +2 -2
- data/lib/ruber/document_project.rb +5 -3
- data/lib/ruber/editor/document.rb +5 -4
- data/lib/ruber/editor/ktexteditor_wrapper.rb +1 -1
- data/lib/ruber/exception_widgets.rb +1 -1
- data/lib/ruber/main_window/main_window.rb +4 -3
- data/lib/ruber/main_window/main_window_actions.rb +2 -2
- data/lib/ruber/main_window/main_window_internal.rb +1 -1
- data/lib/ruber/output_widget.rb +17 -5
- data/lib/ruber/project.rb +34 -3
- data/lib/ruber/project_dir_scanner.rb +171 -0
- data/lib/ruber/settings_container.rb +7 -7
- data/lib/ruber/settings_dialog.rb +24 -24
- data/lib/ruber/version.rb +1 -1
- data/lib/ruber/world/environment.rb +1 -0
- data/lib/ruber/world/plugin.yaml +7 -2
- data/lib/ruber/{application → world}/project_files_widget.rb +0 -0
- data/lib/ruber/{application → world}/ui/project_files_rule_chooser_widget.rb +2 -2
- data/lib/ruber/{application → world}/ui/project_files_rule_chooser_widget.ui +0 -0
- data/lib/ruber/{application → world}/ui/project_files_widget.rb +2 -2
- data/lib/ruber/{application → world}/ui/project_files_widget.ui +0 -0
- data/plugins/auto_end/auto_end.rb +21 -18
- data/plugins/autosave/autosave.rb +1 -1
- data/plugins/find_in_files/find_in_files.rb +1 -1
- data/plugins/irb/irb.png +0 -0
- data/plugins/irb/irb.rb +142 -0
- data/plugins/irb/irb.svg +240 -0
- data/plugins/irb/irb_controller.rb +541 -0
- data/plugins/irb/irbrc.rb +21 -0
- data/plugins/irb/plugin.yaml +19 -0
- data/plugins/irb/ui/irb_config_widget.rb +151 -0
- data/plugins/irb/ui/irb_config_widget.ui +123 -0
- data/plugins/irb/ui/irb_tool_widget.rb +97 -0
- data/plugins/irb/ui/irb_tool_widget.ui +86 -0
- data/plugins/project_browser/project_browser.rb +1 -1
- data/plugins/rspec/plugin.yaml +6 -3
- data/plugins/rspec/rspec.rb +172 -473
- data/plugins/rspec/tool_widget.rb +462 -0
- data/plugins/rspec/ui/rspec_project_widget.rb +58 -38
- data/plugins/rspec/ui/rspec_project_widget.ui +68 -64
- data/plugins/ruberri/class_formatter.rb +126 -0
- data/plugins/ruberri/method_formatter.rb +90 -0
- data/plugins/ruberri/plugin.yaml +13 -0
- data/plugins/ruberri/ruberri.rb +226 -0
- data/plugins/ruberri/search.rb +111 -0
- data/plugins/ruberri/ui/tool_widget.rb +73 -0
- data/plugins/ruberri/ui/tool_widget.ui +49 -0
- data/plugins/ruby_runner/ruby_runner.rb +2 -2
- data/plugins/ruby_syntax_checker/plugin.yaml +11 -0
- data/plugins/ruby_syntax_checker/ruby_syntax_checker.rb +147 -0
- data/plugins/syntax_checker/plugin.yaml +10 -6
- data/plugins/syntax_checker/syntax_checker.rb +216 -520
- data/plugins/syntax_checker/ui/config_widget.rb +61 -0
- data/plugins/syntax_checker/ui/config_widget.ui +44 -0
- data/plugins/yaml_syntax_checker/plugin.yaml +11 -0
- data/plugins/yaml_syntax_checker/yaml_syntax_checker.rb +62 -0
- data/ruber.desktop +0 -0
- data/spec/auto_end_spec.rb +224 -186
- data/spec/document_project_spec.rb +9 -1
- data/spec/document_spec.rb +9 -0
- data/spec/environment_spec.rb +12 -0
- data/spec/output_widget_spec.rb +69 -2
- data/spec/project_dir_scanner_spec.rb +195 -0
- data/spec/project_spec.rb +43 -73
- data/spec/ruby_syntax_checker_spec.rb +361 -0
- data/spec/syntax_checker_spec.rb +1132 -0
- data/spec/yaml_syntax_checker_spec.rb +130 -0
- metadata +232 -225
- data/lib/ruber/application/project_files_list.rb +0 -320
- data/spec/project_files_list_spec.rb +0 -411
@@ -1,15 +1,15 @@
|
|
1
1
|
=begin
|
2
2
|
** Form generated from reading ui file 'rspec_project_widget.ui'
|
3
3
|
**
|
4
|
-
** Created:
|
5
|
-
** by: Qt User Interface Compiler version 4.7.
|
4
|
+
** Created: mar ago 2 14:59:43 2011
|
5
|
+
** by: Qt User Interface Compiler version 4.7.3
|
6
6
|
**
|
7
7
|
** WARNING! All changes made in this file will be lost when recompiling ui file!
|
8
8
|
=end
|
9
9
|
|
10
10
|
class Ui_RSpecProjectWidget
|
11
|
-
attr_reader :
|
12
|
-
attr_reader :
|
11
|
+
attr_reader :verticalLayout_2
|
12
|
+
attr_reader :_rspec__ruby_options
|
13
13
|
attr_reader :groupBox_2
|
14
14
|
attr_reader :gridLayout_2
|
15
15
|
attr_reader :label_5
|
@@ -17,28 +17,31 @@ class Ui_RSpecProjectWidget
|
|
17
17
|
attr_reader :label_6
|
18
18
|
attr_reader :_rspec__executable
|
19
19
|
attr_reader :_rspec__full_backtraces
|
20
|
-
attr_reader :verticalSpacer_3
|
21
20
|
attr_reader :groupBox
|
22
21
|
attr_reader :gridLayout
|
23
22
|
attr_reader :label
|
24
23
|
attr_reader :_rspec__spec_directory
|
25
24
|
attr_reader :label_2
|
26
25
|
attr_reader :_rspec__spec_files
|
26
|
+
attr_reader :_rspec__code_directory
|
27
27
|
attr_reader :label_3
|
28
|
-
attr_reader :
|
29
|
-
attr_reader :
|
30
|
-
attr_reader :
|
28
|
+
attr_reader :groupBox_3
|
29
|
+
attr_reader :gridLayout_3
|
30
|
+
attr_reader :_rspec__patterns
|
31
|
+
attr_reader :add_pattern
|
32
|
+
attr_reader :remove_pattern
|
31
33
|
|
32
34
|
def setupUi(rSpecProjectWidget)
|
33
35
|
if rSpecProjectWidget.objectName.nil?
|
34
36
|
rSpecProjectWidget.objectName = "rSpecProjectWidget"
|
35
37
|
end
|
36
|
-
rSpecProjectWidget.resize(447,
|
37
|
-
@
|
38
|
-
@
|
39
|
-
@
|
38
|
+
rSpecProjectWidget.resize(447, 650)
|
39
|
+
@verticalLayout_2 = Qt::VBoxLayout.new(rSpecProjectWidget)
|
40
|
+
@verticalLayout_2.objectName = "verticalLayout_2"
|
41
|
+
@_rspec__ruby_options = RubyOptionsWidget.new(rSpecProjectWidget)
|
42
|
+
@_rspec__ruby_options.objectName = "_rspec__ruby_options"
|
40
43
|
|
41
|
-
@
|
44
|
+
@verticalLayout_2.addWidget(@_rspec__ruby_options)
|
42
45
|
|
43
46
|
@groupBox_2 = Qt::GroupBox.new(rSpecProjectWidget)
|
44
47
|
@groupBox_2.objectName = "groupBox_2"
|
@@ -70,11 +73,7 @@ class Ui_RSpecProjectWidget
|
|
70
73
|
@gridLayout_2.addWidget(@_rspec__full_backtraces, 2, 0, 1, 1)
|
71
74
|
|
72
75
|
|
73
|
-
@
|
74
|
-
|
75
|
-
@verticalSpacer_3 = Qt::SpacerItem.new(20, 0, Qt::SizePolicy::Minimum, Qt::SizePolicy::Expanding)
|
76
|
-
|
77
|
-
@gridLayout_3.addItem(@verticalSpacer_3, 3, 1, 1, 1)
|
76
|
+
@verticalLayout_2.addWidget(@groupBox_2)
|
78
77
|
|
79
78
|
@groupBox = Qt::GroupBox.new(rSpecProjectWidget)
|
80
79
|
@groupBox.objectName = "groupBox"
|
@@ -83,54 +82,72 @@ class Ui_RSpecProjectWidget
|
|
83
82
|
@label = Qt::Label.new(@groupBox)
|
84
83
|
@label.objectName = "label"
|
85
84
|
|
86
|
-
@gridLayout.addWidget(@label,
|
85
|
+
@gridLayout.addWidget(@label, 1, 0, 1, 1)
|
87
86
|
|
88
87
|
@_rspec__spec_directory = KDE::UrlRequester.new(@groupBox)
|
89
88
|
@_rspec__spec_directory.objectName = "_rspec__spec_directory"
|
90
89
|
|
91
|
-
@gridLayout.addWidget(@_rspec__spec_directory,
|
90
|
+
@gridLayout.addWidget(@_rspec__spec_directory, 1, 1, 1, 1)
|
92
91
|
|
93
92
|
@label_2 = Qt::Label.new(@groupBox)
|
94
93
|
@label_2.objectName = "label_2"
|
95
94
|
|
96
|
-
@gridLayout.addWidget(@label_2,
|
95
|
+
@gridLayout.addWidget(@label_2, 2, 0, 1, 1)
|
97
96
|
|
98
97
|
@_rspec__spec_files = KDE::LineEdit.new(@groupBox)
|
99
98
|
@_rspec__spec_files.objectName = "_rspec__spec_files"
|
100
99
|
|
101
|
-
@gridLayout.addWidget(@_rspec__spec_files,
|
100
|
+
@gridLayout.addWidget(@_rspec__spec_files, 2, 1, 1, 1)
|
101
|
+
|
102
|
+
@_rspec__code_directory = KDE::UrlRequester.new(@groupBox)
|
103
|
+
@_rspec__code_directory.objectName = "_rspec__code_directory"
|
104
|
+
|
105
|
+
@gridLayout.addWidget(@_rspec__code_directory, 0, 1, 1, 1)
|
102
106
|
|
103
107
|
@label_3 = Qt::Label.new(@groupBox)
|
104
108
|
@label_3.objectName = "label_3"
|
105
109
|
|
106
|
-
@gridLayout.addWidget(@label_3,
|
110
|
+
@gridLayout.addWidget(@label_3, 0, 0, 1, 1)
|
111
|
+
|
107
112
|
|
108
|
-
@
|
109
|
-
@_rspec__spec_pattern.objectName = "_rspec__spec_pattern"
|
113
|
+
@verticalLayout_2.addWidget(@groupBox)
|
110
114
|
|
111
|
-
@
|
115
|
+
@groupBox_3 = Qt::GroupBox.new(rSpecProjectWidget)
|
116
|
+
@groupBox_3.objectName = "groupBox_3"
|
117
|
+
@gridLayout_3 = Qt::GridLayout.new(@groupBox_3)
|
118
|
+
@gridLayout_3.objectName = "gridLayout_3"
|
119
|
+
@_rspec__patterns = Qt::TreeView.new(@groupBox_3)
|
120
|
+
@_rspec__patterns.objectName = "_rspec__patterns"
|
121
|
+
@_rspec__patterns.rootIsDecorated = false
|
122
|
+
@_rspec__patterns.uniformRowHeights = true
|
123
|
+
@_rspec__patterns.itemsExpandable = false
|
124
|
+
@_rspec__patterns.allColumnsShowFocus = true
|
125
|
+
@_rspec__patterns.expandsOnDoubleClick = false
|
112
126
|
|
127
|
+
@gridLayout_3.addWidget(@_rspec__patterns, 0, 0, 1, 2)
|
113
128
|
|
114
|
-
@
|
129
|
+
@add_pattern = Qt::PushButton.new(@groupBox_3)
|
130
|
+
@add_pattern.objectName = "add_pattern"
|
115
131
|
|
116
|
-
@
|
132
|
+
@gridLayout_3.addWidget(@add_pattern, 1, 0, 1, 1)
|
117
133
|
|
118
|
-
@
|
134
|
+
@remove_pattern = Qt::PushButton.new(@groupBox_3)
|
135
|
+
@remove_pattern.objectName = "remove_pattern"
|
136
|
+
@remove_pattern.enabled = false
|
137
|
+
|
138
|
+
@gridLayout_3.addWidget(@remove_pattern, 1, 1, 1, 1)
|
119
139
|
|
120
|
-
@_rspec__ruby_options = RubyOptionsWidget.new(rSpecProjectWidget)
|
121
|
-
@_rspec__ruby_options.objectName = "_rspec__ruby_options"
|
122
140
|
|
123
|
-
@
|
141
|
+
@verticalLayout_2.addWidget(@groupBox_3)
|
124
142
|
|
125
143
|
@label_5.buddy = @_rspec__options
|
126
144
|
@label_6.buddy = @_rspec__executable
|
127
145
|
@label.buddy = @_rspec__spec_directory
|
128
146
|
@label_2.buddy = @_rspec__spec_files
|
129
|
-
@label_3.buddy = @
|
147
|
+
@label_3.buddy = @_rspec__code_directory
|
130
148
|
Qt::Widget.setTabOrder(@_rspec__executable, @_rspec__options)
|
131
149
|
Qt::Widget.setTabOrder(@_rspec__options, @_rspec__spec_directory)
|
132
150
|
Qt::Widget.setTabOrder(@_rspec__spec_directory, @_rspec__spec_files)
|
133
|
-
Qt::Widget.setTabOrder(@_rspec__spec_files, @_rspec__spec_pattern)
|
134
151
|
|
135
152
|
retranslateUi(rSpecProjectWidget)
|
136
153
|
|
@@ -149,12 +166,15 @@ class Ui_RSpecProjectWidget
|
|
149
166
|
@label_6.text = Qt::Application.translate("RSpecProjectWidget", "&RSpec executable", nil, Qt::Application::UnicodeUTF8)
|
150
167
|
@_rspec__full_backtraces.text = Qt::Application.translate("RSpecProjectWidget", "&Generate full backtraces", nil, Qt::Application::UnicodeUTF8)
|
151
168
|
@groupBox.title = Qt::Application.translate("RSpecProjectWidget", "Spec files", nil, Qt::Application::UnicodeUTF8)
|
152
|
-
@label.text = Qt::Application.translate("RSpecProjectWidget", "Spec
|
169
|
+
@label.text = Qt::Application.translate("RSpecProjectWidget", "&Spec directory", nil, Qt::Application::UnicodeUTF8)
|
153
170
|
@label_2.text = Qt::Application.translate("RSpecProjectWidget", "&Filter", nil, Qt::Application::UnicodeUTF8)
|
154
171
|
@_rspec__spec_files.text = Qt::Application.translate("RSpecProjectWidget", "*_spec.rb", nil, Qt::Application::UnicodeUTF8)
|
155
|
-
@label_3.text = Qt::Application.translate("RSpecProjectWidget", "&
|
156
|
-
@
|
157
|
-
@
|
172
|
+
@label_3.text = Qt::Application.translate("RSpecProjectWidget", "&Code directory", nil, Qt::Application::UnicodeUTF8)
|
173
|
+
@groupBox_3.title = Qt::Application.translate("RSpecProjectWidget", "&Patterns", nil, Qt::Application::UnicodeUTF8)
|
174
|
+
@_rspec__patterns.setProperty("access", Qt::Variant.new(Qt::Application.translate("RSpecProjectWidget", "$patterns", nil, Qt::Application::UnicodeUTF8)))
|
175
|
+
@_rspec__patterns.setProperty("signal", Qt::Variant.new(Qt::Application.translate("RSpecProjectWidget", "activated", nil, Qt::Application::UnicodeUTF8)))
|
176
|
+
@add_pattern.text = Qt::Application.translate("RSpecProjectWidget", "&Add pattern", nil, Qt::Application::UnicodeUTF8)
|
177
|
+
@remove_pattern.text = Qt::Application.translate("RSpecProjectWidget", "&Remove selected pattern", nil, Qt::Application::UnicodeUTF8)
|
158
178
|
end # retranslateUi
|
159
179
|
|
160
180
|
def retranslate_ui(rSpecProjectWidget)
|
@@ -7,27 +7,17 @@
|
|
7
7
|
<x>0</x>
|
8
8
|
<y>0</y>
|
9
9
|
<width>447</width>
|
10
|
-
<height>
|
10
|
+
<height>650</height>
|
11
11
|
</rect>
|
12
12
|
</property>
|
13
13
|
<property name="windowTitle">
|
14
14
|
<string>Form</string>
|
15
15
|
</property>
|
16
|
-
<layout class="
|
17
|
-
<item
|
18
|
-
<
|
19
|
-
<property name="orientation">
|
20
|
-
<enum>Qt::Vertical</enum>
|
21
|
-
</property>
|
22
|
-
<property name="sizeHint" stdset="0">
|
23
|
-
<size>
|
24
|
-
<width>20</width>
|
25
|
-
<height>10</height>
|
26
|
-
</size>
|
27
|
-
</property>
|
28
|
-
</spacer>
|
16
|
+
<layout class="QVBoxLayout" name="verticalLayout_2">
|
17
|
+
<item>
|
18
|
+
<widget class="RubyOptionsWidget" name="_rspec__ruby_options" native="true"/>
|
29
19
|
</item>
|
30
|
-
<item
|
20
|
+
<item>
|
31
21
|
<widget class="QGroupBox" name="groupBox_2">
|
32
22
|
<property name="title">
|
33
23
|
<string>RSpec</string>
|
@@ -73,39 +63,26 @@
|
|
73
63
|
</layout>
|
74
64
|
</widget>
|
75
65
|
</item>
|
76
|
-
<item
|
77
|
-
<spacer name="verticalSpacer_3">
|
78
|
-
<property name="orientation">
|
79
|
-
<enum>Qt::Vertical</enum>
|
80
|
-
</property>
|
81
|
-
<property name="sizeHint" stdset="0">
|
82
|
-
<size>
|
83
|
-
<width>20</width>
|
84
|
-
<height>0</height>
|
85
|
-
</size>
|
86
|
-
</property>
|
87
|
-
</spacer>
|
88
|
-
</item>
|
89
|
-
<item row="4" column="0" colspan="2">
|
66
|
+
<item>
|
90
67
|
<widget class="QGroupBox" name="groupBox">
|
91
68
|
<property name="title">
|
92
69
|
<string>Spec files</string>
|
93
70
|
</property>
|
94
71
|
<layout class="QGridLayout" name="gridLayout">
|
95
|
-
<item row="
|
72
|
+
<item row="1" column="0">
|
96
73
|
<widget class="QLabel" name="label">
|
97
74
|
<property name="text">
|
98
|
-
<string
|
75
|
+
<string>&Spec directory</string>
|
99
76
|
</property>
|
100
77
|
<property name="buddy">
|
101
78
|
<cstring>_rspec__spec_directory</cstring>
|
102
79
|
</property>
|
103
80
|
</widget>
|
104
81
|
</item>
|
105
|
-
<item row="
|
82
|
+
<item row="1" column="1">
|
106
83
|
<widget class="KUrlRequester" name="_rspec__spec_directory"/>
|
107
84
|
</item>
|
108
|
-
<item row="
|
85
|
+
<item row="2" column="0">
|
109
86
|
<widget class="QLabel" name="label_2">
|
110
87
|
<property name="text">
|
111
88
|
<string>&Filter</string>
|
@@ -115,65 +92,93 @@
|
|
115
92
|
</property>
|
116
93
|
</widget>
|
117
94
|
</item>
|
118
|
-
<item row="
|
95
|
+
<item row="2" column="1">
|
119
96
|
<widget class="KLineEdit" name="_rspec__spec_files">
|
120
97
|
<property name="text">
|
121
98
|
<string>*_spec.rb</string>
|
122
99
|
</property>
|
123
100
|
</widget>
|
124
101
|
</item>
|
125
|
-
<item row="
|
102
|
+
<item row="0" column="1">
|
103
|
+
<widget class="KUrlRequester" name="_rspec__code_directory"/>
|
104
|
+
</item>
|
105
|
+
<item row="0" column="0">
|
126
106
|
<widget class="QLabel" name="label_3">
|
127
107
|
<property name="text">
|
128
|
-
<string>&
|
108
|
+
<string>&Code directory</string>
|
129
109
|
</property>
|
130
110
|
<property name="buddy">
|
131
|
-
<cstring>
|
111
|
+
<cstring>_rspec__code_directory</cstring>
|
132
112
|
</property>
|
133
113
|
</widget>
|
134
114
|
</item>
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
115
|
+
</layout>
|
116
|
+
</widget>
|
117
|
+
</item>
|
118
|
+
<item>
|
119
|
+
<widget class="QGroupBox" name="groupBox_3">
|
120
|
+
<property name="title">
|
121
|
+
<string>&Patterns</string>
|
122
|
+
</property>
|
123
|
+
<layout class="QGridLayout" name="gridLayout_3">
|
124
|
+
<item row="0" column="0" colspan="2">
|
125
|
+
<widget class="QTreeView" name="_rspec__patterns">
|
126
|
+
<property name="rootIsDecorated">
|
127
|
+
<bool>false</bool>
|
128
|
+
</property>
|
129
|
+
<property name="uniformRowHeights">
|
130
|
+
<bool>true</bool>
|
131
|
+
</property>
|
132
|
+
<property name="itemsExpandable">
|
133
|
+
<bool>false</bool>
|
134
|
+
</property>
|
135
|
+
<property name="allColumnsShowFocus">
|
136
|
+
<bool>true</bool>
|
137
|
+
</property>
|
138
|
+
<property name="expandsOnDoubleClick">
|
139
|
+
<bool>false</bool>
|
139
140
|
</property>
|
140
141
|
<property name="access" stdset="0">
|
141
|
-
<string>$
|
142
|
+
<string>$patterns</string>
|
143
|
+
</property>
|
144
|
+
<property name="signal" stdset="0">
|
145
|
+
<string>activated</string>
|
146
|
+
</property>
|
147
|
+
</widget>
|
148
|
+
</item>
|
149
|
+
<item row="1" column="0">
|
150
|
+
<widget class="QPushButton" name="add_pattern">
|
151
|
+
<property name="text">
|
152
|
+
<string>&Add pattern</string>
|
153
|
+
</property>
|
154
|
+
</widget>
|
155
|
+
</item>
|
156
|
+
<item row="1" column="1">
|
157
|
+
<widget class="QPushButton" name="remove_pattern">
|
158
|
+
<property name="enabled">
|
159
|
+
<bool>false</bool>
|
160
|
+
</property>
|
161
|
+
<property name="text">
|
162
|
+
<string>&Remove selected pattern</string>
|
142
163
|
</property>
|
143
164
|
</widget>
|
144
165
|
</item>
|
145
166
|
</layout>
|
146
167
|
</widget>
|
147
168
|
</item>
|
148
|
-
<item row="5" column="0" colspan="2">
|
149
|
-
<spacer name="verticalSpacer_2">
|
150
|
-
<property name="orientation">
|
151
|
-
<enum>Qt::Vertical</enum>
|
152
|
-
</property>
|
153
|
-
<property name="sizeHint" stdset="0">
|
154
|
-
<size>
|
155
|
-
<width>20</width>
|
156
|
-
<height>0</height>
|
157
|
-
</size>
|
158
|
-
</property>
|
159
|
-
</spacer>
|
160
|
-
</item>
|
161
|
-
<item row="1" column="0">
|
162
|
-
<widget class="RubyOptionsWidget" name="_rspec__ruby_options" native="true"/>
|
163
|
-
</item>
|
164
169
|
</layout>
|
165
170
|
</widget>
|
166
171
|
<customwidgets>
|
167
|
-
<customwidget>
|
168
|
-
<class>KUrlRequester</class>
|
169
|
-
<extends>QFrame</extends>
|
170
|
-
<header>kurlrequester.h</header>
|
171
|
-
</customwidget>
|
172
172
|
<customwidget>
|
173
173
|
<class>KLineEdit</class>
|
174
174
|
<extends>QLineEdit</extends>
|
175
175
|
<header>klineedit.h</header>
|
176
176
|
</customwidget>
|
177
|
+
<customwidget>
|
178
|
+
<class>KUrlRequester</class>
|
179
|
+
<extends>QFrame</extends>
|
180
|
+
<header>kurlrequester.h</header>
|
181
|
+
</customwidget>
|
177
182
|
<customwidget>
|
178
183
|
<class>RubyOptionsWidget</class>
|
179
184
|
<extends>QWidget</extends>
|
@@ -186,7 +191,6 @@
|
|
186
191
|
<tabstop>_rspec__options</tabstop>
|
187
192
|
<tabstop>_rspec__spec_directory</tabstop>
|
188
193
|
<tabstop>_rspec__spec_files</tabstop>
|
189
|
-
<tabstop>_rspec__spec_pattern</tabstop>
|
190
194
|
</tabstops>
|
191
195
|
<resources/>
|
192
196
|
<connections/>
|
@@ -0,0 +1,126 @@
|
|
1
|
+
=begin
|
2
|
+
Copyright (C) 2011 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 'rdoc/ri/driver'
|
22
|
+
require 'rdoc/ri/store'
|
23
|
+
require 'rdoc/markup/document'
|
24
|
+
require 'rdoc/markup/to_html'
|
25
|
+
|
26
|
+
module Ruber
|
27
|
+
|
28
|
+
module RI
|
29
|
+
|
30
|
+
class ClassFormatter
|
31
|
+
|
32
|
+
def initialize cls, store, store_type
|
33
|
+
@store = RDoc::RI::Store.new store, store_type
|
34
|
+
@cls = @store.load_class cls
|
35
|
+
end
|
36
|
+
|
37
|
+
def to_html
|
38
|
+
superclass = @cls.superclass if @cls.type == :class
|
39
|
+
if superclass and superclass != 'Object'
|
40
|
+
superclass = " < #{superclass}"
|
41
|
+
elsif superclass == 'Object' then superclass = ''
|
42
|
+
end
|
43
|
+
title = "#{@cls.type.capitalize} #{@cls.full_name}#{superclass}"
|
44
|
+
title << " (from #{@store.friendly_path})" unless @store.friendly_path =~ /ruby core/
|
45
|
+
parts = [RDoc::Markup::Heading.new(1, title)]
|
46
|
+
parts << format_included
|
47
|
+
parts << @cls.comment
|
48
|
+
parts << format_constants
|
49
|
+
parts << format_class_methods
|
50
|
+
parts << format_instance_methods
|
51
|
+
parts.compact!
|
52
|
+
doc = RDoc::Markup::Document.new
|
53
|
+
last = parts.count - 1
|
54
|
+
parts.each_with_index do |prt, i|
|
55
|
+
if prt.is_a? Array then prt.each{|x| doc << x}
|
56
|
+
else doc << prt
|
57
|
+
end
|
58
|
+
doc << RDoc::Markup::Rule.new(1) unless i == last
|
59
|
+
end
|
60
|
+
formatter = RDoc::Markup::ToHtml.new
|
61
|
+
doc.accept formatter
|
62
|
+
end
|
63
|
+
|
64
|
+
private
|
65
|
+
|
66
|
+
def format_included
|
67
|
+
included = @cls.includes
|
68
|
+
unless included.empty?
|
69
|
+
res = []
|
70
|
+
res << RDoc::Markup::Heading.new(2, "Included modules")
|
71
|
+
list = RDoc::Markup::List.new :BULLET
|
72
|
+
@cls.includes.each{|i| list << RDoc::Markup::ListItem.new(nil, RDoc::Markup::Paragraph.new(i.module.to_s) )}
|
73
|
+
res << list
|
74
|
+
res
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
def format_class_methods
|
79
|
+
methods = @cls.method_list.reject{|m| m.full_name.include? '#'}
|
80
|
+
unless methods.empty?
|
81
|
+
res = []
|
82
|
+
res << RDoc::Markup::Heading.new(2, "Class methods")
|
83
|
+
method_list = methods.map do |m|
|
84
|
+
RDoc::Markup::ListItem.new nil, RDoc::Markup::Verbatim.new(m.name)
|
85
|
+
end
|
86
|
+
res << RDoc::Markup::List.new(:BULLET, *method_list)
|
87
|
+
res
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
def format_instance_methods
|
92
|
+
methods = @cls.method_list.select{|m| m.full_name.include? '#'}
|
93
|
+
unless methods.empty?
|
94
|
+
res = []
|
95
|
+
res << RDoc::Markup::Heading.new(2, "Instance methods")
|
96
|
+
method_list = methods.map do |m|
|
97
|
+
RDoc::Markup::ListItem.new nil, RDoc::Markup::Verbatim.new(m.name)
|
98
|
+
end
|
99
|
+
res << RDoc::Markup::List.new(:BULLET, *method_list)
|
100
|
+
res
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
def format_constants
|
105
|
+
return if @cls.constants.empty?
|
106
|
+
res = []
|
107
|
+
res << RDoc::Markup::Heading.new(2, "Constants defined in this #{@cls.type}")
|
108
|
+
last = @cls.constants.count - 1
|
109
|
+
@cls.constants.each_with_index do |c, i|
|
110
|
+
res << RDoc::Markup::Heading.new(3, "<tt>#{c.name}</tt>")
|
111
|
+
res << c.comment
|
112
|
+
|
113
|
+
end
|
114
|
+
res
|
115
|
+
end
|
116
|
+
|
117
|
+
end
|
118
|
+
|
119
|
+
end
|
120
|
+
|
121
|
+
end
|
122
|
+
|
123
|
+
if $0 == __FILE__
|
124
|
+
cls, store, store_type = *ARGV
|
125
|
+
puts Ruber::RI::ClassFormatter.new(cls, store, store_type.to_sym).to_html
|
126
|
+
end
|