Giter Site home page Giter Site logo

acts_as_sdata-examples's Introduction

Usage examples of acts_as_sdata plugin

acts_as_sdata is an implementation of SData (Sage Data) protocol in Ruby.
This repo contains examples of acts_as_sdata adoptions.

Presidents

This application exposes the list of US presidents in SData way.

From client side it looks like this:

Instance path

http://localhost:3000/presidents/!Wilson

<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom">
  <title>Wilson, Woodrow</title>
  <summary>Wilson, Woodrow (1856-1924)</summary>
</entry>

Collection path

http://localhost:3000/presidents

<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id>
  <title>List of US presidents</title>
  <updated>2009-11-17T10:55:28+06:00</updated>
  <link href="http://example.com/presidents"/>
  <author>
    <name>Sage</name>
  </author>
  <entry>
    <title>Washington, George</title>
    <summary>Washington, George (1732-1799)</summary>
  </entry>
  <entry>
    <title>Adams, John</title>
    <summary>Adams, John (1735-1826)</summary>
  </entry>
.....

Predicate

http://localhost:3000/presidents(born_at gt 1900)
(all presidents born in XX century)

<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id>
  <title>List of US presidents</title>
  <updated>2009-11-17T10:58:15+06:00</updated>
  <link href="http://example.com/presidents"/>
  <author>
    <name>Sage</name>
  </author>
  <entry>
    <title>Kennedy, John</title>
    <summary>Kennedy, John (1917-1963)</summary>
  </entry>
  <entry>
    <title>Johnson, Lyndon</title>
    <summary>Johnson, Lyndon (1908-1973)</summary>
  </entry>
.....

How to install ‘presidents’

Clone and set up modules:
$ git clone git://github.com/DanielVartanov/acts_as_sdata-examples.git
$ cd acts_as_sdata-examples
$ git submodule init
$ git submodule update

Then, run it:
$ script/server

If you see error “acts_as_sdata-examples/presidents/vendor/rails/activesupport/lib/active_support/dependencies.rb:55: uninitialized constant ActiveSupport::Dependencies::Mutex (NameError)”

$ gem update --system 1.5.3

If you see error: “src/rails/acts_as_sdata-examples/presidents/config/../vendor/rails/railties/lib/rails/gem_dependency.rb:119:in `requirement’: undefined local variable or method `version_requirements’ for # (NameError)”
In config/environment.rb after line
require File.join(File.dirname(__FILE__), 'boot')

Add the following code:
if Gem::VERSION >= "1.3.6" module Rails class GemDependency def requirement r = super (r == Gem::Requirement.default) ? nil : r end end end end

Also need to install the following gems:
$ gem install atom
$ gem install fuzzy_hash
$ gem install sqlite3

acts_as_sdata-examples's People

Stargazers

Leo Ping avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.