function_module 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 24620a02caec6a71060c0892e50fbc0fa8771096
4
- data.tar.gz: c51458970ab959073f6af2c0a13a7423da6eacbf
3
+ metadata.gz: b6ce3623e2abb1f2d01ad7a52b17f68d45788794
4
+ data.tar.gz: 1c58376affa4de866a56f54a03e6906956058191
5
5
  SHA512:
6
- metadata.gz: 55a575dcceca4ca59bd94872d03423bbcf025fb0e89d311cedbc8537d410b0786e0f187b893ea2c147264c2cd0d231468a2a5637dc87532d5a4c32835a301b2f
7
- data.tar.gz: 6beed7a529102844e4f406813b507a9837b03d14239e3577591c45dd93a55c04dadc05817d35b7f20c07994b8c0a0c45f76cd7730f8805f189fb4836c8f66021
6
+ metadata.gz: 59d073e3726ed0aaf40620220f9b0667cc218c8910b659a62f02020e2dde01f9b88ee52f2076402048bd055668990ea0c81998050a11fadc994ff0bdcb16bf34
7
+ data.tar.gz: d774e6ac00ed33fb3b7e22b8634f5389dad360edefc24a97a7364eefc3509598b1a3135fdb83e840f137a85def2a5fd308f8a23c1b1f17bed9cbb0dca9d65e0d
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ # Ver.0.1.1 (2016/06/04)
2
+ * Add `Module#alias_module_function`
3
+
4
+ #Ver. 0.1.0 (2016/06/04)
5
+ * Initial version.
data/README.md CHANGED
@@ -32,12 +32,15 @@ Note:
32
32
  * It doesn't check method definition; even if private instance method and public singleton method are different, it is counted as module function.
33
33
  * methods in `Module` itself are excluded (`Module.new.module_functions` return empty `Aryay`)
34
34
 
35
- ### `Module#include_module_functions` (private)
35
+ ### `Module#include_module_functions(mod)` (private)
36
36
  Using `include_module_functions another_mod` in some module,
37
37
 
38
38
  * include `another_mod` as usual.
39
39
  * extend `another_mod` and make module functions public (usable for singleton methods)
40
40
 
41
+ ### `Module#alias_module_function(new_name, old_name)` (private)
42
+ Make alias of module functions. In `alias`/`alias_method`, only instance method is aliased.
43
+
41
44
  ## Development
42
45
 
43
46
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -21,4 +21,14 @@ class Module # :nodoc:
21
21
  extend mod
22
22
  singleton_class.__send__ :public, *mod.module_functions
23
23
  end
24
+
25
+ # make alias for module function.
26
+ # @param new_name new method name (in Symbol/String)
27
+ # @param old_name old method name (in Symbol/String)
28
+ def alias_module_function(new_name, old_name)
29
+ # alias private method
30
+ alias_method new_name, old_name
31
+ # make new method to module function
32
+ module_function new_name
33
+ end
24
34
  end
@@ -1,3 +1,3 @@
1
1
  module FunctionModule
2
- VERSION = "0.1.0"
2
+ VERSION = '0.1.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: function_module
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
  - jkr2255
@@ -62,6 +62,7 @@ files:
62
62
  - ".gitignore"
63
63
  - ".rspec"
64
64
  - ".travis.yml"
65
+ - CHANGELOG.md
65
66
  - Gemfile
66
67
  - LICENSE.txt
67
68
  - README.md