Module: IssueScheduler
- Defined in:
- lib/issue_scheduler.rb,
lib/issue_scheduler/config.rb,
lib/issue_scheduler/version.rb,
lib/issue_scheduler/issue_template.rb
Overview
A module to encapsulate the Issue Scheduler functionality
Defined Under Namespace
Classes: Config, IssueTemplate
Constant Summary collapse
- VERSION =
The version of the Issue Scheduler gem
'0.1.1'
Class Method Summary collapse
-
.lib_dir ⇒ String
Return the directory where the Issue Scheduler code is located.
-
.load_yaml(file_name) ⇒ Hash
Reads the contents of the given YAML file.
-
.parse_yaml(yaml_string) ⇒ Hash
Parses the given YAML string.
Class Method Details
.lib_dir ⇒ String
Return the directory where the Issue Scheduler code is located
18 19 20 |
# File 'lib/issue_scheduler.rb', line 18 def self.lib_dir File.join(__dir__, 'issue_scheduler') end |
.load_yaml(file_name) ⇒ Hash
Reads the contents of the given YAML file
64 65 66 67 68 69 |
# File 'lib/issue_scheduler.rb', line 64 def self.load_yaml(file_name) yaml_string = File.read(file_name) parse_yaml(yaml_string) rescue Errno::ENOENT => e raise "Error reading YAML file: #{e.}" end |
.parse_yaml(yaml_string) ⇒ Hash
Parses the given YAML string
37 38 39 40 41 42 43 44 |
# File 'lib/issue_scheduler.rb', line 37 def self.parse_yaml(yaml_string) = { permitted_classes: [Symbol, Date], aliases: true, symbolize_names: true } YAML.safe_load(yaml_string, **).tap do |yaml| raise 'YAML is not an object' unless yaml.is_a?(Hash) end rescue Psych::SyntaxError => e raise "YAML is not valid: #{e.}" end |