0.0
No commit activity in last 3 years
No release in over 3 years
Provides a ruby API for starting a vanilli server and interacting with it.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.9
~> 10.4
~> 0.31

Runtime

~> 1.8
 Project Readme

vanilli-ruby

Ruby bindings for use with vanilli.

IMPORTANT: Requires vanilli 4.8.1+ to be installed globally

Installation

Add this line to your application's Gemfile:

gem 'vanilli-ruby'

And then execute:

$ bundle

Or install it yourself as:

$ gem install vanilli-ruby

Usage

Two classes are provided VanilliServer and VanilliClient.

VanilliClient

This class provides a client API for interacting with a running vanilli server. The API has deliberately been kept as close as possible to the canonical javascript API with a few "rubifications" (snake case on method names for example). However, the API is close enough that providing extra documentation here is counter-productive - please see the javascript documentation.

Instantiating the client is straightforward:

require 'vanilli/client'

vanilli = VanilliClient.new

vanilli.stub(...)
#etc.

VanilliServer

Of course, to be able to make use of the client one needs a vanilli server running to connect to. This can be achieved in a number of ways:

  • Start vanilli via its CLI
npm install -g vanilli
vanilli --port 9000
  • Start vanilli from javascript i.e. use the javascript API perhaps from some grunt/gulp/npm based task.

  • Use VanilliServer provided with this ruby gem This just acts as a wrapper around the vanilli CLI. Therefore you MUST have vanilli installed to your path for this to work. Once installed, start something like this:

vanilli_server = VanilliServer.new(port: 9000,
                                  log_level: "debug",
                                  static_root: "/your/web/app/assets",
                                  static_include: ['**/*.html', '**/*.js', '**/*.css*', '/robots.txt'])
                .start

Contributing

To try out the gem before releasing, build and then install the gem:

gem build vanilly-ruby.gemspec
gem install vanilli-ruby-VERSION.gem

Releasing

  • Up the version in vanilli-ruby.gemspec
  • Commit and push
  • gem build vanilli-ruby.gemspec
  • gem push vanilli-ruby-VERSION.gem