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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d11a14ba6fa18ac44914bc2051936cf92d98fad3
4
- data.tar.gz: a6f5c124956818f7d2038d4fb9e77fca540e7266
3
+ metadata.gz: 155375f4017eb0969ae05c2480d7355830d30399
4
+ data.tar.gz: 8baaa5efdf1bb22879413422d3e6e9c31544a736
5
5
  SHA512:
6
- metadata.gz: cd7766fa1aa678994b79cb9e23b6238072b4e7cd32b73fba1cef73c8f25880014ebb76be7ba0d9799e5cffe68864b70c01463ab3d1fadd27c59e80d65e8814a6
7
- data.tar.gz: a2afa97441ba71e7e78d6f6e7b6ecf49b55cc72f1e66791eb9327f7736ffe5fd38913dce02f57d942d0778e0a559ab9f4776b5fad0d87149b6435c6c0abfdf24
6
+ metadata.gz: d738a979ea8d21146c8dbe7222b403a104103266ed3df3cfc0212e1ca89f3308507274cb8349815208f9a2f217c27ea598a40f97d5be84e0bf609ac37c23caba
7
+ data.tar.gz: c4f51535e91b4e881f7dc0e0e8f8cecb24d883853611bfa70b5b51766b0759375a0a64b3b42292211ff7a8f41eca782fb2040a87884b7f7a5a4c0f02d56257d4
data/.gitignore CHANGED
@@ -11,3 +11,5 @@
11
11
  .rspec_status
12
12
 
13
13
  .byebug_history
14
+
15
+ Gemfile.lock
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
- external_application: nil,
56
- heading: nil,
57
- job_title: nil,
58
- summary: nil,
59
- description: nil,
60
- employer: nil,
61
- employer_home_page: nil,
62
- opportunities: nil,
63
- from_date: nil,
64
- to_date: nil,
65
- external_logo_url: nil,
66
- application_url: nil,
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'),
@@ -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
@@ -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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Metrojobb
2
- VERSION = '0.4.0'
2
+ VERSION = '0.5.1'
3
3
  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.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-19 00:00:00.000000000 Z
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
@@ -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