This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ be() { if [ -f .env ]; then env $(<.env grep -v "^#") bundle exec "$@"; else bundle exec "$@"; fi; } | |
$ echo HELLO=WORLD > .env | |
$ echo "# a comment" >> .env | |
$ be ruby -e 'puts ENV["HELLO"]' | |
WORLD |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[3, "end"], | |
[3, "end"], | |
[3, "end"], | |
[3, "end"], | |
[5, " end"], | |
[5, " end"], | |
[5, " end"], | |
[5, " end"], | |
[5, " end"], | |
[5, " end"], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@class_generator = ->(name, attrs) { | |
file = "tmp/meta_classes/#{name.underscore}.rb" | |
FileUtils.mkdir_p(File.dirname(file)) | |
template = File.write(file, ERB.new(<<TEMP, nil, "%").result(binding)) | |
class <%= name %> | |
attr_accessor <%= attrs.map(&:inspect).join(', ') %> | |
def initialize(<%= attrs.join(", ") %>) | |
% attrs.each do |attr| | |
@<%= attr %> = <%= attr %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'active_support/core_ext/string' | |
module Logger | |
class Null | |
def initialize | |
@blob = {} | |
end | |
def unknown(*); end | |
def fatal(*); end |
OlderNewer