Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
veNJOB
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thanh Hung Pham
veNJOB
Commits
478d6a95
Commit
478d6a95
authored
Jul 04, 2017
by
Thanh Hung Pham
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Config autoload
parent
9604a13f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
3 deletions
+4
-3
config/application.rb
+2
-0
lib/crawler/careerbuilder.rb
+1
-1
lib/tasks/crawler.rake
+1
-2
No files found.
config/application.rb
View file @
478d6a95
...
...
@@ -14,5 +14,7 @@ module VeNJOB
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
config
.
autoload_paths
+=
%W[
#{
config
.
root
}
/lib]
config
.
eager_load_paths
+=
%W[
#{
config
.
root
}
/lib]
end
end
lib/
tasks
/careerbuilder.rb
→
lib/
crawler
/careerbuilder.rb
View file @
478d6a95
...
...
@@ -3,7 +3,7 @@ require 'open-uri'
require
'nokogiri'
require
'logger'
class
Careerbuilder
class
C
rawler
::
C
areerbuilder
attr_reader
:domain
,
:thread_count
,
:logger
def
initialize
(
domain
,
thread_count
=
1
)
...
...
lib/tasks/crawler.rake
View file @
478d6a95
namespace
:crawler
do
desc
'client crawler'
task
load: :environment
do
require
"
#{
Rails
.
root
}
/lib/tasks/careerbuilder"
thread_count
=
ENV
[
'THREAD_COUNT'
]
||
1
Careerbuilder
.
new
(
'http://careerbuilder.vn'
,
thread_count
.
to_i
).
crawl
C
rawler
::
C
areerbuilder
.
new
(
'http://careerbuilder.vn'
,
thread_count
.
to_i
).
crawl
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment