smart_aleck 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/.gitignore +2 -0
- data/lib/smart_aleck/category_indexer.rb +7 -3
- data/lib/smart_aleck/version.rb +1 -1
- data/smart_aleck.gemspec +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YThiZjJmZDE5M2IxMjc2MDRjZDhiNDgxYTZlNzhjMjQwMmZlZGQ4ZA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZjhjMGEzNzMzZTc3MjMxMDU1OWMxYzc0NzlkMmU0MTUwMTJhZDc1MQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YjNjY2RlODhiNTNkZTM4ODcxMTc4MzZmNGEyMWI3YTIwYTQ2YzQxYjA0MDM2
|
10
|
+
YTU2MTEyZDJlZDg0NWFhOTBlYWE0OTRkYWMyMTYwMGZhNTZjMTkxNjYzM2Jl
|
11
|
+
MzdjYzMwMTM1OTdiODc0N2FjZmNjODkzZTYwYzdhYTk1NTFiY2U=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YzQyZDg0MjYzYTBkNmU4OTFlN2FhNzNmYjU1OTNiMDBiZmRhNzcyOThiMzE0
|
14
|
+
NjgwZDVhZjA3OWMyOWE5NmY4NmVjODMxOGZmYmE5Y2UxN2M4ZjBkMTViNjQ2
|
15
|
+
YmMwYTUyNWNiZjQ1MWY3ZWIzYjBmNmEwOWU5M2Q0YjhiMjgzYjg=
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'base58'
|
2
|
+
|
1
3
|
module SmartAleck
|
2
4
|
class CategoryIndexer
|
3
5
|
attr_reader :category_hash
|
@@ -8,9 +10,11 @@ module SmartAleck
|
|
8
10
|
|
9
11
|
def initialize(categories)
|
10
12
|
@category_hash =
|
11
|
-
|
12
|
-
|
13
|
-
|
13
|
+
Base58.encode(
|
14
|
+
categories.map {|category|
|
15
|
+
2 ** (category.respond_to?(:id) ? category.id : category).to_i
|
16
|
+
}.inject(:|).to_i
|
17
|
+
)
|
14
18
|
end
|
15
19
|
end
|
16
20
|
end
|
data/lib/smart_aleck/version.rb
CHANGED
data/smart_aleck.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smart_aleck
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dennis Walters
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - ! '>='
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: base58
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ~>
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0.1'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ~>
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0.1'
|
83
97
|
description:
|
84
98
|
email:
|
85
99
|
- pooster@gmail.com
|