bsiggelkow / jsonify Goto Github PK
View Code? Open in Web Editor NEWJSON builder
Home Page: http://jsonify.org
License: MIT License
JSON builder
Home Page: http://jsonify.org
License: MIT License
I think most people who will be interested in this library will want to use it for REST rather than RPC. Also the first example doesn't show how to have more than one item in the root object. If it showed how to have more than one item in the root object people could probably figure out how to have only one item in the root object, but it doesn't go the other way.
Jsonify::Builder.plain do |json|
json.bar do
json.id bar.id
end
json.foos(foos) do |foo|
{id: foo._id}
end
end
If foos is empty the return from builder is empty - so no bar.
I'm getting this error:
Invalid gemspec in [/Users/rafamvc/Developer/.rvm/gems/ruby-1.9.2-p136@railspre/specifications/jsonify-0.1.2.gemspec]: invalid date format in specification: "2011-08-09 00:00:00.000000000Z"
Invalid gemspec in [/Users/rafamvc/Developer/.rvm/gems/ruby-1.9.2-p136@railspre/specifications/jsonify-rails-0.0.7.gemspec]: invalid date format in specification: "2011-08-05 00:00:00.000000000Z"
Invalid gemspec in [/Users/rafamvc/Developer/.rvm/gems/ruby-1.9.2-p136@railspre/specifications/jsonify-0.1.2.gemspec]: invalid date format in specification: "2011-08-09 00:00:00.000000000Z"
Invalid gemspec in [/Users/rafamvc/Developer/.rvm/gems/ruby-1.9.2-p136@railspre/specifications/jsonify-rails-0.0.7.gemspec]: invalid date format in specification: "2011-08-05 00:00:00.000000000Z"
I'm some problems using strings is arrays.
For example this:
json.test ['hello world']
Produces:
{
"test": ["helloworld"}
}
It strips out the whitespace characters.
Radio buttons seem to not work for dejsonify.
It may miss adding checked
Hello,
I cant start rails application after installing Jsonify to my gemfile:
โ caza git:(214-uko) โ rails server
script/rails:6: stack level too deep (SystemStackError)
I tried out about 4 tools to creating json, this look like that I wanted but I cant run it. I would be very pleased and very happy for any help :).
Best regards.
https://github.com/intridea/multi_json
I use YAJL as my json encoder and the multi json gem allows for you to swap any compatible encoder transparently.
Somehow, when I run the code with comments it breaks, if I delete the comments it works:
# [{"description":"test description","title":"test rafa","icon_url":"http://localhost:3000/uploads/asset_library/logo_asset/3/resized_target-logo.png","content_url":"http://localhost:3000/creatives/8/ad"}]
@links = [
['self', 'http://example.com/people/123'],
['school', 'http://gatech.edu'],
]
json.links(@links) do |link|
{:rel => link.first, :href => link.last}
end
# json.rafa "rafa"
# json.append! @creatives.count
# json.creative(@creatives) do |creative|
# {:description => creative.description, :title => creative.title, :iconUrl => creative.icon_url, :contentUrl => creative.content_url}
# end
# ["test",{"creative":{"description":"test rafa latest","title":"test rafa latest"}}]
Hi,
Your travis-ci.org builds are failing because you did not configure what Rubies you want to test against, and your code has 1.9-specific hashes. Please add .travis.yml because Travis uses 1.8.7 by default. You can use amqp gem as example.
Thank you.
on behalf of the Travis CI Team
At least as far as I can tell. You can create an array of strings easily (as per the API docs) but what I'd like to be able to do is (something like):
json.array!(things) do |thing|
json.foo thing.bar
json.other_foo thing.item
end
to return
[{'foo':'bar', 'other_foo':1}, {'foo':'baz', 'other_foo':2},...]
I think it would be neat if instead of
json = Builder.new Jsonify::Builder.new(:pretty => true)
json.owner = 'bsiggelkow'
json.repo = 'jsonify'
body = json.compile!
I could do
json = Builder.new Jsonify::Builder.new(:pretty => true) do |json|
json.owner = 'bsiggelkow'
json.repo = 'jsonify'
end.compile!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.