Code Monkey home page Code Monkey logo

cramp's People

Contributors

anatol avatar batizhevsky avatar bebac avatar devton avatar indrekj avatar jcoglan avatar koudelka avatar laktek avatar lazyatom avatar lifo avatar lorensr avatar lucasallan avatar mrjaba avatar pastorius avatar rickyrobinson avatar rookus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cramp's Issues

Fibers and respond_with

FiberPool is not usable in respond_with, because respond_with is not wrapped in fiber

FiberError: can't yield from root fiber

Issue with activerecord functionality

I try create and run cramp application with activerecord functionality, but when I run server it give me error:

/root/cs/application.rb:27:in `initialize!': uninitialized constant Cs::Application::ActiveRecord (NameError)
    from config.ru:2:in `block in <main>'
    from /usr/local/rvm/gems/ruby-1.9.2-p180/gems/rack-1.3.2/lib/rack/builder.rb:51:in `instance_eval'
    from /usr/local/rvm/gems/ruby-1.9.2-p180/gems/rack-1.3.2/lib/rack/builder.rb:51:in `initialize'
    from config.ru:1:in `new'
    from config.ru:1:in `<main>'
    from /usr/local/rvm/gems/ruby-1.9.2-p180/gems/thin-1.2.11/lib/rack/adapter/loader.rb:36:in `eval'
    from /usr/local/rvm/gems/ruby-1.9.2-p180/gems/thin-1.2.11/lib/rack/adapter/loader.rb:36:in `load'
    from /usr/local/rvm/gems/ruby-1.9.2-p180/gems/thin-1.2.11/lib/thin/controllers/controller.rb:181:in `load_rackup_config'
    from /usr/local/rvm/gems/ruby-1.9.2-p180/gems/thin-1.2.11/lib/thin/controllers/controller.rb:71:in `start'
    from /usr/local/rvm/gems/ruby-1.9.2-p180/gems/thin-1.2.11/lib/thin/runner.rb:185:in `run_command'
    from /usr/local/rvm/gems/ruby-1.9.2-p180/gems/thin-1.2.11/lib/thin/runner.rb:151:in `run!'
    from /usr/local/bin/cramp:16:in `<main>'

After adding

require 'active_record'

Server start. Is anybody have that problem, or it's only in my system?

Cramp depends on Arel and MysqlPlus.

The fact that Cramp requires Arel and MysqlPlus is a bit unpleasant for those of us who do not use ActiveRecord or MySQL. I am looking at async web frameworks that I could use in my DataMapper backed project.

cramp gem still has old dependencies

If you run "gem dependency cramp", you can still see:

Gem cramp-0.11
activemodel (> 3.0.0.beta3, runtime)
activesupport (
> 3.0.0.beta3, runtime)
arel (= 0.3.3, runtime)
eventmachine (> 0.12.10, runtime)
mysqlplus (
> 0.1.1, runtime)
rack (~> 1.1.0, runtime)

that is very unpleasant :)

Table Name does not follow camelization

Hello,

I have a model called ModelClass for example. Instead of querying a table named model_class, it queries modelclass thus not following the camelization standard of rails migration. You might guess I want to reuse tables I already have.

I do not know if I need to look into arel or cramp model code to see where I can force the table name to something else.

Thanks!
Julien.

rainsocket.ru example don't work with Rainbows 3.1.0

rainbows -E deployment -c rainbows.conf hello_world.ru

I, [2011-02-19T20:55:32.441969 #17259]  INFO -- : listening on addr=0.0.0.0:8080 fd=3
I, [2011-02-19T20:55:32.443003 #17259]  INFO -- : worker=0 spawning...
I, [2011-02-19T20:55:32.444474 #17259]  INFO -- : master process ready
I, [2011-02-19T20:55:32.447091 #17260]  INFO -- : worker=0 spawned pid=17260
I, [2011-02-19T20:55:32.447649 #17260]  INFO -- : Refreshing Gem list
I, [2011-02-19T20:55:32.928327 #17260]  INFO -- : Rainbows! EventMachine worker_connections=1024
I, [2011-02-19T20:55:32.928476 #17260]  INFO -- : EventMachine: epoll=false kqueue=true

In Google Chrome console:

ws = new WebSocket('ws://localhost:8080'); ws.onmessage = function(evt){ console.log(evt.data); }

In terminal I can see:

127.0.0.1 - - [19/Feb/2011 20:55:37] "GET / HTTP/1.1" -1 - 0.0001

But after 2 sec in Google Chrome console:

Unexpected response code: 200

Messages aren't received...

OS X 10.6.6 / Google Chrome 10.0.648.82

Segfault

/Users/oleg/.rvm/rubies/ruby-1.9.2-p180/bin/ruby -I"lib:test" -I"/Users/oleg/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib" "/Users/oleg/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/rake_test_loader.rb" "test/**/*_test.rb" 
Loaded suite /Users/oleg/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.9.2/lib/rake/rake_test_loader
Started

BaseTest:
     PASS test_body (0.09s) 
     PASS test_headers (0.00s) 

CallbackTest:
     PASS test_before_start_halt (0.00s) 
     PASS test_on_finish_callback (0.00s) 
     PASS test_on_start_callback (0.00s) 

ChunkedTransportTest:
     PASS test_body (0.00s) 
     PASS test_headers (0.00s) 

CustomHeadersTest:
     PASS test_headers (0.00s) 

ExceptionHandlerTest:
     PASS test_bad_respond_with (0.02s) 
     PASS test_exception_in_before_start (0.00s) 
     PASS test_exception_in_on_start (0.01s) 
     PASS test_exception_in_timer (0.00s) 

FiberPoolTest:
/Users/oleg/.rvm/gems/ruby-1.9.2-p180/gems/eventmachine-1.0.0.beta.3/lib/eventmachine.rb:941: [BUG] Segmentation fault
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin11.2.0]

-- control frame ----------
c:0023 p:---- s:0107 b:0107 l:000106 d:000106 CFUNC  :each
c:0022 p:0094 s:0104 b:0104 l:000103 d:000103 METHOD /Users/oleg/.rvm/gems/ruby-1.9.2-p180/gems/eventmachine-1.0.0.beta.3/lib/eventmachine.rb:941
c:0021 p:---- s:0099 b:0099 l:000098 d:000098 FINISH
c:0020 p:---- s:0097 b:0097 l:000096 d:000096 CFUNC  :run_machine
c:0019 p:0248 s:0094 b:0094 l:000093 d:000093 METHOD /Users/oleg/.rvm/gems/ruby-1.9.2-p180/gems/eventmachine-1.0.0.beta.3/lib/eventmachine.rb:199
c:0018 p:0074 s:0087 b:0087 l:001348 d:001348 METHOD /Users/oleg/Sites/git_forks/cramp-blah/lib/cramp/test_case.rb:27
c:0017 p:0077 s:0078 b:0078 l:001268 d:001268 METHOD /Users/oleg/Sites/git_forks/cramp-blah/lib/cramp/test_case.rb:39
c:0016 p:0019 s:0067 b:0067 l:001358 d:001358 METHOD /Users/oleg/Sites/git_forks/cramp-blah/test/controller/fiber_pool_test.rb:50
c:0015 p:0042 s:0064 b:0064 l:000063 d:000063 METHOD /Users/oleg/.rvm/gems/ruby-1.9.2-p180/gems/turn-0.8.2/lib/turn/autorun/minitest.rb:157
c:0014 p:0010 s:0058 b:0058 l:001020 d:000057 BLOCK  /Users/oleg/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.9/lib/active_support/testing/setup_and_teardown.rb:35
c:0013 p:0173 s:0056 b:0056 l:000055 d:000055 METHOD /Users/oleg/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.9/lib/active_support/callbacks.rb:419
c:0012 p:0019 s:0047 b:0047 l:001020 d:001020 METHOD /Users/oleg/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.9/lib/active_support/testing/setup_and_teardown.rb:34
c:0011 p:0069 s:0041 b:0040 l:0012f8 d:000039 BLOCK  /Users/oleg/.rvm/gems/ruby-1.9.2-p180/gems/turn-0.8.2/lib/turn/autorun/minitest.rb:77
c:0010 p:---- s:0033 b:0033 l:000032 d:000032 FINISH
c:0009 p:---- s:0031 b:0031 l:000030 d:000030 CFUNC  :each
c:0008 p:0068 s:0028 b:0028 l:0012f8 d:000027 BLOCK  /Users/oleg/.rvm/gems/ruby-1.9.2-p180/gems/turn-0.8.2/lib/turn/autorun/minitest.rb:69
c:0007 p:---- s:0024 b:0024 l:000023 d:000023 FINISH
c:0006 p:---- s:0022 b:0022 l:000021 d:000021 CFUNC  :each
c:0005 p:0082 s:0019 b:0019 l:0012f8 d:0012f8 METHOD /Users/oleg/.rvm/gems/ruby-1.9.2-p180/gems/turn-0.8.2/lib/turn/autorun/minitest.rb:63
c:0004 p:0213 s:0014 b:0014 l:000013 d:000013 METHOD /Users/oleg/.rvm/gems/ruby-1.9.2-p180/gems/turn-0.8.2/lib/turn/autorun/minitest.rb:42
c:0003 p:0057 s:0007 b:0007 l:000678 d:000c20 BLOCK  /Users/oleg/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/minitest/unit.rb:508
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:002128 d:002128 TOP   
---------------------------
-- Ruby level backtrace information ----------------------------------------
/Users/oleg/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/minitest/unit.rb:508:in `block in autorun'
/Users/oleg/.rvm/gems/ruby-1.9.2-p180/gems/turn-0.8.2/lib/turn/autorun/minitest.rb:42:in `run'
/Users/oleg/.rvm/gems/ruby-1.9.2-p180/gems/turn-0.8.2/lib/turn/autorun/minitest.rb:63:in `run_test_suites'
/Users/oleg/.rvm/gems/ruby-1.9.2-p180/gems/turn-0.8.2/lib/turn/autorun/minitest.rb:63:in `each'
/Users/oleg/.rvm/gems/ruby-1.9.2-p180/gems/turn-0.8.2/lib/turn/autorun/minitest.rb:69:in `block in run_test_suites'
/Users/oleg/.rvm/gems/ruby-1.9.2-p180/gems/turn-0.8.2/lib/turn/autorun/minitest.rb:69:in `each'
/Users/oleg/.rvm/gems/ruby-1.9.2-p180/gems/turn-0.8.2/lib/turn/autorun/minitest.rb:77:in `block (2 levels) in run_test_suites'
/Users/oleg/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.9/lib/active_support/testing/setup_and_teardown.rb:34:in `run'
/Users/oleg/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.9/lib/active_support/callbacks.rb:419:in `_run_setup_callbacks'
/Users/oleg/.rvm/gems/ruby-1.9.2-p180/gems/activesupport-3.0.9/lib/active_support/testing/setup_and_teardown.rb:35:in `block in run'
/Users/oleg/.rvm/gems/ruby-1.9.2-p180/gems/turn-0.8.2/lib/turn/autorun/minitest.rb:157:in `run'
/Users/oleg/Sites/git_forks/cramp-blah/test/controller/fiber_pool_test.rb:50:in `test_body'
/Users/oleg/Sites/git_forks/cramp-blah/lib/cramp/test_case.rb:39:in `get_body_chunks'
/Users/oleg/Sites/git_forks/cramp-blah/lib/cramp/test_case.rb:27:in `get_body'
/Users/oleg/.rvm/gems/ruby-1.9.2-p180/gems/eventmachine-1.0.0.beta.3/lib/eventmachine.rb:199:in `run'
/Users/oleg/.rvm/gems/ruby-1.9.2-p180/gems/eventmachine-1.0.0.beta.3/lib/eventmachine.rb:199:in `run_machine'
/Users/oleg/.rvm/gems/ruby-1.9.2-p180/gems/eventmachine-1.0.0.beta.3/lib/eventmachine.rb:941:in `run_deferred_callbacks'
/Users/oleg/.rvm/gems/ruby-1.9.2-p180/gems/eventmachine-1.0.0.beta.3/lib/eventmachine.rb:941:in `each'

-- C level backtrace information -------------------------------------------

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

rake aborted!
Command failed with status (): [/Users/oleg/.rvm/rubies/ruby-1.9.2-p180/bi...]

Tasks: TOP => default => test
(See full trace by running task with --trace)

Any idea what might be causing this?

cramp/callbacks.rb:92:in `handle_exception

