sinatra

Is there an ActiveMerchant for Sinatra?

What payment gateway library works with Sinatra if you're looking to add ecommerce functionality to your app? ...

Can you let users upload Sinatra apps and run them inside Rails as middleware?

I want to let users write small custom apps (think themes or plugins on Wordpress) and upload/run them on my site. I'm thinking about using Sinatra apps for this since it would give the users a lot of flexibility, and then running them as middleware inside my rails app. But I can't figure out the security implications of this. I tried...

Help with starting up my thin server with Sinatra

Hi All, I'm a newcomer trying to get my feet wet with Ruby and Sinatra. I followed the Slicehost articles in getting Ruby 1.9.1 setup along with Thin 1.2.7 with a reverse proxy to Nginx. Most things were going pretty smooth until I tried to start up my thin server. This is the output I get from my logs: $ sudo thin -C config.yml -R c...

Sinatra Partial with data?

I am making a super small Sinatra blog application, how could I take entries from a database, format them, and insert them into my layout? ...

Sinatra and Markaby: "Template Engine Not Found"

Using the standard gem for using Markaby with Sinatra, listed at http://www.sinatrarb.com/extensions-wild.html sudo gem install markaby Password: Successfully installed builder-2.1.2 Successfully installed markaby-0.5 2 gems installed sudo gem install sbfaulkner-sinatra-markaby -s http://gems.github.com Password: Successfully ins...

Override default route if no parameter specified

Consider the following snippet: get '/hello/:name' do |n| "Hello #{n}!" end How can I set a default parameters if name isn't specified? If I can set the default paramater to Tom will this also route the URL so /hello/ will automatically redirect to /hello/tom? ...

Getting Header Data with Sinatra

I'm writing a web app for EVE online in sinatra,and want to retrive header data. In php I can get data from a header variable with: $_SERVER['HTTP_EVE_TRUSTED'] how can I do the same in a sinatra page? ...

gem install sinatra keeps fetching wrong version

when i type "gem install sinatra" it keeps pulling 0.9.4 instead of the new 1.0 why does this happen? ...

DataMapper Dates

Forgive me if this is a simple answer. But how do you get a Date from a DataMapper property. For example: require 'rubygems' require 'sinatra' require 'datamapper' class Test include DataMapper::Resource property :id, Serial property :created_at, Date end get '/:id' do test = Test.get(1) test.created_at = ? end ...

Big sinatra problems

Hi, So I'm having huge trouble with sinatra. Here's what I have: require 'dm-core' DataMapper.setup(:default, ENV['DATABASE_URL'] || 'sqlite3://my.db') class Something include DataMapper::Resource property :id, Serial property :thing, Text property :run_in, Integer property :added_at, ...

Erb with Sinatra in ruby

So I have a webserver I've built using sinatra, the meat of which goes like this: set :variable,"value" get '/' do erb :index end And, of course, the template in views/index.erb which looks something like this: <html> <!-- etc --> <ul> <% my_array.each do |thing| %> <%="Something: #{thing}, variable from sinatra: #{settings.v...

Error Building Gem

I tried to install the following gem: http://github.com/maxjustus/sinatra-authentication on Windows 7 running Ruby 1.9 from the One-Click Installer. I got the following error: Microsoft Windows [Version 6.1.7600] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\Users\Joel>gem install sinatra-authentication Buildin...

Static page routing in Sinatra (Ruby)

You can serve static files with Sinatra by placing them in public/ (by default) -- I have an index.html in there at the moment, but how can I make the root point to that file without having to parse it as a template? To be clear, I can access /index.html successfully, and I'd like to route / to be the same static file, but without redir...

Ruby Rack: startup and teardown operations (Tokyo Cabinet connection)

I have built a pretty simple REST service in Sinatra, on Rack. It's backed by 3 Tokyo Cabinet/Table datastores, which have connections that need to be opened and closed. I have two model classes written in straight Ruby that currently simply connect, get or put what they need, and then disconnect. Obviously, this isn't going to work long...

Sintra app in a gem

I have a Sinatra application I've created and I'd like to package it as a gem-based binary. I have my gemspec and gem set up to generate a suitable executable that points to the my_sinatra_app.rb (which is executable) but the sinatra server never runs. Any ideas why and how to make it work? my_sinatra_app executable: #!/System/Library...

problem with installing mmangino-facebooker gem

Hello, I've problem like in title. I'm using ruby with Sinatra framework and trying to integrate my site with faceboook connect using frankie gem. Unfortunetly I'm getting dependencie error like that: Could not find RubyGem mmangino-facebooker (>= 1.0.2) When I try to install sudo gem install mmangino-facebooker I'm getting ...

Sinatra Set Settings (Ruby)

Using Sinatra in Ruby you can set the server's settings by doing: set :myvariable, "MyValue" and then access it anywhere in templates etc with settings.myvariable. In my script I need to be able to re-set these variables falling back to a bunch of defaults. I figured the easiest way to do this would be to have a function that perform...

Why do I get a NoSuchMethod error running Warbler?

I'm getting the following error when running warble under both jRuby 1.3 and 1.4. I'm new to warbler, any suggestions what to try next? $ warble war WarblerWar.java:70:in `addEntry': java.lang.NoSuchMethodError: org.jruby.util.ByteList.getUnsafeBytes()[B from WarblerWar.java:63:in `addEntries' Other info that might help: It's...

Execute code once Sinatra server is running

I have a Sinatra Application enclosed in Sinatra::Base and I'd like to run some code once the server has started, how should I go about doing this? Here's an example: require 'sinatra' require 'launchy' class MyServer < Sinatra::Base get '/' do "My server" end # This is the bit I'm not sure how to do after_server_running ...

ExtJs Direct with Sinatra

Has anyone used ExtJs Direct functionality with Sinatra? I see ExtJs Direct examples for Merb and Rails, but I haven't found anything which will work with pure Ruby. ...