method_found 0.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b2e8e38c169b46157f6c1a94856b022b110efc13
4
- data.tar.gz: 0c0b6468a1d9e23d1238379e4963fcf37e7e5e51
3
+ metadata.gz: 54697c45ed4ce6071e6c36e15b8aa1a7ec0a2ace
4
+ data.tar.gz: 366c25aaff318c8033e51ebff45c6415c5c32651
5
5
  SHA512:
6
- metadata.gz: 664ef99573b8519bffd46a80a92183477a9d0e4c74dbffbfdba48d723ef1d90e8813b536947635706f66f05561ac22ffbffaa70f801912475deb6688127f98e6
7
- data.tar.gz: f8dd6a6173cd3b73476ca500055e0b0d2b72de6d6f10f8a14266467dc8e227477a32a088edf4223fb4aa4ffb4d7bebf5a5a9e13ed2e70ad1b7a0f02cd6a5812b
6
+ metadata.gz: d78c7e39e4eb121df39f2f9f0b6c68c21cc0b1465bde81220b38bfa74b6d5d032e3f311fcfaf389d5eb40daccd81567d43b1c3c42f2ff749e435db1fc8a24ae1
7
+ data.tar.gz: 9f3a8ef4238dcd2575dd5a55992835ac77033f5a4739db70f7b1624632e7ba4916d5cd4142aede903ed70d9cc9d342ff208d6161e494573c1b4714dfff10c3c2
data/Gemfile CHANGED
@@ -4,3 +4,4 @@ source 'https://rubygems.org'
4
4
  gemspec
5
5
 
6
6
  gem "pry-byebug"
7
+ gem "guard-rspec"
@@ -0,0 +1,70 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ ## Uncomment and set this to only include directories you want to watch
5
+ # directories %w(app lib config test spec features) \
6
+ # .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")}
7
+
8
+ ## Note: if you are using the `directories` clause above and you are not
9
+ ## watching the project directory ('.'), then you will want to move
10
+ ## the Guardfile to a watched dir and symlink it back, e.g.
11
+ #
12
+ # $ mkdir config
13
+ # $ mv Guardfile config/
14
+ # $ ln -s config/Guardfile .
15
+ #
16
+ # and, you'll have to watch "config/Guardfile" instead of "Guardfile"
17
+
18
+ # Note: The cmd option is now required due to the increasing number of ways
19
+ # rspec may be run, below are examples of the most common uses.
20
+ # * bundler: 'bundle exec rspec'
21
+ # * bundler binstubs: 'bin/rspec'
22
+ # * spring: 'bin/rspec' (This will use spring if running and you have
23
+ # installed the spring binstubs per the docs)
24
+ # * zeus: 'zeus rspec' (requires the server to be started separately)
25
+ # * 'just' rspec: 'rspec'
26
+
27
+ guard :rspec, cmd: "bundle exec rspec" do
28
+ require "guard/rspec/dsl"
29
+ dsl = Guard::RSpec::Dsl.new(self)
30
+
31
+ # Feel free to open issues for suggestions and improvements
32
+
33
+ # RSpec files
34
+ rspec = dsl.rspec
35
+ watch(rspec.spec_helper) { rspec.spec_dir }
36
+ watch(rspec.spec_support) { rspec.spec_dir }
37
+ watch(rspec.spec_files)
38
+
39
+ # Ruby files
40
+ ruby = dsl.ruby
41
+ dsl.watch_spec_files_for(ruby.lib_files)
42
+
43
+ # Rails files
44
+ rails = dsl.rails(view_extensions: %w(erb haml slim))
45
+ dsl.watch_spec_files_for(rails.app_files)
46
+ dsl.watch_spec_files_for(rails.views)
47
+
48
+ watch(rails.controllers) do |m|
49
+ [
50
+ rspec.spec.call("routing/#{m[1]}_routing"),
51
+ rspec.spec.call("controllers/#{m[1]}_controller"),
52
+ rspec.spec.call("acceptance/#{m[1]}")
53
+ ]
54
+ end
55
+
56
+ # Rails config changes
57
+ watch(rails.spec_helper) { rspec.spec_dir }
58
+ watch(rails.routes) { "#{rspec.spec_dir}/routing" }
59
+ watch(rails.app_controller) { "#{rspec.spec_dir}/controllers" }
60
+
61
+ # Capybara features specs
62
+ watch(rails.view_dirs) { |m| rspec.spec.call("features/#{m[1]}") }
63
+ watch(rails.layouts) { |m| rspec.spec.call("features/#{m[1]}") }
64
+
65
+ # Turnip features and steps
66
+ watch(%r{^spec/acceptance/(.+)\.feature$})
67
+ watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) do |m|
68
+ Dir[File.join("**/#{m[1]}.feature")][0] || "spec/acceptance"
69
+ end
70
+ end
data/README.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # MethodFound
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/method_found.svg)][gem]
4
+ [![Build Status](https://travis-ci.org/shioyama/method_found.svg?branch=master)][travis]
5
+
6
+ [gem]: https://rubygems.org/gems/method_found
7
+ [travis]: https://travis-ci.org/shioyama/method_found
8
+
3
9
  Intercept `method_missing` and do something useful with it.
4
10
 
5
11
  ## Installation
@@ -7,7 +13,7 @@ Intercept `method_missing` and do something useful with it.
7
13
  Add to your Gemfile:
8
14
 
9
15
  ```ruby
10
- gem 'method_found', '~> 0.1.0'
16
+ gem 'method_found', '~> 0.1.1'
11
17
  ```
12
18
 
13
19
  And bundle it.
@@ -12,6 +12,12 @@ module MethodFound
12
12
  define_method :respond_to_missing? do |method_name, include_private = false|
13
13
  (method_name =~ regex) || super(method_name, include_private)
14
14
  end
15
+
16
+ define_method :inspect do
17
+ klass = self.class
18
+ name = klass.name || klass.inspect
19
+ "#<#{name}: #{regex.inspect}>"
20
+ end
15
21
  end
16
22
  end
17
23
  end
@@ -1,3 +1,3 @@
1
1
  module MethodFound
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: method_found
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Salzberg
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-04-16 00:00:00.000000000 Z
11
+ date: 2017-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -64,6 +64,7 @@ files:
64
64
  - ".travis.yml"
65
65
  - CODE_OF_CONDUCT.md
66
66
  - Gemfile
67
+ - Guardfile
67
68
  - LICENSE.txt
68
69
  - README.md
69
70
  - Rakefile