I don't know what happen.. please help me ..
i
set mysql max connection to 800
set fiber poll to 800

and use ab to -n 800 -c 800 url. and the thin server crash...

/Users/zhuoyikang/.rvm/gems/ruby-1.9.3-p194/gems/cramp-0.15.1/lib/cramp/callbacks.rb:92:in handle_exception': cannot load such file -- cramp/exception_handler (LoadError) from /Users/zhuoyikang/.rvm/gems/ruby-1.9.3-p194/gems/cramp-0.15.1/lib/cramp/fiber_pool.rb:29:inrescue in block in callback_wrapper'
from /Users/zhuoyikang/.rvm/gems/ruby-1.9.3-p194/gems/cramp-0.15.1/lib/cramp/fiber_pool.rb:26:in block in callback_wrapper' from /Users/zhuoyikang/.rvm/gems/ruby-1.9.3-p194/gems/cramp-0.15.1/lib/vendor/fiber_pool.rb:48:incall'
from /Users/zhuoyikang/.rvm/gems/ruby-1.9.3-p194/gems/cramp-0.15.1/lib/vendor/fiber_pool.rb:48:in block (3 levels) in initialize' from /Users/zhuoyikang/.rvm/gems/ruby-1.9.3-p194/gems/cramp-0.15.1/lib/vendor/fiber_pool.rb:47:inloop'
from /Users/zhuoyikang/.rvm/gems/ruby-1.9.3-p194/gems/cramp-0.15.1/lib/vendor/fiber_pool.rb:47:in `block (2 levels) in initialize'

cramp websockets not work on Thin since faye-websocket ~> 0.7.1

Since cramp is depedent of 'faye-websocket', '~> 0.7.1' I have problem with websockets connection. Looks like Thin breaking something
On latest version websockets response looks like this:

GET /chat HTTP/1.1
Host: localhost:3001
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Key: PuTGxkRU5cjY8PZ5Y4+4mQ==
Sec-WebSocket-Version: 13

HTTP/1.1 101 Switching Protocols
Connection: keep-alive
Server: thin 1.6.2 codename Doc Brown

HTTP/1.1 101 Switching Protocols
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Accept: itIs6clgPwlktYYxEOu6s2pMNs8=

HTTP/1.1 200 OK
Connection: keep-alive
Server: thin 1.6.2 codename Doc Brown
Content-Type: text/html

�{"action":"connected"}
{"action":"disconnected"}

Previous dependency'faye-websocket', '~> 0.4.6' gives

GET /chat HTTP/1.1
Host: localhost:3001
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Key: 5Iba1zzsP3lHZoR9dvNezQ==
Sec-WebSocket-Version: 13

HTTP/1.1 101 Switching Protocols
Upgrade: websocket
Connection: Upgrade
Sec-WebSocket-Accept: gobdn6TEQiGIjj5vW2Vxtj9uMTE=

�{"action":"data"}
�{"action":"connected"}

Tested with 1.9.3-p392 and Gemfile dependencies

GEM
  remote: http://rubygems.org/
  specs:
    activesupport (3.2.18)
      i18n (~> 0.6, >= 0.6.4)
      multi_json (~> 1.0)
    async-rack (0.5.1)
      rack (~> 1.1)
    cramp (0.15.3)
      activesupport (~> 3.2.16)
      eventmachine (~> 1.0.3)
      faye-websocket (~> 0.7.1)
      rack (~> 1.5.2)
      thor (~> 0.18.0)
    daemons (1.1.9)
    eventmachine (1.0.3)
    faye-websocket (0.7.3)
      eventmachine (>= 0.12.0)
      websocket-driver (>= 0.3.1)
    http_router (0.11.1)
      rack (>= 1.0.0)
      url_mount (~> 0.2.1)
    i18n (0.6.9)
    multi_json (1.10.1)
    rack (1.5.2)
    thin (1.6.2)
      daemons (>= 1.0.9)
      eventmachine (>= 1.0.0)
      rack (>= 1.0.0)
    thor (0.18.1)
    unicode_utils (1.4.0)
    url_mount (0.2.1)
      rack
    websocket-driver (0.3.3)
    yajl-ruby (1.2.0)

PLATFORMS
  ruby

DEPENDENCIES
  async-rack
  cramp
  http_router
  thin
  unicode_utils
  yajl-ruby

So simple app in cramp does not work in current version

class WsAction < Cramp::Websocket
  on_start :on_start
  on_finish :on_finish
  on_data :on_data

  def on_start
  end
  def on_finish
  end
  def on_data
  end
end

Support for Rails 4?

cramp (>= 0) ruby depends on
activesupport (= 3.0.pre) ruby

er.... any plans to upgrade to support 4.x ?

Have a question about on_start stage

As mentioned, on_start callbacks provide multiple entry points into the Started Request state. In the example, there are two entries:
on_start :setup_redis_callbacks
on_start :fetch_twitter

I want to know is if both callbacks provides render, what will happen? Will it mess up the output for a client?

I've got YARD exceptions, installing cramp

subj.

Building YARD (yri) index for cramp-0.15.1...
[error]: ParserSyntaxError: syntax error in `lib/cramp/generators/templates/application/application.rb`:(4,8): syntax error, unexpected '<'
[error]: Stack trace:
    /var/lib/gems/1.9.1/gems/yard-0.7.5/lib/yard/parser/ruby/ruby_parser.rb:517:in `on_parse_error'
    /var/lib/gems/1.9.1/gems/yard-0.7.5/lib/yard/parser/ruby/ruby_parser.rb:49:in `parse'
    /var/lib/gems/1.9.1/gems/yard-0.7.5/lib/yard/parser/ruby/ruby_parser.rb:49:in `parse'
    /var/lib/gems/1.9.1/gems/yard-0.7.5/lib/yard/parser/ruby/ruby_parser.rb:15:in `parse'
    /var/lib/gems/1.9.1/gems/yard-0.7.5/lib/yard/parser/source_parser.rb:438:in `parse'
    /var/lib/gems/1.9.1/gems/yard-0.7.5/lib/yard/parser/source_parser.rb:361:in `parse_in_order'

[error]: ParserSyntaxError: syntax error in `lib/cramp/generators/templates/application/app/actions/home_action.rb`:(2,3): syntax error, unexpected '<'
[error]: Stack trace:
    /var/lib/gems/1.9.1/gems/yard-0.7.5/lib/yard/parser/ruby/ruby_parser.rb:517:in `on_parse_error'
    /var/lib/gems/1.9.1/gems/yard-0.7.5/lib/yard/parser/ruby/ruby_parser.rb:49:in `parse'
    /var/lib/gems/1.9.1/gems/yard-0.7.5/lib/yard/parser/ruby/ruby_parser.rb:49:in `parse'
    /var/lib/gems/1.9.1/gems/yard-0.7.5/lib/yard/parser/ruby/ruby_parser.rb:15:in `parse'
    /var/lib/gems/1.9.1/gems/yard-0.7.5/lib/yard/parser/source_parser.rb:438:in `parse'
    /var/lib/gems/1.9.1/gems/yard-0.7.5/lib/yard/parser/source_parser.rb:361:in `parse_in_order'

Cramp not flushing on render

Hi, I've got a problem with Cramp 0.15.1 not flushing to clients when you call render, so the entire response body is only being sent when finish is called.

I've tested this with all of the examples that stream, and it is true on Chrome and Firefox:

Chrome 17.0.963.12 dev
Firefox 8.0

Not sure if I can really offer any more information than that, happy to help try and fix if you want?

Reserved bit error

I'm getting the following error in the chrome console when connecting with the latest Chrome browser:

One or more reserved bits are on: reserved1 = 1, reserved2 = 0, reserved3 = 0 

Is this because Cramp doesn't support the latest protocol yet? Or ??

Can't run in ubuntu

I had installed rvm in my Ubuntu 11.04. I create ruby 1.9.2 for cramp. Then i run
gem install cramp
It installed cramp's gem and dependent gems. But when I run
"cramp new my_site"
it falled with error "cramp: command not found". Maybe I need include some additional path to my $PATH variable?

Why all the MySQL deps?

Hoy!

I think it would be great to have a split between the cramp/controllers and cramp/models gems so we can avoid installing MySQL if we don't need it :( It's such a pain...

ActiveSupport version bump

Hello,
it seems that the current Cramp gem has some outdated versions of the beta gems.
It requires ActiveSupport 3.0.0.beta, but "gem install activesupport --pre" installs 3.0.0.beta3.

This prevents installation.
I only recently started working with Ruby, so please ignore this if it is meaningless.
Thanks,

Luca

Streaming does not work

I have this code:

# hello_world.ru
require "rubygems"
require 'cramp'

class HomeAction < Cramp::Action
  def start
    render "Hello World"
    sleep 5
    render "foo"
    finish
  end
end

run HomeAction

I run this with thin --timeout 0 -R hello_world.ru start but nothing is streamed:

local ~$ curl -v http://127.0.0.1:3000
* About to connect() to 127.0.0.1 port 3000 (#0)
*   Trying 127.0.0.1... connected
* Connected to 127.0.0.1 (127.0.0.1) port 3000 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.21.0 (x86_64-pc-linux-gnu) libcurl/7.21.0 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.18
> Host: 127.0.0.1:3000
> Accept: */*
> 
< HTTP/1.1 200 OK
< Content-Type: text/html
< Connection: keep-alive
< Server: thin 1.2.11 codename Bat-Shit Crazy
* no chunk, no close, no size. Assume close to signal end
< 
* Closing connection #0
Hello Worldfoo

It takes exactly the sleep(5) seconds to get the result returned.

I have the same problem when running in a clamp skeleton application as described in the docs. (using Bundler)

Server output:

local ~/workspace/crampy$ thin --timeout 0 -R hello_world.ru start -V
>> Thin web server (v1.2.11 codename Bat-Shit Crazy)
>> Tracing ON
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:3000, CTRL+C to stop
GET / HTTP/1.1
User-Agent: curl/7.21.0 (x86_64-pc-linux-gnu) libcurl/7.21.0 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.18
Host: 127.0.0.1:3000
Accept: */*

HTTP/1.1 200 OK
Content-Type: text/html
Connection: keep-alive
Server: thin 1.2.11 codename Bat-Shit Crazy

Hello World
foo
^C>> Stopping ...

Versions:

local ~/workspace/crampy$ ruby -v
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux]
local ~/workspace/crampy$ thin -v
thin 1.2.11 codename Bat-Shit Crazy

Gems:

cramp (0.15.1)
http_router (0.10.2)
async-rack (0.5.1)
thin (1.2.11)

I am not sure where to start debugging so any help would be very appreciated! Thank you!

Tests fail on 1.9.2 and 1.9.3

Hello, I have had problems running the tests. I am on OS X 10.7.2 build 11C74.

Under ruby-1.9.2-p290, failure occurs at FiberPoolTest / test_body. Backtrace information is shown at the Ruby and C levels.

Under ruby-1.9.3-p0, WebSocketTest / test_sending_data_over_websocket passes, but the next test fails with the following error:
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/turn-0.8.3/lib/turn/runners/minirunner.rb:52:in map': uninitialized fiber (FiberError)`

