fuby 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/fuby.gemspec +2 -1
- data/lib/fuby.rb +2 -1
- data/lib/fuby/_.rb +1 -0
- data/lib/fuby/abbreviation.rb +1 -3
- data/lib/fuby/alias_method.rb +0 -2
- data/lib/fuby/attributes.rb +0 -2
- data/lib/fuby/bind.rb +0 -2
- data/lib/fuby/class_attributes.rb +0 -2
- data/lib/fuby/deep_each.rb +0 -2
- data/lib/fuby/define_instance_method.rb +2 -4
- data/lib/fuby/define_missing_method.rb +0 -2
- data/lib/fuby/define_object_method.rb +2 -4
- data/lib/fuby/define_tok.rb +0 -2
- data/lib/fuby/descendants.rb +0 -2
- data/lib/fuby/drop.rb +0 -2
- data/lib/fuby/drop_until.rb +0 -2
- data/lib/fuby/drop_while.rb +0 -2
- data/lib/fuby/each_with_index_or_key.rb +0 -2
- data/lib/fuby/eql_componentwise.rb +0 -2
- data/lib/fuby/equivalence.rb +0 -2
- data/lib/fuby/eval.rb +0 -3
- data/lib/fuby/extend.rb +0 -2
- data/lib/fuby/include.rb +0 -2
- data/lib/fuby/index_or_key.rb +0 -3
- data/lib/fuby/instance_attributes.rb +0 -2
- data/lib/fuby/invert.rb +0 -2
- data/lib/fuby/longest_common.rb +0 -1
- data/lib/fuby/matches_part_of.rb +0 -2
- data/lib/fuby/matches_suffix_of.rb +0 -2
- data/lib/fuby/member.rb +0 -2
- data/lib/fuby/not.rb +0 -2
- data/lib/fuby/opposite.rb +0 -2
- data/lib/fuby/otherwise.rb +0 -2
- data/lib/fuby/part_of.rb +0 -2
- data/lib/fuby/pop_if.rb +0 -2
- data/lib/fuby/prefixes.rb +0 -2
- data/lib/fuby/private.rb +0 -2
- data/lib/fuby/protected.rb +0 -2
- data/lib/fuby/public.rb +0 -2
- data/lib/fuby/random.rb +0 -2
- data/lib/fuby/self_and_descendants.rb +0 -2
- data/lib/fuby/shift_while.rb +0 -2
- data/lib/fuby/splat.rb +0 -2
- data/lib/fuby/strip.rb +0 -2
- data/lib/fuby/subclass.rb +1 -3
- data/lib/fuby/submodule.rb +1 -3
- data/lib/fuby/suffix_of.rb +0 -2
- data/lib/fuby/suffixes.rb +0 -2
- data/lib/fuby/take.rb +0 -2
- data/lib/fuby/take_until.rb +0 -2
- data/lib/fuby/take_while.rb +0 -2
- data/lib/fuby/tap.rb +0 -2
- data/lib/fuby/to_boolean.rb +0 -2
- data/lib/fuby/to_camel_case.rb +0 -2
- data/lib/fuby/to_components.rb +0 -2
- data/lib/fuby/to_dash_case.rb +0 -2
- data/lib/fuby/to_snake_case.rb +0 -2
- data/lib/fuby/try_each.rb +0 -1
- data/lib/fuby/try_eval.rb +2 -1
- data/lib/fuby/try_exec.rb +1 -0
- data/lib/fuby/unabbreviation.rb +1 -1
- data/lib/fuby/unshift_options.rb +1 -0
- data/test/fuby/define_instance_method.rb +40 -0
- data/test/fuby/define_object_method.rb +40 -0
- metadata +6 -3
- data/test/fuby/version.rb +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 99e1db273fc106282f8517b589af92d19e2360ae
|
4
|
+
data.tar.gz: 11e5281463debc8412bf2890e433a21b4c4c4ca0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6b0d1dc5b4cbe786685f395b4af46898a118a4184b622f42d8f842159adebbaae838f6177724a63cfe4fc71379629836fa8251c9a26ad0638f716615adac567
|
7
|
+
data.tar.gz: 1a0e4aaff0ddd9e05f6422db698b3ddba4ef3d554b286a275b0765cf66eb98086f690ad820f1f99490f900c10ccaca2ffec15124ad0aa228f8f7fe1aa52ca282
|
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.2
|
data/fuby.gemspec
CHANGED
@@ -17,5 +17,6 @@ Gem::Specification.new do |gem|
|
|
17
17
|
gem.homepage = "http://github.com/tosyx/fuby"
|
18
18
|
|
19
19
|
gem.files = `git ls-files`.split($/)
|
20
|
-
gem.
|
20
|
+
gem.require_paths = Dir[ "lib" ]
|
21
|
+
gem.test_files = Dir[ "test/**/*" ]
|
21
22
|
end
|
data/lib/fuby.rb
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
module Fuby
|
2
|
+
end
|
data/lib/fuby/_.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
Dir.glob "#{ File.dirname __FILE__ }/*.rb", &method(:require)
|
data/lib/fuby/abbreviation.rb
CHANGED
data/lib/fuby/alias_method.rb
CHANGED
data/lib/fuby/attributes.rb
CHANGED
data/lib/fuby/bind.rb
CHANGED
data/lib/fuby/deep_each.rb
CHANGED
@@ -1,17 +1,15 @@
|
|
1
|
-
using Fuby
|
2
|
-
|
3
1
|
module Fuby
|
4
2
|
refine ::Module do
|
5
3
|
|
6
4
|
def define_instance_method *sig, &blk
|
7
|
-
self.define_method *sig, &blk
|
5
|
+
self.send :define_method, *sig, &blk
|
8
6
|
end
|
9
7
|
|
10
8
|
end
|
11
9
|
refine ::Object do
|
12
10
|
|
13
11
|
def define_instance_method *sig, &blk
|
14
|
-
self.define_singleton_method *sig, &blk
|
12
|
+
self.send :define_singleton_method, *sig, &blk
|
15
13
|
end
|
16
14
|
|
17
15
|
end
|
@@ -1,17 +1,15 @@
|
|
1
|
-
using Fuby
|
2
|
-
|
3
1
|
module Fuby
|
4
2
|
refine ::Module do
|
5
3
|
|
6
4
|
def define_object_method *sig, &blk
|
7
|
-
self.define_singleton_method *sig, &blk
|
5
|
+
self.send :define_singleton_method, *sig, &blk
|
8
6
|
end
|
9
7
|
|
10
8
|
end
|
11
9
|
refine ::Object do
|
12
10
|
|
13
11
|
def define_object_method *sig, &blk
|
14
|
-
self.class.define_method *sig, &blk
|
12
|
+
self.class.send :define_method, *sig, &blk
|
15
13
|
end
|
16
14
|
|
17
15
|
end
|
data/lib/fuby/define_tok.rb
CHANGED
data/lib/fuby/descendants.rb
CHANGED
data/lib/fuby/drop.rb
CHANGED
data/lib/fuby/drop_until.rb
CHANGED
data/lib/fuby/drop_while.rb
CHANGED
data/lib/fuby/equivalence.rb
CHANGED
data/lib/fuby/eval.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
require_relative 'intercept'
|
2
2
|
|
3
3
|
module Fuby
|
4
|
-
|
5
4
|
refine ::Hash do
|
6
5
|
|
7
6
|
def hash_eval &body
|
@@ -32,7 +31,6 @@ module Fuby
|
|
32
31
|
alias_method :hash_exec, :hash_eval
|
33
32
|
|
34
33
|
end
|
35
|
-
|
36
34
|
refine ::Object do
|
37
35
|
|
38
36
|
def curry_eval *pre, &shell
|
@@ -50,5 +48,4 @@ module Fuby
|
|
50
48
|
alias_method :curry_exec, :curry_eval
|
51
49
|
|
52
50
|
end
|
53
|
-
|
54
51
|
end
|
data/lib/fuby/extend.rb
CHANGED
data/lib/fuby/include.rb
CHANGED
data/lib/fuby/index_or_key.rb
CHANGED
data/lib/fuby/invert.rb
CHANGED
data/lib/fuby/longest_common.rb
CHANGED
data/lib/fuby/matches_part_of.rb
CHANGED
data/lib/fuby/member.rb
CHANGED
data/lib/fuby/not.rb
CHANGED
data/lib/fuby/opposite.rb
CHANGED
data/lib/fuby/otherwise.rb
CHANGED
data/lib/fuby/part_of.rb
CHANGED
data/lib/fuby/pop_if.rb
CHANGED
data/lib/fuby/prefixes.rb
CHANGED
data/lib/fuby/private.rb
CHANGED
data/lib/fuby/protected.rb
CHANGED
data/lib/fuby/public.rb
CHANGED
data/lib/fuby/random.rb
CHANGED
data/lib/fuby/shift_while.rb
CHANGED
data/lib/fuby/splat.rb
CHANGED
data/lib/fuby/strip.rb
CHANGED
data/lib/fuby/subclass.rb
CHANGED
data/lib/fuby/submodule.rb
CHANGED
data/lib/fuby/suffix_of.rb
CHANGED
data/lib/fuby/suffixes.rb
CHANGED
data/lib/fuby/take.rb
CHANGED
data/lib/fuby/take_until.rb
CHANGED
data/lib/fuby/take_while.rb
CHANGED
data/lib/fuby/tap.rb
CHANGED
data/lib/fuby/to_boolean.rb
CHANGED
data/lib/fuby/to_camel_case.rb
CHANGED
data/lib/fuby/to_components.rb
CHANGED
data/lib/fuby/to_dash_case.rb
CHANGED
data/lib/fuby/to_snake_case.rb
CHANGED
data/lib/fuby/try_each.rb
CHANGED
data/lib/fuby/try_eval.rb
CHANGED
data/lib/fuby/try_exec.rb
CHANGED
data/lib/fuby/unabbreviation.rb
CHANGED
data/lib/fuby/unshift_options.rb
CHANGED
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'fuby/define_instance_method'
|
2
|
+
|
3
|
+
using Fuby
|
4
|
+
|
5
|
+
describe Module do
|
6
|
+
describe "define_instance_method name, &block" do
|
7
|
+
it "defines an instance method" do
|
8
|
+
|
9
|
+
class A
|
10
|
+
end
|
11
|
+
|
12
|
+
a = A.new
|
13
|
+
|
14
|
+
A.define_instance_method :foo do
|
15
|
+
444
|
16
|
+
end
|
17
|
+
|
18
|
+
a.foo.must_equal 444
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
describe Object do
|
24
|
+
describe "define_instance_method name, &block" do
|
25
|
+
it "defines singleton method on `self`" do
|
26
|
+
|
27
|
+
class A
|
28
|
+
end
|
29
|
+
|
30
|
+
a = A.new
|
31
|
+
|
32
|
+
a.define_instance_method :foo do
|
33
|
+
555
|
34
|
+
end
|
35
|
+
|
36
|
+
a.foo.must_equal 555
|
37
|
+
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'fuby/define_object_method'
|
2
|
+
|
3
|
+
using Fuby
|
4
|
+
|
5
|
+
describe Module do
|
6
|
+
describe "define_object_method name, &block" do
|
7
|
+
it "defines a singleton method" do
|
8
|
+
|
9
|
+
class A
|
10
|
+
end
|
11
|
+
|
12
|
+
a = A.new
|
13
|
+
|
14
|
+
A.define_object_method :foo do
|
15
|
+
444
|
16
|
+
end
|
17
|
+
|
18
|
+
A.foo.must_equal 444
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
describe Object do
|
24
|
+
describe "define_object_method name, &block" do
|
25
|
+
it "defines an instance method on `self.class`" do
|
26
|
+
|
27
|
+
class A
|
28
|
+
end
|
29
|
+
|
30
|
+
a = A.new
|
31
|
+
|
32
|
+
a.define_object_method :foo do
|
33
|
+
555
|
34
|
+
end
|
35
|
+
|
36
|
+
a.foo.must_equal 555
|
37
|
+
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fuby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Goldsmith
|
@@ -27,6 +27,7 @@ files:
|
|
27
27
|
- VERSION
|
28
28
|
- fuby.gemspec
|
29
29
|
- lib/fuby.rb
|
30
|
+
- lib/fuby/_.rb
|
30
31
|
- lib/fuby/abbreviation.rb
|
31
32
|
- lib/fuby/alias_method.rb
|
32
33
|
- lib/fuby/all.rb
|
@@ -145,7 +146,9 @@ files:
|
|
145
146
|
- test/fuby/class_attributes.rb
|
146
147
|
- test/fuby/deep.rb
|
147
148
|
- test/fuby/deep_each.rb
|
149
|
+
- test/fuby/define_instance_method.rb
|
148
150
|
- test/fuby/define_missing_method.rb
|
151
|
+
- test/fuby/define_object_method.rb
|
149
152
|
- test/fuby/define_tok.rb
|
150
153
|
- test/fuby/descendants.rb
|
151
154
|
- test/fuby/dimension.rb
|
@@ -237,7 +240,6 @@ files:
|
|
237
240
|
- test/fuby/unshift.rb
|
238
241
|
- test/fuby/unshift_options.rb
|
239
242
|
- test/fuby/uuid.rb
|
240
|
-
- test/fuby/version.rb
|
241
243
|
homepage: http://github.com/tosyx/fuby
|
242
244
|
licenses:
|
243
245
|
- MIT
|
@@ -273,7 +275,9 @@ test_files:
|
|
273
275
|
- test/fuby/class_attributes.rb
|
274
276
|
- test/fuby/deep.rb
|
275
277
|
- test/fuby/deep_each.rb
|
278
|
+
- test/fuby/define_instance_method.rb
|
276
279
|
- test/fuby/define_missing_method.rb
|
280
|
+
- test/fuby/define_object_method.rb
|
277
281
|
- test/fuby/define_tok.rb
|
278
282
|
- test/fuby/descendants.rb
|
279
283
|
- test/fuby/dimension.rb
|
@@ -365,5 +369,4 @@ test_files:
|
|
365
369
|
- test/fuby/unshift.rb
|
366
370
|
- test/fuby/unshift_options.rb
|
367
371
|
- test/fuby/uuid.rb
|
368
|
-
- test/fuby/version.rb
|
369
372
|
has_rdoc:
|
data/test/fuby/version.rb
DELETED
File without changes
|