Skip to content

Commit

Permalink
Update compositor.json via compositor.io
Browse files Browse the repository at this point in the history
  • Loading branch information
cdimascio committed Mar 18, 2018
1 parent f46a097 commit 91ebabf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compositor.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"metadata": {
"source": "github.readme"
},
"html": "\n<p><img src=\"https://travis-ci.org/cdimascio/java-dotenv.svg?branch=master\"> <img src=\"https://img.shields.io/badge/status-stable-green.svg\"> <img src=\"https://img.shields.io/badge/coverage-94%25-blue.svg\"> <img src=\"https://img.shields.io/badge/license-Apache%202.0-blue.svg\"></p>\n<p><img src=\"https://raw.githubusercontent.com/cdimascio/java-dotenv/master/assets/java-dotenv.png\"> </p>\n<p>A zero-dependency Java port of the Ruby dotenv project (which loads environment variables from a <code>.env</code> file). java-dotenv also offers a <a href=\"#kotlin-dsl\">Kotlin DSL</a>.</p>\n<p>From the original Library:</p>\n<blockquote>\n<p>Storing configuration in the environment is one of the tenets of a <a href=\"http://12factor.net/config\">twelve-factor</a> app. Anything that is likely to change between deployment environments&#x2013;such as resource handles for databases or credentials for external services&#x2013;should be extracted from the code into environment variables.</p>\n<p>But it is not always practical to set environment variables on development machines or continuous integration servers where multiple projects are run. Dotenv load variables from a .env file into ENV when the environment is bootstrapped.</p>\n</blockquote>\n<p>Environment variables listed in the host environment override those in <code>.env</code>. </p>\n<p>Use <code>dotenv.get(&quot;...&quot;)</code> instead of Java&apos;s <code>System.getenv(...)</code>. </p>\n<h2>Install</h2>\n<h3>Maven</h3>\n<pre><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">dependency</span>&gt;</span>\n <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">groupId</span>&gt;</span>io.github.cdimascio<span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">groupId</span>&gt;</span>\n <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">artifactId</span>&gt;</span>java-dotenv<span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">artifactId</span>&gt;</span>\n <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">version</span>&gt;</span>3.0.1<span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">version</span>&gt;</span>\n<span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">dependency</span>&gt;</span></pre><h3>Gradle</h3>\n<pre>compile <span class=\"hljs-string\">&apos;io.github.cdimascio:java-dotenv:3.0.1&apos;</span></pre><h2>Usage</h2>\n<p>Use dotenv.get(&quot;...&quot;) instead of Java&apos;s System.getenv(...). Here&apos;s <a href=\"#faq\">why</a>.</p>\n<p>Create a <code>.env</code> file in the root of your project</p>\n<pre># formatted as key=value\nMY_ENV_VAR1=some_value\nMY_EVV_VAR2=some_value</pre><p>With <strong>Java</strong></p>\n<pre><span class=\"hljs-keyword\">import</span> io.github.cdimascio.dotenv.Dotenv;\n\nDotenv dotenv = Dotenv.load();\ndotenv.get(<span class=\"hljs-string\">&quot;MY_ENV_VAR1&quot;</span>)</pre><p>or with <strong>Kotlin</strong> </p>\n<pre><span class=\"hljs-keyword\">import</span> io.github.cdimascio.dotenv.dotenv\n\n<span class=\"hljs-keyword\">val</span> dotenv = dotenv()\ndotenv[<span class=\"hljs-string\">&quot;MY_ENV_VAR1&quot;</span>]</pre><h2>Advanced Usage</h2>\n<h3>Configure</h3>\n<p>Configure <code>java-dotenv</code> once in your application. </p>\n<p>With <strong>Java</strong></p>\n<pre>Dotenv dotenv = Dotenv.configure()\n .directory(<span class=\"hljs-string\">&quot;./some/path&quot;</span>)\n .ignoreIfMalformed()\n .ignoreIfMissing()\n .load();</pre><ul>\n<li>see <a href=\"#configuration-options\">configuration options</a></li>\n</ul>\n<p>or with <strong>Kotlin</strong></p>\n<pre><span class=\"hljs-keyword\">val</span> dotenv = dotenv {\n directory = <span class=\"hljs-string\">&quot;./some/path&quot;</span>\n ignoreIfMalformed = <span class=\"hljs-literal\">true</span>\n ignoreIfMissing = <span class=\"hljs-literal\">true</span>\n}</pre><ul>\n<li>see <a href=\"#configuration-options\">Kotlin DSL configuration options</a></li>\n</ul>\n<h3>Get environment variables</h3>\n<p>Note, environment variables specified in the host environment take precedence over those in <code>.env</code>.</p>\n<p>With <strong>Java</strong></p>\n<pre>dotenv.get(<span class=\"hljs-string\">&quot;MY_ENV_VAR1&quot;</span>);\ndotenv.get(<span class=\"hljs-string\">&quot;HOME&quot;</span>);</pre><p>or with <strong>Kotlin</strong></p>\n<pre>dotenv[<span class=\"hljs-string\">&quot;MY_ENV_VAR1&quot;</span>]\ndotenv[<span class=\"hljs-string\">&quot;HOME&quot;</span>]</pre><h2>Configuration options</h2>\n<h3><em>optional</em> <code>directory</code></h3>\n<ul>\n<li><p><code>path</code> specifies the directory containing <code>.env</code>. Dotenv first searches for <code>.env</code> using the given path on the filesystem. If not found, it searches the given path on the classpath. If <code>directory</code> is not specified it defaults to searching the current working directory on the filesystem. If not found, it searches the current directory on the classpath.</p>\n<p> <strong>Java example</strong></p>\n<pre> Dotenv\n .configure()\n .directory(<span class=\"hljs-string\">&quot;/some/path&quot;</span>)\n .load()</pre><p> <strong>Kotlin Dsl example</strong></p>\n<pre> dotenv {\n directory = <span class=\"hljs-string\">&quot;/some/path&quot;</span>\n }</pre></li>\n</ul>\n<h3><em>optional</em> <code>ignoreIfMalformed</code></h3>\n<ul>\n<li><p>Do not throw when <code>.env</code> entries are malformed. Malformed entries are skipped.</p>\n<p> <strong>Java example</strong></p>\n<pre> Dotenv\n .configure()\n .ignoreIfMalformed()\n .load()</pre><p> <strong>Kotlin Dsl example</strong></p>\n<pre> dotenv {\n ignoreIfMalformed = <span class=\"hljs-keyword\">true</span>\n }</pre></li>\n</ul>\n<h3><em>optional</em> <code>ignoreIfMissing</code></h3>\n<ul>\n<li><p>Do not throw when <code>.env</code> does not exist. Dotenv will continue to retrieve environment variables that are set in the environment e.g. <code>dotenv[&quot;HOME&quot;]</code></p>\n<p> <strong>Java example</strong></p>\n<pre> Dotenv\n .configure()\n .ignoreIfMissing()\n .load()</pre><p> <strong>Kotlin Dsl example</strong></p>\n<pre> dotenv {\n ignoreIfMissing = <span class=\"hljs-keyword\">true</span>\n }</pre></li>\n</ul>\n<h2>Examples</h2>\n<ul>\n<li>with <a href=\"https:/cdimascio/kotlin-swagger-spring-functional-template\">Spring Framework</a> </li>\n<li>see <a href=\"./src/test/kotlin/tests/DslTests.kt\">Kotlin DSL tests</a></li>\n<li>see <a href=\"./src/test/java/tests/JavaTests.java\">Java tests</a></li>\n</ul>\n<h2>FAQ</h2>\n<p><strong>Q:</strong> Why should I use <code>dotenv.get(&quot;MY_ENV_VAR&quot;)</code> instead of <code>System.getenv(&quot;MY_ENV_VAR&quot;)</code></p>\n<p><strong>A</strong>: Since Java does not provide a way to set environment variables on a currently running process, vars listed in <code>.env</code> cannot be set and thus cannot be retrieved using <code>System.getenv(...)</code>.</p>\n<p><strong>Q</strong>: Should I commit my <code>.env</code> file?</p>\n<p><strong>A</strong>: No. We strongly recommend against committing your <code>.env</code> file to version control. It should only include environment-specific values such as database passwords or API keys. Your production database should have a different password than your development database.</p>\n<p><strong>Q</strong>: What happens to environment variables that were already set?</p>\n<p><strong>A</strong>: java-dotenv will never modify any environment variables that have already been set. In particular, if there is a variable in your <code>.env</code> file which collides with one that already exists in your environment, then that variable will be skipped. This behavior allows you to override all <code>.env</code> configurations with a machine-specific environment, although it is not recommended.</p>\n<p><strong>Q</strong>: What about variable expansion in <code>.env</code>? </p>\n<p><strong>A</strong>: We haven&apos;t been presented with a compelling use case for expanding variables and believe it leads to env vars that are not &quot;fully orthogonal&quot; as <a href=\"https://12factor.net/config\">The Twelve-Factor App outlines</a>. Please open an issue if you have a compelling use case.</p>\n<p><strong>Note and reference</strong>: The FAQs present on <a href=\"https:/motdotla/dotenv#faq\">motdotla&apos;s dotenv</a> node project page are so well done that I&apos;ve included those that are relevant in the FAQs above.</p>\n<h2>Contributors</h2>\n<p>Contributions are welcome!</p>\n<p>see <a href=\"CONTRIBUTING.md\">CONTRIBUTING.md</a></p>\n<h2>License</h2>\n<p><a href=\"https://www.apache.org/licenses/LICENSE-2.0\">Apache 2.0</a> - see <a href=\"LICENSE\">LICENSE</a></p>\n"
"html": "\n<p><img src=\"https://travis-ci.org/cdimascio/java-dotenv.svg?branch=master\"> <img src=\"https://img.shields.io/badge/status-stable-green.svg\"> <img src=\"https://img.shields.io/badge/coverage-94%25-blue.svg\"> <img src=\"https://img.shields.io/badge/license-Apache%202.0-blue.svg\"></p>\n<p><img src=\"https://raw.githubusercontent.com/cdimascio/java-dotenv/master/assets/java-dotenv.png\"> </p>\n<p>A zero-dependency Java port of the Ruby dotenv project (which loads environment variables from a <code>.env</code> file). java-dotenv also offers a <a href=\"#kotlin-dsl\">Kotlin DSL</a>.</p>\n<p>From the original Library:</p>\n<blockquote>\n<p>Storing configuration in the environment is one of the tenets of a <a href=\"http://12factor.net/config\">twelve-factor</a> app. Anything that is likely to change between deployment environments&#x2013;such as resource handles for databases or credentials for external services&#x2013;should be extracted from the code into environment variables.</p>\n<p>But it is not always practical to set environment variables on development machines or continuous integration servers where multiple projects are run. Dotenv load variables from a .env file into ENV when the environment is bootstrapped.</p>\n</blockquote>\n<p>Environment variables listed in the host environment override those in <code>.env</code>. </p>\n<p>Use <code>dotenv.get(&quot;...&quot;)</code> instead of Java&apos;s <code>System.getenv(...)</code>. </p>\n<h2>Install</h2>\n<h3>Maven</h3>\n<pre><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">dependency</span>&gt;</span>\n <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">groupId</span>&gt;</span>io.github.cdimascio<span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">groupId</span>&gt;</span>\n <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">artifactId</span>&gt;</span>java-dotenv<span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">artifactId</span>&gt;</span>\n <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">version</span>&gt;</span>3.0.1<span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">version</span>&gt;</span>\n<span class=\"hljs-tag\">&lt;/<span class=\"hljs-name\">dependency</span>&gt;</span></pre><h3>Gradle</h3>\n<pre>compile <span class=\"hljs-string\">&apos;io.github.cdimascio:java-dotenv:3.0.1&apos;</span></pre><h2>Usage</h2>\n<p>Use dotenv.get(&quot;...&quot;) instead of Java&apos;s System.getenv(...). Here&apos;s <a href=\"#faq\">why</a>.</p>\n<p>Create a <code>.env</code> file in the root of your project</p>\n<pre># formatted as key=value\nMY_ENV_VAR1=some_value\nMY_EVV_VAR2=some_value</pre><p>With <strong>Java</strong></p>\n<pre><span class=\"hljs-keyword\">import</span> io.github.cdimascio.dotenv.Dotenv;\n\nDotenv dotenv = Dotenv.load();\ndotenv.get(<span class=\"hljs-string\">&quot;MY_ENV_VAR1&quot;</span>)</pre><p>or with <strong>Kotlin</strong> </p>\n<pre><span class=\"hljs-keyword\">import</span> io.github.cdimascio.dotenv.dotenv\n\n<span class=\"hljs-keyword\">val</span> dotenv = dotenv()\ndotenv[<span class=\"hljs-string\">&quot;MY_ENV_VAR1&quot;</span>]</pre><h2>Advanced Usage</h2>\n<h3>Configure</h3>\n<p>Configure <code>java-dotenv</code> once in your application. </p>\n<p>With <strong>Java</strong></p>\n<pre>Dotenv dotenv = Dotenv.configure()\n .directory(<span class=\"hljs-string\">&quot;./some/path&quot;</span>)\n .ignoreIfMalformed()\n .ignoreIfMissing()\n .load();</pre><ul>\n<li>see <a href=\"#configuration-options\">configuration options</a></li>\n</ul>\n<p>or with <strong>Kotlin</strong></p>\n<pre><span class=\"hljs-keyword\">val</span> dotenv = dotenv {\n directory = <span class=\"hljs-string\">&quot;./some/path&quot;</span>\n ignoreIfMalformed = <span class=\"hljs-literal\">true</span>\n ignoreIfMissing = <span class=\"hljs-literal\">true</span>\n}</pre><ul>\n<li>see <a href=\"#configuration-options\">Kotlin DSL configuration options</a></li>\n</ul>\n<h3>Get environment variables</h3>\n<p>Note, environment variables specified in the host environment take precedence over those in <code>.env</code>.</p>\n<p>With <strong>Java</strong></p>\n<pre>dotenv.get(<span class=\"hljs-string\">&quot;MY_ENV_VAR1&quot;</span>);\ndotenv.get(<span class=\"hljs-string\">&quot;HOME&quot;</span>);</pre><p>or with <strong>Kotlin</strong></p>\n<pre>dotenv[<span class=\"hljs-string\">&quot;MY_ENV_VAR1&quot;</span>]\ndotenv[<span class=\"hljs-string\">&quot;HOME&quot;</span>]</pre><h2>Configuration options</h2>\n<h3><em>optional</em> <code>directory</code></h3>\n<ul>\n<li><p><code>path</code> specifies the directory containing <code>.env</code>. Dotenv first searches for <code>.env</code> using the given path on the filesystem. If not found, it searches the given path on the classpath. If <code>directory</code> is not specified it defaults to searching the current working directory on the filesystem. If not found, it searches the current directory on the classpath.</p>\n<p> <strong>Java example</strong></p>\n<pre> Dotenv\n .configure()\n .directory(<span class=\"hljs-string\">&quot;/some/path&quot;</span>)\n .load()</pre><p> <strong>Kotlin Dsl example</strong></p>\n<pre> dotenv {\n directory = <span class=\"hljs-string\">&quot;/some/path&quot;</span>\n }</pre></li>\n</ul>\n<h3><em>optional</em> <code>ignoreIfMalformed</code></h3>\n<ul>\n<li><p>Do not throw when <code>.env</code> entries are malformed. Malformed entries are skipped.</p>\n<p> <strong>Java example</strong></p>\n<pre> Dotenv\n .configure()\n .ignoreIfMalformed()\n .load()</pre><p> <strong>Kotlin Dsl example</strong></p>\n<pre> dotenv {\n ignoreIfMalformed = <span class=\"hljs-keyword\">true</span>\n }</pre></li>\n</ul>\n<h3><em>optional</em> <code>ignoreIfMissing</code></h3>\n<ul>\n<li><p>Do not throw when <code>.env</code> does not exist. Dotenv will continue to retrieve environment variables that are set in the environment e.g. <code>dotenv[&quot;HOME&quot;]</code></p>\n<p> <strong>Java example</strong></p>\n<pre> Dotenv\n .configure()\n .ignoreIfMissing()\n .load()</pre><p> <strong>Kotlin Dsl example</strong></p>\n<pre> dotenv {\n ignoreIfMissing = <span class=\"hljs-keyword\">true</span>\n }</pre></li>\n</ul>\n<h2>Examples</h2>\n<ul>\n<li>with <a href=\"https:/cdimascio/kotlin-swagger-spring-functional-template\">Spring Framework</a> </li>\n<li>see <a href=\"./src/test/kotlin/tests/DslTests.kt\">Kotlin DSL tests</a></li>\n<li>see <a href=\"./src/test/java/tests/JavaTests.java\">Java tests</a></li>\n</ul>\n<h2>FAQ</h2>\n<p><strong>Q:</strong> Why should I use <code>dotenv.get(&quot;MY_ENV_VAR&quot;)</code> instead of <code>System.getenv(&quot;MY_ENV_VAR&quot;)</code></p>\n<p><strong>A</strong>: Since Java does not provide a way to set environment variables on a currently running process, vars listed in <code>.env</code> cannot be set and thus cannot be retrieved using <code>System.getenv(...)</code>.</p>\n<p><strong>Q</strong>: Should I commit my <code>.env</code> file?</p>\n<p><strong>A</strong>: No. We strongly recommend against committing your <code>.env</code> file to version control. It should only include environment-specific values such as database passwords or API keys. Your production database should have a different password than your development database.</p>\n<p><strong>Q</strong>: What happens to environment variables that were already set?</p>\n<p><strong>A</strong>: java-dotenv will never modify any environment variables that have already been set. In particular, if there is a variable in your <code>.env</code> file which collides with one that already exists in your environment, then that variable will be skipped. This behavior allows you to override all <code>.env</code> configurations with a machine-specific environment, although it is not recommended.</p>\n<p><strong>Q</strong>: What about variable expansion in <code>.env</code>? </p>\n<p><strong>A</strong>: We haven&apos;t been presented with a compelling use case for expanding variables and believe it leads to env vars that are not &quot;fully orthogonal&quot; as <a href=\"https://12factor.net/config\">The Twelve-Factor App outlines</a>. Please open an issue if you have a compelling use case.</p>\n<p><strong>Note and reference</strong>: The FAQs present on <a href=\"https:/motdotla/dotenv#faq\">motdotla&apos;s dotenv</a> node project page are so well done that I&apos;ve included those that are relevant in the FAQs above.</p>\n<h2>Contributors</h2>\n<p>Contributions are welcome!</p>\n<p>see <a href=\"CONTRIBUTING.md\">CONTRIBUTING.md</a></p>\n<h2>License</h2>\n<p><a href=\"https://www.apache.org/licenses/LICENSE-2.0\">Apache 2.0</a> \nsee <a href=\"LICENSE\">LICENSE</a></p>\n"
},
{
"component": "footer",
Expand Down

0 comments on commit 91ebabf

Please sign in to comment.