Allowing Yaml #184

Closed
HugoGiraudel opened this Issue Aug 24, 2014 · 14 comments

Comments

Projects
None yet
3 participants
@HugoGiraudel
Member

HugoGiraudel commented Aug 24, 2014

What about allowing both .json and .yml as configuration format?

@HugoGiraudel

This comment has been minimized.

Show comment
Hide comment
@HugoGiraudel

HugoGiraudel Aug 25, 2014

Member

Ping @SassDoc/owners. Obviously I want opinions here. :)

Member

HugoGiraudel commented Aug 25, 2014

Ping @SassDoc/owners. Obviously I want opinions here. :)

@valeriangalliat

This comment has been minimized.

Show comment
Hide comment
Member

valeriangalliat commented Aug 25, 2014

👍

@pascalduez

This comment has been minimized.

Show comment
Hide comment
@pascalduez

pascalduez Aug 25, 2014

Member

Feels like a nice addition.
As discussed, depending on how much complexity it would had to the core.

Member

pascalduez commented Aug 25, 2014

Feels like a nice addition.
As discussed, depending on how much complexity it would had to the core.

@valeriangalliat

This comment has been minimized.

Show comment
Hide comment
@valeriangalliat

valeriangalliat Aug 26, 2014

Member
var ext = path.extname(filename);

switch (ext) {
  case '.yaml':
  case '.yml':
    return readFile(filename).then(yaml.parse);
  case '.json':
    return readFile(filename).then(JSON.parse);
  default:
    throw 'Sorry, I don\'t know how to handle `' + ext + '` files, please use `.yaml` or `.json`.'
}

Well the YAML module will maybe have another API, but I'm sure it will look close to this. :p
Doesn't looks too complex to me.

Member

valeriangalliat commented Aug 26, 2014

var ext = path.extname(filename);

switch (ext) {
  case '.yaml':
  case '.yml':
    return readFile(filename).then(yaml.parse);
  case '.json':
    return readFile(filename).then(JSON.parse);
  default:
    throw 'Sorry, I don\'t know how to handle `' + ext + '` files, please use `.yaml` or `.json`.'
}

Well the YAML module will maybe have another API, but I'm sure it will look close to this. :p
Doesn't looks too complex to me.

@pascalduez

This comment has been minimized.

Show comment
Hide comment
@pascalduez

pascalduez Aug 26, 2014

Member

Looks like bearable complexity indeed :)

Member

pascalduez commented Aug 26, 2014

Looks like bearable complexity indeed :)

@HugoGiraudel

This comment has been minimized.

Show comment
Hide comment
@HugoGiraudel

HugoGiraudel Aug 26, 2014

Member

@valeriangalliat Alright. Tag! You're in.

Member

HugoGiraudel commented Aug 26, 2014

@valeriangalliat Alright. Tag! You're in.

@HugoGiraudel HugoGiraudel added this to the 1.6 milestone Aug 26, 2014

@valeriangalliat

This comment has been minimized.

Show comment
Hide comment
@valeriangalliat

valeriangalliat Aug 26, 2014

Member

No entry error
Unknown type error
YAML execution

Looks good?

Member

valeriangalliat commented Aug 26, 2014

No entry error
Unknown type error
YAML execution

Looks good?

@valeriangalliat

This comment has been minimized.

Show comment
Hide comment
Member

valeriangalliat commented Aug 26, 2014

See 8006955.

@valeriangalliat

This comment has been minimized.

Show comment
Hide comment
@valeriangalliat

valeriangalliat Aug 26, 2014

Member

I have to say it was more complicated than I thought (like always) on my code example above... but it's a great addition. :)

Member

valeriangalliat commented Aug 26, 2014

I have to say it was more complicated than I thought (like always) on my code example above... but it's a great addition. :)

@HugoGiraudel

This comment has been minimized.

Show comment
Hide comment
@HugoGiraudel

HugoGiraudel Aug 26, 2014

Member

Do you have updated documentation as well?

Member

HugoGiraudel commented Aug 26, 2014

Do you have updated documentation as well?

@valeriangalliat

This comment has been minimized.

Show comment
Hide comment
@valeriangalliat

valeriangalliat Aug 26, 2014

Member

You mean the wiki? Nope, but I'm gonna do it. I add "since 1.6" in small, right?

Member

valeriangalliat commented Aug 26, 2014

You mean the wiki? Nope, but I'm gonna do it. I add "since 1.6" in small, right?

@HugoGiraudel

This comment has been minimized.

Show comment
Hide comment
Member

HugoGiraudel commented Aug 26, 2014

Yes.

@valeriangalliat

This comment has been minimized.

Show comment
Hide comment
Member

valeriangalliat commented Aug 26, 2014

Done.

@HugoGiraudel

This comment has been minimized.

Show comment
Hide comment
@HugoGiraudel

HugoGiraudel Aug 26, 2014

Member

Will be available in 1.6.

Member

HugoGiraudel commented Aug 26, 2014

Will be available in 1.6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment