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 +4 -4
- data/.gitignore +1 -0
- data/README.md +6 -5
- data/lib/selfish.rb +2 -17
- data/lib/selfish/1.rb +1 -1
- data/lib/selfish/_.rb +1 -1
- data/lib/selfish/all.rb +1 -2
- data/lib/selfish/core.rb +17 -0
- data/lib/selfish/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: 1a47fa24338259ce00fbef8694269a021e125ab6
|
4
|
+
data.tar.gz: 747e4df311b0591f2ef6bc5f7b6e4abf1f8d0d44
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fccb710332284f8ae48b61272a10b6a192d4f78da312ab5a232e164b77e5f8c70a7b31a14f05f70b313dcabb0b8cecc866804d570a3a77c19c6331442edbf94d
|
7
|
+
data.tar.gz: 4c3a5a2a7d0be838e63cdcefe969f57881894f40f8f982006cb23e554d8ba6fe72a39032267b7e45b6aedf5f15cb3c501d86aefc76a9a51add830a2791b030b9
|
data/.gitignore
CHANGED
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
|
-
|
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
|
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"]]
|
data/lib/selfish.rb
CHANGED
@@ -1,17 +1,2 @@
|
|
1
|
-
require "selfish/
|
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"
|
data/lib/selfish/1.rb
CHANGED
data/lib/selfish/_.rb
CHANGED
data/lib/selfish/all.rb
CHANGED
data/lib/selfish/core.rb
ADDED
@@ -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
|
data/lib/selfish/version.rb
CHANGED
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.
|
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:
|
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.
|
94
|
+
rubygems_version: 2.5.1
|
94
95
|
signing_key:
|
95
96
|
specification_version: 4
|
96
97
|
summary: SELF In ShortHand
|