jobparser 0.13.5 → 0.13.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -69,7 +69,7 @@ module JobParser
69
69
  field :location, :type => String
70
70
  field :deadline, :type => String
71
71
  field :job_postcode, :type => String
72
- field :schema, :type => Boolean, : default => false
72
+ field :schema, :type => Boolean, :default => false
73
73
 
74
74
  end
75
75
 
@@ -2,8 +2,7 @@ module JobParser
2
2
  module Facets
3
3
  class Postcode < Facet
4
4
  def parse
5
- postcode_regex = /([A-PR-UWYZ0-9][A-HK-Y0-9][AEHMNPRTVXY0-9]?[ABEHMNPRVWXY0-9]?\s?[0-9][ABD-HJLN-UW-Z]{2}|GIR 0AA)/
6
- postcode_regex.match(@plain_text.gsub("\n", " ")) { |m|
5
+ POSTCODE_REGEX.match(@plain_text.gsub("\n", " ")) { |m|
7
6
  return m[0]
8
7
  }
9
8
  end
@@ -82,7 +82,7 @@ module JobParser
82
82
  end
83
83
 
84
84
  def job_postcode
85
- get_content_at_prop("postalCode")
85
+ POSTCODE_REGEX.match(job_location) { |m| return m[0] }
86
86
  end
87
87
 
88
88
  def deadline
@@ -12,6 +12,7 @@ module JobParser
12
12
  LOCATION_REGEX = /(?:location: )([\D]*)$/i
13
13
  SALARY_GROUP_REGEX = /£([\d,]*)(?:.+)£([\d,]*)/
14
14
  CLEAN_SALARY_REGEX = /,|\s/
15
+ POSTCODE_REGEX = /([A-PR-UWYZ0-9][A-HK-Y0-9][AEHMNPRTVXY0-9]?[ABEHMNPRVWXY0-9]?\s?[0-9][ABD-HJLN-UW-Z]{2}|GIR 0AA)/
15
16
 
16
17
  # words commonly used in job listings - not sure if this is a good way to go but I think it's worth a go
17
18
  # could scope this regex just to headers
@@ -1,3 +1,3 @@
1
1
  module JobParser
2
- VERSION = "0.13.5"
2
+ VERSION = "0.13.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jobparser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.5
4
+ version: 0.13.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: