Created
September 7, 2016 15:44
-
-
Save staticnull/eb06fdae3e6a96c5fbbc56b38a44071c to your computer and use it in GitHub Desktop.
Env.groovy
This file contains 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
import grails.util.* | |
class Env { | |
static String getEnvironmentName() { Environment.getCurrent().getName() } | |
static boolean isDevelopment() { GrailsUtil.isDevelopmentEnv() } | |
static boolean isDevelopmentOrTest() { isDevelopment() || isTest() } | |
static boolean isNotDevelopmentOrTest() { !isDevelopmentOrTest() } | |
static boolean isTest() { Environment.current == Environment.TEST } | |
static boolean isProduction() { Environment.current == Environment.PRODUCTION } | |
static boolean isNotProduction() { !isProduction() } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment