fuby 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +1 -1
  3. data/VERSION +1 -1
  4. data/fuby.gemspec +2 -1
  5. data/lib/fuby.rb +2 -1
  6. data/lib/fuby/_.rb +1 -0
  7. data/lib/fuby/abbreviation.rb +1 -3
  8. data/lib/fuby/alias_method.rb +0 -2
  9. data/lib/fuby/attributes.rb +0 -2
  10. data/lib/fuby/bind.rb +0 -2
  11. data/lib/fuby/class_attributes.rb +0 -2
  12. data/lib/fuby/deep_each.rb +0 -2
  13. data/lib/fuby/define_instance_method.rb +2 -4
  14. data/lib/fuby/define_missing_method.rb +0 -2
  15. data/lib/fuby/define_object_method.rb +2 -4
  16. data/lib/fuby/define_tok.rb +0 -2
  17. data/lib/fuby/descendants.rb +0 -2
  18. data/lib/fuby/drop.rb +0 -2
  19. data/lib/fuby/drop_until.rb +0 -2
  20. data/lib/fuby/drop_while.rb +0 -2
  21. data/lib/fuby/each_with_index_or_key.rb +0 -2
  22. data/lib/fuby/eql_componentwise.rb +0 -2
  23. data/lib/fuby/equivalence.rb +0 -2
  24. data/lib/fuby/eval.rb +0 -3
  25. data/lib/fuby/extend.rb +0 -2
  26. data/lib/fuby/include.rb +0 -2
  27. data/lib/fuby/index_or_key.rb +0 -3
  28. data/lib/fuby/instance_attributes.rb +0 -2
  29. data/lib/fuby/invert.rb +0 -2
  30. data/lib/fuby/longest_common.rb +0 -1
  31. data/lib/fuby/matches_part_of.rb +0 -2
  32. data/lib/fuby/matches_suffix_of.rb +0 -2
  33. data/lib/fuby/member.rb +0 -2
  34. data/lib/fuby/not.rb +0 -2
  35. data/lib/fuby/opposite.rb +0 -2
  36. data/lib/fuby/otherwise.rb +0 -2
  37. data/lib/fuby/part_of.rb +0 -2
  38. data/lib/fuby/pop_if.rb +0 -2
  39. data/lib/fuby/prefixes.rb +0 -2
  40. data/lib/fuby/private.rb +0 -2
  41. data/lib/fuby/protected.rb +0 -2
  42. data/lib/fuby/public.rb +0 -2
  43. data/lib/fuby/random.rb +0 -2
  44. data/lib/fuby/self_and_descendants.rb +0 -2
  45. data/lib/fuby/shift_while.rb +0 -2
  46. data/lib/fuby/splat.rb +0 -2
  47. data/lib/fuby/strip.rb +0 -2
  48. data/lib/fuby/subclass.rb +1 -3
  49. data/lib/fuby/submodule.rb +1 -3
  50. data/lib/fuby/suffix_of.rb +0 -2
  51. data/lib/fuby/suffixes.rb +0 -2
  52. data/lib/fuby/take.rb +0 -2
  53. data/lib/fuby/take_until.rb +0 -2
  54. data/lib/fuby/take_while.rb +0 -2
  55. data/lib/fuby/tap.rb +0 -2
  56. data/lib/fuby/to_boolean.rb +0 -2
  57. data/lib/fuby/to_camel_case.rb +0 -2
  58. data/lib/fuby/to_components.rb +0 -2
  59. data/lib/fuby/to_dash_case.rb +0 -2
  60. data/lib/fuby/to_snake_case.rb +0 -2
  61. data/lib/fuby/try_each.rb +0 -1
  62. data/lib/fuby/try_eval.rb +2 -1
  63. data/lib/fuby/try_exec.rb +1 -0
  64. data/lib/fuby/unabbreviation.rb +1 -1
  65. data/lib/fuby/unshift_options.rb +1 -0
  66. data/test/fuby/define_instance_method.rb +40 -0
  67. data/test/fuby/define_object_method.rb +40 -0
  68. metadata +6 -3
  69. data/test/fuby/version.rb +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b32c422c938ac0a08d7dfde0c4cad4d1a7982d96
4
- data.tar.gz: 68ae7e8b2d24571257f928fe885e1bbaea415423
3
+ metadata.gz: 99e1db273fc106282f8517b589af92d19e2360ae
4
+ data.tar.gz: 11e5281463debc8412bf2890e433a21b4c4c4ca0
5
5
  SHA512:
6
- metadata.gz: 7191422d20c2ead219d23b550491fc9d160b13173e51d69444c875e95b16b441bccc76fc5bfda05956595bc2412a2971eb50a836ea0295421fb683e0c21ef653
7
- data.tar.gz: 15c992b9a874306832c8819ba5489ca12c51d4387cb8e7e5bd79a92720b8106f61d7bca8ae405f31d96b260af1e8bb73b35430b128b3e9e8bbfd88592bb9a038
6
+ metadata.gz: c6b0d1dc5b4cbe786685f395b4af46898a118a4184b622f42d8f842159adebbaae838f6177724a63cfe4fc71379629836fa8251c9a26ad0638f716615adac567
7
+ data.tar.gz: 1a0e4aaff0ddd9e05f6422db698b3ddba4ef3d554b286a275b0765cf66eb98086f690ad820f1f99490f900c10ccaca2ffec15124ad0aa228f8f7fe1aa52ca282
data/Rakefile CHANGED
@@ -4,5 +4,5 @@ require "rake/testtask"
4
4
  Rake::TestTask.new do |t|
5
5
  t.libs.push "lib", "test/lib"
6
6
  t.test_files = FileList[ "test/fuby/**/*.rb" ]
7
- t.ruby_opts = [ "-r minitest/spec", "-r minitest/autorun" ] # , "-r fuby"
7
+ t.ruby_opts = [ "-r minitest/autorun" ] # , "-r fuby"
8
8
  end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
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.test_files = gem.files.grep(%r{^(test|spec|features)/})
20
+ gem.require_paths = Dir[ "lib" ]
21
+ gem.test_files = Dir[ "test/**/*" ]
21
22
  end
data/lib/fuby.rb CHANGED
@@ -1 +1,2 @@
1
- # Dir.glob "#{ File.dirname __FILE__ }/fuby/*.rb", &method(:require)
1
+ module Fuby
2
+ end
data/lib/fuby/_.rb ADDED
@@ -0,0 +1 @@
1
+ Dir.glob "#{ File.dirname __FILE__ }/*.rb", &method(:require)
@@ -1,6 +1,4 @@
1
- require 'fuby/unabbreviation'
2
-
3
- using Fuby
1
+ require_relative 'unabbreviation'
4
2
 
5
3
  module Fuby
6
4
  refine ::Symbol do
@@ -1,7 +1,5 @@
1
1
  require_relative 'uuid'
2
2
 
3
- using Fuby
4
-
5
3
  module Fuby
6
4
  refine ::Module do
7
5
 
@@ -1,7 +1,5 @@
1
1
  require 'delegate'
2
2
 
3
- using Fuby
4
-
5
3
  module Fuby
6
4
  class Attributes < SimpleDelegator
7
5
 
data/lib/fuby/bind.rb CHANGED
@@ -1,7 +1,5 @@
1
1
  require_relative 'uuid'
2
2
 
3
- using Fuby
4
-
5
3
  module Fuby
6
4
  refine ::Proc do
7
5
 
@@ -1,7 +1,5 @@
1
1
  require_relative 'attributes'
2
2
 
3
- using Fuby
4
-
5
3
  module Fuby
6
4
  refine ::Module do
7
5
 
@@ -1,5 +1,3 @@
1
- using Fuby
2
-
3
1
  module Fuby
4
2
  module ::Enumerable # can't refine Module
5
3
 
@@ -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,7 +1,5 @@
1
1
  require_relative 'uuid'
2
2
 
3
- using Fuby
4
-
5
3
  module Fuby
6
4
  refine ::Module do
7
5
  protected
@@ -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
@@ -1,5 +1,3 @@
1
- using Fuby
2
-
3
1
  module Fuby
4
2
  refine ::Module do
5
3
 
@@ -1,5 +1,3 @@
1
- using Fuby
2
-
3
1
  module Fuby
4
2
  refine ::Module do
5
3
 
data/lib/fuby/drop.rb CHANGED
@@ -1,5 +1,3 @@
1
- using Fuby
2
-
3
1
  module Fuby
4
2
  refine ::Array do
5
3
 
@@ -1,7 +1,5 @@
1
1
  require_relative 'method_added_as_filter'
2
2
 
3
- using Fuby
4
-
5
3
  module Fuby
6
4
  refine ::Array do
7
5
 
@@ -1,7 +1,5 @@
1
1
  require_relative 'shift_while'
2
2
 
3
- using Fuby
4
-
5
3
  module Fuby
6
4
  refine ::Array do
7
5
 
@@ -1,5 +1,3 @@
1
- using Fuby
2
-
3
1
  module Fuby
4
2
  refine ::Hash do
5
3
 
@@ -1,7 +1,5 @@
1
1
  require_relative 'each_with_index_or_key'
