scribe/config/env.cr
Edward Loveall 9e96f29852
Add basic response (except images)
The basic idea here is to fetch the post with the medium API, parse the
JSON into types, and then re-display the content. We also have to fetch
each media object as a REST call to get things like embeded iframes.
2021-05-01 17:39:05 -04:00

24 lines
498 B
Crystal

module Lucky::Env
extend self
{% for env in [:development, :test, :production] %}
def {{ env.id }}?
name == {{ env.id.stringify }}
end
{% end %}
def name
ENV["LUCKY_ENV"]? || "development"
end
# Returns true if a task is being run through the `lucky` cli
#
# Use this method to only run (or avoid running) code when a task is executed.
def task?
ENV["LUCKY_TASK"]? == "true"
end
def use_local?
ENV.fetch("USE_LOCAL", "false") == "true"
end
end