Module: RailsMermaidErd
- Defined in:
- lib/rails-mermaid_erd.rb,
lib/rails-mermaid_erd/railtie.rb,
lib/rails-mermaid_erd/version.rb
Defined Under Namespace
Classes: Builder, Configuration, Railtie
Constant Summary collapse
- VERSION =
"0.7.0"
Class Method Summary collapse
- .configuration ⇒ Object
-
.read_gem_asset(relative_path) ⇒ Object
File.read with a domain-specific error when the bundled asset is missing, which usually means a broken gem install (e.g. lib/templates/vendor/ got pruned).
Class Method Details
.configuration ⇒ Object
13 14 15 |
# File 'lib/rails-mermaid_erd.rb', line 13 def configuration @configuration ||= Configuration.new end |
.read_gem_asset(relative_path) ⇒ Object
File.read with a domain-specific error when the bundled asset is missing, which usually means a broken gem install (e.g. lib/templates/vendor/ got pruned). The default Errno::ENOENT just points at this file and is hard to act on.
21 22 23 24 25 26 27 28 |
# File 'lib/rails-mermaid_erd.rb', line 21 def read_gem_asset(relative_path) path = File.(relative_path, __dir__) File.read(path) rescue Errno::ENOENT raise "rails-mermaid_erd: bundled asset missing at #{path}. " \ "The gem appears to be incompletely installed; " \ "try `gem pristine rails-mermaid_erd` or reinstall the gem." end |