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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d1e39d8087b54161b4019cfc99370e36c9ad95db
4
- data.tar.gz: 15d0c22c0e27e941dab617c4da97dd83443789da
3
+ metadata.gz: eb93b5e9ba380a5666b800d5cc3491920068ff6e
4
+ data.tar.gz: 9c2b66af59b1584bac1ff3d3367915bb2ffa3dce
5
5
  SHA512:
6
- metadata.gz: 2dcf5cb2962cfb72b1ad5c7184d8cde6a33cd88132deb2e09779372c3f64012755a88a2f577f702719960e6bc8a7e4a2ade130313270e21adb3d20c4f44beba7
7
- data.tar.gz: 5301506475928065b8300c1602b7adb96b8cb674a9ffcb425acc4223884d3d4e01bd1241e20f5fad7bf7682bda176a1fd60b532d352074d716c3e15768ba1412
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.
@@ -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
- arr = self.uniq
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
@@ -1,3 +1,3 @@
1
1
  module Recordkeeper
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -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 adds a method to the Array class.}
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.1
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-17 00:00:00.000000000 Z
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 adds a method to the
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: []