Skip to content

Commit

Permalink
Use Bundler for the web app and update README for new installation pr…
Browse files Browse the repository at this point in the history
…ocedure.
  • Loading branch information
benlangfeld committed Aug 26, 2011
1 parent 25afbd6 commit 610000e
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 22 deletions.
24 changes: 9 additions & 15 deletions README.md
Expand Up @@ -17,31 +17,25 @@ Place this in your dialplan.rb of your Adhearsion project:

## Installation

1. Install the [RESTful-Adhearsion](http://github.com/jsgoecke/restful_adhearsion) client library gem:
1. In your components directory of your Adhearsion project:

`sudo gem install jsgoecke-restful_adhearsion --source=http://gems.github.com/`
`git clone git://github.com/adhearsion/restful_clicktocall.git`

2. In your components directory of your Adhearsion project:
2. Add the example code from above to your `adhearsion-project/dialplan.rb`.

`git clone git://github.com/jsgoecke/restful_clicktocall.git`
3. Add the restful_rpc component to your Gemfile and `startup.rb` gem component configuration.

3. Then add the example code from above to your `adhearsion-project/dialplan.rb`.
4. From within the directory `adhearsion-project/components/restful_clicktocall/web` run:

4. Enable the restful_rpc component from within your `adhearsion-project/` directory:
`bundle install && bundle exec rackup`

`ahn enable component restful_rpc`
5. Connect to the web form:

5. From within the directory `adhearsion-project/components/restful_clicktocall/web` run:

`ruby run_me.rb`

6. Connect to the web form:

`http://localhost:4567`
`http://localhost:9292`

Then you are off and running!

7. If you would like to run Sinatra as a daemon, I recommend you use Rack and Passenger
6. If you would like to run Sinatra as a daemon, I recommend you use Rack and Passenger

Simply do the following:

Expand Down
4 changes: 4 additions & 0 deletions web/Gemfile
@@ -0,0 +1,4 @@
source :rubygems

gem 'sinatra'
gem 'restful_adhearsion'
22 changes: 22 additions & 0 deletions web/Gemfile.lock
@@ -0,0 +1,22 @@
GEM
remote: http://rubygems.org/
specs:
json (1.5.3)
mime-types (1.16)
rack (1.3.2)
rest-client (1.6.7)
mime-types (>= 1.16)
restful_adhearsion (0.1.3)
json (>= 1.1.3)
rest-client (>= 0.8.2)
sinatra (1.2.6)
rack (~> 1.1)
tilt (< 2.0, >= 1.2.2)
tilt (1.3.3)

PLATFORMS
ruby

DEPENDENCIES
restful_adhearsion
sinatra
6 changes: 4 additions & 2 deletions web/config.ru
@@ -1,10 +1,12 @@
require 'rubygems'
require 'sinatra'
require 'bundler'

Bundler.require

ROOT_DIR = File.expand_path(File.dirname(__FILE__))

Sinatra::Application.set :run => false,
:environment => :production

require 'run_me.rb'
require './run_me'
run Sinatra::Application
5 changes: 0 additions & 5 deletions web/run_me.rb
@@ -1,8 +1,3 @@
require 'rubygems'
require 'sinatra' # Get with "gem install sinatra"
require 'restful_adhearsion'
require 'pp'

# Create our Adhearsion object connected to the RESTful API of Adhearsion
Adhearsion = RESTfulAdhearsion.new :host => "localhost",
:port => 5000,
Expand Down

0 comments on commit 610000e

Please sign in to comment.