webscraper_framework 0.1.709 → 0.1.710
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 +4 -4
- data/lib/webscraper_framework/application.rb +19 -0
- data/lib/webscraper_framework/cli.rb +9 -3
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7669121cd74e34bea4cc70e6da7dae0c7c16b386
|
4
|
+
data.tar.gz: ed1affd44387ac0c6f563822fff85ae7e5f9553a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 827ab5f381e2244c136b1ece0a7ea2bbce90433f217c25e28d5f3b27a12c7b7fd11446041bbc13151bebe41ff24fe3f61dc97adf2ee49914f41cb549eb740e7e
|
7
|
+
data.tar.gz: bdae0cf08fdd7c058f55224ceb851f123e91772bfe0e852791eb68ec461623bdca720002c1c1020055d3f8992256bedf402b1452eb3f112a29f624fb11f3ef00
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
module WebscraperFrameworks
|
3
|
+
class Application
|
4
|
+
def initialize
|
5
|
+
|
6
|
+
model_files = Dir["./models/*"]
|
7
|
+
helper_files = Dir["./helpers/*"]
|
8
|
+
scraper_files = Dir["./scrapers/*"]
|
9
|
+
|
10
|
+
|
11
|
+
puts "-"
|
12
|
+
puts Dir["./"]
|
13
|
+
puts model_files
|
14
|
+
puts helper_files
|
15
|
+
puts scraper_files
|
16
|
+
puts "-"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -5,13 +5,14 @@ module WebscraperFramework
|
|
5
5
|
class CLI
|
6
6
|
|
7
7
|
def initialize(arguments)
|
8
|
-
|
9
8
|
@action = arguments[0]
|
10
9
|
end
|
11
10
|
|
12
11
|
def start
|
13
12
|
if @action == "new"
|
14
13
|
create_project
|
14
|
+
elsif @action == "server"
|
15
|
+
start_server
|
15
16
|
else
|
16
17
|
puts "Invalid command, exiting".red.on_white.bold
|
17
18
|
puts "The only valid command is 'new'".green.on_white.bold
|
@@ -19,6 +20,10 @@ module WebscraperFramework
|
|
19
20
|
goodbye
|
20
21
|
end
|
21
22
|
|
23
|
+
def start_server
|
24
|
+
WebscraperFramework::Application.new
|
25
|
+
end
|
26
|
+
|
22
27
|
def create_project
|
23
28
|
puts "Hello! Which travel inspiration will you like to explore for your next trip?".green.bold
|
24
29
|
puts "This is a work in progress... nothing works.".blue.bold
|
@@ -34,10 +39,11 @@ module WebscraperFramework
|
|
34
39
|
end
|
35
40
|
end
|
36
41
|
|
37
|
-
|
42
|
+
|
43
|
+
`mkdir #{project_name}`
|
38
44
|
if File.directory?("./#{project_name}")
|
39
45
|
puts "#{"[Success]".green.bold} created directory!\t ./#{project_name}/"
|
40
|
-
|
46
|
+
`mkdir #{project_name}/config`
|
41
47
|
puts "#{"[Success]".green.bold} created directory!\t ./#{project_name}/config"
|
42
48
|
|
43
49
|
else
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webscraper_framework
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.710
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rene van Pelt
|
@@ -62,6 +62,7 @@ files:
|
|
62
62
|
- Gemfile
|
63
63
|
- bin/wsfr
|
64
64
|
- lib/webscraper_framework.rb
|
65
|
+
- lib/webscraper_framework/application.rb
|
65
66
|
- lib/webscraper_framework/base.rb
|
66
67
|
- lib/webscraper_framework/base_model.rb
|
67
68
|
- lib/webscraper_framework/cli.rb
|