metrojobb 0.4.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/README.md +16 -14
- data/lib/metrojobb/ad.rb +11 -9
- data/lib/metrojobb/contact.rb +3 -3
- data/lib/metrojobb/location.rb +3 -3
- data/lib/metrojobb/version.rb +1 -1
- metadata +2 -3
- data/Gemfile.lock +0 -53
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 155375f4017eb0969ae05c2480d7355830d30399
|
4
|
+
data.tar.gz: 8baaa5efdf1bb22879413422d3e6e9c31544a736
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d738a979ea8d21146c8dbe7222b403a104103266ed3df3cfc0212e1ca89f3308507274cb8349815208f9a2f217c27ea598a40f97d5be84e0bf609ac37c23caba
|
7
|
+
data.tar.gz: c4f51535e91b4e881f7dc0e0e8f8cecb24d883853611bfa70b5b51766b0759375a0a64b3b42292211ff7a8f41eca782fb2040a87884b7f7a5a4c0f02d56257d4
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Metrojobb
|
1
|
+
# Metrojobb [![Build Status](https://travis-ci.org/buren/metrojobb.svg?branch=master)](https://travis-ci.org/buren/metrojobb)
|
2
2
|
|
3
3
|
Build a feed for Metrojobb with ease.
|
4
4
|
|
@@ -28,7 +28,7 @@ Create full XML-document
|
|
28
28
|
|
29
29
|
```ruby
|
30
30
|
ads = Metrojobb::Ads.new([ad])
|
31
|
-
ads.to_xml # Returns full XML document
|
31
|
+
ads.to_xml # Returns the full XML document
|
32
32
|
```
|
33
33
|
|
34
34
|
Single model
|
@@ -52,18 +52,20 @@ Ad model:
|
|
52
52
|
|
53
53
|
```ruby
|
54
54
|
ad = Metrojobb::Ad.new(
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
55
|
+
order_number: '<<your-id>>'
|
56
|
+
external_application: true,
|
57
|
+
heading: '',
|
58
|
+
job_title: '',
|
59
|
+
summary: '',
|
60
|
+
description: '',
|
61
|
+
employer: '',
|
62
|
+
employer_home_page: '',
|
63
|
+
opportunities: '',
|
64
|
+
from_date: '2018-09-01',
|
65
|
+
to_date: '2018-10-01',
|
66
|
+
external_logo_url: 'https://example.com',
|
67
|
+
application_url: 'https://example.com',
|
68
|
+
video_url: 'https://example.com',
|
67
69
|
# relations
|
68
70
|
location: Metrojobb::Location.new(city: 'Stockholm'),
|
69
71
|
contact: Metrojobb::Contact.new(name: 'buren'),
|
data/lib/metrojobb/ad.rb
CHANGED
@@ -22,6 +22,7 @@ module Metrojobb
|
|
22
22
|
:to_date,
|
23
23
|
:external_logo_url,
|
24
24
|
:application_url,
|
25
|
+
:video_url,
|
25
26
|
# relations
|
26
27
|
:location,
|
27
28
|
:contact,
|
@@ -57,17 +58,18 @@ module Metrojobb
|
|
57
58
|
def to_xml(builder: Builder::XmlMarkup.new(indent: DEFAULT_INDENT))
|
58
59
|
builder.ad(orderno: order_number) do |node|
|
59
60
|
node.externalApplication(external_application)
|
60
|
-
node.heading { |n| n.cdata!(heading.to_s) }
|
61
|
-
node.jobTitle { |n| n.cdata!(job_title.to_s) }
|
62
|
-
node.summary { |n| n.cdata!(summary.to_s) }
|
63
|
-
node.description{ |n| n.cdata!(description.to_s) }
|
64
|
-
node.employer{ |n| n.cdata!(employer.to_s) }
|
65
|
-
node.employerHomePage{ |n| n.cdata!(employer_home_page.to_s) }
|
66
|
-
node.opportunities{ |n| n.cdata!(opportunities.to_s) }
|
61
|
+
node.heading { |n| n.cdata!(heading.to_s) } if heading.present?
|
62
|
+
node.jobTitle { |n| n.cdata!(job_title.to_s) } if job_title.present?
|
63
|
+
node.summary { |n| n.cdata!(summary.to_s) } if summary.present?
|
64
|
+
node.description { |n| n.cdata!(description.to_s) } if description.present?
|
65
|
+
node.employer { |n| n.cdata!(employer.to_s) } if employer.present?
|
66
|
+
node.employerHomePage { |n| n.cdata!(employer_home_page.to_s) } if employer_home_page.present?
|
67
|
+
node.opportunities { |n| n.cdata!(opportunities.to_s) } if opportunities.present?
|
67
68
|
node.fromdate(from_date)
|
68
69
|
node.todate(to_date)
|
69
|
-
node.externalLogoUrl{ |n| n.cdata!(external_logo_url.to_s) }
|
70
|
-
node.applicationURL { |n| n.cdata!(application_url.to_s) }
|
70
|
+
node.externalLogoUrl { |n| n.cdata!(external_logo_url.to_s) } if external_logo_url.present?
|
71
|
+
node.applicationURL { |n| n.cdata!(application_url.to_s) } if application_url.present?
|
72
|
+
node.videoURL { |n| n.cdata!(video_url.to_s) } if video_url.present?
|
71
73
|
|
72
74
|
location.to_xml(builder: node) if location
|
73
75
|
contact.to_xml(builder: node) if contact
|
data/lib/metrojobb/contact.rb
CHANGED
@@ -6,9 +6,9 @@ module Metrojobb
|
|
6
6
|
|
7
7
|
def to_xml(builder: Builder::XmlMarkup.new(indent: DEFAULT_INDENT))
|
8
8
|
builder.contact do |node|
|
9
|
-
node.name { |n| n.cdata!(name.to_s) }
|
10
|
-
node.phone { |n| n.cdata!(phone.to_s) }
|
11
|
-
node.email { |n| n.cdata!(email.to_s) }
|
9
|
+
node.name { |n| n.cdata!(name.to_s) } if name.present?
|
10
|
+
node.phone { |n| n.cdata!(phone.to_s) } if phone.present?
|
11
|
+
node.email { |n| n.cdata!(email.to_s) } if email.present?
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
data/lib/metrojobb/location.rb
CHANGED
@@ -6,9 +6,9 @@ module Metrojobb
|
|
6
6
|
|
7
7
|
def to_xml(builder: Builder::XmlMarkup.new(indent: DEFAULT_INDENT))
|
8
8
|
builder.location do |node|
|
9
|
-
node.street { |n| n.cdata!(street.to_s) }
|
10
|
-
node.postalCode { |n| n.cdata!(postal_code.to_s) }
|
11
|
-
node.city { |n| n.cdata!(city.to_s) }
|
9
|
+
node.street { |n| n.cdata!(street.to_s) } if street.present?
|
10
|
+
node.postalCode { |n| n.cdata!(postal_code.to_s) } if street.present?
|
11
|
+
node.city { |n| n.cdata!(city.to_s) } if street.present?
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
data/lib/metrojobb/version.rb
CHANGED
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.5.1
|
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-
|
11
|
+
date: 2017-09-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -105,7 +105,6 @@ files:
|
|
105
105
|
- ".rspec"
|
106
106
|
- ".travis.yml"
|
107
107
|
- Gemfile
|
108
|
-
- Gemfile.lock
|
109
108
|
- LICENSE.txt
|
110
109
|
- README.md
|
111
110
|
- Rakefile
|
data/Gemfile.lock
DELETED
@@ -1,53 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
metrojobb (0.3.0)
|
5
|
-
activemodel (~> 5.0)
|
6
|
-
builder (~> 3.2)
|
7
|
-
|
8
|
-
GEM
|
9
|
-
remote: https://rubygems.org/
|
10
|
-
specs:
|
11
|
-
activemodel (5.1.4)
|
12
|
-
activesupport (= 5.1.4)
|
13
|
-
activesupport (5.1.4)
|
14
|
-
concurrent-ruby (~> 1.0, >= 1.0.2)
|
15
|
-
i18n (~> 0.7)
|
16
|
-
minitest (~> 5.1)
|
17
|
-
tzinfo (~> 1.1)
|
18
|
-
builder (3.2.3)
|
19
|
-
byebug (9.1.0)
|
20
|
-
concurrent-ruby (1.0.5)
|
21
|
-
diff-lcs (1.3)
|
22
|
-
i18n (0.8.6)
|
23
|
-
minitest (5.10.3)
|
24
|
-
rake (10.5.0)
|
25
|
-
rspec (3.6.0)
|
26
|
-
rspec-core (~> 3.6.0)
|
27
|
-
rspec-expectations (~> 3.6.0)
|
28
|
-
rspec-mocks (~> 3.6.0)
|
29
|
-
rspec-core (3.6.0)
|
30
|
-
rspec-support (~> 3.6.0)
|
31
|
-
rspec-expectations (3.6.0)
|
32
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
33
|
-
rspec-support (~> 3.6.0)
|
34
|
-
rspec-mocks (3.6.0)
|
35
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
36
|
-
rspec-support (~> 3.6.0)
|
37
|
-
rspec-support (3.6.0)
|
38
|
-
thread_safe (0.3.6)
|
39
|
-
tzinfo (1.2.3)
|
40
|
-
thread_safe (~> 0.1)
|
41
|
-
|
42
|
-
PLATFORMS
|
43
|
-
ruby
|
44
|
-
|
45
|
-
DEPENDENCIES
|
46
|
-
bundler (~> 1.16.a)
|
47
|
-
byebug
|
48
|
-
metrojobb!
|
49
|
-
rake (~> 10.0)
|
50
|
-
rspec (~> 3.0)
|
51
|
-
|
52
|
-
BUNDLED WITH
|
53
|
-
1.16.0.pre.2
|