Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a .list() method to Dotenv #19

Closed
wants to merge 1 commit into from
Closed

Add a .list() method to Dotenv #19

wants to merge 1 commit into from

Conversation

pwoolcoc
Copy link

@pwoolcoc pwoolcoc commented Mar 1, 2019

Currently, I am writing a gradle plugin for .env files, and it would be nice to be able to iterate over the list of variables that were defined in the .env file

@cdimascio
Copy link
Owner

@pwoolcoc thanks!
this is good idea. will have a look

@pwoolcoc
Copy link
Author

pwoolcoc commented Mar 1, 2019

@cdimascio I see you added and then commented out an iterator for it -- are you planning on un-commenting that at some point? that would work for me just as well as a list would, tbh

@cdimascio
Copy link
Owner

cdimascio commented Mar 2, 2019

@pwoolcoc yes. I commented it out as it needed some work. The types weren't working out well on the Java side. I believe I have it resolved now

All in all, I borrowed many of your ideas
The PR is here, feel free to comment. I'm happy to make adjustments. I believe it now meets your needs.

The change is available in v4.1.0. It should make it to MavenCentral within ~24hours

@cdimascio
Copy link
Owner

cdimascio commented Mar 2, 2019

@pwoolcoc FYI: If you want to try it out before it makes it to MavenCentral you can get it from JCenter with the following:

If you need it more quickly you can resolve to JCenter with the following:
Gradle

repositories {
    maven {
        url  "https://dl.bintray.com/cdimascio/maven" 
    }
}

Maven
settings.xml file

<?xml version="1.0" encoding="UTF-8" ?>
<settings xsi:schemaLocation='http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd'
          xmlns='http://maven.apache.org/SETTINGS/1.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
    
    <profiles>
        <profile>
            <repositories>
                <repository>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                    <id>bintray-cdimascio-maven</id>
                    <name>bintray</name>
                    <url>https://dl.bintray.com/cdimascio/maven</url>
                </repository>
            </repositories>
            <pluginRepositories>
                <pluginRepository>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                    <id>bintray-cdimascio-maven</id>
                    <name>bintray-plugins</name>
                    <url>https://dl.bintray.com/cdimascio/maven</url>
                </pluginRepository>
            </pluginRepositories>
            <id>bintray</id>
        </profile>
    </profiles>
    <activeProfiles>
        <activeProfile>bintray</activeProfile>
    </activeProfiles>
</settings>

@cdimascio
Copy link
Owner

@pwoolcoc would love to checkout your gradle plugin once its ready to go. sounds interesting!

@cdimascio
Copy link
Owner

There's also a usage blurb in the documentation

@pwoolcoc
Copy link
Author

pwoolcoc commented Mar 2, 2019

this looks great, thanks! this will work perfectly for me :) I'll let you know when i have published my plugin

@pwoolcoc pwoolcoc closed this Mar 2, 2019
@cdimascio
Copy link
Owner

@all-contributors please add @pwoolcoc for ideas

@allcontributors
Copy link
Contributor

@cdimascio

I've put up a pull request to add @pwoolcoc! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants