datahen 1.2.2 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/datahen/scraper/ruby_parser_executor.rb +32 -16
- data/lib/datahen/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86d8da3818045a267671b3b30465157d906fab7e2b078dd0e7e5b41a2d55f379
|
4
|
+
data.tar.gz: f61c35112e1678e7d09aafbe0faf1f9b8d8493ee026363a8904a6f22b4fd9f4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81a8e60ad534a7ad33adb03f7519579e59ebbcc4f7230a597763225a1c0c1f54a625ee9f84b1f23b4f6d9ef5df378c36107f4d5a340ab1a24830fc1e1be1b9f9
|
7
|
+
data.tar.gz: b83b9b59a403df0b6a2db1d05e7e3d7320f35945aa0bd70e88abe5d568a637865352bf8943d2873ccbc91878307b89efac8ed1c2d3f0a8be8f05370840f27c6c
|
@@ -108,16 +108,32 @@ module Datahen
|
|
108
108
|
end
|
109
109
|
end
|
110
110
|
|
111
|
+
def update_parsing_status page_gid, status
|
112
|
+
return unless save
|
113
|
+
|
114
|
+
response = parsing_update(
|
115
|
+
job_id: job_id,
|
116
|
+
gid: page_gid,
|
117
|
+
parsing_status: status)
|
118
|
+
|
119
|
+
if response.code == 200
|
120
|
+
puts "Page #{page_gid} status changed to #{status}."
|
121
|
+
else
|
122
|
+
puts "Error: Unable to change page #{page_gid} status: #{response.body} to #{status}"
|
123
|
+
raise "Unable to change page #{page_gid} status: #{response.body} to #{status}"
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
111
127
|
def save_type
|
112
128
|
:parsing
|
113
129
|
end
|
114
130
|
|
115
|
-
def refetch_page
|
131
|
+
def refetch_page page_gid
|
116
132
|
if save
|
117
|
-
|
118
|
-
puts "Refetch page #{
|
133
|
+
update_parsing_status page_gid, :to_refetch
|
134
|
+
puts "Refetch page #{page_gid}"
|
119
135
|
else
|
120
|
-
puts "Would have refetch page #{
|
136
|
+
puts "Would have refetch page #{page_gid}"
|
121
137
|
end
|
122
138
|
end
|
123
139
|
|
@@ -130,12 +146,12 @@ module Datahen
|
|
130
146
|
refetch_page page_gid
|
131
147
|
end
|
132
148
|
|
133
|
-
def reparse_page
|
149
|
+
def reparse_page page_gid
|
134
150
|
if save
|
135
|
-
|
136
|
-
puts "Reparse page #{
|
151
|
+
update_parsing_status page_gid, :to_reparse
|
152
|
+
puts "Reparse page #{page_gid}"
|
137
153
|
else
|
138
|
-
puts "Would have reparse page #{
|
154
|
+
puts "Would have reparse page #{page_gid}"
|
139
155
|
end
|
140
156
|
end
|
141
157
|
|
@@ -148,12 +164,12 @@ module Datahen
|
|
148
164
|
reparse_page page_gid
|
149
165
|
end
|
150
166
|
|
151
|
-
def limbo_page
|
167
|
+
def limbo_page page_gid
|
152
168
|
if save
|
153
|
-
|
154
|
-
puts "Limbo page #{
|
169
|
+
update_parsing_status page_gid, :limbo
|
170
|
+
puts "Limbo page #{page_gid}"
|
155
171
|
else
|
156
|
-
puts "Would have limbo page #{
|
172
|
+
puts "Would have limbo page #{page_gid}"
|
157
173
|
end
|
158
174
|
end
|
159
175
|
|
@@ -204,13 +220,13 @@ module Datahen
|
|
204
220
|
end
|
205
221
|
|
206
222
|
if refetch_self
|
207
|
-
|
223
|
+
update_parsing_status gid, :to_refetch
|
208
224
|
elsif reparse_self
|
209
|
-
|
225
|
+
update_parsing_status gid, :to_reparse
|
210
226
|
elsif limbo_self
|
211
|
-
|
227
|
+
update_parsing_status gid, :limbo
|
212
228
|
else
|
213
|
-
|
229
|
+
update_parsing_status gid, :done
|
214
230
|
end
|
215
231
|
end
|
216
232
|
proc.call
|
data/lib/datahen/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: datahen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Parama Danoesubroto
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-02-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -278,7 +278,7 @@ metadata:
|
|
278
278
|
allowed_push_host: https://rubygems.org
|
279
279
|
homepage_uri: https://datahen.com
|
280
280
|
source_code_uri: https://github.com/DataHenOfficial/datahen-ruby
|
281
|
-
post_install_message:
|
281
|
+
post_install_message:
|
282
282
|
rdoc_options: []
|
283
283
|
require_paths:
|
284
284
|
- lib
|
@@ -293,8 +293,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
293
293
|
- !ruby/object:Gem::Version
|
294
294
|
version: '0'
|
295
295
|
requirements: []
|
296
|
-
rubygems_version: 3.
|
297
|
-
signing_key:
|
296
|
+
rubygems_version: 3.2.3
|
297
|
+
signing_key:
|
298
298
|
specification_version: 4
|
299
299
|
summary: DataHen toolbelt for developers
|
300
300
|
test_files: []
|