ava_rb_toolbox 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: b0c1eb89b887640ccc0c5c892b04bffe4ce31927
4
+ data.tar.gz: e53b1170ee8032a2b16664ce32a3b6f4e8b6d0d4
5
+ SHA512:
6
+ metadata.gz: 4531a7ea955a57259a4aeb0fbdca6d393020d2f44a3166e6c1586a08c837400e737fc8bfc924f6d66d3d347c40cb2055cdcc5e2e331ae573027b50e7fff4d797
7
+ data.tar.gz: 827c4a5c16d70acac3073dc7db1bfacf0ef7224545973ffff0084b18d343e54165ab23a50837c75e8f249bfc79cf03eefbe161fea941211277bc6709bf82a111
File without changes
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2013 Anton
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,19 @@
1
+ = ava_rb_toolbox
2
+
3
+ Description goes here.
4
+
5
+ == Contributing to ava_rb_toolbox
6
+
7
+ * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
8
+ * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
9
+ * Fork the project.
10
+ * Start a feature/bugfix branch.
11
+ * Commit and push until you are happy with your contribution.
12
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
13
+ * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
14
+
15
+ == Copyright
16
+
17
+ Copyright (c) 2013 Anton. See LICENSE.txt for
18
+ further details.
19
+
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.1
@@ -0,0 +1,66 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = "ava_rb_toolbox"
8
+ s.version = "0.0.1"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Anton Kuzmin"]
12
+ s.date = "2013-06-15"
13
+ s.description = ""
14
+ s.email = "thehappycoder@gmail.com"
15
+ s.extra_rdoc_files = [
16
+ "LICENSE.txt",
17
+ "README.rdoc"
18
+ ]
19
+ s.files = [
20
+ "Changelog.md",
21
+ "LICENSE.txt",
22
+ "README.rdoc",
23
+ "VERSION",
24
+ "ava_rb_toolbox.gemspec",
25
+ "lib/ava_rb_toolbox.rb",
26
+ "lib/ava_rb_toolbox/enumerable.rb",
27
+ "lib/ava_rb_toolbox/module.rb"
28
+ ]
29
+ s.homepage = "http://github.com/thehappycoder/ava_rb_toolbox"
30
+ s.licenses = ["MIT"]
31
+ s.require_paths = ["lib"]
32
+ s.required_ruby_version = Gem::Requirement.new(">= 2.0.0")
33
+ s.rubygems_version = "2.0.3"
34
+ s.summary = "Small useful additions to ruby standard classes"
35
+
36
+ if s.respond_to? :specification_version then
37
+ s.specification_version = 4
38
+
39
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
40
+ s.add_development_dependency(%q<rspec>, ["~> 2.13.0"])
41
+ s.add_development_dependency(%q<shoulda>, [">= 0"])
42
+ s.add_development_dependency(%q<yard>, [">= 0"])
43
+ s.add_development_dependency(%q<bundler>, ["~> 1.3.5"])
44
+ s.add_development_dependency(%q<jeweler>, ["~> 1.8.4"])
45
+ s.add_development_dependency(%q<simplecov>, ["~> 0.7.1"])
46
+ s.add_development_dependency(%q<simplecov-rcov>, ["~> 0.2.3"])
47
+ else
48
+ s.add_dependency(%q<rspec>, ["~> 2.13.0"])
49
+ s.add_dependency(%q<shoulda>, [">= 0"])
50
+ s.add_dependency(%q<yard>, [">= 0"])
51
+ s.add_dependency(%q<bundler>, ["~> 1.3.5"])
52
+ s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
53
+ s.add_dependency(%q<simplecov>, ["~> 0.7.1"])
54
+ s.add_dependency(%q<simplecov-rcov>, ["~> 0.2.3"])
55
+ end
56
+ else
57
+ s.add_dependency(%q<rspec>, ["~> 2.13.0"])
58
+ s.add_dependency(%q<shoulda>, [">= 0"])
59
+ s.add_dependency(%q<yard>, [">= 0"])
60
+ s.add_dependency(%q<bundler>, ["~> 1.3.5"])
61
+ s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
62
+ s.add_dependency(%q<simplecov>, ["~> 0.7.1"])
63
+ s.add_dependency(%q<simplecov-rcov>, ["~> 0.2.3"])
64
+ end
65
+ end
66
+
@@ -0,0 +1 @@
1
+ require 'ava_rb_toolbox/enumerable'
@@ -0,0 +1,36 @@
1
+ require_relative 'module'
2
+
3
+ module Enumerable
4
+ # Returns a {AvaRbToolbox::Enumerable}
5
+ def ava
6
+ @ava ||= AvaRbToolbox::Enumerable.new(self)
7
+ end
8
+ end
9
+
10
+ # This class extends functionality of an enumerable
11
+ # @author Anton Kuzmin
12
+ class AvaRbToolbox::Enumerable
13
+ def initialize(target)
14
+ @target = target
15
+ end
16
+
17
+ # Groups enumerable entries by key returned by `proc` or `block`
18
+ # into hash where value is an enumerable's entry.
19
+ #
20
+ # If `block` is given, `proc` is ignored.
21
+ #
22
+ # @return [Hash]
23
+ def group_by_unique(proc = nil, &block)
24
+ result = {}
25
+
26
+ return result if proc.nil? and !block_given?
27
+
28
+ proc = block if block_given?
29
+
30
+ @target.each_entry do |item|
31
+ result[proc.call(item)] = item
32
+ end
33
+
34
+ result
35
+ end
36
+ end
@@ -0,0 +1,3 @@
1
+ module AvaRbToolbox
2
+
3
+ end
metadata ADDED
@@ -0,0 +1,152 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ava_rb_toolbox
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Anton Kuzmin
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-06-15 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rspec
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ~>
18
+ - !ruby/object:Gem::Version
19
+ version: 2.13.0
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ~>
25
+ - !ruby/object:Gem::Version
26
+ version: 2.13.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: shoulda
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: yard
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: bundler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 1.3.5
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: 1.3.5
69
+ - !ruby/object:Gem::Dependency
70
+ name: jeweler
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ~>
74
+ - !ruby/object:Gem::Version
75
+ version: 1.8.4
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ~>
81
+ - !ruby/object:Gem::Version
82
+ version: 1.8.4
83
+ - !ruby/object:Gem::Dependency
84
+ name: simplecov
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ~>
88
+ - !ruby/object:Gem::Version
89
+ version: 0.7.1
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ~>
95
+ - !ruby/object:Gem::Version
96
+ version: 0.7.1
97
+ - !ruby/object:Gem::Dependency
98
+ name: simplecov-rcov
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ~>
102
+ - !ruby/object:Gem::Version
103
+ version: 0.2.3
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ~>
109
+ - !ruby/object:Gem::Version
110
+ version: 0.2.3
111
+ description: ''
112
+ email: thehappycoder@gmail.com
113
+ executables: []
114
+ extensions: []
115
+ extra_rdoc_files:
116
+ - LICENSE.txt
117
+ - README.rdoc
118
+ files:
119
+ - Changelog.md
120
+ - LICENSE.txt
121
+ - README.rdoc
122
+ - VERSION
123
+ - ava_rb_toolbox.gemspec
124
+ - lib/ava_rb_toolbox.rb
125
+ - lib/ava_rb_toolbox/enumerable.rb
126
+ - lib/ava_rb_toolbox/module.rb
127
+ homepage: http://github.com/thehappycoder/ava_rb_toolbox
128
+ licenses:
129
+ - MIT
130
+ metadata: {}
131
+ post_install_message:
132
+ rdoc_options: []
133
+ require_paths:
134
+ - lib
135
+ required_ruby_version: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - '>='
138
+ - !ruby/object:Gem::Version
139
+ version: 2.0.0
140
+ required_rubygems_version: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - '>='
143
+ - !ruby/object:Gem::Version
144
+ version: '0'
145
+ requirements: []
146
+ rubyforge_project:
147
+ rubygems_version: 2.0.3
148
+ signing_key:
149
+ specification_version: 4
150
+ summary: Small useful additions to ruby standard classes
151
+ test_files: []
152
+ has_rdoc: