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

Low setup usage #133

Closed
jayvdb opened this issue Nov 17, 2018 · 3 comments
Closed

Low setup usage #133

jayvdb opened this issue Nov 17, 2018 · 3 comments
Assignees

Comments

@jayvdb
Copy link
Member

jayvdb commented Nov 17, 2018

Some alternatives to moban have simplicity on their side.

It should be possible for moban to be easily used in an ad-hoc manner without a config file , like moban foo.jj2 to generate foo using environment variables.

c.f. https://github.com/andreasjansson/envtpl/blob/master/README.md

Or if there is a config file, moban foo.jj2 would load it and generate foo or the target listed in the config if it is present there.

@chfw
Copy link
Member

chfw commented Nov 17, 2018

yep, can easily do that.

The reason why it hasn't been done is missing actual use case.

@CLiu13 CLiu13 self-assigned this Dec 31, 2018
CLiu13 added a commit to CLiu13/moban that referenced this issue Jan 1, 2019
This adds the ability to use moban in an ad-hoc manner
without a config file, like `moban foo.jj2`. This also
adds environment variables as a fallback data source if
the default/specified data files do not exist.

Closes moremoban#133
CLiu13 added a commit to CLiu13/moban that referenced this issue Jan 2, 2019
This adds the ability to use moban in an ad-hoc manner
without a config file, like `moban foo.jj2`. This also
adds environment variables as a fallback data source if
the default/specified data files do not exist.

Closes moremoban#133
CLiu13 added a commit to CLiu13/moban that referenced this issue Jan 2, 2019
This adds the ability to use moban in an ad-hoc manner
without a config file, like `moban foo.jj2`. This also
adds environment variables as a fallback data source if
the default/specified data files do not exist.

Closes moremoban#133
CLiu13 added a commit to CLiu13/moban that referenced this issue Jan 2, 2019
This adds the ability to use moban in an ad-hoc manner
without a config file. This also adds environment variables
as a fallback data source if the default/specified data files
do not exist.

Closes moremoban#133
CLiu13 added a commit to CLiu13/moban that referenced this issue Jan 2, 2019
This adds the ability to use moban in an ad-hoc manner
without a config file. This also adds environment variables
as a fallback data source if the default/specified data files
do not exist.

Closes moremoban#133
CLiu13 added a commit to CLiu13/moban that referenced this issue Jan 3, 2019
This adds the ability to use moban in an ad-hoc manner
without a config file. This also adds environment variables
as a fallback data source if the default/specified data files
do not exist.

Closes moremoban#133
CLiu13 added a commit to CLiu13/moban that referenced this issue Jan 3, 2019
This adds the ability to use moban in an ad-hoc manner
without a config file. This also adds environment variables
as a fallback data source if the default/specified data files
do not exist.

Closes moremoban#133
CLiu13 added a commit to CLiu13/moban that referenced this issue Jan 3, 2019
This adds the ability to use moban in an ad-hoc manner
without a config file. This also adds environment variables
as a fallback data source if the default/specified data files
do not exist.

Closes moremoban#133
CLiu13 added a commit to CLiu13/moban that referenced this issue Jan 3, 2019
This adds the ability to use moban in an ad-hoc manner
without a config file. This also adds environment variables
as a fallback data source if the default/specified data files
do not exist.

Closes moremoban#133
CLiu13 added a commit to CLiu13/moban that referenced this issue Jan 3, 2019
This adds the ability to use moban in an ad-hoc manner
without a config file. This also adds environment variables
as a fallback data source if the default/specified data files
do not exist.

Closes moremoban#133
CLiu13 added a commit to CLiu13/moban that referenced this issue Jan 3, 2019
This adds the ability to use moban in an ad-hoc manner
without a config file. This also adds environment variables
as a fallback data source if the default/specified data files
do not exist.

Closes moremoban#133
CLiu13 added a commit to CLiu13/moban that referenced this issue Jan 3, 2019
This adds the ability to use moban in an ad-hoc manner
without a config file. This also adds environment variables
as a fallback data source if the default/specified data files
do not exist.

Closes moremoban#133
CLiu13 added a commit to CLiu13/moban that referenced this issue Jan 3, 2019
This adds the ability to use moban in an ad-hoc manner
without a config file. This also adds environment variables
as a fallback data source if the default/specified data files
do not exist.

Closes moremoban#133
CLiu13 added a commit to CLiu13/moban that referenced this issue Jan 3, 2019
This adds the ability to use moban in an ad-hoc manner
without a config file. This also adds environment variables
as a fallback data source if the default/specified data files
do not exist.

Closes moremoban#133
CLiu13 added a commit to CLiu13/moban that referenced this issue Jan 3, 2019
This adds the ability to use moban in an ad-hoc manner
without a config file. This also adds environment variables
as a fallback data source if the default/specified data files
do not exist.

Closes moremoban#133
CLiu13 added a commit to CLiu13/moban that referenced this issue Jan 3, 2019
This adds the ability to use moban in an ad-hoc manner
without a config file. This also adds environment variables
as a fallback data source if the default/specified data files
do not exist.

Closes moremoban#133
@chfw chfw closed this as completed in #146 Jan 4, 2019
@chfw
Copy link
Member

chfw commented Jan 6, 2019

@jayvdb @CLiu13 , previously I suggested to inject env to globals. Now, I got another suggestion:

Referencing https://github.com/andreasjansson/envtpl/blob/master/README.md, I think we could do a bit better in the following way:

  1. incorporate environment variables as a base data config for all data config files, meaning each data config automatically overrides the environment variable.

for example, scenario 1:

env var:

export HELLO="TEST"

test.jj2:
{{HELLO}}

moban -t test.jj2

shall simply get

TEST

scenario 2:

env var:

export HELLO="TEST"

data.yml

HELLO: world

test.jj2:
{{HELLO}}

moban -t test.jj2

shall simply get

world

  1. we may extend our functionality to support

moban -t "{{HELLO}}"

and get moban.output

#149

@chfw chfw reopened this Jan 6, 2019
@chfw
Copy link
Member

chfw commented Jan 6, 2019

hmm.. after checking the implementation, item 1 is there :)

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

No branches or pull requests

3 participants