The following is the configuration setup for
- Rails 8
- Kamal 2
- VPS Ubuntu 24.04 LTS
- PostgreSQL
- Redis
- SSL
| require 'hexapdf' | |
| class ShowTextProcessor < HexaPDF::Content::Processor | |
| def initialize(page) | |
| super() | |
| @canvas = page.canvas(type: :overlay) | |
| end | |
| def show_text(str) |
| date = ARGV[0] | |
| class Date | |
| def self.valid?(date) | |
| y, m, d = date.split '-' | |
| date.match(/^\d{4}-\d{2}-\d{2}$/) && Date.valid_date?(y.to_i, m.to_i, d.to_i) | |
| end | |
| end | |
| class Array | |
| def flattener | |
| arr = [] | |
| self.each do |x| | |
| if x.is_a? Array | |
| arr = arr + x.flattener | |
| else | |
| arr << x | |
| end |
| class Plateau | |
| attr_accessor :max_x, :max_y, :direction | |
| def initialize(x, y, direction = :n) | |
| @max_x = x.to_i | |
| @max_y = y.to_i | |
| @direction = direction.downcase.to_sym | |
| end | |
| end |
| class Plateau | |
| attr_accessor :max_x, :max_y, :direction | |
| def initialize(x, y, direction = :n) | |
| @max_x = x.to_i | |
| @max_y = y.to_i | |
| @direction = direction.downcase.to_sym | |
| end | |
| def land(position) |