deep_count 0.1.1 → 0.1.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: d156dc28da407f30c1f5591561517945f2956395
4
- data.tar.gz: 778219122207891ba0ca13fa6a65f9d70c55016d
3
+ metadata.gz: a5497e23950ac5a3236caeb66195e3ed3dab2edf
4
+ data.tar.gz: a334fdf0b4774fccdb315ce7b5df7e8e35becc11
5
5
  SHA512:
6
- metadata.gz: 85ee04a99fd5f555d4245e634ad725cc0d1433aff770cfd881bfb353a15b8115039681c0640e5c1e6801a72e3690c726d8331f63a307edceb9e5fe19ac67c058
7
- data.tar.gz: 76b97d24b147b7b9c6338a492e02ea64b1ae9b68439f15656dc70175d72bbad8e15aea58837d5c7b658fdcdaa747a29a5705fd04aba8f5d5a43cf90668d91462
6
+ metadata.gz: 7ac817ea22f63096346d5bd45c3b103b42fd416f90f9f22f5ade8a235b5f153095953277e59bc420567d3e1128cfb0c48b706dff0b814e7a32a6d27e08cccc4a
7
+ data.tar.gz: d033c6fc075c310d8fd0777c0b9e8d756b9e753672502071183e9da34b72456f794a28ab5f49a8407f326064d2094305b3d6c3b9a9b632811c9ae4dc36886cb3
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # DeepCount
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/deep_count`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
3
+ Convert result of count by multiple group to nested hash.
6
4
 
7
5
  ## Installation
8
6
 
@@ -22,7 +20,17 @@ Or install it yourself as:
22
20
 
23
21
  ## Usage
24
22
 
25
- TODO: Write usage instructions here
23
+ Default ActiveRecord behavior:
24
+
25
+ ```ruby
26
+ User.group(:sex, :role).count #=> {["female", "admin"]=>1, ["male", "admin"]=>1, ["male", "user"]=>3}
27
+ ```
28
+
29
+ Own solution:
30
+
31
+ ```ruby
32
+ User.group(:sex, :role).deep_count #=> {"female"=>{"admin"=>1}, "male"=>{"admin"=>1, "user"=>3}}
33
+ ```
26
34
 
27
35
  ## Development
28
36
 
@@ -9,8 +9,8 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["Alexandr Melnikov"]
10
10
  spec.email = ["amelnikov@ergoserv.com"]
11
11
 
12
- spec.summary = %q{Present count with multiple group as nested hash.}
13
- spec.homepage = "http://some.com"
12
+ spec.summary = %q{Convert result of count by multiple group to nested hash.}
13
+ spec.homepage = "https://github.com/melnikovsansan/deep_count"
14
14
  spec.license = "MIT"
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
@@ -1,3 +1,3 @@
1
1
  module DeepCount
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deep_count
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexandr Melnikov
@@ -87,7 +87,7 @@ files:
87
87
  - lib/deep_count.rb
88
88
  - lib/deep_count/adapter.rb
89
89
  - lib/deep_count/version.rb
90
- homepage: http://some.com
90
+ homepage: https://github.com/melnikovsansan/deep_count
91
91
  licenses:
92
92
  - MIT
93
93
  metadata: {}
@@ -110,5 +110,5 @@ rubyforge_project:
110
110
  rubygems_version: 2.4.8
111
111
  signing_key:
112
112
  specification_version: 4
113
- summary: Present count with multiple group as nested hash.
113
+ summary: Convert result of count by multiple group to nested hash.
114
114
  test_files: []