Permalink
Browse files

concurrency mania

  • Loading branch information...
1 parent c0745fc commit c2c7973a9c8ddc1028d92ad375c21dca604a515a @gnarmis committed Apr 25, 2012
Showing with 118 additions and 9 deletions.
  1. +0 −1 .gitignore
  2. +3 −5 Gemfile
  3. +106 −0 Gemfile.lock
  4. +4 −0 README.md
  5. +1 −2 config.ru
  6. +4 −0 lib/foo/foo.rb
  7. +0 −1 spec/spec_helper.rb
View
@@ -1,4 +1,3 @@
-*.lock
*.log
coverage
.yardoc
View
@@ -1,12 +1,12 @@
source :rubygems
gem 'rack'
-gem 'rack'
gem 'sinatra'
-gem 'data_mapper', '1.2.0'
-#gem 'dm-sqlite-adaptor', '1.2.0'
+gem 'sinatra-synchrony'
+gem 'faraday'
group :development do
+ gem 'thin'
gem 'pry'
gem 'logger'
gem 'shotgun'
@@ -17,6 +17,4 @@ group :test do
gem 'rack-test', :require => "rack/test"
gem 'capybara', :require => "capybara/rspec"
gem 'simplecov', :require => false
- gem 'redcarpet'
- gem 'yard'
end
View
@@ -0,0 +1,106 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ addressable (2.2.7)
+ capybara (1.1.2)
+ mime-types (>= 1.16)
+ nokogiri (>= 1.3.3)
+ rack (>= 1.0.0)
+ rack-test (>= 0.5.4)
+ selenium-webdriver (~> 2.0)
+ xpath (~> 0.1.4)
+ childprocess (0.3.2)
+ ffi (~> 1.0.6)
+ coderay (1.0.6)
+ daemons (1.1.8)
+ diff-lcs (1.1.3)
+ em-http-request (1.0.0)
+ addressable (>= 2.2.3)
+ em-socksify
+ eventmachine (>= 1.0.0.beta.3)
+ http_parser.rb (>= 0.5.2)
+ em-resolv-replace (1.1.2)
+ em-socksify (0.1.0)
+ eventmachine
+ em-synchrony (1.0.0)
+ eventmachine (>= 1.0.0.beta.1)
+ eventmachine (1.0.0.beta.3)
+ faraday (0.8.0)
+ multipart-post (~> 1.1)
+ ffi (1.0.11)
+ http_parser.rb (0.5.3)
+ libwebsocket (0.1.3)
+ addressable
+ logger (1.2.8)
+ method_source (0.7.1)
+ mime-types (1.18)
+ multi_json (1.0.4)
+ multipart-post (1.1.5)
+ nokogiri (1.5.2)
+ pry (0.9.9.3)
+ coderay (~> 1.0.5)
+ method_source (~> 0.7.1)
+ slop (>= 2.4.4, < 3)
+ rack (1.4.1)
+ rack-fiber_pool (0.9.2)
+ rack-protection (1.2.0)
+ rack
+ rack-test (0.6.1)
+ rack (>= 1.0)
+ rspec (2.9.0)
+ rspec-core (~> 2.9.0)
+ rspec-expectations (~> 2.9.0)
+ rspec-mocks (~> 2.9.0)
+ rspec-core (2.9.0)
+ rspec-expectations (2.9.1)
+ diff-lcs (~> 1.1.3)
+ rspec-mocks (2.9.0)
+ rubyzip (0.9.7)
+ selenium-webdriver (2.21.2)
+ childprocess (>= 0.2.5)
+ ffi (~> 1.0)
+ libwebsocket (~> 0.1.3)
+ multi_json (~> 1.0)
+ rubyzip
+ shotgun (0.9)
+ rack (>= 1.0)
+ simplecov (0.6.1)
+ multi_json (~> 1.0)
+ simplecov-html (~> 0.5.3)
+ simplecov-html (0.5.3)
+ sinatra (1.3.2)
+ rack (~> 1.3, >= 1.3.6)
+ rack-protection (~> 1.2)
+ tilt (~> 1.3, >= 1.3.3)
+ sinatra-synchrony (0.3.0)
+ em-http-request (= 1.0.0)
+ em-resolv-replace (>= 1.1.1)
+ em-synchrony (= 1.0.0)
+ eventmachine (= 1.0.0.beta.3)
+ rack-fiber_pool (= 0.9.2)
+ sinatra (>= 1.0)
+ slop (2.4.4)
+ thin (1.3.1)
+ daemons (>= 1.0.9)
+ eventmachine (>= 0.12.6)
+ rack (>= 1.0.0)
+ tilt (1.3.3)
+ xpath (0.1.4)
+ nokogiri (~> 1.3)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ capybara
+ faraday
+ logger
+ pry
+ rack
+ rack-test
+ rspec
+ shotgun
+ simplecov
+ sinatra
+ sinatra-synchrony
+ thin
View
@@ -10,6 +10,10 @@ Want to just dive into development without browsing around for a while and setti
- clone this repository
+- using RVM, install/use 1.9.2 (`rvm install 1.9.2`, `rvm use 1.9.2`). 1.9.3 doesn't play nice with EventMachine or Thin.
+
+- create an RVM gemset
+
- run `bundle install` (add other gems you may need to the Gemfile beforehand)
- start building your project
View
@@ -1,6 +1,5 @@
require File.dirname(__FILE__) + '/config/boot.rb'
run Rack::URLMap.new({
- "/" => Project::Foo,
- "/foo" => Project::FooAPI
+ "/" => Project::Foo
})
View
@@ -1,5 +1,9 @@
+require 'faraday'
+
module Project
class Foo < Sinatra::Base
+ register Sinatra::Synchrony
+ Faraday.default_adapter = :em_synchrony
# set configuration for this app
configure :production, :development do
enable :logging
View
@@ -5,7 +5,6 @@
end
require File.expand_path(File.dirname(__FILE__) + "/../config/boot")
-
RSpec.configure do |conf|
conf.include Rack::Test::Methods
conf.include Capybara::DSL

0 comments on commit c2c7973

Please sign in to comment.