endeavour 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/endeavour.rb +6 -0
- data/lib/endeavour/hook.rb +2 -0
- data/lib/endeavour/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07b7f145d64b15fc7039971cfef53dd2f8d17c0e
|
4
|
+
data.tar.gz: 1ca5d657d4c8acb0f7d51ba6bb3f100dcc3c50b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49b213464e8c7eb7d60c6b4fbacd65b53b96634c6d6bf86cc72c5b63c36d20be21de813525f7f023a62453e3aae796ab63afd0a348c45bea7b3a90f0a0d9ed37
|
7
|
+
data.tar.gz: 6c077c53f1acd331e76bf2786283ac01f5ae03b10184339b6e7337059f98a82e285dbabe27bbffa0abce36bf5e09bd7b0bd9182394444129ecf3f25c3b12b676
|
data/README.md
CHANGED
@@ -5,6 +5,8 @@ instances. `try` permits calling a method on an object and returning `nil`
|
|
5
5
|
rather than `NoMethodError` if the object is `nil` or does not respond to
|
6
6
|
the method.
|
7
7
|
|
8
|
+
[![CircleCI](https://circleci.com/gh/allspiritseve/endeavour/tree/master.svg?style=svg)](https://circleci.com/gh/allspiritseve/endeavour/tree/master)
|
9
|
+
|
8
10
|
## Usage
|
9
11
|
|
10
12
|
There are two ways to use `try`:
|
data/lib/endeavour.rb
CHANGED
@@ -12,6 +12,12 @@ class Endeavour
|
|
12
12
|
@object = object
|
13
13
|
end
|
14
14
|
|
15
|
+
%w(inspect to_s).each do |method|
|
16
|
+
define_method(method) do |*args, &block|
|
17
|
+
self.class.call(@object, method, *args, &block)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
15
21
|
def method_missing(method, *args, &block)
|
16
22
|
self.class.call(@object, method, *args, &block)
|
17
23
|
end
|
data/lib/endeavour/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: endeavour
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cory Kaufman-Schofield
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-10-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest-reporters
|
@@ -98,6 +98,7 @@ files:
|
|
98
98
|
- lib/endeavour/core_ext.rb
|
99
99
|
- lib/endeavour/core_ext/nil_class/try.rb
|
100
100
|
- lib/endeavour/core_ext/object/try.rb
|
101
|
+
- lib/endeavour/hook.rb
|
101
102
|
- lib/endeavour/railtie.rb
|
102
103
|
- lib/endeavour/version.rb
|
103
104
|
homepage: https://github.com/allspiritseve/endeavour
|
@@ -120,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
121
|
version: '0'
|
121
122
|
requirements: []
|
122
123
|
rubyforge_project:
|
123
|
-
rubygems_version: 2.
|
124
|
+
rubygems_version: 2.6.13
|
124
125
|
signing_key:
|
125
126
|
specification_version: 4
|
126
127
|
summary: Try, but better.
|