Please let me know if any additional information would be helpful. I can post the Gemfile.lock or the backtrace data if needed.

run on_finish when kill/restart server

I have some finalize actions in on_finish callback, but these didn't run when I kill or restart server.
How can I finish all connections before kill/restart server? or there are better ways to do this?

problem with old gems

on rubygems this project have this old dependecies.

eventmachine ~> 0.12.10
mysqlplus ~> 0.1.1
rack ~> 1.1.0
arel = 0.3.3
activemodel ~> 3.0.0.beta3
activesupport ~> 3.0.0.beta3

is possible to update this?

cramp with twitter feed

hello, is the a way to have my data come in always the newest at the top and the old scrolling down, instead of the new tweets to come at the end.. thanks

EDIT: is tweeterstream sorry not tweeter feed

ActiveSupport really needed?

I really like Cramp, it's great but i'm not entirely sure about having ActiveSupport as a dependency.
This should be changed?

Incompatible character encodings

When I rendering data with chinese or japanese to a Firefox websocket client, it causes these:

shared/bundle/ruby/1.9.1/gems/cramp-0.15.1/lib/cramp/websocket/protocol10_frame_parser.rb:199:in `send_frame': incompatible character encodings: ASCII-8BIT and UTF-8 (Encoding::CompatibilityError)
    from shared/bundle/ruby/1.9.1/gems/cramp-0.15.1/lib/cramp/websocket/protocol10_frame_parser.rb:203:in `send_text_frame'
    from shared/bundle/ruby/1.9.1/gems/cramp-0.15.1/lib/cramp/action.rb:77:in `render_websocket'
    from shared/bundle/ruby/1.9.1/gems/cramp-0.15.1/lib/cramp/action.rb:14:in `render'

