metrojobb 0.5.1 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +4 -2
- data/lib/metrojobb/category.rb +20 -3
- data/lib/metrojobb/version.rb +1 -1
- data/metrojobb.gemspec +3 -2
- metadata +19 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: a663651a9ba6c314a9d46a0cca1fb9945f73115eb65a20f753466a43cf56d2ff
|
4
|
+
data.tar.gz: 9f74f72552ee33a83aad2f43ae59bfb396526c374f770d8d56d289f7675252d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eaafa0144773b149aacacdfd7e1112552d65b8143c24c9aba237715b79b26c2b38f05fa04b7a4b79d93182460f3b9b44a0abc97d670445e8324f675b46c3deec
|
7
|
+
data.tar.gz: '086775305f1c610c11c8bb40cae43dac854a53c375674339fe4f3092903d75d3e13fdc98f4623761a10a2532ee27c7f993dbbd92fa4a5906a307735fde376aab'
|
data/.travis.yml
CHANGED
data/lib/metrojobb/category.rb
CHANGED
@@ -5,9 +5,26 @@ module Metrojobb
|
|
5
5
|
class Category < Model
|
6
6
|
attr_accessor :id, :name
|
7
7
|
|
8
|
-
NAME_ID_MAP =
|
9
|
-
|
10
|
-
|
8
|
+
NAME_ID_MAP = lambda {
|
9
|
+
top_categories = {}
|
10
|
+
|
11
|
+
data = CSV.read(
|
12
|
+
File.expand_path('../../../data/categories.csv', __FILE__)
|
13
|
+
).map do |row|
|
14
|
+
id, name = row
|
15
|
+
if id.length < 3
|
16
|
+
top_categories[id] = name
|
17
|
+
else
|
18
|
+
top_id = id[0..1]
|
19
|
+
top_id = id[0] if id.length == 3
|
20
|
+
top_name = top_categories[top_id]
|
21
|
+
name = "#{top_name} > #{name}"
|
22
|
+
end
|
23
|
+
[id, name]
|
24
|
+
end
|
25
|
+
|
26
|
+
data.to_h.invert.freeze
|
27
|
+
}.call
|
11
28
|
|
12
29
|
ID_NAME_MAP = NAME_ID_MAP.invert.freeze
|
13
30
|
|
data/lib/metrojobb/version.rb
CHANGED
data/metrojobb.gemspec
CHANGED
@@ -23,9 +23,10 @@ Gem::Specification.new do |spec|
|
|
23
23
|
|
24
24
|
spec.add_dependency 'activemodel', '~> 5.0'
|
25
25
|
spec.add_dependency 'builder', '~> 3.2'
|
26
|
+
spec.add_dependency 'simplecov', '~> 0.15'
|
26
27
|
|
27
|
-
spec.add_development_dependency 'bundler', '~> 1.16
|
28
|
+
spec.add_development_dependency 'bundler', '~> 1.16'
|
28
29
|
spec.add_development_dependency 'rake', '~> 10.0'
|
29
30
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
30
|
-
|
31
|
+
spec.add_development_dependency 'byebug'
|
31
32
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metrojobb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jacob Burenstam
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -38,20 +38,34 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '3.2'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: simplecov
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0.15'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.15'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: bundler
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
44
58
|
requirements:
|
45
59
|
- - "~>"
|
46
60
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.16
|
61
|
+
version: '1.16'
|
48
62
|
type: :development
|
49
63
|
prerelease: false
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
51
65
|
requirements:
|
52
66
|
- - "~>"
|
53
67
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.16
|
68
|
+
version: '1.16'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: rake
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -147,7 +161,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
147
161
|
version: '0'
|
148
162
|
requirements: []
|
149
163
|
rubyforge_project:
|
150
|
-
rubygems_version: 2.6
|
164
|
+
rubygems_version: 2.7.6
|
151
165
|
signing_key:
|
152
166
|
specification_version: 4
|
153
167
|
summary: Build a feed for Metrojobb
|