rspec-formatters 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 0198b8ef4057df923aab7bbf5a811d73b379d20e
4
+ data.tar.gz: 533075a4d905473db18521a0bb84782602f707ef
5
+ SHA512:
6
+ metadata.gz: 26709e704dd79e1d83c7e5e95f6bce120e2c96e629d38fda0557d504660839b8074c2b80193e58fd79446c6c3e3f7244cb8a56b2661b5c43ff42970b209bc9ee
7
+ data.tar.gz: 5337d0c5c770d0d471d41409d63c9dac5b6bd69fad6d9a2239e48112f19729c369628e296da47c0946d2f9d3cbe076cdedd2e800af3ee0ca18d568564c601944
data/.gitignore ADDED
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in rspec-formatters.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2015 Richard Ramsden
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,47 @@
1
+ # Rspec Formatters
2
+
3
+ A collection of useful RSpec 3 formatters
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'rspec-formatters'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install rspec-formatters
20
+
21
+ ## Usage
22
+
23
+ ### VimQuickfix Formatter
24
+
25
+ The VimQuickfix Formatter creates formatted error output which the vim quickfix
26
+ window can parse
27
+
28
+ ```
29
+ rspec \
30
+ --require=rspec-formatters --format=VimQuickfix --out=tmp/quickfix.out \
31
+ --format=progress
32
+ ```
33
+
34
+ You can open the vim quickfix window using
35
+
36
+ ```
37
+ :cg tmp/quickfix.out
38
+ :copen
39
+ ```
40
+
41
+ ## Contributing
42
+
43
+ 1. Fork it ( https://github.com/[my-github-username]/rspec-formatters/fork )
44
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
45
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
46
+ 4. Push to the branch (`git push origin my-new-feature`)
47
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -0,0 +1,5 @@
1
+ require 'rspec/core'
2
+ require 'rspec/core/formatters/base_formatter'
3
+ require 'rspec-formatters/version'
4
+ require 'rspec-formatters/formatters'
5
+ require 'rspec-formatters/rspec'
@@ -0,0 +1,3 @@
1
+ Dir[File.join(File.dirname(__FILE__), 'formatters', '*.rb')].each do |file|
2
+ require file
3
+ end
@@ -0,0 +1,24 @@
1
+ require 'rspec/core/formatters/base_formatter'
2
+
3
+ module RSpec
4
+ module Formatters
5
+ class VimQuickfix < RSpec::Core::Formatters::BaseFormatter
6
+ RSpec::Core::Formatters.register self, :example_failed
7
+
8
+ def example_failed notification
9
+ exception = notification.exception
10
+ message = format_message exception.message
11
+ example = notification.example
12
+ location = example.location
13
+ output.puts "#{location}: #{example.example_group.description.strip} " +
14
+ "#{example.description.strip}: #{message.strip}" if location
15
+ end
16
+
17
+ private
18
+
19
+ def format_message msg
20
+ msg.gsub("\n", ' ')[0,80]
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,11 @@
1
+ class RSpec::Core::Formatters::Loader
2
+ alias_method :built_in_formatter_aliased, :built_in_formatter
3
+
4
+ def built_in_formatter(key)
5
+ begin
6
+ Kernel.const_get "RSpec::Formatters::#{key}"
7
+ rescue NameError
8
+ built_in_formatter_aliased(key)
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,5 @@
1
+ module RSpec
2
+ module Formatters
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,24 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'rspec-formatters/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "rspec-formatters"
8
+ spec.version = RSpec::Formatters::VERSION
9
+ spec.authors = ["Richard Ramsden"]
10
+ spec.email = ["richard@rramsden.ca"]
11
+ spec.summary = %q{A collection of useful RSpec 3 formatters}
12
+ spec.description = %q{A collection of useful RSpec 3 formatters}
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.7"
22
+ spec.add_development_dependency "rake", "~> 10.0"
23
+ spec.add_development_dependency "rspec-core", "~> 3.0"
24
+ end
metadata ADDED
@@ -0,0 +1,98 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rspec-formatters
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Richard Ramsden
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-06-21 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.7'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.7'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec-core
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ description: A collection of useful RSpec 3 formatters
56
+ email:
57
+ - richard@rramsden.ca
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - Gemfile
64
+ - LICENSE.txt
65
+ - README.md
66
+ - Rakefile
67
+ - lib/rspec-formatters.rb
68
+ - lib/rspec-formatters/formatters.rb
69
+ - lib/rspec-formatters/formatters/vim_quickfix.rb
70
+ - lib/rspec-formatters/rspec.rb
71
+ - lib/rspec-formatters/version.rb
72
+ - rspec-formatters.gemspec
73
+ homepage: ''
74
+ licenses:
75
+ - MIT
76
+ metadata: {}
77
+ post_install_message:
78
+ rdoc_options: []
79
+ require_paths:
80
+ - lib
81
+ required_ruby_version: !ruby/object:Gem::Requirement
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
86
+ required_rubygems_version: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ requirements: []
92
+ rubyforge_project:
93
+ rubygems_version: 2.2.2
94
+ signing_key:
95
+ specification_version: 4
96
+ summary: A collection of useful RSpec 3 formatters
97
+ test_files: []
98
+ has_rdoc: