employ_me 0.0.5 → 0.0.7

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bf37370d3f7bf02eb6cf13e67c6f5c075c1b1082eab6b068202eb057ab79c34f
4
- data.tar.gz: e7d65db11f7260bc26c5fab9e6e2c00c284ec4336b2934171d4958213c19eebf
3
+ metadata.gz: 4f4b463366d35ea5a9fdb6f25a7998cabd3c541d26e79dbb66f421b24f7b551e
4
+ data.tar.gz: fb7e27cbf418305b7fcad4365315e2c8c442c8b07878e8e7d5dad16523db7c60
5
5
  SHA512:
6
- metadata.gz: 5ef8e85d23a7a12db2abce764bb26851fcf9ed5c8612790cf5ae37e40ddac4583e1fe603b4dfdbc0dd39d90d2f849339dba4c4ea18dcb123cd8383bf11033405
7
- data.tar.gz: 0c1d0fe3a2748649144c75c24d71f5698b028be3bb3f1e35f70527c68af1256408a28698323b7f4663df74dd37033b80b96dc0e9c395f19f46b43efc0e240fe6
6
+ metadata.gz: 7df561e9aa898960323735c0f4f0ddc670f83928f172c2592d220975adb5ce239b592e92313f730c64277d4e676865d9456866ee810a2dcf2a5203755194e91f
7
+ data.tar.gz: 7a941526bece9a6e5d439c228da244a98ba1168b0c317eb45cf83ac1e81cc9cb6c9249ff560609b4a5f4a3328fc2745abccde72610f0075e69ac2f989a5ff0d1
@@ -0,0 +1,79 @@
1
+ module EmployMe
2
+ module Parser
3
+ module Location
4
+ module Strategies
5
+ class PatternMatch
6
+ # Return [state code, city name, state name]
7
+ def self.perform(root_node)
8
+ tree = [root_node]
9
+
10
+ # Depth First Search
11
+ while tree.size > 0
12
+ curr_node = tree.shift
13
+
14
+ if curr_node.children.all? { |child| child.name == "comment" || child.name == 'text' }
15
+ curr_node_text = curr_node.text
16
+
17
+ # Remote Jobs
18
+ regex = Regexp.new('Remote', Regexp::IGNORECASE)
19
+ return ['REMOTE', nil, nil] if regex.match(curr_node_text)
20
+
21
+ regex = Regexp.new('US & Canada Remote', Regexp::IGNORECASE)
22
+ return ['REMOTE', nil, nil] if regex.match(curr_node_text)
23
+
24
+ # San Francisco, CA Jobs
25
+ regex = Regexp.new('San Francisco, CA', Regexp::IGNORECASE)
26
+ return ['CA', 'San Francisco', 'CA'] if regex.match(curr_node_text)
27
+
28
+ # San Mateo, CA Jobs
29
+ regex = Regexp.new('San Mateo, CA', Regexp::IGNORECASE)
30
+ return ['CA', 'San Mateo', 'CA'] if regex.match(curr_node_text)
31
+
32
+ # Boca Raton, FL Jobs
33
+ regex = Regexp.new('Boca Raton, FL', Regexp::IGNORECASE)
34
+ return ['FL', 'Boca Raton', 'FL'] if regex.match(curr_node_text)
35
+
36
+ regex = Regexp.new('Boca Raton, Florida', Regexp::IGNORECASE)
37
+ return ['FL', 'Boca Raton', 'FL'] if regex.match(curr_node_text)
38
+
39
+ regex = Regexp.new('Boca Raton, Florida, United States', Regexp::IGNORECASE)
40
+ return ['FL', 'Boca Raton', 'FL'] if regex.match(curr_node_text)
41
+
42
+ # Raleigh, NC Jobs
43
+ regex = Regexp.new('Raleigh, NC', Regexp::IGNORECASE)
44
+ return ['NC', 'Raleigh', 'NC'] if regex.match(curr_node_text)
45
+
46
+ # New York, NY Jobs
47
+ regex = Regexp.new('New York, NY', Regexp::IGNORECASE)
48
+ return ['NY', 'New York', 'NY'] if regex.match(curr_node_text)
49
+
50
+ regex = Regexp.new('New York, New York', Regexp::IGNORECASE)
51
+ return ['NY', 'New York', 'NY'] if regex.match(curr_node_text)
52
+
53
+ regex = Regexp.new('New York, New York, United States', Regexp::IGNORECASE)
54
+ return ['NY', 'New York', 'NY'] if regex.match(curr_node_text)
55
+
56
+ regex = Regexp.new('New York Office', Regexp::IGNORECASE)
57
+ return ['NY', 'New York', 'NY'] if regex.match(curr_node_text)
58
+
59
+ # Seattle, WA Jobs
60
+ regex = Regexp.new('Seattle, WA', Regexp::IGNORECASE)
61
+ return ['WA', 'Seattle', 'WA'] if regex.match(curr_node_text)
62
+
63
+ regex = Regexp.new('Seattle, Washington', Regexp::IGNORECASE)
64
+ return ['WA', 'Seattle', 'WA'] if regex.match(curr_node_text)
65
+
66
+ regex = Regexp.new('Seattle, Washington, United States', Regexp::IGNORECASE)
67
+ return ['WA', 'Seattle', 'WA'] if regex.match(curr_node_text)
68
+ end
69
+
70
+ tree.concat(curr_node.children)
71
+ end
72
+
73
+ nil
74
+ end
75
+ end
76
+ end
77
+ end
78
+ end
79
+ end
@@ -19,7 +19,7 @@ module EmployMe
19
19
  return 'c_sharp' if regex.match(curr_node_text)
20
20
 
21
21
  # Go
22
- regex = Regexp.new('Go', Regexp::IGNORECASE)
22
+ regex = Regexp.new('Go')
23
23
  return 'go' if regex.match(curr_node_text)
24
24
 
25
25
  # Java
@@ -47,6 +47,13 @@ module EmployMe
47
47
  # Ruby
48
48
  regex = Regexp.new('Ruby', Regexp::IGNORECASE)
49
49
  return 'ruby' if regex.match(curr_node_text)
50
+
51
+ regex = Regexp.new('Ruby on Rails', Regexp::IGNORECASE)
52
+ return 'ruby' if regex.match(curr_node_text)
53
+
54
+ # Swift
55
+ regex = Regexp.new('Swift', Regexp::IGNORECASE)
56
+ return 'swift' if regex.match(curr_node_text)
50
57
  end
51
58
 
52
59
  tree.concat(curr_node.children)
data/lib/employ_me.rb CHANGED
@@ -1,3 +1,4 @@
1
+ require 'employ_me/parser/location/strategies/pattern_match.rb'
1
2
  require 'employ_me/parser/programming_language/strategies/pattern_match.rb'
2
3
  require 'employ_me/parser/salary/strategies/pattern_match.rb'
3
4
  require 'employ_me/parser/title/strategies/pattern_match.rb'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: employ_me
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - dgonzdev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-10-18 00:00:00.000000000 Z
11
+ date: 2025-11-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -31,6 +31,7 @@ extensions: []
31
31
  extra_rdoc_files: []
32
32
  files:
33
33
  - lib/employ_me.rb
34
+ - lib/employ_me/parser/location/strategies/pattern_match.rb
34
35
  - lib/employ_me/parser/programming_language/strategies/pattern_match.rb
35
36
  - lib/employ_me/parser/salary/strategies/pattern_match.rb
36
37
  - lib/employ_me/parser/title/strategies/pattern_match.rb