selfish 0.1.1 → 0.2.0

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: 56213d12ad449bfd5d36a333bbaa116fb6191061
4
- data.tar.gz: 5a80077a412b254e1eac2ee6254c6c4fef02f034
3
+ metadata.gz: 1a47fa24338259ce00fbef8694269a021e125ab6
4
+ data.tar.gz: 747e4df311b0591f2ef6bc5f7b6e4abf1f8d0d44
5
5
  SHA512:
6
- metadata.gz: 334daff4c48a065b62a4ff8cce82e01fd7e4daca7999d9653c38f69492274b6c04c2572d76ca5d9a51bfff35e862793064035ce5846f7e02ffea4be981565b4e
7
- data.tar.gz: 549250138a1f82e9179c3b3657e11b9571f490a8583da1f43a03c7440e20ed842ff6d1d24db155cc101e777a7e0e4899683eefccfafca99cfff50504002f453c
6
+ metadata.gz: fccb710332284f8ae48b61272a10b6a192d4f78da312ab5a232e164b77e5f8c70a7b31a14f05f70b313dcabb0b8cecc866804d570a3a77c19c6331442edbf94d
7
+ data.tar.gz: 4c3a5a2a7d0be838e63cdcefe969f57881894f40f8f982006cb23e554d8ba6fe72a39032267b7e45b6aedf5f15cb3c501d86aefc76a9a51add830a2791b030b9
data/.gitignore CHANGED
@@ -7,3 +7,4 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ /*.gem
data/README.md CHANGED
@@ -1,11 +1,12 @@
1
1
  # Selfish
2
2
 
3
- Selfish#selfish ... Set block first parameter to self
4
- Selfish#_self ... just 'self'
3
+ `Selfish#selfish` ... Set block first parameter to self
4
+ `Selfish#_self` ... just 'self'
5
5
 
6
6
  You can use `Selfish::UnderScore#_` as alias of above two methods with `require "selfish/_"`.
7
- And also you can use `Selfish::OneCharacter#s` as `self` and `Selfish::OneCharacter#i` as same as `Selfish#selfish`
8
- with `require "selfish/1"`.
7
+ And also you can use `Selfish::OneCharacter#s` as `self` and `Selfish::OneCharacter#i` as same as `Selfish#selfish` with `require "selfish/1"`.
8
+
9
+ You can use all features with just `require "selfish"`.
9
10
 
10
11
  ## Installation
11
12
 
@@ -28,7 +29,7 @@ Or install it yourself as:
28
29
  Like below:
29
30
 
30
31
  ```
31
- require "selfish/all"
32
+ require "selfish"
32
33
 
33
34
  ["foo", "bar"].map.with_index &i("baz", "qux"){|a, b, i| [a, b, i, _, upcase]}
34
35
  #=> [["baz", "qux", 0, "foo", "FOO"], ["baz", "qux", 1, "bar", "BAR"]]
@@ -1,17 +1,2 @@
1
- require "selfish/version"
2
-
3
- module Selfish
4
- def selfish(*a, &b)
5
- if !a.empty? && !b
6
- b = a.shift.to_proc
7
- end
8
- proc {|_, *arg| _.instance_exec(*a, *arg, &b)}
9
- end
10
- def _self
11
- self
12
- end
13
- end
14
-
15
- class Object
16
- include Selfish
17
- end
1
+ require "selfish/_"
2
+ require "selfish/1"
@@ -1,4 +1,4 @@
1
- require "selfish"
1
+ require "selfish/core"
2
2
 
3
3
  module Selfish::OneCharacter
4
4
  alias i selfish
@@ -1,4 +1,4 @@
1
- require "selfish"
1
+ require "selfish/core"
2
2
 
3
3
  module Selfish::UnderScore
4
4
  def _(&b)
@@ -1,3 +1,2 @@
1
+ STDERR.puts "Warning: deprecated. please require \"selfish\" instead."
1
2
  require "selfish"
2
- require "selfish/_"
3
- require "selfish/1"
@@ -0,0 +1,17 @@
1
+ require "selfish/version"
2
+
3
+ module Selfish
4
+ def selfish(*a, &b)
5
+ if !a.empty? && !b
6
+ b = a.shift.to_proc
7
+ end
8
+ proc {|_, *arg| _.instance_exec(*a, *arg, &b)}
9
+ end
10
+ def _self
11
+ self
12
+ end
13
+ end
14
+
15
+ class Object
16
+ include Selfish
17
+ end
@@ -1,3 +1,3 @@
1
1
  module Selfish
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: selfish
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - wanabe
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-06-14 00:00:00.000000000 Z
11
+ date: 2017-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -68,6 +68,7 @@ files:
68
68
  - lib/selfish/1.rb
69
69
  - lib/selfish/_.rb
70
70
  - lib/selfish/all.rb
71
+ - lib/selfish/core.rb
71
72
  - lib/selfish/version.rb
72
73
  - selfish.gemspec
73
74
  homepage: http://github.cim/wanabe
@@ -90,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
90
91
  version: '0'
91
92
  requirements: []
92
93
  rubyforge_project:
93
- rubygems_version: 2.4.5
94
+ rubygems_version: 2.5.1
94
95
  signing_key:
95
96
  specification_version: 4
96
97
  summary: SELF In ShortHand