Comments (2)
This just bit me as well. I read an application's default config file using TOML.load_file. When I then try to generate the TOML string again it blows up:
2.1.1p76 :014 > data = TOML.load_file('influxdb.toml')
=> {"bind-address"=>"0.0.0.0", "reporting-disabled"=>false, "logging"=> {"level"=>"info", "file"=>"/opt/influxdb/shared/log.txt"}, "admin"=>{"port"=>8083, "assets"=>"/opt/influxdb/current/admin"}, "api"=>{"port"=>8086, "read-timeout"=>"5s"}, "input_plugins"=>{"graphite"=>{"enabled"=>false}, "udp"=>{"enabled"=>false}, "udp_servers"=>[{"enabled"=>false}]}, "raft"=>{"port"=>8090, "dir"=>"/opt/influxdb/shared/data/raft"}, "storage"=>{"dir"=>"/opt/influxdb/shared/data/db", "write-buffer-size"=>10000}, "cluster"=>{"protobuf_port"=>8099, "protobuf_timeout"=>"2s", "protobuf_heartbeat"=>"200ms", "protobuf_min_backoff"=>"1s", "protobuf_max_backoff"=>"10s", "write-buffer-size"=>10000, "max-response-buffer-size"=>100, "concurrent-shard-query-limit"=>10}, "leveldb"=>{"max-open-files"=>40, "lru-cache-size"=>"200m", "max-open-shards"=>0, "point-batch-size"=>100, "write-batch-size"=>5000000}, "sharding"=>{"replication-factor"=>1, "short-term"=>{"duration"=>"7d", "split"=>1}, "long-term"=>{"duration"=>"30d", "split"=>1}}, "wal"=>{"dir"=>"/opt/influxdb/shared/data/wal", "flush-after"=>1000, "bookmark-after"=>1000, "index-after"=>1000, "requests-per-logfile"=>10000}}
2.1.1p76 :015 > TOML::Generator.new(data).body
NoMethodError: undefined method `to_toml' for {"enabled"=>false}:Hash
from toml.
Great catch! Either of you have time to whip up a quick PR for this? Looks simple enough.
from toml.
Related Issues (20)
- Can't serialize empty arrays HOT 1
- Why is this the default TOML gem on rubygems.org? HOT 3
- Fails to build against parslet 1.7.1 HOT 3
- Are curly brackets a correct and supported syntax? HOT 1
- Failed to parse numbers with underscores HOT 3
- raise error when parser fails HOT 1
- Specify version support HOT 1
- Merge with other gems
- parsing breaks on multi-line strings HOT 2
- `#@` is getting (erroneously?) escaped
- Quoted keys are not un-quoted
- Release 0.3.0 to rubygems HOT 5
- Error while parsing valid toml HOT 1
- Parsing with CRLF EOL's sometimes fail (on WSL2/Linux)
- Strings containing dots as keys are misgenerated into invalid TOML and not parsed properly.
- Feature: Preserve hash strructure when generating a TOML file
- Question: How do I make variables out of the TOML file? HOT 1
- hi
- Parser fails when config contains array of tables with literal strings
- Unexpected exceptions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from toml.