Module: SchwabRb::PathSupport
- Defined in:
- lib/schwab_rb/path_support.rb
Overview
Common path expansion and directory helpers for token and data files.
Class Method Summary collapse
Class Method Details
.ensure_parent_directory(path) ⇒ Object
16 17 18 19 |
# File 'lib/schwab_rb/path_support.rb', line 16 def ensure_parent_directory(path) directory = File.dirname((path)) FileUtils.mkdir_p(directory) end |
.expand_path(path) ⇒ Object
10 11 12 13 14 |
# File 'lib/schwab_rb/path_support.rb', line 10 def (path) raise ArgumentError, "token_path is nil or empty" if path.nil? || path.to_s.strip.empty? File.(path.to_s) end |