diff --git a/lib/aruba/cucumber.rb b/lib/aruba/cucumber.rb index b361b7f03..4e23fab95 100644 --- a/lib/aruba/cucumber.rb +++ b/lib/aruba/cucumber.rb @@ -10,4 +10,3 @@ require 'aruba/cucumber/file' require 'aruba/cucumber/testing_frameworks' require 'aruba/cucumber/rvm' -require 'aruba/reporting' diff --git a/lib/aruba/reporting.rb b/lib/aruba/reporting.rb deleted file mode 100644 index 9453964fc..000000000 --- a/lib/aruba/reporting.rb +++ /dev/null @@ -1,126 +0,0 @@ -require 'fileutils' - -if(ENV['ARUBA_REPORT_DIR']) - require 'aruba/platform' - Aruba.platform.deprecated 'The use of "aruba/reporting" is deprecated. This functionality will be removed with "1.0.0"' - - ENV['ARUBA_REPORT_TEMPLATES'] ||= File.dirname(__FILE__) + '/../../templates' - - require 'fileutils' - require 'erb' - require 'cgi' - require 'bcat/ansi' - require 'rdiscount' - require 'aruba/spawn_process' - - module Aruba - module Reporting - class << self - def reports - @reports ||= Hash.new do |hash, feature| - hash[feature] = [] - end - end - end - - def pygmentize(file) - pygmentize = Processes::SpawnProcess.new(%{pygmentize -f html -O encoding=utf-8 "#{file}"}, 3, 0.5, Dir.getwd) - pygmentize.run! do |p| - exit_status = p.stop(false) - if(exit_status == 0) - p.stdout(false) - elsif(p.stderr(false) =~ /no lexer/) # Pygment's didn't recognize it - IO.read(file) - else - STDERR.puts "\e[31m#{p.stderr} - is pygments installed?\e[0m" - exit $CHILD_STATUS.exitstatus - end - end - end - - def title - @scenario.title - end - - def description - unescaped_description = @scenario.description.gsub(/^(\s*)\\/, '\1') - markdown = RDiscount.new(unescaped_description) - markdown.to_html - end - - def commands - @commands || [] - end - - def output - aruba.config.keep_ansi = true # We want the output coloured! - escaped_stdout = CGI.escapeHTML(all_stdout) - html = Bcat::ANSI.new(escaped_stdout).to_html - Bcat::ANSI::STYLES.each do |name, style| - html.gsub!(/style='#{style}'/, %{class="xterm_#{name}"}) - end - html - end - - def report - erb = ERB.new(template('main.erb'), nil, '-') - erb.result(binding) - end - - def files - erb = ERB.new(template('files.erb'), nil, '-') - file = current_directory - erb.result(binding) - end - - def again(erb, erbout, file) - erbout.concat(erb.result(binding)) - end - - def children(dir) - Dir["#{dir}/*"].sort - end - - def template(path) - IO.read(File.join(ENV['ARUBA_REPORT_TEMPLATES'], path)) - end - - def depth - File.dirname(@scenario.feature.file).split('/').length - end - - def index - erb = ERB.new(template('index.erb'), nil, '-') - erb.result(binding) - end - - def index_title - "Examples" - end - end - end - World(Aruba::Reporting) - - After do |scenario| - @scenario = scenario - html_file = "#{scenario.feature.file}:#{scenario.line}.html" - report_file = File.join(ENV['ARUBA_REPORT_DIR'], html_file) - _mkdir(File.dirname(report_file)) - File.open(report_file, 'w') do |io| - io.write(report) - end - - Aruba::Reporting.reports[scenario.feature] << [scenario, html_file] - - FileUtils.cp_r(File.join(ENV['ARUBA_REPORT_TEMPLATES'], '.'), ENV['ARUBA_REPORT_DIR']) - Dir["#{ENV['ARUBA_REPORT_DIR']}/**/*.erb"].each{|f| FileUtils.rm(f)} - end - - at_exit do - index_file = File.join(ENV['ARUBA_REPORT_DIR'], "index.html") - extend(Aruba::Reporting) - File.open(index_file, 'w') do |io| - io.write(index) - end - end -end diff --git a/templates/css/console.css b/templates/css/console.css deleted file mode 100644 index f7309a9d9..000000000 --- a/templates/css/console.css +++ /dev/null @@ -1,24 +0,0 @@ -.console { - background-color: #000000; - color: #ffffff; -} - -.console .xterm_ef1 { /* red */ - color: #ff0000; -} - -.console .xterm_ef2 { /* green */ - color: #00ff00; -} - -.console .xterm_ef3 { /* yellow */ - color: #ffff00; -} - -.console .xterm_ef6 { /* cyan */ - color: #00ffff; -} - -.console .xterm_ef8 { /* gray */ - color: #888888; -} diff --git a/templates/css/filesystem.css b/templates/css/filesystem.css deleted file mode 100644 index 60c001fd5..000000000 --- a/templates/css/filesystem.css +++ /dev/null @@ -1,42 +0,0 @@ -.filesystem ul { - background: #FFFFFF; - margin: 0; - padding: 0; -} - -.filesystem li { - list-style-type: none; - padding-left: 20px; - margin-bottom: 4px; -} - -.filesystem li .highlight { - display: block; - border: 1px solid #CCCCCC; - margin-top: 4px; -} - -.filesystem li .highlight pre, pre.console { - margin: 2px; - padding: 2px; -} - -.filesystem li.file { - cursor: pointer; -} - -.filesystem li.folder { - background: url('../images/folder.png') no-repeat; -} - -.filesystem li.feature { - background: url('../images/page_white_gherkin.png') no-repeat; -} - -.filesystem li.rb { - background: url('../images/page_white_ruby.png') no-repeat; -} - -.filesystem li.unknown { - background: url('../images/page_white.png') no-repeat; -} diff --git a/templates/css/pygments-autumn.css b/templates/css/pygments-autumn.css deleted file mode 100644 index 4fd3ec6d7..000000000 --- a/templates/css/pygments-autumn.css +++ /dev/null @@ -1,59 +0,0 @@ -/* https://raw.github.com/richleland/pygments-css/master/autumn.css */ -.highlight .hll { background-color: #ffffcc } -.highlight .c { color: #aaaaaa; font-style: italic } /* Comment */ -.highlight .err { color: #F00000; background-color: #F0A0A0 } /* Error */ -.highlight .k { color: #0000aa } /* Keyword */ -.highlight .cm { color: #aaaaaa; font-style: italic } /* Comment.Multiline */ -.highlight .cp { color: #4c8317 } /* Comment.Preproc */ -.highlight .c1 { color: #aaaaaa; font-style: italic } /* Comment.Single */ -.highlight .cs { color: #0000aa; font-style: italic } /* Comment.Special */ -.highlight .gd { color: #aa0000 } /* Generic.Deleted */ -.highlight .ge { font-style: italic } /* Generic.Emph */ -.highlight .gr { color: #aa0000 } /* Generic.Error */ -.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ -.highlight .gi { color: #00aa00 } /* Generic.Inserted */ -.highlight .go { color: #888888 } /* Generic.Output */ -.highlight .gp { color: #555555 } /* Generic.Prompt */ -.highlight .gs { font-weight: bold } /* Generic.Strong */ -.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ -.highlight .gt { color: #aa0000 } /* Generic.Traceback */ -.highlight .kc { color: #0000aa } /* Keyword.Constant */ -.highlight .kd { color: #0000aa } /* Keyword.Declaration */ -.highlight .kn { color: #0000aa } /* Keyword.Namespace */ -.highlight .kp { color: #0000aa } /* Keyword.Pseudo */ -.highlight .kr { color: #0000aa } /* Keyword.Reserved */ -.highlight .kt { color: #00aaaa } /* Keyword.Type */ -.highlight .m { color: #009999 } /* Literal.Number */ -.highlight .s { color: #aa5500 } /* Literal.String */ -.highlight .na { color: #1e90ff } /* Name.Attribute */ -.highlight .nb { color: #00aaaa } /* Name.Builtin */ -.highlight .nc { color: #00aa00; text-decoration: underline } /* Name.Class */ -.highlight .no { color: #aa0000 } /* Name.Constant */ -.highlight .nd { color: #888888 } /* Name.Decorator */ -.highlight .ni { color: #800000; font-weight: bold } /* Name.Entity */ -.highlight .nf { color: #00aa00 } /* Name.Function */ -.highlight .nn { color: #00aaaa; text-decoration: underline } /* Name.Namespace */ -.highlight .nt { color: #1e90ff; font-weight: bold } /* Name.Tag */ -.highlight .nv { color: #aa0000 } /* Name.Variable */ -.highlight .ow { color: #0000aa } /* Operator.Word */ -.highlight .w { color: #bbbbbb } /* Text.Whitespace */ -.highlight .mf { color: #009999 } /* Literal.Number.Float */ -.highlight .mh { color: #009999 } /* Literal.Number.Hex */ -.highlight .mi { color: #009999 } /* Literal.Number.Integer */ -.highlight .mo { color: #009999 } /* Literal.Number.Oct */ -.highlight .sb { color: #aa5500 } /* Literal.String.Backtick */ -.highlight .sc { color: #aa5500 } /* Literal.String.Char */ -.highlight .sd { color: #aa5500 } /* Literal.String.Doc */ -.highlight .s2 { color: #aa5500 } /* Literal.String.Double */ -.highlight .se { color: #aa5500 } /* Literal.String.Escape */ -.highlight .sh { color: #aa5500 } /* Literal.String.Heredoc */ -.highlight .si { color: #aa5500 } /* Literal.String.Interpol */ -.highlight .sx { color: #aa5500 } /* Literal.String.Other */ -.highlight .sr { color: #009999 } /* Literal.String.Regex */ -.highlight .s1 { color: #aa5500 } /* Literal.String.Single */ -.highlight .ss { color: #0000aa } /* Literal.String.Symbol */ -.highlight .bp { color: #00aaaa } /* Name.Builtin.Pseudo */ -.highlight .vc { color: #aa0000 } /* Name.Variable.Class */ -.highlight .vg { color: #aa0000 } /* Name.Variable.Global */ -.highlight .vi { color: #aa0000 } /* Name.Variable.Instance */ -.highlight .il { color: #009999 } /* Literal.Number.Integer.Long */ \ No newline at end of file diff --git a/templates/files.erb b/templates/files.erb deleted file mode 100644 index 50e6b2f38..000000000 --- a/templates/files.erb +++ /dev/null @@ -1,14 +0,0 @@ -<% if children(file).any? %> -
t |
-<% commands.each do |cmd| -%> -$ <%= cmd %> -<% end -%> -<%= output %> -- -