rspec_html_formatter 0.2.1 → 0.2.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 852a43f9fda3ab51fc50d627dbd52c24b0a45dc7
4
- data.tar.gz: 5d3b05098ec8b6afda47875a083f1bffd251ad7e
3
+ metadata.gz: b3ab2472b5273334def23ad768200c77f16a7c8e
4
+ data.tar.gz: ccc827278c66d81b0b7da54857ec389d1d236a0a
5
5
  SHA512:
6
- metadata.gz: 5fa14ad31349e734e9d7a96861379fa0128ba291c16892d72860f0c726f03ce7776f2db6d9b54a17bdd1e445fa2b7fe5d98e6959ffe8cb3edac1e02a3abecb74
7
- data.tar.gz: 366a23ae7c6a347940608d2cd96a6a95fca531833d7f3a0bd9807dce025d83e42dce9ee71afca6d8c87a2395da569456782828a2bd59ed0b31793ce0071fe4dc
6
+ metadata.gz: 52982d96ad88d0cf6340bdd6a03f7bb0c2468d48ff7474f618360921e313f3f6091c5ad47e6753976c2c6f5f779ea3075850daab5bb81d4d06543be918c55f9f
7
+ data.tar.gz: b5019a0911d0ea2a178ca608ae52bf38f1e0fda9ab7afaf54c9e1f330e6330f6dea0eb964e6717ea69911fcc88b758b7265189220e0ce31c002d62b764351681
data/README.md CHANGED
@@ -9,13 +9,13 @@ versions of Rspec then you should use the rspec_reports_formatter 0.3.x (master)
9
9
  ## Install
10
10
 
11
11
  ```
12
- gem install rspec_reports_formatter -v 0.2.0
12
+ gem install rspec_reports_formatter -v 0.2.2
13
13
  ```
14
14
 
15
15
  ideally just add it to your bundler Gemfile as follows:
16
16
 
17
17
  ```ruby
18
- gem 'rspec-legacy_formatters', '~> 0.2.0'
18
+ gem 'rspec-legacy_formatters', '~> 0.2.2'
19
19
  ```
20
20
 
21
21
  ## Use
@@ -41,7 +41,7 @@ If you are using a more recent version of Rspec (3.0.0 onwards) but for some rea
41
41
  group :development do
42
42
  gem 'rspec','~> 3.0.0.rc1'
43
43
  gem 'bundler', '~> 1.0'
44
- gem 'rspec-legacy_formatters', '~> 0.2.0'
44
+ gem 'rspec-legacy_formatters', '~> 0.2.1'
45
45
  gem 'rspec_html_formatter'
46
46
  end
47
47
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.2
@@ -26,10 +26,34 @@ class Oopsy
26
26
 
27
27
  private
28
28
 
29
+ def os
30
+ @os ||= (
31
+ host_os = RbConfig::CONFIG['host_os']
32
+ case host_os
33
+ when /mswin|msys|mingw|cygwin|bccwin|wince|emc/
34
+ :windows
35
+ when /darwin|mac os/
36
+ :macosx
37
+ when /linux/
38
+ :linux
39
+ when /solaris|bsd/
40
+ :unix
41
+ else
42
+ raise Exception, "unknown os: #{host_os.inspect}"
43
+ end
44
+ )
45
+ end
46
+
29
47
  def process_source
30
48
  data = @backtrace_message.split(':')
31
- file_path = data.first
32
- line_number = data[1].to_i
49
+ unless data.empty?
50
+ if os == :windows
51
+ file_path = data[0] + ':' + data[1]
52
+ line_number = data[2].to_i
53
+ else
54
+ file_path = data.first
55
+ line_number = data[1].to_i
56
+ end
33
57
  lines = File.readlines(file_path)
34
58
  start_line = line_number-2
35
59
  end_line = line_number+3
@@ -37,8 +61,8 @@ class Oopsy
37
61
 
38
62
  formatter = Rouge::Formatters::HTML.new(css_class: 'highlight', line_numbers: true, start_line: start_line+1)
39
63
  lexer = Rouge::Lexers::Ruby.new
40
- formatter.format(lexer.lex(source))
41
-
64
+ formatter.format(lexer.lex(source.encode('utf-8')))
65
+ end
42
66
  end
43
67
 
44
68
  def process_message
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: rspec_html_formatter 0.2.1 ruby lib
5
+ # stub: rspec_html_formatter 0.2.2 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "rspec_html_formatter"
9
- s.version = "0.2.1"
9
+ s.version = "0.2.2"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Kingsley Hendrickse"]
14
- s.date = "2014-08-03"
14
+ s.date = "2014-09-25"
15
15
  s.description = "Rspec custom formatter to generate pretty html results"
16
16
  s.email = "kingsleyhendrickse@me.com"
17
17
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec_html_formatter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kingsley Hendrickse
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-03 00:00:00.000000000 Z
11
+ date: 2014-09-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec-core