2
2
 
3
- using Fuby
4
-
5
3
  module Fuby
6
4
  module ::Enumerable # can't refine Module
7
5
 
@@ -1,7 +1,5 @@
1
1
  require_relative 'splat'
2
2
 
3
- using Fuby
4
-
5
3
  module Fuby
6
4
  module ::Enumerable # can't refine Module
7
5
 
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
@@ -1,5 +1,3 @@
1
- using Fuby
2
-
3
1
  module Fuby
4
2
  refine ::Object do
5
3
 
data/lib/fuby/include.rb CHANGED
@@ -1,5 +1,3 @@
1
- using Fuby
2
-
3
1
  module Fuby
4
2
  refine ::Module do
5
3
 
@@ -1,5 +1,4 @@
1
1
  module Fuby
2
-
3
2
  refine ::Array do
4
3
 
5
4
  def index_or_key
@@ -7,7 +6,6 @@ module Fuby
7
6
  end
8
7
 
9
8
  end
10
-
11
9
  refine ::Hash do
12
10
 
13
11
  def index_or_key
@@ -15,5 +13,4 @@ module Fuby
15
13
  end
16
14
 
17
15
  end
18
-
19
16
  end
@@ -1,7 +1,5 @@
1
1
  require_relative 'attributes'
2
2
 
3
- using Fuby
4
-
5
3
  module Fuby
6
4
  refine ::Object do
7
5
 
data/lib/fuby/invert.rb CHANGED
@@ -1,8 +1,6 @@
1
1
  require_relative 'self_and_descendants'
2
2
  require_relative 'each_with_index_or_key'
3
3
 
4
- using Fuby
5
-
6
4
  module Fuby
7
5
 
8
6
  module ::Enumerable # can't refine Module
@@ -1,5 +1,4 @@
1
1
  require_relative 'equivalence'
2
- using Fuby
3
2
 
4
3
  module Fuby
5
4
  module ::Enumerable # can't refine Module
@@ -1,8 +1,6 @@
1
1
  require_relative 'method_added_as_binary_operator'
2
2
  require_relative 'matches_componentwise'
3
3
 
4
- using Fuby
5
-
6
4
  module Fuby
7
5
  module ::Enumerable # can't refine Module
8
6
 
@@ -1,5 +1,3 @@
1
- using Fuby
2
-
3
1
  module Fuby
4
2
  refine ::Array do
5
3
 
data/lib/fuby/member.rb CHANGED
@@ -1,7 +1,5 @@
1
1
  require_relative 'method_added_as_binary_operator'
2
2
 
3
- using Fuby
4
-
5
3
  module Fuby
6
4
  module ::Enumerable # can't refine Module
7
5
 
data/lib/fuby/not.rb CHANGED
@@ -1,5 +1,3 @@
1
- using Fuby
2
-
3
1
  module Fuby
4
2
  refine ::Proc do
5
3
 
data/lib/fuby/opposite.rb CHANGED
@@ -1,5 +1,3 @@
1
- using Fuby
2
-
3
1
  module Fuby
4
2
 
5
3
  refine ::Symbol do
@@ -1,5 +1,3 @@
1
- using Fuby
2
-
3
1
  module Fuby
4
2
  refine ::Object do
5
3
 
data/lib/fuby/part_of.rb CHANGED
@@ -1,8 +1,6 @@
1
1
  require_relative 'method_added_as_binary_operator'
2
2
  require_relative 'eql_componentwise'
3
3
 
4
- using Fuby
5
-
6
4
  module Fuby
7
5
  module ::Enumerable # can't refine Module
8
6
 
data/lib/fuby/pop_if.rb CHANGED
@@ -1,7 +1,5 @@
1
1
  require_relative 'method_added_as_filter'
2
2
 
3
- using Fuby
4
-
5
3
  module Fuby
6
4
  refine ::Array do
7
5
 
data/lib/fuby/prefixes.rb CHANGED
@@ -1,5 +1,3 @@
1
- using Fuby
2
-
3
1
  module Fuby
4
2
  refine ::Array do
5
3
 
data/lib/fuby/private.rb CHANGED
@@ -1,5 +1,3 @@
1
- using Fuby
2
-
3
1
  module Fuby
4
2
  refine ::Method do
5
3
 
@@ -1,5 +1,3 @@
1
- using Fuby
2
-
3
1
  module Fuby
4
2
  refine ::Method do
5
3
 
data/lib/fuby/public.rb CHANGED
@@ -1,5 +1,3 @@
1
- using Fuby
2
-
3
1
  module Fuby
4
2
  refine ::Method do
5
3
 
