fsprojects / FSharp.Configuration

The FSharp.Configuration project contains type providers for the configuration of .NET projects.
http://fsprojects.github.io/FSharp.Configuration/
Other
114 stars 63 forks source link

Yaml map sequences #53

Closed matthid closed 9 years ago

matthid commented 9 years ago

This is basically the implementation of https://github.com/fsprojects/FSharp.Configuration/issues/51

But with some major limitations:

Some notes:

Please be kind as these are my first experiments with type providers (a painful experience) :)

vasily-kirichenko commented 9 years ago

It's great! Thanks. Could you fix AppVeyor build? Actually build.fsx is also broken. To fix it, run .paket\paket update.

vasily-kirichenko commented 9 years ago

image

vasily-kirichenko commented 9 years ago

image

matthid commented 9 years ago

Sure I will try to fix appveyor (it took quite some time to start yesterday). I'm not even sure why it would break... I didn't even change anything there :/.

Second picture: Some of the YamlExceptions come from "Settings.yaml" and where there even before I started (no idea why). Sometimes SharpYaml seems to go crasy and you need to restart/rebuild.

First picture: This is obviously working for me, otherwise I wouldn't have sent this PR :(

matthid commented 9 years ago

It seems to work in AppVeyor as well now.

vasily-kirichenko commented 9 years ago

Aha, if I change Lists.yaml as following:

items:
    - part_no:   A4786
      descrip:   Water Bucket (Filled)
      price:     1,47
      quantity:  4

    - part_no:   E1628
      descrip:   High Heeled "Ruby" Slippers
      size:      8
      price:     100,27
      quantity:  1

The exception has gone. So, we should be able to parse floats with different decimal separators. I'm afraid it's a SharpYaml bug.

vasily-kirichenko commented 9 years ago

For now, could change type of price to int? I mean price: 147, price: 10027.

matthid commented 9 years ago

Sure, But the exception is catched somewhere and it seems to work anyway, right? I'm a bit confused now as the tests seem to run fine.

matthid commented 9 years ago

Ah so you saying its not working on your machine because of localization, is that correct?

vasily-kirichenko commented 9 years ago

Yes.

matthid commented 9 years ago

Thanks for figuring that out. Ok that should now be fixed as well (waiting for AppVeyor). Can you open a issue over there at SharpYaml?

matthid commented 9 years ago

Thanks for merging. I sent the changes to https://github.com/fsprojects/FSharp.TypeProviders.StarterPack/pull/54 as well. I noticed that the files have already diverged, so maybe we should add the nuget package or use paket to reference their files (See https://github.com/fsprojects/FSharp.TypeProviders.StarterPack/issues/44)? It would be also more clear for future collaborators to not touch those files.

mavnn commented 9 years ago

A paket file reference would be the preferred method at the moment, yes.