sinatra

Making a social network with Sinatra

I'm rather curious. Would it be possible to make something as complex as a basic social network (login etc) with Sinatra? ...

Listing buckets with AWS::S3 in Sinatra

I'm trying to access my Amazon S3 account using the aws-s3 gem, but no matter what I do, I can't even print a bucket list. Error: undefined method `bytesize' for #<AWS::S3::Bucket:0x1b9e488> From Code: # hello_world.rb require 'rubygems' require 'sinatra' require 'aws/s3' get '/' do connection = AWS::S3::Base.establish_connection...

Does Pony support SSL/TLS for GMail (Yes!)

Does the Pony gem support e-mail with SSL/TLS? I'm trying to (easily) send e-mail with Google Apps on Heroku. Thanks! After jumping through several hoops, I found a combination of solutions that worked for me: http://417east.com/thoughts/2009/austin/heroku-gmail-sinatra. ...

Get client's IP address in Sinatra?

This is a really simple question, but I cannot find any mention of this, anywhere.. How do I get the client's IP address from in Sinatra? get '/' do "Your IP address is #{....}" end ...

Request information from OpenID provider with Ruby

Im currently using ruby-openid gem to work with OpenID providers within my Sinatra application, but i cannot get information fields. This is an example request: openid_url = 'blahblah' resp = openid.begin(openid_url) resp.add_extension_arg('sreg','required','email') resp.add_extension_arg('sreg','optional','fullname,nickname,dob,gender...

Usage of Sinatra in Small-Medium apps

Is Sinatra being used for medium-large sized web applications (not just for small apps)? ...

Can Netbeans be used as an IDE for Sinatra?

Preface: I'm a big fan of Netbeans for Rails development. I'm just starting my first Sinatra app and it doesn't look like Netbeans provides any IDE support for Sinatra development. Has anyone discovered a solution or did I just miss something? ...

How do you debug a Sinatra app like a Rails app?

In my main Sinatra controller, I want to debug the params hash after it is POSTed from a form. I have added: puts params.inspect and set :logging, :true The params.inspect works if everything goes well. But if an error happens before the controller is executed I'm not getting any information about the error like I would in Rails b...

Novice, using Ruby to build a small application

I'm learning Ruby right now and I got stuck, maybe you guys can help me a bit. I want to build a small app based on Sinatra that increments a value and prints it on different requests. You go to the root page and you get 1, if you refresh the page you get 2 and so on. I have no ideea how to get the increment to happen only on refresh ...

Problem creating ActiveRecord model: data missing from save

Hi all, I'm having trouble creating a new model row in the database using ActiveRecord in a Sinatra app I'm developing. The object in question is being created without any errors (using save!, no exceptions are raised), but most of the data I specify for the save is not present. class ProjectMeta < ActiveRecord::Base attr_accessor ...

Is there a .NET framework similar to Ruby's Sinatra?

Does anyone know if there is a .NET library/API similar to Ruby's Sinatra? Just wondering since with the new Routing API in ASP.NET MVC, WCF and .NET 3.5, it seems like a possibility. ...

What's the most commonly used unit testing framework for different types of Ruby applications?

Are the same unit testing frameworks used for different web frameworks - Rails, Merb, Sinatra, Ramaze and desktop frameworks - Shoes? And what is the most widely used unit testing framework that would work with all of the various web and desktop frameworks? ...

What's the advantage of making a Sinatra/Rack app into a single, locally-executable file?

I was reading the description of Vegas, which is a gem that aims to solve the simple problem of creating executable versions of Sinatra/Rack apps. I didn't know this was a problem that needed to be solved. The reason this seems of dubious benefit is because of this: Now if you run ./my_app it should: * find an appropria...

Sinatra "after" filter

Sinatra has a "before" filter, but is there an easy way to implement an "after" filter? ...

How to configure VirtualHost for a Sinatra App with Passenger?

Hey experts, i run a rails app on passenger and it all works like it should. Now i want to add an sinatra app to run as rack application with passenger, but i always get a routing error. My VirtualHosts File looks like: NameVirtualHost *:80 <VirtualHost *:80> ServerName www.domain1.com DocumentRoot /home/user1/vhosts/project1/pub...

How do I do html forms with sinatra?

Is there some utilities available so that I could easily encapsulate form fields passed in requests in an object or do I have to create it myself by parsing fields from params in every request? ...

Using Rack::Session::Datamapper

mkristgan's rack_datamapper gem says that it "can be wrapped to be used in a specific environement, i.e. Rack::Session::Datamapper". Unfortunately, I don't know quite enough about Ruby to accomplish this task yet –Modules/Classes in Ruby are still above my head (coming from PHP). Can anyone offer assistance with using rack_datamapper...

How to check if a template exists in Sinatra

In the Sinatra ruby framework, I have a route like this: get '/portfolio/:item' do haml params[:item].to_sym end This works great if the template that exists (e.g., if I hit /portfolio/website, and I have a template called /views/website.haml), but if I try a URL that doesn't have a template, like example.com/portfolio/notemplate, I...

Automatic logging of DataMapper queries

I am working on a simple app in Sinatra with DataMapper. I want to see the queries that DM is created for my various chained finders, etc. I have tried: DataMapper::Logger.new(STDOUT, :debug) in my configure do ... end block in an environment.rb file that loads when the app is started. I have also tried: DataMapper::Logger.new('...

Having trouble debugging Sinatra app in production

Hello Stackies, I'm deploying a Sinatra app using passenger. The deployed app is working, but not entirely: some paths work fine, others simply render a blank page. I can't seem to find any major differences between the routes that work and the routes that don't, and I can't seem to track down any errors.. Handlers I have defined the ...