Sha256: ef26619e9a16f05aa7a04faf3941f4480684c872ad97dd238d49352e28f6c9e0
Contents?: true
Size: 1.81 KB
Versions: 2
Compression:
Stored size: 1.81 KB
Contents
# frozen_string_literal: true module Conductor module Env def self.env @env ||= if ENV['CONDUCTOR_TEST'] == 'true' load_test_env else @env ||= { home: ENV['HOME'], css_path: ENV['MARKED_CSS_PATH'], ext: ENV['MARKED_EXT'], includes: ENV['MARKED_INCLUDES'], origin: ENV['MARKED_ORIGIN'], filepath: ENV['MARKED_PATH'], phase: ENV['MARKED_PHASE'], outline: ENV['OUTLINE'], path: ENV['PATH'] } end @env end def self.load_test_env @env = { home: '/Users/ttscoff', css_path: '/Applications/Marked 2.app/Contents/Resources/swiss.css', ext: 'md', includes: [], origin: '/Users/ttscoff/Library/Mobile Documents/9CR7T2DMDG~com~ngocluu~onewriter/Documents/nvALT2.2/', filepath: '/Users/ttscoff/Library/Mobile Documents/9CR7T2DMDG~com~ngocluu~onewriter/Documents/nvALT2.2/bt.com App Review- AeroPress timer for iPhone.md', phase: 'PREPROCESS', outline: 'NONE', path: '/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/ttscoff/Library/Mobile Documents/9CR7T2DMDG~com~ngocluu~onewriter/Documents/nvALT2.2' } end def self.to_s out_h = { 'HOME' => @env[:home], 'MARKED_CSS_PATH' => @env[:css_path], 'MARKED_EXT' => @env[:ext], 'MARKED_ORIGIN' => @env[:origin], 'MARKED_INCLUDES' => @env[:includes], 'MARKED_PATH' => @env[:filepath], 'MARKED_PHASE' => @env[:phase], 'OUTLINE' => @env[:outline], 'PATH'=> @env[:path] } out_h.map { |k, v| %(#{k}="#{v}") }.join(' ') end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
marked-conductor-1.0.1 | lib/conductor/env.rb |
marked-conductor-1.0.0 | lib/conductor/env.rb |