contentful / boilerplate-ruby Goto Github PK
View Code? Open in Web Editor NEWRuby boilerplate project for getting started with Contentful
Ruby boilerplate project for getting started with Contentful
The prerequisites are unclear: this may be on most Ruby devs workstations, but we still need to make crystal clear what's required, otherwise the ./run doesn’t work which ends the Contentful journey for someone who's in a rush.
Maybe that can be something you detect and propose installing if it’s missing? Like a conditional gem install bundler
?
the ./run
should maybe not do both installation and running? Otherwise every time you run
that's calling bundle install
which is irrelevant
The output of the sample should give a little bit more indications of what's going on. Right now you get
Running Script:
Command: bundle exec ruby script.rb
happycat
5ETMRzkl9KM4omyMwKAOki
6KntaYXaHSyIw8M6eo26OK
7qVBlCjpWE86Oseo40gAEY
garfield
4MU1s3potiUEM2G4okYOqw
nyancat
ge1xHyH3QOWucKWCCAgIG
finn
jake
It could be probably better to have:
$ ./run
Printing the first 100 entry IDs of your space:
- happycat
- 5ETMRzkl9KM4omyMwKAOki
- 6KntaYXaHSyIw8M6eo26OK
- 7qVBlCjpWE86Oseo40gAEY
- garfield
- 4MU1s3potiUEM2G4okYOqw
- nyancat
- ge1xHyH3QOWucKWCCAgIG
- finn
- jake
Check out script.rb to tweak this further and get started!
# You now have the basics to get started.
# You may be interested in checking out the Ruby SDK tutorial to go further: https://www.contentful.com/developers/docs/ruby/tutorials/getting-started-with-contentful-and-ruby/
./run
(I'm on OSX)successfully list all entries in my space
$ ./run
Checking requirements:
Checking: ruby
OK
Checking: bundler
OK
Dependencies already installed. Skipping
Running Script:
Command: bundle exec ruby script.rb
/usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/contentful-2.0.1/lib/contentful/asset.rb:79:in `create_files!': undefined method `[]=' for nil:NilClass (NoMethodError)
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/contentful-2.0.1/lib/contentful/asset.rb:30:in `initialize'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/contentful-2.0.1/lib/contentful/resource_builder.rb:77:in `new'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/contentful-2.0.1/lib/contentful/resource_builder.rb:77:in `build_item'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/contentful-2.0.1/lib/contentful/resource_builder.rb:68:in `build_single'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/contentful-2.0.1/lib/contentful/resource_builder.rb:50:in `run'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/contentful-2.0.1/lib/contentful/entry.rb:60:in `resolve_include'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/contentful-2.0.1/lib/contentful/entry.rb:45:in `build_nested_resource'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/contentful-2.0.1/lib/contentful/entry.rb:32:in `block in coerce_link_array'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/contentful-2.0.1/lib/contentful/entry.rb:31:in `each'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/contentful-2.0.1/lib/contentful/entry.rb:31:in `coerce_link_array'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/contentful-2.0.1/lib/contentful/entry.rb:17:in `coerce'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/contentful-2.0.1/lib/contentful/fields_resource.rb:100:in `block in hydrate_fields'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/contentful-2.0.1/lib/contentful/fields_resource.rb:99:in `each'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/contentful-2.0.1/lib/contentful/fields_resource.rb:99:in `hydrate_fields'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/contentful-2.0.1/lib/contentful/fields_resource.rb:10:in `initialize'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/contentful-2.0.1/lib/contentful/resource_builder.rb:77:in `new'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/contentful-2.0.1/lib/contentful/resource_builder.rb:77:in `build_item'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/contentful-2.0.1/lib/contentful/resource_builder.rb:60:in `block in build_array'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/contentful-2.0.1/lib/contentful/resource_builder.rb:59:in `map'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/contentful-2.0.1/lib/contentful/resource_builder.rb:59:in `build_array'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/contentful-2.0.1/lib/contentful/resource_builder.rb:49:in `run'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/contentful-2.0.1/lib/contentful/client.rb:284:in `do_build_resource'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/contentful-2.0.1/lib/contentful/client.rb:221:in `get'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/contentful-2.0.1/lib/contentful/request.rb:30:in `get'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/contentful-2.0.1/lib/contentful/client.rb:158:in `entries'
from script.rb:19:in `<main>'
Check out script.rb to tweak this further and get started!
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.