ruber 0.0.1.1
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/COPYING +339 -0
- data/INSTALL +137 -0
- data/LICENSE +8 -0
- data/bin/ruber +65 -0
- data/data/share/apps/ruber/core_components.yaml +31 -0
- data/data/share/apps/ruber/ruberui.rc +109 -0
- data/data/share/icons/ruber.png +0 -0
- data/data/share/pixmaps/ruby.png +0 -0
- data/icons/ruber-16.png +0 -0
- data/icons/ruber-32.png +0 -0
- data/icons/ruber-48.png +0 -0
- data/icons/ruber-8.png +0 -0
- data/lib/ruber/application/application.rb +288 -0
- data/lib/ruber/application/plugin.yaml +11 -0
- data/lib/ruber/component_manager.rb +899 -0
- data/lib/ruber/config/config.rb +82 -0
- data/lib/ruber/config/plugin.yaml +3 -0
- data/lib/ruber/document_project.rb +209 -0
- data/lib/ruber/documents/document_list.rb +416 -0
- data/lib/ruber/documents/plugin.yaml +4 -0
- data/lib/ruber/editor/document.rb +506 -0
- data/lib/ruber/editor/editor_view.rb +167 -0
- data/lib/ruber/editor/ktexteditor_wrapper.rb +202 -0
- data/lib/ruber/exception_widgets.rb +245 -0
- data/lib/ruber/external_program_plugin.rb +397 -0
- data/lib/ruber/filtered_output_widget.rb +342 -0
- data/lib/ruber/gui_states_handler.rb +231 -0
- data/lib/ruber/kde_config_option_backend.rb +167 -0
- data/lib/ruber/kde_sugar.rb +249 -0
- data/lib/ruber/main_window/choose_plugins_dlg.rb +353 -0
- data/lib/ruber/main_window/main_window.rb +524 -0
- data/lib/ruber/main_window/main_window_actions.rb +537 -0
- data/lib/ruber/main_window/main_window_internal.rb +239 -0
- data/lib/ruber/main_window/open_file_in_project_dlg.rb +212 -0
- data/lib/ruber/main_window/output_color_widget.rb +35 -0
- data/lib/ruber/main_window/plugin.yaml +58 -0
- data/lib/ruber/main_window/save_modified_files_dlg.rb +89 -0
- data/lib/ruber/main_window/status_bar.rb +156 -0
- data/lib/ruber/main_window/ui/choose_plugins_widget.rb +90 -0
- data/lib/ruber/main_window/ui/choose_plugins_widget.ui +77 -0
- data/lib/ruber/main_window/ui/main_window_settings_widget.rb +108 -0
- data/lib/ruber/main_window/ui/main_window_settings_widget.ui +89 -0
- data/lib/ruber/main_window/ui/new_project_widget.rb +119 -0
- data/lib/ruber/main_window/ui/new_project_widget.ui +178 -0
- data/lib/ruber/main_window/ui/open_file_in_project_dlg.rb +109 -0
- data/lib/ruber/main_window/ui/open_file_in_project_dlg.ui +168 -0
- data/lib/ruber/main_window/ui/output_color_widget.rb +241 -0
- data/lib/ruber/main_window/ui/output_color_widget.ui +204 -0
- data/lib/ruber/main_window/workspace.rb +442 -0
- data/lib/ruber/output_widget.rb +1093 -0
- data/lib/ruber/plugin.rb +264 -0
- data/lib/ruber/plugin_like.rb +589 -0
- data/lib/ruber/plugin_specification.rb +106 -0
- data/lib/ruber/plugin_specification_reader.rb +451 -0
- data/lib/ruber/project.rb +493 -0
- data/lib/ruber/project_backend.rb +105 -0
- data/lib/ruber/projects/plugin.yaml +11 -0
- data/lib/ruber/projects/project_files_list.rb +314 -0
- data/lib/ruber/projects/project_files_widget.rb +301 -0
- data/lib/ruber/projects/project_list.rb +314 -0
- data/lib/ruber/projects/ui/project_files_rule_chooser_widget.rb +74 -0
- data/lib/ruber/projects/ui/project_files_rule_chooser_widget.ui +61 -0
- data/lib/ruber/projects/ui/project_files_widget.rb +117 -0
- data/lib/ruber/projects/ui/project_files_widget.ui +123 -0
- data/lib/ruber/qt_sugar.rb +673 -0
- data/lib/ruber/settings_container.rb +515 -0
- data/lib/ruber/settings_dialog.rb +244 -0
- data/lib/ruber/settings_dialog_manager.rb +503 -0
- data/lib/ruber/utils.rb +414 -0
- data/lib/ruber/yaml_option_backend.rb +159 -0
- data/outsider_files +15 -0
- data/plugins/autosave/autosave.rb +404 -0
- data/plugins/autosave/plugin.yaml +16 -0
- data/plugins/autosave/ui/autosave_config_widget.rb +83 -0
- data/plugins/autosave/ui/autosave_config_widget.ui +68 -0
- data/plugins/command/command.png +0 -0
- data/plugins/command/command.rb +74 -0
- data/plugins/command/plugin.yaml +11 -0
- data/plugins/find_in_files/find_in_files.rb +337 -0
- data/plugins/find_in_files/find_in_files_dlg.rb +411 -0
- data/plugins/find_in_files/find_in_files_ui.rc +11 -0
- data/plugins/find_in_files/find_in_files_widgets.rb +485 -0
- data/plugins/find_in_files/plugin.yaml +23 -0
- data/plugins/find_in_files/ui/config_widget.rb +58 -0
- data/plugins/find_in_files/ui/config_widget.ui +41 -0
- data/plugins/find_in_files/ui/find_in_files_widget.rb +260 -0
- data/plugins/find_in_files/ui/find_in_files_widget.ui +324 -0
- data/plugins/project_browser/plugin.yaml +10 -0
- data/plugins/project_browser/project_browser.rb +245 -0
- data/plugins/rake/plugin.yaml +39 -0
- data/plugins/rake/rake.png +0 -0
- data/plugins/rake/rake.rb +567 -0
- data/plugins/rake/rake_extension.rb +153 -0
- data/plugins/rake/rake_widgets.rb +615 -0
- data/plugins/rake/rakeui.rc +27 -0
- data/plugins/rake/ui/add_quick_task_widget.rb +71 -0
- data/plugins/rake/ui/add_quick_task_widget.ui +59 -0
- data/plugins/rake/ui/choose_task_widget.rb +77 -0
- data/plugins/rake/ui/choose_task_widget.ui +72 -0
- data/plugins/rake/ui/config_widget.rb +127 -0
- data/plugins/rake/ui/config_widget.ui +123 -0
- data/plugins/rake/ui/project_widget.rb +217 -0
- data/plugins/rake/ui/project_widget.ui +246 -0
- data/plugins/rspec/plugin.yaml +30 -0
- data/plugins/rspec/rspec.png +0 -0
- data/plugins/rspec/rspec.rb +945 -0
- data/plugins/rspec/rspec.svg +90 -0
- data/plugins/rspec/rspecui.rc +20 -0
- data/plugins/rspec/ruber_rspec_formatter.rb +312 -0
- data/plugins/rspec/ui/rspec_project_widget.rb +170 -0
- data/plugins/rspec/ui/rspec_project_widget.ui +193 -0
- data/plugins/ruby_development/plugin.yaml +27 -0
- data/plugins/ruby_development/ruby_development.png +0 -0
- data/plugins/ruby_development/ruby_development.rb +453 -0
- data/plugins/ruby_development/ruby_developmentui.rc +19 -0
- data/plugins/ruby_development/ui/project_widget.rb +112 -0
- data/plugins/ruby_development/ui/project_widget.ui +108 -0
- data/plugins/ruby_runner/config_widget.rb +116 -0
- data/plugins/ruby_runner/plugin.yaml +26 -0
- data/plugins/ruby_runner/project_widget.rb +62 -0
- data/plugins/ruby_runner/ruby.png +0 -0
- data/plugins/ruby_runner/ruby_interpretersui.rc +26 -0
- data/plugins/ruby_runner/ruby_runner.rb +411 -0
- data/plugins/ruby_runner/ui/config_widget.rb +92 -0
- data/plugins/ruby_runner/ui/config_widget.ui +91 -0
- data/plugins/ruby_runner/ui/project_widget.rb +60 -0
- data/plugins/ruby_runner/ui/project_widget.ui +48 -0
- data/plugins/ruby_runner/ui/ruby_runnner_plugin_option_widget.rb +59 -0
- data/plugins/ruby_runner/ui/ruby_runnner_plugin_option_widget.ui +44 -0
- data/plugins/state/plugin.yaml +28 -0
- data/plugins/state/state.rb +520 -0
- data/plugins/state/ui/config_widget.rb +92 -0
- data/plugins/state/ui/config_widget.ui +89 -0
- data/plugins/syntax_checker/plugin.yaml +18 -0
- data/plugins/syntax_checker/syntax_checker.rb +662 -0
- data/ruber.desktop +10 -0
- data/spec/annotation_model_spec.rb +174 -0
- data/spec/common.rb +119 -0
- data/spec/component_manager_spec.rb +1259 -0
- data/spec/document_list_spec.rb +626 -0
- data/spec/document_project_spec.rb +373 -0
- data/spec/document_spec.rb +779 -0
- data/spec/editor_view_spec.rb +167 -0
- data/spec/external_program_plugin_spec.rb +676 -0
- data/spec/filtered_output_widget_spec.rb +642 -0
- data/spec/gui_states_handler_spec.rb +304 -0
- data/spec/kde_config_option_backend_spec.rb +214 -0
- data/spec/kde_sugar_spec.rb +101 -0
- data/spec/ktexteditor_wrapper_spec.rb +305 -0
- data/spec/output_widget_spec.rb +1703 -0
- data/spec/plugin_spec.rb +1393 -0
- data/spec/plugin_specification_reader_spec.rb +1765 -0
- data/spec/plugin_specification_spec.rb +401 -0
- data/spec/project_backend_spec.rb +172 -0
- data/spec/project_files_list_spec.rb +401 -0
- data/spec/project_list_spec.rb +511 -0
- data/spec/project_spec.rb +990 -0
- data/spec/qt_sugar_spec.rb +328 -0
- data/spec/settings_container_spec.rb +617 -0
- data/spec/settings_dialog_manager_spec.rb +773 -0
- data/spec/settings_dialog_spec.rb +419 -0
- data/spec/state_spec.rb +991 -0
- data/spec/utils_spec.rb +406 -0
- data/spec/workspace_spec.rb +869 -0
- data/spec/yaml_option_backend_spec.rb +246 -0
- metadata +284 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
|
3
|
+
<svg
|
|
4
|
+
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
|
5
|
+
xmlns:cc="http://creativecommons.org/ns#"
|
|
6
|
+
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
7
|
+
xmlns:svg="http://www.w3.org/2000/svg"
|
|
8
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
+
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
10
|
+
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
11
|
+
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
12
|
+
width="16"
|
|
13
|
+
height="16"
|
|
14
|
+
id="svg2"
|
|
15
|
+
sodipodi:version="0.32"
|
|
16
|
+
inkscape:version="0.46"
|
|
17
|
+
version="1.0"
|
|
18
|
+
sodipodi:docname="rspec.svg"
|
|
19
|
+
inkscape:output_extension="org.inkscape.output.svg.inkscape">
|
|
20
|
+
<defs
|
|
21
|
+
id="defs4">
|
|
22
|
+
<inkscape:perspective
|
|
23
|
+
sodipodi:type="inkscape:persp3d"
|
|
24
|
+
inkscape:vp_x="0 : 526.18109 : 1"
|
|
25
|
+
inkscape:vp_y="0 : 1000 : 0"
|
|
26
|
+
inkscape:vp_z="744.09448 : 526.18109 : 1"
|
|
27
|
+
inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
|
|
28
|
+
id="perspective10" />
|
|
29
|
+
<inkscape:perspective
|
|
30
|
+
id="perspective2451"
|
|
31
|
+
inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
|
|
32
|
+
inkscape:vp_z="744.09448 : 526.18109 : 1"
|
|
33
|
+
inkscape:vp_y="0 : 1000 : 0"
|
|
34
|
+
inkscape:vp_x="0 : 526.18109 : 1"
|
|
35
|
+
sodipodi:type="inkscape:persp3d" />
|
|
36
|
+
</defs>
|
|
37
|
+
<sodipodi:namedview
|
|
38
|
+
id="base"
|
|
39
|
+
pagecolor="#ffffff"
|
|
40
|
+
bordercolor="#666666"
|
|
41
|
+
borderopacity="1.0"
|
|
42
|
+
inkscape:pageopacity="0.0"
|
|
43
|
+
inkscape:pageshadow="2"
|
|
44
|
+
inkscape:zoom="1"
|
|
45
|
+
inkscape:cx="8"
|
|
46
|
+
inkscape:cy="8"
|
|
47
|
+
inkscape:document-units="px"
|
|
48
|
+
inkscape:current-layer="layer1"
|
|
49
|
+
showgrid="false"
|
|
50
|
+
inkscape:window-width="1440"
|
|
51
|
+
inkscape:window-height="837"
|
|
52
|
+
inkscape:window-x="-5"
|
|
53
|
+
inkscape:window-y="-3" />
|
|
54
|
+
<metadata
|
|
55
|
+
id="metadata7">
|
|
56
|
+
<rdf:RDF>
|
|
57
|
+
<cc:Work
|
|
58
|
+
rdf:about="">
|
|
59
|
+
<dc:format>image/svg+xml</dc:format>
|
|
60
|
+
<dc:type
|
|
61
|
+
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
|
62
|
+
</cc:Work>
|
|
63
|
+
</rdf:RDF>
|
|
64
|
+
</metadata>
|
|
65
|
+
<g
|
|
66
|
+
inkscape:label="Livello 1"
|
|
67
|
+
inkscape:groupmode="layer"
|
|
68
|
+
id="layer1">
|
|
69
|
+
<image
|
|
70
|
+
y="-0.1523809"
|
|
71
|
+
x="0.53333372"
|
|
72
|
+
id="image2453"
|
|
73
|
+
height="16"
|
|
74
|
+
width="16"
|
|
75
|
+
sodipodi:absref="/home/stefano/documenti/miei_programmi/kruby/data/share/icons/kruby.png"
|
|
76
|
+
xlink:href="/home/stefano/documenti/miei_programmi/kruby/data/share/icons/kruby.png" />
|
|
77
|
+
<text
|
|
78
|
+
xml:space="preserve"
|
|
79
|
+
style="font-size:9.99999992999999954px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr;text-anchor:start;fill:#0000ff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Courier 10 Pitch;-inkscape-font-specification:Courier 10 Pitch Bold"
|
|
80
|
+
x="2.623167"
|
|
81
|
+
y="2.6442723"
|
|
82
|
+
id="text2383"
|
|
83
|
+
sodipodi:linespacing="125%"
|
|
84
|
+
transform="matrix(0.7240218,0.6897771,0.6897771,-0.7240218,0,0)"><tspan
|
|
85
|
+
sodipodi:role="line"
|
|
86
|
+
id="tspan2385"
|
|
87
|
+
x="2.623167"
|
|
88
|
+
y="2.6442723">BDD</tspan></text>
|
|
89
|
+
</g>
|
|
90
|
+
</svg>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<!DOCTYPE kpartgui SYSTEM 'kpartgui.dtd'>
|
|
2
|
+
<kpartgui version="1" name="ruber-rspec_plugin" >
|
|
3
|
+
<MenuBar>
|
|
4
|
+
<Menu noMerge="1" name="ruby" >
|
|
5
|
+
<text>&Ruby</text>
|
|
6
|
+
<Separator/>
|
|
7
|
+
<Menu noMerge="1" name="rspec">
|
|
8
|
+
<text>&Tests</text>
|
|
9
|
+
<Action name="rspec-go_to_spec"/>
|
|
10
|
+
<Action name="rspec-go_to_file"/>
|
|
11
|
+
<Separator/>
|
|
12
|
+
<Action name="rspec-run_all" />
|
|
13
|
+
<Action name="rspec-run_current"/>
|
|
14
|
+
<Action name="rspec-run_current_line"/>
|
|
15
|
+
<Separator/>
|
|
16
|
+
<Action name="rspec-stop"/>
|
|
17
|
+
</Menu>
|
|
18
|
+
</Menu>
|
|
19
|
+
</MenuBar>
|
|
20
|
+
</kpartgui>
|
|
@@ -0,0 +1,312 @@
|
|
|
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 'yaml'
|
|
22
|
+
|
|
23
|
+
module Ruber
|
|
24
|
+
|
|
25
|
+
module RSpec
|
|
26
|
+
|
|
27
|
+
begin
|
|
28
|
+
require 'spec/runner/formatter/base_text_formatter'
|
|
29
|
+
RSPEC_VERSION = 1
|
|
30
|
+
rescue LoadError
|
|
31
|
+
require 'rspec/core/formatters/base_text_formatter'
|
|
32
|
+
RSPEC_VERSION = 2
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
base = RSPEC_VERSION == 1 ? Spec::Runner::Formatter::BaseTextFormatter : ::RSpec::Core::Formatters::BaseTextFormatter
|
|
36
|
+
|
|
37
|
+
=begin rdoc
|
|
38
|
+
RSpec formatter used by the rspec plugin
|
|
39
|
+
|
|
40
|
+
It writes data as YAML-formatted hashes. The data relative to a single example,
|
|
41
|
+
as well as the preamble and the summary, are separated from each other with special
|
|
42
|
+
strings, stored in the {STARTING_DELIMITER} and {ENDING_DELIMITER} constants. This
|
|
43
|
+
is made to avoid problems in case buffering breaks a string containing one of these
|
|
44
|
+
strings in pieces.
|
|
45
|
+
|
|
46
|
+
Among keys specific to each of them, all the hashes contain the @:type@ key, which
|
|
47
|
+
tells which kind of information the hash contains.
|
|
48
|
+
|
|
49
|
+
@$$$$%%%%$$$$KRUBY_BEGIN@
|
|
50
|
+
|
|
51
|
+
and
|
|
52
|
+
|
|
53
|
+
@$$$$%%%%$$$$KRUBY_END@
|
|
54
|
+
|
|
55
|
+
The output is flushed after every writing
|
|
56
|
+
|
|
57
|
+
This is a base class used by both {Version1Formatter} and {Version2Formatter} which
|
|
58
|
+
defines all the methods which haven't changed in from RSpec 1 to RSpec 2. In particular,
|
|
59
|
+
it doesn't contain the @example_failed@ and @example_pending@ methods as their
|
|
60
|
+
signature has changed from one version to the ohter.
|
|
61
|
+
=end
|
|
62
|
+
class BaseFormatter < base
|
|
63
|
+
|
|
64
|
+
=begin rdoc
|
|
65
|
+
The starting delimiter used by the formatter
|
|
66
|
+
@todo (after first alpha) Change it to include the string @KRUBY@ with @RUBER@ inside it
|
|
67
|
+
=end
|
|
68
|
+
STARTING_DELIMITER = '####%%%%####KRUBY_BEGIN'
|
|
69
|
+
|
|
70
|
+
=begin rdoc
|
|
71
|
+
The ending delimiter used by the formatter
|
|
72
|
+
@todo (after first alpha) Change it to include the string @KRUBY@ with @RUBER@ inside it
|
|
73
|
+
=end
|
|
74
|
+
ENDING_DELIMITER = '####%%%%####KRUBY_END'
|
|
75
|
+
|
|
76
|
+
=begin rdoc
|
|
77
|
+
Method called by RSpec after the examples have been collected
|
|
78
|
+
|
|
79
|
+
It writes to the output a YAML dump of a hash with the following entries:
|
|
80
|
+
* @:type@: @:start@
|
|
81
|
+
* @:count@: the number of examples found by RSpec
|
|
82
|
+
@param [Integer] count the number of examples
|
|
83
|
+
@return [nil]
|
|
84
|
+
=end
|
|
85
|
+
def start count
|
|
86
|
+
super
|
|
87
|
+
hash = {:type => :start, :count => count}
|
|
88
|
+
write_data hash
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
=begin rdoc
|
|
92
|
+
Method called by RSpec after starting an example
|
|
93
|
+
|
|
94
|
+
It writes to the output a YAML dump of a hash with the following entries:
|
|
95
|
+
* @:type@: @:new_example@
|
|
96
|
+
* @:description@: the name of the example, made of the name of the example group
|
|
97
|
+
and the description of the example itself
|
|
98
|
+
@param [Spec::Example::ExampleProxy] ex the started example
|
|
99
|
+
@return [nil]
|
|
100
|
+
=end
|
|
101
|
+
def example_started ex
|
|
102
|
+
super
|
|
103
|
+
hash = {}
|
|
104
|
+
hash[:type] = :new_example
|
|
105
|
+
hash[:description] = "#{example_group.description} #{ex.description}"
|
|
106
|
+
write_data hash
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
=begin rdoc
|
|
110
|
+
Method called by RSpec after an example has been completed successfully
|
|
111
|
+
|
|
112
|
+
It writes to the output a YAML dump of a hash with the following entries:
|
|
113
|
+
* @:type@: @:success@
|
|
114
|
+
* @:description@: the name of the passed example, made of the name of the example group
|
|
115
|
+
and the description of the example itself
|
|
116
|
+
@param [Spec::Example::ExampleProxy] ex the started example
|
|
117
|
+
@return [nil]
|
|
118
|
+
=end
|
|
119
|
+
def example_passed ex
|
|
120
|
+
super
|
|
121
|
+
hash = {}
|
|
122
|
+
hash[:type] = :success
|
|
123
|
+
hash[:description] = "#{example_group.description} #{ex.description}"
|
|
124
|
+
write_data hash
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
=begin rdoc
|
|
128
|
+
Override of @Spec::Runner::Formatter::BaseTextFormatter#dump_failure@ which does nothing
|
|
129
|
+
@return [nil]
|
|
130
|
+
=end rdoc
|
|
131
|
+
def dump_failure counter, fail
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
=begin rdoc
|
|
136
|
+
Override of @Spec::Runner::Formatter::BaseTextFormatter#dump_pending@ which does nothing
|
|
137
|
+
@return [nil]
|
|
138
|
+
=end rdoc
|
|
139
|
+
def dump_pending
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
=begin rdoc
|
|
143
|
+
Method called by RSpec after running all the examples
|
|
144
|
+
|
|
145
|
+
It writes a summary containing the number of run, failed, passed an pending examples
|
|
146
|
+
to the output as a YAML dumnp of a hash. The hash has the following entries:
|
|
147
|
+
The hash contains the following entries (the keys are all symbols)
|
|
148
|
+
@:type@: @:summary@
|
|
149
|
+
@total@: the number of run examples
|
|
150
|
+
@failure@: the number of failed examples
|
|
151
|
+
@pending@: the number of pending examples
|
|
152
|
+
@passed@: the number of passed examples
|
|
153
|
+
@return [nil]
|
|
154
|
+
=end
|
|
155
|
+
def dump_summary time, total, failure, pending
|
|
156
|
+
hash = {
|
|
157
|
+
:type => :summary,
|
|
158
|
+
:total => total,
|
|
159
|
+
:failure => failure,
|
|
160
|
+
:pending => pending,
|
|
161
|
+
:passed => total - (failure + pending)
|
|
162
|
+
}
|
|
163
|
+
write_data hash
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
def dump_failures
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
private
|
|
170
|
+
|
|
171
|
+
=begin rdoc
|
|
172
|
+
Writes data to the output stream
|
|
173
|
+
|
|
174
|
+
The data is passed in hashes and is written as a YAML dump between a starting
|
|
175
|
+
and an end delimiter. The output stream is flueshed both before and after writing,
|
|
176
|
+
so that the data is written alone on the string
|
|
177
|
+
|
|
178
|
+
@param [Hash] data the data to write on the output stream
|
|
179
|
+
@return [nil]
|
|
180
|
+
=end
|
|
181
|
+
def write_data hash
|
|
182
|
+
# STDERR.puts hash.inspect
|
|
183
|
+
@output.flush
|
|
184
|
+
str = "#{STARTING_DELIMITER}\n#{YAML.dump(hash)}\n#{ENDING_DELIMITER}"
|
|
185
|
+
@output.puts str
|
|
186
|
+
# @output.puts STARTING_DELIMITER
|
|
187
|
+
# @output.puts YAML.dump(hash)
|
|
188
|
+
# @output.puts ENDING_DELIMITER
|
|
189
|
+
@output.flush
|
|
190
|
+
nil
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
class Version1Formatter < BaseFormatter
|
|
196
|
+
|
|
197
|
+
=begin rdoc
|
|
198
|
+
Method called by RSpec after an example has been completed and failed
|
|
199
|
+
|
|
200
|
+
It writes to the output a YAML dump of a hash with the following entries:
|
|
201
|
+
* @:type@: @:failure@
|
|
202
|
+
* @:description@: the name of the failed example, made of the name of the example group
|
|
203
|
+
and the description of the example itself
|
|
204
|
+
* @:exception@: the name of the exception class which caused the failure
|
|
205
|
+
* @:message@: the error message contained in the exception which caused the failure
|
|
206
|
+
* @:location@: a string with the location (file name and line number) where the
|
|
207
|
+
failure happened
|
|
208
|
+
* @:backtrace@: a string containing the entries of the exception's backtrace, joined
|
|
209
|
+
by newlines
|
|
210
|
+
@param [Spec::Example::ExampleProxy] ex the failed example
|
|
211
|
+
@param [Integer] counter the number of the failed example
|
|
212
|
+
@param [Spec::Runner::Reporter::Failure] failure the object describing the failure
|
|
213
|
+
@return [nil]
|
|
214
|
+
=end
|
|
215
|
+
def example_failed ex, counter, failure
|
|
216
|
+
hash = {}
|
|
217
|
+
hash[:type] = :failure
|
|
218
|
+
hash[:description] = "#{@example_group.description} #{ex.description}"
|
|
219
|
+
hash[:exception] = failure.exception.class.name
|
|
220
|
+
hash[:message] = failure.exception.message
|
|
221
|
+
hash[:location] = ex.location
|
|
222
|
+
hash[:backtrace] = failure.exception.backtrace.join "\n"
|
|
223
|
+
write_data hash
|
|
224
|
+
end
|
|
225
|
+
|
|
226
|
+
=begin rdoc
|
|
227
|
+
Method called by RSpec after a pending example has been executed
|
|
228
|
+
|
|
229
|
+
It writes to the output a YAML dump of a hash with the following entries:
|
|
230
|
+
* @:type@: @:pending@
|
|
231
|
+
* @:description@: the name of the pending example, made of the name of the example group
|
|
232
|
+
and the description of the example itself
|
|
233
|
+
* @:message@: the message produced by @pending@
|
|
234
|
+
* @:location@: a string with the location (file name and line number) of pending
|
|
235
|
+
example
|
|
236
|
+
@param [Spec::Example::ExampleProxy] ex the pending example
|
|
237
|
+
@param [String] msg the message associated with the pending example
|
|
238
|
+
@return [nil]
|
|
239
|
+
=end
|
|
240
|
+
def example_pending ex, msg
|
|
241
|
+
hash = {}
|
|
242
|
+
hash[:type] = :pending
|
|
243
|
+
hash[:description] = "#{@example_group.description} #{ex.description}"
|
|
244
|
+
hash[:message] = msg
|
|
245
|
+
hash[:location] = ex.location
|
|
246
|
+
write_data hash
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
class Version2Formatter < BaseFormatter
|
|
252
|
+
=begin rdoc
|
|
253
|
+
Method called by RSpec after an example has been completed and failed
|
|
254
|
+
|
|
255
|
+
It writes to the output a YAML dump of a hash with the following entries:
|
|
256
|
+
* @:type@: @:failure@
|
|
257
|
+
* @:description@: the name of the failed example, made of the name of the example group
|
|
258
|
+
and the description of the example itself
|
|
259
|
+
* @:exception@: the name of the exception class which caused the failure
|
|
260
|
+
* @:message@: the error message contained in the exception which caused the failure
|
|
261
|
+
* @:location@: a string with the location (file name and line number) where the
|
|
262
|
+
failure happened
|
|
263
|
+
* @:backtrace@: a string containing the entries of the exception's backtrace, joined
|
|
264
|
+
by newlines
|
|
265
|
+
@param [RSpec::Core::Example] ex the failed example
|
|
266
|
+
@return [nil]
|
|
267
|
+
@todo add an entry contaning the code which caused the error (obtained using the
|
|
268
|
+
@read_failed_line@ method defined in @RSpec::Core::Formatters::BaseFormatter@).
|
|
269
|
+
=end
|
|
270
|
+
def example_failed ex
|
|
271
|
+
super
|
|
272
|
+
hash = {}
|
|
273
|
+
hash[:type] = :failure
|
|
274
|
+
hash[:description] = ex.metadata[:full_description]
|
|
275
|
+
exception = ex.metadata[:execution_result][:exception_encountered]
|
|
276
|
+
hash[:exception] = exception.class.name
|
|
277
|
+
hash[:message] = exception.message
|
|
278
|
+
hash[:location] = ex.metadata[:location]
|
|
279
|
+
hash[:backtrace] = format_backtrace(exception.backtrace, ex).join "\n"
|
|
280
|
+
write_data hash
|
|
281
|
+
end
|
|
282
|
+
|
|
283
|
+
=begin rdoc
|
|
284
|
+
Method called by RSpec after a pending example has been executed
|
|
285
|
+
|
|
286
|
+
It writes to the output a YAML dump of a hash with the following entries:
|
|
287
|
+
* @:type@: @:pending@
|
|
288
|
+
* @:description@: the name of the pending example, made of the name of the example group
|
|
289
|
+
and the description of the example itself
|
|
290
|
+
* @:message@: the message produced by @pending@
|
|
291
|
+
* @:location@: a string with the location (file name and line number) of pending
|
|
292
|
+
example
|
|
293
|
+
@param [RSpec::Core::Example] ex the pending example
|
|
294
|
+
@return [nil]
|
|
295
|
+
=end
|
|
296
|
+
def example_pending ex
|
|
297
|
+
super
|
|
298
|
+
hash = {}
|
|
299
|
+
hash[:type] = :pending
|
|
300
|
+
hash[:description] = ex.metadata[:full_description]
|
|
301
|
+
hash[:message] = ex.metadata[:execution_result][:exception_encountered].message
|
|
302
|
+
hash[:location] = ex[:metadata][:location]
|
|
303
|
+
write_data hash
|
|
304
|
+
end
|
|
305
|
+
|
|
306
|
+
end
|
|
307
|
+
|
|
308
|
+
Formatter = RSPEC_VERSION == 1 ? Version1Formatter : Version2Formatter
|
|
309
|
+
|
|
310
|
+
end
|
|
311
|
+
|
|
312
|
+
end
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
** Form generated from reading ui file 'rspec_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_RSpecProjectWidget
|
|
11
|
+
attr_reader :gridLayout_3
|
|
12
|
+
attr_reader :verticalSpacer
|
|
13
|
+
attr_reader :groupBox_2
|
|
14
|
+
attr_reader :gridLayout_2
|
|
15
|
+
attr_reader :label_5
|
|
16
|
+
attr_reader :_rspec__options
|
|
17
|
+
attr_reader :label_6
|
|
18
|
+
attr_reader :_rspec__executable
|
|
19
|
+
attr_reader :_rspec__full_backtraces
|
|
20
|
+
attr_reader :verticalSpacer_3
|
|
21
|
+
attr_reader :groupBox
|
|
22
|
+
attr_reader :gridLayout
|
|
23
|
+
attr_reader :label
|
|
24
|
+
attr_reader :_rspec__spec_directory
|
|
25
|
+
attr_reader :label_2
|
|
26
|
+
attr_reader :_rspec__spec_files
|
|
27
|
+
attr_reader :label_3
|
|
28
|
+
attr_reader :_rspec__spec_pattern
|
|
29
|
+
attr_reader :verticalSpacer_2
|
|
30
|
+
attr_reader :_rspec__ruby_options
|
|
31
|
+
|
|
32
|
+
def setupUi(rSpecProjectWidget)
|
|
33
|
+
if rSpecProjectWidget.objectName.nil?
|
|
34
|
+
rSpecProjectWidget.objectName = "rSpecProjectWidget"
|
|
35
|
+
end
|
|
36
|
+
rSpecProjectWidget.resize(447, 315)
|
|
37
|
+
@gridLayout_3 = Qt::GridLayout.new(rSpecProjectWidget)
|
|
38
|
+
@gridLayout_3.objectName = "gridLayout_3"
|
|
39
|
+
@verticalSpacer = Qt::SpacerItem.new(20, 10, Qt::SizePolicy::Minimum, Qt::SizePolicy::Expanding)
|
|
40
|
+
|
|
41
|
+
@gridLayout_3.addItem(@verticalSpacer, 0, 0, 1, 1)
|
|
42
|
+
|
|
43
|
+
@groupBox_2 = Qt::GroupBox.new(rSpecProjectWidget)
|
|
44
|
+
@groupBox_2.objectName = "groupBox_2"
|
|
45
|
+
@gridLayout_2 = Qt::GridLayout.new(@groupBox_2)
|
|
46
|
+
@gridLayout_2.objectName = "gridLayout_2"
|
|
47
|
+
@label_5 = Qt::Label.new(@groupBox_2)
|
|
48
|
+
@label_5.objectName = "label_5"
|
|
49
|
+
|
|
50
|
+
@gridLayout_2.addWidget(@label_5, 1, 0, 1, 1)
|
|
51
|
+
|
|
52
|
+
@_rspec__options = KDE::LineEdit.new(@groupBox_2)
|
|
53
|
+
@_rspec__options.objectName = "_rspec__options"
|
|
54
|
+
|
|
55
|
+
@gridLayout_2.addWidget(@_rspec__options, 1, 2, 1, 1)
|
|
56
|
+
|
|
57
|
+
@label_6 = Qt::Label.new(@groupBox_2)
|
|
58
|
+
@label_6.objectName = "label_6"
|
|
59
|
+
|
|
60
|
+
@gridLayout_2.addWidget(@label_6, 0, 0, 1, 1)
|
|
61
|
+
|
|
62
|
+
@_rspec__executable = KDE::LineEdit.new(@groupBox_2)
|
|
63
|
+
@_rspec__executable.objectName = "_rspec__executable"
|
|
64
|
+
|
|
65
|
+
@gridLayout_2.addWidget(@_rspec__executable, 0, 2, 1, 1)
|
|
66
|
+
|
|
67
|
+
@_rspec__full_backtraces = Qt::CheckBox.new(@groupBox_2)
|
|
68
|
+
@_rspec__full_backtraces.objectName = "_rspec__full_backtraces"
|
|
69
|
+
|
|
70
|
+
@gridLayout_2.addWidget(@_rspec__full_backtraces, 2, 0, 1, 1)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
@gridLayout_3.addWidget(@groupBox_2, 2, 0, 1, 2)
|
|
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)
|
|
78
|
+
|
|
79
|
+
@groupBox = Qt::GroupBox.new(rSpecProjectWidget)
|
|
80
|
+
@groupBox.objectName = "groupBox"
|
|
81
|
+
@gridLayout = Qt::GridLayout.new(@groupBox)
|
|
82
|
+
@gridLayout.objectName = "gridLayout"
|
|
83
|
+
@label = Qt::Label.new(@groupBox)
|
|
84
|
+
@label.objectName = "label"
|
|
85
|
+
|
|
86
|
+
@gridLayout.addWidget(@label, 0, 0, 1, 1)
|
|
87
|
+
|
|
88
|
+
@_rspec__spec_directory = KDE::UrlRequester.new(@groupBox)
|
|
89
|
+
@_rspec__spec_directory.objectName = "_rspec__spec_directory"
|
|
90
|
+
|
|
91
|
+
@gridLayout.addWidget(@_rspec__spec_directory, 0, 1, 1, 1)
|
|
92
|
+
|
|
93
|
+
@label_2 = Qt::Label.new(@groupBox)
|
|
94
|
+
@label_2.objectName = "label_2"
|
|
95
|
+
|
|
96
|
+
@gridLayout.addWidget(@label_2, 1, 0, 1, 1)
|
|
97
|
+
|
|
98
|
+
@_rspec__spec_files = KDE::LineEdit.new(@groupBox)
|
|
99
|
+
@_rspec__spec_files.objectName = "_rspec__spec_files"
|
|
100
|
+
|
|
101
|
+
@gridLayout.addWidget(@_rspec__spec_files, 1, 1, 1, 1)
|
|
102
|
+
|
|
103
|
+
@label_3 = Qt::Label.new(@groupBox)
|
|
104
|
+
@label_3.objectName = "label_3"
|
|
105
|
+
|
|
106
|
+
@gridLayout.addWidget(@label_3, 2, 0, 1, 1)
|
|
107
|
+
|
|
108
|
+
@_rspec__spec_pattern = KDE::LineEdit.new(@groupBox)
|
|
109
|
+
@_rspec__spec_pattern.objectName = "_rspec__spec_pattern"
|
|
110
|
+
|
|
111
|
+
@gridLayout.addWidget(@_rspec__spec_pattern, 2, 1, 1, 1)
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
@gridLayout_3.addWidget(@groupBox, 4, 0, 1, 2)
|
|
115
|
+
|
|
116
|
+
@verticalSpacer_2 = Qt::SpacerItem.new(20, 0, Qt::SizePolicy::Minimum, Qt::SizePolicy::Expanding)
|
|
117
|
+
|
|
118
|
+
@gridLayout_3.addItem(@verticalSpacer_2, 5, 0, 1, 2)
|
|
119
|
+
|
|
120
|
+
@_rspec__ruby_options = RubyOptionsWidget.new(rSpecProjectWidget)
|
|
121
|
+
@_rspec__ruby_options.objectName = "_rspec__ruby_options"
|
|
122
|
+
|
|
123
|
+
@gridLayout_3.addWidget(@_rspec__ruby_options, 1, 0, 1, 1)
|
|
124
|
+
|
|
125
|
+
@label_5.buddy = @_rspec__options
|
|
126
|
+
@label_6.buddy = @_rspec__executable
|
|
127
|
+
@label.buddy = @_rspec__spec_directory
|
|
128
|
+
@label_2.buddy = @_rspec__spec_files
|
|
129
|
+
@label_3.buddy = @_rspec__spec_pattern
|
|
130
|
+
Qt::Widget.setTabOrder(@_rspec__executable, @_rspec__options)
|
|
131
|
+
Qt::Widget.setTabOrder(@_rspec__options, @_rspec__spec_directory)
|
|
132
|
+
Qt::Widget.setTabOrder(@_rspec__spec_directory, @_rspec__spec_files)
|
|
133
|
+
Qt::Widget.setTabOrder(@_rspec__spec_files, @_rspec__spec_pattern)
|
|
134
|
+
|
|
135
|
+
retranslateUi(rSpecProjectWidget)
|
|
136
|
+
|
|
137
|
+
Qt::MetaObject.connectSlotsByName(rSpecProjectWidget)
|
|
138
|
+
end # setupUi
|
|
139
|
+
|
|
140
|
+
def setup_ui(rSpecProjectWidget)
|
|
141
|
+
setupUi(rSpecProjectWidget)
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
def retranslateUi(rSpecProjectWidget)
|
|
145
|
+
rSpecProjectWidget.windowTitle = Qt::Application.translate("RSpecProjectWidget", "Form", nil, Qt::Application::UnicodeUTF8)
|
|
146
|
+
@groupBox_2.title = Qt::Application.translate("RSpecProjectWidget", "RSpec", nil, Qt::Application::UnicodeUTF8)
|
|
147
|
+
@label_5.text = Qt::Application.translate("RSpecProjectWidget", "&RSpec options", nil, Qt::Application::UnicodeUTF8)
|
|
148
|
+
@_rspec__options.setProperty("access", Qt::Variant.new(Qt::Application.translate("RSpecProjectWidget", "$spec_options", nil, Qt::Application::UnicodeUTF8)))
|
|
149
|
+
@label_6.text = Qt::Application.translate("RSpecProjectWidget", "&RSpec executable", nil, Qt::Application::UnicodeUTF8)
|
|
150
|
+
@_rspec__full_backtraces.text = Qt::Application.translate("RSpecProjectWidget", "&Generate full backtraces", nil, Qt::Application::UnicodeUTF8)
|
|
151
|
+
@groupBox.title = Qt::Application.translate("RSpecProjectWidget", "Spec files", nil, Qt::Application::UnicodeUTF8)
|
|
152
|
+
@label.text = Qt::Application.translate("RSpecProjectWidget", "Spec &directory", nil, Qt::Application::UnicodeUTF8)
|
|
153
|
+
@label_2.text = Qt::Application.translate("RSpecProjectWidget", "&Filter", nil, Qt::Application::UnicodeUTF8)
|
|
154
|
+
@_rspec__spec_files.text = Qt::Application.translate("RSpecProjectWidget", "*_spec.rb", nil, Qt::Application::UnicodeUTF8)
|
|
155
|
+
@label_3.text = Qt::Application.translate("RSpecProjectWidget", "&Pattern", nil, Qt::Application::UnicodeUTF8)
|
|
156
|
+
@_rspec__spec_pattern.text = Qt::Application.translate("RSpecProjectWidget", "%f_spec.rb", nil, Qt::Application::UnicodeUTF8)
|
|
157
|
+
@_rspec__spec_pattern.setProperty("access", Qt::Variant.new(Qt::Application.translate("RSpecProjectWidget", "$pattern", nil, Qt::Application::UnicodeUTF8)))
|
|
158
|
+
end # retranslateUi
|
|
159
|
+
|
|
160
|
+
def retranslate_ui(rSpecProjectWidget)
|
|
161
|
+
retranslateUi(rSpecProjectWidget)
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
module Ui
|
|
167
|
+
class RSpecProjectWidget < Ui_RSpecProjectWidget
|
|
168
|
+
end
|
|
169
|
+
end # module Ui
|
|
170
|
+
|