wdw_sources 0.1.2 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af4dce345954fdfb0f519f8d08adeb8957f212da046d18dc79f1c61a7fa13cbc
|
4
|
+
data.tar.gz: 44f993ac032e04b56e94b3c02b86eee1287dbcdede3bee00e427bee95f7d5d89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d0f9b3cb1ebcb9782f0c73567aab72831b8538e59f2d5709803bb99e845c98bbfea3c222b0121e2cd568a4e86b3945e73a2ac2603a0179b3a8f3b568a7125d5
|
7
|
+
data.tar.gz: 1e4883a7606721a759274d39c3ebaaaa7d548abf08ea729c95250fe7367b440d84464d61d3b8b5cdad796cc8832178ade44bce9aeae9a76fa9bd785bcd622690
|
@@ -10,23 +10,33 @@ module WdwSources
|
|
10
10
|
|
11
11
|
tp_list = Touringplans.list_all(interest)
|
12
12
|
tp_list.each do |tp_list_item|
|
13
|
-
|
13
|
+
tp_list_item_venue_permalink = tp_list_item.venue_permalink
|
14
|
+
tp_list_item_permalink = tp_list_item.permalink
|
15
|
+
|
16
|
+
_cache_tp_place(tp_list_item_venue_permalink, tp_list_item_permalink, interest)
|
14
17
|
end
|
15
18
|
end
|
16
19
|
|
17
|
-
def self._cache_tp_place(
|
18
|
-
|
20
|
+
def self._cache_tp_place(tp_list_item_venue_permalink, tp_list_item_permalink, interest)
|
21
|
+
return "Missing tp_list_item_venue_permalink" if tp_list_item_venue_permalink.to_s.length < 3
|
22
|
+
return "Missing tp_list_item_permalink" if tp_list_item_permalink.to_s.length < 3
|
23
|
+
return "Missing interest" if interest.to_s.length < 3
|
19
24
|
|
20
|
-
cache_resources = {attractions
|
21
|
-
dining
|
22
|
-
hotels
|
25
|
+
cache_resources = {"attractions" => WdwSources::TouringplansAttraction,
|
26
|
+
"dining" => WdwSources::TouringplansDiningVenue,
|
27
|
+
"hotels" => WdwSources::TouringplansHotel
|
23
28
|
}
|
24
29
|
|
25
30
|
cache_resource = cache_resources[interest]
|
26
|
-
cache_item = cache_resource.find_or_create_by(permalink:
|
31
|
+
cache_item = cache_resource.find_or_create_by(permalink: tp_list_item_permalink)
|
32
|
+
|
33
|
+
tp_item_full_record = Touringplans.show(tp_list_item_venue_permalink,interest, tp_list_item_permalink)
|
27
34
|
|
28
|
-
|
29
|
-
|
35
|
+
vp = {venue_permalink: tp_list_item_venue_permalink}
|
36
|
+
full_record_hash = vp.merge(tp_item_full_record.to_h)
|
37
|
+
cache_item.update!(full_record_hash)
|
38
|
+
# tp_item_full_record.to_h
|
39
|
+
cache_item
|
30
40
|
end
|
31
41
|
|
32
42
|
# def self.cache_all_hotels
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#
|
2
|
+
#
|
3
|
+
# frozen_string_literal: true
|
4
|
+
|
5
|
+
require 'rails/generators/base'
|
6
|
+
|
7
|
+
module WdwSources
|
8
|
+
module Generators
|
9
|
+
class InstallGenerator < Rails::Generators::Base
|
10
|
+
def install
|
11
|
+
run "bundle install"
|
12
|
+
rake "wdw_sources:install:migrations"
|
13
|
+
rake "db:migrate"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/lib/wdw_sources/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wdw_sources
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- captproton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -113,7 +113,7 @@ files:
|
|
113
113
|
- db/migrate/20211024225255_create_wdw_sources_touringplans_dining_venues.rb
|
114
114
|
- db/migrate/20211024225412_create_wdw_sources_touringplans_attractions.rb
|
115
115
|
- db/migrate/20211024225455_create_wdw_sources_touringplans_hotels.rb
|
116
|
-
- lib/generators/wdw_sources/install_generator.rb
|
116
|
+
- lib/generators/wdw_sources/install/install_generator.rb
|
117
117
|
- lib/tasks/wdw_sources_tasks.rake
|
118
118
|
- lib/wdw_sources.rb
|
119
119
|
- lib/wdw_sources/engine.rb
|