toady 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.gitignore +8 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/Gemfile +7 -0
- data/LICENSE +20 -0
- data/README.md +58 -0
- data/Rakefile +7 -0
- data/lib/toady.rb +16 -0
- data/lib/toady/version.rb +3 -0
- data/spec/spec_helper.rb +12 -0
- data/spec/toady_spec.rb +36 -0
- data/toady.gemspec +22 -0
- metadata +73 -0
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
M2ZjZjYxNzlhN2I4ZDdhODI2NmQ3OWE0MTljODZlNWNjYzM3NGQ4Ng==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
YjFkNzRmZWM3MDcyMzcyNGMyMDlmODM3MGJmMmUxMzlhNTM2ZTUxZQ==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
ZjY1ODg3YjRlOGZlYmFlMDA5Mjg4NDkwOTM1YTAxMWQ5MzU3NDRlMjkxYzQz
|
10
|
+
MDc0NjhhMjE5NTI5N2VlMjViNzMxNWVhNWQ4NTA5YTIxMGY3NTRmY2FhZjFl
|
11
|
+
ZmQ0ZTBlMWRhNmI5YzFkY2UxNDA5ZTg3YzAzNDFkMTBhOTc3NWY=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
NmJjZjZkMjJlNjUzYmE2NTc0MWM0ODZkNzUyZTdlODlkN2Q0MzdkMzEzNjRl
|
14
|
+
MGNmMWMwMWJlMzBjNTQ3NzlkNjFlMjYwNzc4MDYzMGQ5YmM3YzI0NWQ1NzIw
|
15
|
+
NDc5MjhkNjViNGEzM2RiNzAwYjY0ODYwY2VkYTM3NGU4NGQ5YjI=
|
data/.gitignore
ADDED
data/.ruby-gemset
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
toady
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.9.3
|
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2013 Dennis Walters
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
7
|
+
the Software without restriction, including without limitation the rights to
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
9
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
10
|
+
subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
17
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
18
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
19
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
20
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
## Toady ##
|
2
|
+
|
3
|
+
A silly little object that responds to any method.
|
4
|
+
|
5
|
+
## Gem Setup ##
|
6
|
+
|
7
|
+
```ruby
|
8
|
+
gem install toady
|
9
|
+
|
10
|
+
# Gemfile
|
11
|
+
group :test do
|
12
|
+
gem 'toady'
|
13
|
+
end
|
14
|
+
```
|
15
|
+
|
16
|
+
## How Do I Use This Thing? ##
|
17
|
+
|
18
|
+
```ruby
|
19
|
+
|
20
|
+
# Via class methods
|
21
|
+
Toady.any_method_that_you_like('some', 'arguments')
|
22
|
+
=> [:any_method_that_you_like, 'some', 'arguments']
|
23
|
+
|
24
|
+
Toady.respond_to?(:a_different_method)
|
25
|
+
=> true
|
26
|
+
|
27
|
+
# Via instance methods
|
28
|
+
toady = Toady.new
|
29
|
+
|
30
|
+
toady.flibberty_giblets!
|
31
|
+
=> [:flibberty_giblets!]
|
32
|
+
|
33
|
+
toady.respond_to?(:my_sausages_turned_to_gold)
|
34
|
+
=> true
|
35
|
+
```
|
36
|
+
|
37
|
+
## Formal Documentation ##
|
38
|
+
|
39
|
+
The actual library docs can be read
|
40
|
+
[over on rubydoc](http://rubydoc.info/gems/toady/frames).
|
41
|
+
|
42
|
+
## Contributing ##
|
43
|
+
|
44
|
+
Do you use git-flow? I sure do. Please base anything you do off of
|
45
|
+
[the develop branch](https://github.com/ess/factis/tree/develop).
|
46
|
+
|
47
|
+
1. Fork it.
|
48
|
+
2. Perform some BDD magic. Seriously. Be testing.
|
49
|
+
3. Submit a pull request.
|
50
|
+
|
51
|
+
## So, Uh, Why? ##
|
52
|
+
|
53
|
+
More than anything, I needed a general purpose class to help me test
|
54
|
+
a few pub/sub methodologies for correctness.
|
55
|
+
|
56
|
+
## License ##
|
57
|
+
|
58
|
+
MIT License. Copyright 2014 Ess
|
data/Rakefile
ADDED
data/lib/toady.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'toady/version'
|
2
|
+
|
3
|
+
class Toady
|
4
|
+
module Magic
|
5
|
+
def method_missing(method_sym, *arguments, &block)
|
6
|
+
[method_sym.to_sym] + arguments
|
7
|
+
end
|
8
|
+
|
9
|
+
def respond_to?(method_sym, include_private = false)
|
10
|
+
true
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
extend Magic
|
15
|
+
include Magic
|
16
|
+
end
|
data/spec/spec_helper.rb
ADDED
data/spec/toady_spec.rb
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'toady'
|
3
|
+
|
4
|
+
describe Toady do
|
5
|
+
let(:klass) {Toady}
|
6
|
+
let(:instance) {klass.new}
|
7
|
+
|
8
|
+
context 'class level' do
|
9
|
+
it 'responds to any method' do
|
10
|
+
[:any_given_method, :even_with_a_bang!, :or_with_a_?].each do |meth|
|
11
|
+
expect(klass.respond_to?(meth)).to eql(true)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'returns the method and its arguments as an array for unknown methods' do
|
16
|
+
expect(klass.methods).not_to include(:my_sausages)
|
17
|
+
expect(klass.my_sausages(:turned_to, 'gold')).
|
18
|
+
to eql([:my_sausages, :turned_to, 'gold'])
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
context 'instance level' do
|
23
|
+
it 'responds to any method' do
|
24
|
+
[:any_given_method, :even_with_a_bang!, :or_with_a_?].each do |meth|
|
25
|
+
expect(instance.respond_to?(meth)).to eql(true)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'returns the method and its arguments as an array for unknown methods' do
|
30
|
+
expect(instance.instance_methods).not_to include(:my_sausages)
|
31
|
+
expect(instance.my_sausages(:turned_to, 'gold')).
|
32
|
+
to eql([:my_sausages, :turned_to, 'gold'])
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
data/toady.gemspec
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/toady/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.authors = ["Dennis Walters"]
|
6
|
+
gem.email = ["pooster@gmail.com"]
|
7
|
+
gem.summary = %q{A total yes-man object}
|
8
|
+
gem.description = <<-EOD
|
9
|
+
Toady is a simple little fella that always responds to any message
|
10
|
+
you send it.
|
11
|
+
EOD
|
12
|
+
gem.homepage = "http://github.com/ess/toady"
|
13
|
+
gem.license = 'MIT'
|
14
|
+
|
15
|
+
gem.files = `git ls-files`.split($\)
|
16
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
17
|
+
gem.name = "toady"
|
18
|
+
gem.require_paths = ["lib"]
|
19
|
+
gem.version = Toady::VERSION
|
20
|
+
|
21
|
+
gem.add_development_dependency 'rspec'
|
22
|
+
end
|
metadata
ADDED
@@ -0,0 +1,73 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: toady
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Dennis Walters
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-12-01 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: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ! '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
description: ! " Toady is a simple little fella that always responds to any message\n
|
28
|
+
\ you send it.\n"
|
29
|
+
email:
|
30
|
+
- pooster@gmail.com
|
31
|
+
executables: []
|
32
|
+
extensions: []
|
33
|
+
extra_rdoc_files: []
|
34
|
+
files:
|
35
|
+
- .gitignore
|
36
|
+
- .ruby-gemset
|
37
|
+
- .ruby-version
|
38
|
+
- Gemfile
|
39
|
+
- LICENSE
|
40
|
+
- README.md
|
41
|
+
- Rakefile
|
42
|
+
- lib/toady.rb
|
43
|
+
- lib/toady/version.rb
|
44
|
+
- spec/spec_helper.rb
|
45
|
+
- spec/toady_spec.rb
|
46
|
+
- toady.gemspec
|
47
|
+
homepage: http://github.com/ess/toady
|
48
|
+
licenses:
|
49
|
+
- MIT
|
50
|
+
metadata: {}
|
51
|
+
post_install_message:
|
52
|
+
rdoc_options: []
|
53
|
+
require_paths:
|
54
|
+
- lib
|
55
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - ! '>='
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '0'
|
60
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
61
|
+
requirements:
|
62
|
+
- - ! '>='
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: '0'
|
65
|
+
requirements: []
|
66
|
+
rubyforge_project:
|
67
|
+
rubygems_version: 2.1.11
|
68
|
+
signing_key:
|
69
|
+
specification_version: 4
|
70
|
+
summary: A total yes-man object
|
71
|
+
test_files:
|
72
|
+
- spec/spec_helper.rb
|
73
|
+
- spec/toady_spec.rb
|