lxa_core_extensions 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +25 -16
- data/lib/lxa_core_extensions/array.rb +5 -0
- data/lib/lxa_core_extensions/version.rb +1 -1
- data/lxa_core_extensions.gemspec +1 -0
- data/test/test_array.rb +5 -0
- metadata +24 -3
data/README.md
CHANGED
@@ -1,29 +1,38 @@
|
|
1
1
|
# LxaCoreExtensions
|
2
2
|
|
3
|
-
TODO: Write a gem description
|
4
3
|
|
5
|
-
|
4
|
+
[![Build Status](https://travis-ci.org/levinalex/lxa_core_extensions.png)](https://travis-ci.org/levinalex/lxa_core_extensions)
|
5
|
+
[![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/levinalex/lxa_core_extensions)
|
6
6
|
|
7
|
-
|
7
|
+
simple core extensions for ruby:
|
8
8
|
|
9
|
-
|
9
|
+
### Constants
|
10
|
+
|
11
|
+
Infinity #=> Infinity
|
12
|
+
NaN #=> NaN
|
13
|
+
|
14
|
+
### Enumerable#build_hash
|
15
|
+
|
16
|
+
[[1,2],[3,4],[5,6]].build_hash #=> {1=>2, 3=>4, 5=>6}
|
17
|
+
[[1,2],[3,4],[5,6]].build_hash(:last) #=> {2=>[1,2], 4=>[3,4], 6=>[5,6]}
|
10
18
|
|
11
|
-
|
19
|
+
### Hash#compact
|
12
20
|
|
13
|
-
|
21
|
+
{ 4=>35, 9=>nil, 10=>false }.compact #=> {4=>35, 10=>false}
|
14
22
|
|
15
|
-
|
23
|
+
### Hash#rekey
|
16
24
|
|
17
|
-
|
25
|
+
{1=>2, 3=>4, 5=>{6=>7, 8=>9}}.rekey(&:to_s) #=> {"1"=>2,"3"=>4, "5"=>{"6"=>7, "8"=>9}}
|
18
26
|
|
19
|
-
|
27
|
+
### Hash#nested_keys
|
20
28
|
|
21
|
-
|
29
|
+
{1=>{2=>3,4=>5}}.nested_keys.to_a #=> [1,2,4]
|
22
30
|
|
23
|
-
|
31
|
+
### Hash#flip
|
32
|
+
|
33
|
+
{1=>2, 3=>4, 5=>6, 6=>2, 7=>4}.flip #=> {2=>[1, 6], 4=>[3, 7], 6=>[5]}
|
34
|
+
|
35
|
+
## Installation
|
36
|
+
|
37
|
+
gem 'lxa_core_extensions'
|
24
38
|
|
25
|
-
1. Fork it
|
26
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
-
5. Create new Pull Request
|
data/lxa_core_extensions.gemspec
CHANGED
data/test/test_array.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lxa_core_extensions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-02-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: minitest
|
@@ -27,6 +27,22 @@ dependencies:
|
|
27
27
|
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rake
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
30
46
|
description: simple core extensions
|
31
47
|
email:
|
32
48
|
- mail@levinalex.net
|
@@ -64,12 +80,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
64
80
|
- - ! '>='
|
65
81
|
- !ruby/object:Gem::Version
|
66
82
|
version: '0'
|
83
|
+
segments:
|
84
|
+
- 0
|
85
|
+
hash: -2106405039464562958
|
67
86
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
68
87
|
none: false
|
69
88
|
requirements:
|
70
89
|
- - ! '>='
|
71
90
|
- !ruby/object:Gem::Version
|
72
91
|
version: '0'
|
92
|
+
segments:
|
93
|
+
- 0
|
94
|
+
hash: -2106405039464562958
|
73
95
|
requirements: []
|
74
96
|
rubyforge_project:
|
75
97
|
rubygems_version: 1.8.24
|
@@ -82,4 +104,3 @@ test_files:
|
|
82
104
|
- test/test_constants.rb
|
83
105
|
- test/test_enumerable.rb
|
84
106
|
- test/test_hash.rb
|
85
|
-
has_rdoc:
|