Giter Club home page Giter Club logo

Comments (5)

re-ovo avatar re-ovo commented on June 7, 2024 1

Fixed now, thanks

from simple-yaml.

Carleslc avatar Carleslc commented on June 7, 2024

I can't reproduce it.

I tried:

final YamlFile yamlFile = new YamlFile("examples/issue-56.yml");

yamlFile.createOrLoadWithComments();

final String syncComment = "This is a configuration file synchronization feature, you can configure RikkaAC on one server, and\n" +
        "then use \"/rikka sync\" to synchronize to all RikkaAC connected to the same database, this is very\n" +
        "convenient for some large networks";

final String syncConfigComment = "Whether the sync feature should sync config.yml\n" +
        "(!) Note that this will override the storage setting\n" +
        "(!) Better to not change storage setting if you want to sync";

Normal API:

yamlFile.set("sync.sync-config", true);

yamlFile.setComment("sync", syncComment);
yamlFile.setComment("sync.sync-config", syncConfigComment, YamlCommentFormat.BLANK_LINE);

Alternative API:

yamlFile.path("sync")
        .comment(syncComment)
        .path("sync-config")
        .set(true)
        .comment(syncConfigComment, YamlCommentFormat.BLANK_LINE);

Also:

yamlFile.path("sync")
        .comment(syncComment)
        .path("sync-config")
        .set(true)
        .comment(syncConfigComment).blankLine();

And:

yamlFile.set("sync.sync-config", true);

yamlFile.path("sync").comment(syncComment);
yamlFile.path("sync.sync-config").comment(syncConfigComment, YamlCommentFormat.BLANK_LINE);

All of these with the same output on yamlFile.save():

# This is a configuration file synchronization feature, you can configure RikkaAC on one server, and
# then use "/rikka sync" to synchronize to all RikkaAC connected to the same database, this is very
# convenient for some large networks
sync:
  
  # Whether the sync feature should sync config.yml
  # (!) Note that this will override the storage setting
  # (!) Better to not change storage setting if you want to sync
  sync-config: true

I think the build on jitpack was on a wrong commit, I've done a rebuild, if you are using maven please download the dependency again. Maybe you need to clear the cache in your user directory at .m2/repository/me/carleslc first.

from simple-yaml.

re-ovo avatar re-ovo commented on June 7, 2024

Hi, I tried again with clean dependency cache, but it still happens
image
image

from simple-yaml.

re-ovo avatar re-ovo commented on June 7, 2024

But this code working:

yaml.path("c.c")
        .set("fuck you")
        .comment("fuck you")
        .blankLine()

Maybe something is wrong with YamlCommentFormat

from simple-yaml.

Carleslc avatar Carleslc commented on June 7, 2024

Ok, I've been able to reproduce the issue creating a fresh new maven project, because using the repo directly was working fine. Again, was an issue with jitpack serving the wrong build, because the problem was already solved, but on a newer commit than the one jitpack was serving with 1.8 release.

The rebuild done in my previous message was pointing to com.github.Carleslc.Simple-YAML groupId but jitpack still cached the me.carleslc.Simple-YAML to the previous build. Now it serves the correct build.

Clear the cache again at .m2/repository/me/carleslc and reload your maven project, it should be working fine now (worked for me in the fresh project).

<dependency>
    <groupId>me.carleslc.Simple-YAML</groupId>
    <artifactId>Simple-Yaml</artifactId>
    <version>1.8</version>
</dependency>

from simple-yaml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.