I tried modify the line to frame.force_encoding('utf-8') and it works fine,
but I'm not sure is that the best solution?

Website down

Hey @lifo, it looks like the website is down so I can't look at docs or even see if this is a gem I can use for my project. Could you take a look at it? Thanks!

No output when using Rack::Deflater

It seems that thin doesn't serve content properly unless it was generated via halt

Normal request with compression off:

[12:13:56][oleg@Liger:~]$ curl -N -v http://localhost:3000
* About to connect() to localhost port 3000 (#0)
*   Trying ::1... Connection refused
*   Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 3000 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5
> Host: localhost:3000
> Accept: */*
> 
< HTTP/1.1 400 Bad Request
< Content-Type: application/json
< Connection: keep-alive
< Vary: Accept-Encoding
< Server: thin 1.2.11 codename Bat-Shit Crazy
* no chunk, no close, no size. Assume close to signal end
< 
{"message":"Invalid URI"}* Closing connection #0

With compression enabled I see no response content:

[12:14:17][oleg@Liger:~]$ curl -N -v --compress http://localhost:3000
* About to connect() to localhost port 3000 (#0)
*   Trying ::1... Connection refused
*   Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 3000 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5
> Host: localhost:3000
> Accept: */*
> Accept-Encoding: deflate, gzip
> 
< HTTP/1.1 400 Bad Request
< Content-Type: application/json
< Connection: keep-alive
< Vary: Accept-Encoding
< Content-Encoding: deflate
< Server: thin 1.2.11 codename Bat-Shit Crazy
* no chunk, no close, no size. Assume close to signal end
< 
* Closing connection #0

However if my app outputs content via halt it seems to work:

[12:14:56][oleg@Liger:~]$ curl -N -v --compress http://localhost:3000/v1/users
* About to connect() to localhost port 3000 (#0)
*   Trying ::1... Connection refused
*   Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 3000 (#0)
> GET /v1/users HTTP/1.1
> User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5
> Host: localhost:3000
> Accept: */*
> Accept-Encoding: deflate, gzip
> 
< HTTP/1.1 400 Bad Request
< Content-Type: application/json
< Vary: Accept-Encoding
< Content-Encoding: deflate
< Connection: close
< Server: thin 1.2.11 codename Bat-Shit Crazy
< 
{"message":"No API key provided"}* Closing connection #0

Any idea what this might be?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.