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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 155375f4017eb0969ae05c2480d7355830d30399
4
- data.tar.gz: 8baaa5efdf1bb22879413422d3e6e9c31544a736
2
+ SHA256:
3
+ metadata.gz: a663651a9ba6c314a9d46a0cca1fb9945f73115eb65a20f753466a43cf56d2ff
4
+ data.tar.gz: 9f74f72552ee33a83aad2f43ae59bfb396526c374f770d8d56d289f7675252d3
5
5
  SHA512:
6
- metadata.gz: d738a979ea8d21146c8dbe7222b403a104103266ed3df3cfc0212e1ca89f3308507274cb8349815208f9a2f217c27ea598a40f97d5be84e0bf609ac37c23caba
7
- data.tar.gz: c4f51535e91b4e881f7dc0e0e8f8cecb24d883853611bfa70b5b51766b0759375a0a64b3b42292211ff7a8f41eca782fb2040a87884b7f7a5a4c0f02d56257d4
6
+ metadata.gz: eaafa0144773b149aacacdfd7e1112552d65b8143c24c9aba237715b79b26c2b38f05fa04b7a4b79d93182460f3b9b44a0abc97d670445e8324f675b46c3deec
7
+ data.tar.gz: '086775305f1c610c11c8bb40cae43dac854a53c375674339fe4f3092903d75d3e13fdc98f4623761a10a2532ee27c7f993dbbd92fa4a5906a307735fde376aab'
@@ -1,5 +1,7 @@
1
1
  sudo: false
2
2
  language: ruby
3
3
  rvm:
4
- - 2.4.1
5
- before_install: gem install bundler -v 1.16.0.pre.2
4
+ - 2.3.6
5
+ - 2.4.3
6
+ - 2.5.0
7
+ before_install: gem install bundler -v 1.16.0
@@ -5,9 +5,26 @@ module Metrojobb
5
5
  class Category < Model
6
6
  attr_accessor :id, :name
7
7
 
8
- NAME_ID_MAP = CSV.read(
9
- File.expand_path('../../../data/categories.csv', __FILE__)
10
- ).to_h.invert.freeze
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
 
@@ -1,3 +1,3 @@
1
1
  module Metrojobb
2
- VERSION = '0.5.1'
2
+ VERSION = '0.6.0'
3
3
  end
@@ -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.a'
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
- spec.add_development_dependency 'byebug'
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.5.1
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: 2017-09-21 00:00:00.000000000 Z
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.a
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.a
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.13
164
+ rubygems_version: 2.7.6
151
165
  signing_key:
152
166
  specification_version: 4
153
167
  summary: Build a feed for Metrojobb