GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - opencomponents/ruby-oc: OpenComponents for Ruby

BranchesTags
Open more actions menu

Latest commit

 

History

36 Commits
36 Commits

Folders and files

NameName
Last commit message
Last commit date
lib
lib
 
 
spec
spec
 
 
.editorconfig
.editorconfig
 
 
.gitignore
.gitignore
 
 
.rspec
.rspec
 
 
.travis.yml
.travis.yml
 
 
CHANGELOG.md
CHANGELOG.md
 
 
Gemfile
Gemfile
 
 
Gemfile.lock
Gemfile.lock
 
 
Guardfile
Guardfile
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
Rakefile
Rakefile
 
 
opencomponents.gemspec
opencomponents.gemspec
 
 

Repository files navigation

opencomponents

Build Status Coverage Status Code Climate Gem Version Dependency Status

OpenComponents for Ruby

Important

This gem is still under heavy development and the API is likely to change at any time.

Getting Started

Add the gem to your Gemfile and run bundle install:

gem 'opencomponents', '~> 0.4.0'

By default, the gem will attempt to use a component registry located at http://localhost:3030. If you want to use a different registry, you can configure OpenComponents to use it with:

OpenComponents.configure { |config| config.registry = 'http://some.other.host' }

Getting Rendered Components

To request an OpenComponent with its rendered HTML, you can create and load a new RenderedComponent object.

component = OpenComponents::RenderedComponent.new('my-awesome-component')
component.load

Optionally, you can also specify parameters, the component version, and additional HTTP headers to request:

component = OpenComponents::RenderedComponent.new(
  'my-awesome-component',
  params: {name: 'Kate'},
  version: '1.0.2',
  headers: {accept_language: 'emoji'}
)

Getting Unrendered Components

If you'd like to perform the component rendering yourself, you can request an unrendered component from a registry using a UnrenderedComponent object.

component = OpenComponents::UnrenderedComponent.new('my-awesome-component')
component.load

You can use the same optional params, version, and headers arguments as RenderedComponents.

Note: UnrenderedComponents will only fetch component data for you - they do not provide an interface for rendering them. At the moment, it's up to you to determine the best way to render the template.

Integrations

Individual integrations for rendering components in Rails and Sinatra are available.

  • opencomponents-rails
  • sinatra-opencomponents

Contributing

Would be rad. Open a PR or Issue if you have an idea for improvements.

License

Copyright 2015 OpenTable. See LICENSE for details.

About

OpenComponents for Ruby

Resources

Readme
MIT license
Activity
Custom properties

Stars

5 stars

Watchers

27 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.