Module: PuntfileHelper
Constant Summary collapse
- SUPPORTED_PUNTFILES =
["puntfile.yml", "puntfile.yaml", "Puntfile.yml", "Puntfile.yaml", "puntfile", "Puntfile"]
Instance Method Summary collapse
-
#punt_environment(env: nil) ⇒ Object
Pulls the specific environment hash out of the Puntfile.
-
#puntfile ⇒ Object
Returns the puntfile hash for the current program.
Instance Method Details
#punt_environment(env: nil) ⇒ Object
Pulls the specific environment hash out of the Puntfile. If no environment is given, this automatically returns the default environment.
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/punt/helper/puntfile_helper.rb', line 15 def punt_environment(env: nil) env = puntfile.first.first unless env environment = puntfile[env] if env if (!environment) raise "No environment #{env} was found in the puntfile" end return environment end |
#puntfile ⇒ Object
Returns the puntfile hash for the current program. This will scan the various supported Puntfile file formats and attempt to load the first one it finds.
7 8 9 10 11 |
# File 'lib/punt/helper/puntfile_helper.rb', line 7 def puntfile load_puntfile return @@puntfile end |