-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
106 lines (89 loc) · 3.04 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# frozen_string_literal: true
require 'rom/sql/rake_task'
namespace :db do
task :setup do
require_relative './db/connection'
ROM::SQL::RakeSupport.env = Db::Connection.container
end
task :seed do
Rake::Task['pokecord:populate_pokemon'].execute
Rake::Task['pokecord:populate_starters'].execute
Rake::Task['pokecord:populate_galar_pokemon'].execute
Rake::Task['pokecord:populate_rarity'].execute
Rake::Task['pokecord:populate_fight_types'].execute
Rake::Task['pokecord:populate_products'].execute
Rake::Task['pokecord:populate_evolutions'].execute
end
namespace :test do
task :clean do
require 'dotenv'
Dotenv.load('.env.test')
require_relative './db/connection'
ROM::SQL::RakeSupport.env = Db::Connection.container
Rake::Task['db:clean'].execute
end
task :setup do
require 'dotenv'
Dotenv.load('.env.test')
require_relative './db/connection'
ROM::SQL::RakeSupport.env = Db::Connection.container
Rake::Task['db:clean'].execute
Rake::Task['db:migrate'].execute
end
end
end
namespace :dnd do
task :populate_party_roles do
require_relative './lib/taskers/dnd/populate_party_roles'
Taskers::Dnd::PopulatePartyRoles.new.call
end
end
namespace :pokecord do
task :populate_pokemon do
require_relative './lib/taskers/populate_pokemons'
Taskers::PopulatePokemons.new.call
end
task :populate_galar_pokemon do
require_relative './lib/taskers/populate_pokemon_from_csv'
galar_file = File.expand_path('pokemon_info/galar_pokedex.csv', File.dirname(__FILE__))
Taskers::PopulatePokemonFromCsv.new(galar_file).call
end
task :populate_rarity do
require_relative './lib/taskers/populate_rarity'
rarity_file = File.expand_path('pokemon_info/rarity.csv', File.dirname(__FILE__))
Taskers::PopulateRarity.new(rarity_file).call
end
task :populate_catch_numbers do
require_relative './lib/taskers/populate_catch_numbers'
Taskers::PopulateCatchNumbers.new.call
end
task :populate_starters do
require_relative './lib/taskers/populate_starters'
Taskers::PopulateStarters.new.call
end
task :populate_levels do
require_relative './lib/taskers/populate_levels'
Taskers::PopulateLevels.new.call
end
task :populate_required_exp do
require_relative './lib/taskers/populate_required_exp'
Taskers::PopulateRequiredExp.new.call
end
task :populate_fight_types do
require_relative './lib/taskers/populate_fight_types'
Taskers::PopulateFightTypes.new.call
end
task :reset_users_exp_per_step do
require_relative './lib/taskers/reset_users_exp_per_step'
Taskers::ResetUsersExpPerStep.new.call
end
task :populate_products do
require_relative './lib/taskers/populate_products'
Taskers::PopulateProducts.new.call
end
task :populate_evolutions do
require_relative './lib/taskers/populate_evolutions'
evolutions_file = File.expand_path('pokemon_info/evolutions.csv', File.dirname(__FILE__))
Taskers::PopulateEvolutions.new(evolutions_file).call
end
end