data/lib/fuby/random.rb CHANGED
@@ -1,5 +1,3 @@
1
- using Fuby
2
-
3
1
  require 'securerandom'
4
2
 
5
3
  module Fuby
@@ -1,7 +1,5 @@
1
1
  require_relative 'descendants'
2
2
 
3
- using Fuby
4
-
5
3
  module Fuby
6
4
  refine ::Module do
7
5
 
@@ -2,8 +2,6 @@ require_relative 'not'
2
2
  require_relative 'shift_until'
3
3
  require_relative 'method_added_as_filter'
4
4
 
5
- using Fuby
6
-
7
5
  module Fuby
8
6
  refine ::Array do
9
7
 
data/lib/fuby/splat.rb CHANGED
@@ -1,5 +1,3 @@
1
- using Fuby
2
-
3
1
  module Fuby
4
2
  module ::Enumerable # can't refine Module
5
3
 
data/lib/fuby/strip.rb CHANGED
@@ -1,7 +1,5 @@
1
1
  require_relative 'plus'
2
2
 
3
- using Fuby
4
-
5
3
  module Fuby
6
4
  refine ::String do
7
5
 
data/lib/fuby/subclass.rb CHANGED
@@ -1,6 +1,4 @@
1
- require 'fuby/include'
2
-
3
- using Fuby
1
+ require_relative 'include'
4
2
 
5
3
  module Fuby
6
4
  refine ::Module do
@@ -1,6 +1,4 @@
1
- require 'fuby/include'
2
-
3
- using Fuby
1
+ require_relative 'include'
4
2
 
5
3
  module Fuby
6
4
  refine ::Module do
@@ -1,5 +1,3 @@
1
- using Fuby
2
-
3
1
  module Fuby
4
2
  refine ::Array do
5
3
 
data/lib/fuby/suffixes.rb CHANGED
@@ -1,5 +1,3 @@
1
- using Fuby
2
-
3
1
  module Fuby
4
2
  refine ::Array do
5
3
 
data/lib/fuby/take.rb CHANGED
@@ -1,5 +1,3 @@
1
- using Fuby
2
-
3
1
  module Fuby
4
2
  refine ::Array do
5
3
 
@@ -1,5 +1,3 @@
1
- using Fuby
2
-
3
1
  module Fuby
4
2
  refine ::Array do
5
3
 
@@ -1,5 +1,3 @@
1
- using Fuby
2
-
3
1
  module Fuby
4
2
  refine ::Array do
5
3
 
data/lib/fuby/tap.rb CHANGED
@@ -1,5 +1,3 @@
1
- using Fuby
2
-
3
1
  module Fuby
4
2
  refine ::Object do
5
3
 
@@ -1,5 +1,3 @@
1
- using Fuby
2
-
3
1
  module Fuby
4
2
  refine ::Numeric do
5
3
 
@@ -1,7 +1,5 @@
1
1
  require_relative 'to_components'
2
2
 
3
- using Fuby
4
-
5
3
  module Fuby
6
4
  refine ::String do
7
5
 
@@ -1,5 +1,3 @@
1
- using Fuby
2
-
3
1
  module Fuby
4
2
  refine ::String do
5
3
 
@@ -1,7 +1,5 @@
1
1
  require_relative 'to_components'
2
2
 
3
- using Fuby
4
-
5
3
  module Fuby
6
4
  refine ::String do
7
5
 
@@ -1,7 +1,5 @@
1
1
  require_relative 'to_components'
2
2
 
3
- using Fuby
4
-
5
3
  module Fuby
6
4
  refine ::String do
7
5
 
data/lib/fuby/try_each.rb CHANGED
@@ -1,5 +1,4 @@
1
1
  require_relative 'try'
2
-
3
2
  using Fuby
4
3
 
5
4
  module Fuby
data/lib/fuby/try_eval.rb CHANGED
@@ -1,4 +1,5 @@
1
- require 'fuby/try'
1
+ require_relative 'try'
2
+ using Fuby
2
3
 
3
4
  module Fuby
4
5
  refine ::Object do
data/lib/fuby/try_exec.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require_relative 'try_eval'
2
+ using Fuby
2
3
 
3
4
  module Fuby
4
5
  refine ::Object do
@@ -1,4 +1,4 @@
1
- require 'fuby/abbreviation'
1
+ require_relative 'abbreviation'
2
2
 
3
3
  module Fuby
4
4
  refine ::Symbol do
@@ -1,4 +1,5 @@
1
1
  require_relative 'shift_options'
2
+ using Fuby
2
3
 
3
4
  module Fuby
4
5
  refine ::Array do
@@ -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.1
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