jekyll-autoscout24 0.1.3 → 0.1.4

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
- SHA256:
3
- metadata.gz: 0f192fe5bf9facae693314e9460043a0b2c0ba169953dee6256a0b8956ac7032
4
- data.tar.gz: 24716be55f60bc02c8bc118fb6ca0f2b248a64b9ad724c2a56733870cb8f0cc1
2
+ SHA1:
3
+ metadata.gz: e02d7701b035b6fa2cb2f7a2564d487aa3fd54f1
4
+ data.tar.gz: 0c8ce16e97b931d7026d7765992d2b64ebef3489
5
5
  SHA512:
6
- metadata.gz: f96e84b703e09a48f61dc75d26c9d3550617b430759bf1bc2ab0e0491fa71061c48f315340c7c71b66ef6331ffd3c4c2e0ea9516f3dba8674827b063059733c6
7
- data.tar.gz: a8c7ff299b6e54babf73d123dc8eaacbe050de4cf9a010c124ddc34857308a80c7b5b100a23a20054c9ee0e4662f31bc6043ce63710ac6b1d28e7ae282bb82ab
6
+ metadata.gz: 7e7090122b798fa433c3fa4e1da37e334f0b7361f3543ebef01a4c0e7be1e62c41baea02c590d3a296a4cf60997430a78fe12b4780c8d75aed31c82046e9c2b4
7
+ data.tar.gz: 61005d4eb3703067c803225bf9f2b90fff202d258ad26dfbe653540e85b2fa83f8d3d3db77cdee95a6d9e70b7acd9ad67367cbbfd1dce38d8be2fb17dafe3f96
@@ -13,11 +13,11 @@ module Jekyll
13
13
  # Load XML data from the backup file
14
14
  backup = Ox.load_file("#{dir}/autoscout24.xml")
15
15
  # Locate all vehicle nodes in the backup document
16
- vehicles, nodes = [], backup.locate("stx3/vehicle_data/vehicles/vehicle")
16
+ vehicles, nodes = [], backup.locate('stx3/vehicle_data/vehicles/vehicle')
17
17
  # Transform each node found into an instance of Entry drop
18
18
  nodes.each { |n| vehicles << Entry.new(n) }
19
19
  # Merge current site data with the list of vehicles from the backup
20
- @site.data.merge!("autoscout24" => vehicles) unless vehicles.empty?
20
+ @site.data.merge!('autoscout24' => vehicles) unless vehicles.empty?
21
21
  end
22
22
  end
23
23
 
@@ -40,10 +40,29 @@ module Jekyll
40
40
  found = @node.locate(name).first
41
41
  # no match or empty node, therefore nil
42
42
  return nil if found.nil? || found.nodes.empty?
43
+ # could be an array
44
+ return Prices.new(found) if name == 'prices'
43
45
  # either text or recurse
44
46
  found.text === nil ? Entry.new(found) : found.text
45
47
  end
46
48
  end
49
+
50
+ class Prices < Liquid::Drop
51
+ include Enumerable
52
+
53
+ attr_reader :node
54
+
55
+ # ctor
56
+ def initialize(node)
57
+ @node = node
58
+ end
59
+
60
+ def each
61
+ @node.locate('price').each do |n|
62
+ yield Entry.new(n)
63
+ end
64
+ end
65
+ end
47
66
  end
48
67
  end
49
68
 
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module Autoscout24
3
- VERSION = "0.1.3"
3
+ VERSION = "0.1.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-autoscout24
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Enrico Caputo
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2018-03-25 00:00:00.000000000 Z
12
+ date: 2018-03-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ox
@@ -43,16 +43,16 @@ dependencies:
43
43
  name: jekyll
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - "~>"
46
+ - - ~>
47
47
  - !ruby/object:Gem::Version
48
- version: 3.6.2
48
+ version: '3.1'
49
49
  type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - "~>"
53
+ - - ~>
54
54
  - !ruby/object:Gem::Version
55
- version: 3.6.2
55
+ version: '3.1'
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: bundler
58
58
  requirement: !ruby/object:Gem::Requirement
@@ -85,14 +85,14 @@ dependencies:
85
85
  name: minitest
86
86
  requirement: !ruby/object:Gem::Requirement
87
87
  requirements:
88
- - - "~>"
88
+ - - ~>
89
89
  - !ruby/object:Gem::Version
90
90
  version: 5.11.3
91
91
  type: :development
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
- - - "~>"
95
+ - - ~>
96
96
  - !ruby/object:Gem::Version
97
97
  version: 5.11.3
98
98
  - !ruby/object:Gem::Dependency
@@ -117,8 +117,8 @@ executables: []
117
117
  extensions: []
118
118
  extra_rdoc_files: []
119
119
  files:
120
- - ".gitignore"
121
- - ".travis.yml"
120
+ - .gitignore
121
+ - .travis.yml
122
122
  - CODE_OF_CONDUCT.md
123
123
  - Gemfile
124
124
  - LICENSE.txt
@@ -142,17 +142,17 @@ require_paths:
142
142
  - lib
143
143
  required_ruby_version: !ruby/object:Gem::Requirement
144
144
  requirements:
145
- - - ">="
145
+ - - '>='
146
146
  - !ruby/object:Gem::Version
147
147
  version: '0'
148
148
  required_rubygems_version: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - ">="
150
+ - - '>='
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
153
  requirements: []
154
154
  rubyforge_project:
155
- rubygems_version: 2.7.4
155
+ rubygems_version: 2.5.2
156
156
  signing_key:
157
157
  specification_version: 4
158
158
  summary: Jekyll plugin to integrate with AutoScout24