rspec-yenta 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: eb70f9175e9451ef4c62e0f34b9e870fa93e5792
4
+ data.tar.gz: c7f591195395c4933aa755f35ead0d62e405c902
5
+ SHA512:
6
+ metadata.gz: f771e0024d61cb9aec20a0f5141dfca89e425bd45d50b49fb6815ccc2b17b469343dd868f49a86cce5b4ebb48c890f1a4a74985b2e8d9c3c0a651b61216b345b
7
+ data.tar.gz: ffe665e7b483eaa6429116343314827cb4e70a45d408bf82f3726af5e41f4daa6d9e6ca7074f86a6f08c6fe100eb548e0611082a795b74e03e367dc6fd9f347d
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in rspec-yenta.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,17 @@
1
+ ##########################################################################
2
+ #
3
+ # Copyright 2014 University of Notre Dame
4
+ #
5
+ # Additional copyright may be held by others, as reflected in the commit log
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
data/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # RSpec::Yenta
2
+
3
+
4
+
5
+ ## Installation
6
+
7
+ Add this line to your project's Gemfile:
8
+
9
+ gem 'rspec-yenta'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install rspec-yenta
18
+
19
+ ## Usage
20
+
21
+ In your project's Rakefile add the following:
22
+
23
+ ```rake
24
+ require 'rspec/yenta'
25
+ RSpec::Yenta.load_tasks
26
+ ```
27
+
28
+ ```sh
29
+ $ rake yenta
30
+ ```
31
+
32
+ If you aren't seeing some of the tasks you were expecting, try the following:
33
+
34
+ ```rake
35
+ require 'rspec/yenta'
36
+ RSpec::Yenta.load_tasks do
37
+ require File.expand_path("../config/environment.rb", __FILE__)
38
+ end
39
+ ```
40
+
41
+ `RSpec::Yenta.load_tasks` takes an arbitrary block. And the above block is
42
+ requiring the Rails application. This may also be required if you have custom
43
+ matchers that you want to expose. Or if you are working with a Rails Engine.
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1 @@
1
+ require 'rspec/yenta'
@@ -0,0 +1 @@
1
+ require 'rspec/yenta'
@@ -0,0 +1,69 @@
1
+ require "rspec/yenta/version"
2
+
3
+ module RSpec
4
+ module Yenta
5
+ # Your code goes here...
6
+ module_function
7
+
8
+ def load_tasks(&config)
9
+ require "rake"
10
+ TaskHelper.new(&config).install
11
+ end
12
+
13
+ class TaskHelper
14
+ include Rake::DSL if defined? Rake::DSL
15
+ attr_reader :config
16
+ def initialize(&config_block)
17
+ @config = config_block
18
+ end
19
+
20
+ def install
21
+ desc "Find all of your rspec matchers and output them to STDOUT"
22
+ task "yenta" do
23
+
24
+ config.call if config.respond_to?(:call)
25
+
26
+ $SHOW_MATCHERS = {}
27
+ rspec_matcher_namespaces = []
28
+
29
+ require 'rspec'
30
+
31
+ begin
32
+ require 'rspec/matchers'
33
+ rescue LoadError => e
34
+ STDERR << "Unable to load rspec-rails matchers. Yenta may not find all of your matcher.\n"
35
+ end
36
+ if defined?(::RSpec::Matchers)
37
+ rspec_matcher_namespaces << ::RSpec::Matchers
38
+ end
39
+
40
+ begin
41
+ require 'rspec/rails/matchers'
42
+ rescue LoadError => e
43
+ STDERR << "Unable to load rspec-rails matchers. Yenta may not find all of your matcher.\n"
44
+ end
45
+ if defined?(::RSpec::Rails::Matchers)
46
+ rspec_matcher_namespaces << ::RSpec::Rails::Matchers
47
+ end
48
+
49
+ rspec_matcher_namespaces.each do |namespace|
50
+ namespace.instance_methods.sort.each do |method_name|
51
+ unless $SHOW_MATCHERS.has_key?(method_name)
52
+ $SHOW_MATCHERS[method_name] = namespace.instance_method(method_name).source_location
53
+ end
54
+ end
55
+ end
56
+
57
+ method_name_size = 0
58
+ $SHOW_MATCHERS.each{|k,v|
59
+ method_name_size = k.length if k.length > method_name_size
60
+ }
61
+
62
+ $SHOW_MATCHERS.sort.each {|k,v|
63
+ puts "%-#{method_name_size}s\t%s" % [k, v.join(":")]
64
+ }
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,5 @@
1
+ module RSpec
2
+ module Yenta
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/yenta/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "rspec-yenta"
8
+ spec.version = RSpec::Yenta::VERSION
9
+ spec.authors = ["Jeremy Friesen"]
10
+ spec.email = ["jeremy.n.friesen@gmail.com"]
11
+ spec.summary = %q{Yenta, find me all of my RSpec matchers.}
12
+ spec.description = %q{Yenta, find me all of my RSpec matchers.}
13
+ spec.homepage = "https://github.com/jeremyf/yenta"
14
+ spec.license = "APACHE2"
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 "rspec", "~> 2.1"
22
+ spec.add_development_dependency "bundler", "~> 1.5"
23
+ spec.add_development_dependency "rake"
24
+ end
metadata ADDED
@@ -0,0 +1,96 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rspec-yenta
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Jeremy Friesen
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-03-11 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rspec
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: '2.1'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: '2.1'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: '1.5'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ~>
39
+ - !ruby/object:Gem::Version
40
+ version: '1.5'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ description: Yenta, find me all of my RSpec matchers.
56
+ email:
57
+ - jeremy.n.friesen@gmail.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - .gitignore
63
+ - Gemfile
64
+ - LICENSE
65
+ - README.md
66
+ - Rakefile
67
+ - lib/rspec/rspec-yenta.rb
68
+ - lib/rspec/rspec_yenta.rb
69
+ - lib/rspec/yenta.rb
70
+ - lib/rspec/yenta/version.rb
71
+ - rspec-yenta.gemspec
72
+ homepage: https://github.com/jeremyf/yenta
73
+ licenses:
74
+ - APACHE2
75
+ metadata: {}
76
+ post_install_message:
77
+ rdoc_options: []
78
+ require_paths:
79
+ - lib
80
+ required_ruby_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - '>='
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ required_rubygems_version: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ requirements: []
91
+ rubyforge_project:
92
+ rubygems_version: 2.0.14
93
+ signing_key:
94
+ specification_version: 4
95
+ summary: Yenta, find me all of my RSpec matchers.
96
+ test_files: []