Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
beerkg
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
8 ms
·
1.
▲
by
beerkg
4y ago
Shale uses Ruby's standard library parsers out of the box, so if you keep your Ruby up to date with security updates you will be good. Also others in this thread suggested to set minimal version on dependencies, so I'll probably d
2.
▲
by
beerkg
4y ago
If you don't define attributes explicitly on the model, Shale will ignore them. Regarding attributes that you defined but still don't want to be assigned, you should probably filter them before passing them to Shale, or alternativ
3.
▲
by
beerkg
4y ago
Documentation site was based on https://vuepress.vuejs.org/ but it evolved so much I dropped Vue all together and wen't with plain HTML instead. I must have left that meta tag from the early days. Regarding Vue I use i
4.
▲
by
beerkg
4y ago
HappyMapper was actually an inspiration for Shale. If it had support for JSON, Shale probably wouldn't be created :)
5.
▲
by
beerkg
4y ago
I like it actually, using POROs (or any class for that matter) is definitely a big advantage. Maybe I implement something like that for version 2 :)
6.
▲
by
beerkg
4y ago
It's a custom template I created (based on https://vuepress.vuejs.org/ ), because I couldn't find anything that simple. The source code is available on https://github.com/kgiszczak/shale-websit
7.
▲
by
beerkg
4y ago
Yeah, Shale supports generating models from JSON Schema for now, XML is work in progress and should be ready in two or three weeks.
8.
▲
by
beerkg
4y ago
I have a mixed feelings about this, standard library's vulnerabilities are part of Ruby's vulnerabilities, so you would update your Ruby version anyway. But you're right specifing version explicitly would prevent this.
9.
▲
by
beerkg
4y ago
I totally agree with your points, but this approach has one big advantage - it's dead simple - define attributes and mapping and you're good to go.
10.
▲
by
beerkg
4y ago
Ah, I messed up the example, Person class definition should look like this: class Person < Shale::Mapper attribute :first_name, Shale::Type::String attribute :last_name, Shale::Type::String attribute :age, Shale::Type::In
11.
▲
by
beerkg
4y ago
I'm glad you like it. One clarification - Nokogiri is not required by default, you have to explicitly require "shale/adapter/nokogiri" to use it. If you don't Shale will use REXML which comes from Ruby's s
12.
▲
by
beerkg
4y ago
Hi, I released Shale, a Ruby gem that allows you to parse JSON, YAML and XML and convert it into Ruby data structures, as well as serialize your Ruby data model to JSON, YAML or XML. Features: - convert JSON, XML or YAML into Ruby data mode
13.
▲
Show HN: Shale – a Ruby object mapper and serializer for JSON, YAML and XML
(shalerb.org)
182 points
by
beerkg
4y ago
|
52 comments