recordkeeper 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +0 -4
- data/lib/recordkeeper.rb +6 -2
- data/lib/recordkeeper/version.rb +1 -1
- data/recordkeeper.gemspec +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: eb93b5e9ba380a5666b800d5cc3491920068ff6e
|
|
4
|
+
data.tar.gz: 9c2b66af59b1584bac1ff3d3367915bb2ffa3dce
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: af36378cff848a0d684f5774c4130bd2b3b366a7dfd4106ac68a4e38965a17270e746facaf35bcde4a937e562ec012c20635f2fb622e0d108711cf790a45598c
|
|
7
|
+
data.tar.gz: 9cee782968ffc26ebbe2e780c158d25656492416065b9a073506b3186b427b6d001d2b0bccb839a34e97739d311d5ea604d5fe5817da0e0dfdaad7d2fa577645
|
data/README.md
CHANGED
|
@@ -24,10 +24,6 @@ Or install it yourself as:
|
|
|
24
24
|
|
|
25
25
|
$ gem install recordkeeper
|
|
26
26
|
|
|
27
|
-
## Usage
|
|
28
|
-
|
|
29
|
-
TODO: Write usage instructions here
|
|
30
|
-
|
|
31
27
|
## Development
|
|
32
28
|
|
|
33
29
|
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.
|
data/lib/recordkeeper.rb
CHANGED
|
@@ -2,9 +2,9 @@ require "recordkeeper/version"
|
|
|
2
2
|
|
|
3
3
|
module Recordkeeper
|
|
4
4
|
Array.class_eval do
|
|
5
|
+
|
|
5
6
|
def recordkeeper
|
|
6
|
-
|
|
7
|
-
hash = Hash[arr.map { |elm| [elm, 0] } ]
|
|
7
|
+
hash = array_to_hash
|
|
8
8
|
for i in self
|
|
9
9
|
hash.each do |key, value|
|
|
10
10
|
hash[key] = value + 1 if key == i
|
|
@@ -12,5 +12,9 @@ module Recordkeeper
|
|
|
12
12
|
end
|
|
13
13
|
hash
|
|
14
14
|
end
|
|
15
|
+
|
|
16
|
+
def array_to_hash
|
|
17
|
+
Hash[self.map { |elm| [elm, 0] } ]
|
|
18
|
+
end
|
|
15
19
|
end
|
|
16
20
|
end
|
data/lib/recordkeeper/version.rb
CHANGED
data/recordkeeper.gemspec
CHANGED
|
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
|
10
10
|
spec.email = ["yi.susans@gmail.com"]
|
|
11
11
|
|
|
12
12
|
spec.summary = %q{Recordkeeper is an array method that takes an array and returns a hash with a record of the times an element within the array is repeated.}
|
|
13
|
-
spec.description = %q{Built to mimic Python's counter method. This gem
|
|
13
|
+
spec.description = %q{Built to mimic Python's counter method. This gem monkey patches a method to the Array class. Recordkeeper takes an array and returns a hash with a record of the number of times an element within the array is repeated}
|
|
14
14
|
# spec.homepage = "Todo: Put your gem's website or public repo URL here."
|
|
15
15
|
spec.license = "MIT"
|
|
16
16
|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: recordkeeper
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Susan Yi
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-08-
|
|
11
|
+
date: 2016-08-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -52,8 +52,9 @@ dependencies:
|
|
|
52
52
|
- - "~>"
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
54
|
version: '3.0'
|
|
55
|
-
description: Built to mimic Python's counter method. This gem
|
|
56
|
-
Array class.
|
|
55
|
+
description: Built to mimic Python's counter method. This gem monkey patches a method
|
|
56
|
+
to the Array class. Recordkeeper takes an array and returns a hash with a record
|
|
57
|
+
of the number of times an element within the array is repeated
|
|
57
58
|
email:
|
|
58
59
|
- yi.susans@gmail.com
|
|
59
60
|
executables: []
|