Sha256: bb5138396e1580c1dff68e71d4e5f403c4ba4b314425f9dc28865a6afa05597f

Contents?: true

Size: 1.07 KB

Versions: 1

Compression:

Stored size: 1.07 KB

Contents

# CHANGES

## Jellyfish 0.4.0 -- 2012-10-14

* Now you can define your own custom controller like:

``` ruby
require 'jellyfish'
class Heater
  include Jellyfish
  get '/status' do
    temperature
  end

  def controller; Controller; end
  class Controller < Jellyfish::Controller
    def temperature
      "30\u{2103}\n"
    end
  end
end
use Rack::ContentLength
use Rack::ContentType, 'text/plain'
run Heater.new
```

* Now it's possible to use a custom matcher instead of regular expression:

``` ruby
require 'jellyfish'
class Tank
  include Jellyfish
  class Matcher
    def match path
      path.reverse == 'match/'
    end
  end
  get Matcher.new do |match|
    "#{match}\n"
  end
end
use Rack::ContentLength
use Rack::ContentType, 'text/plain'
run Tank.new
```

* Added a Sinatra flavor controller

``` ruby
require 'jellyfish'
class Tank
  include Jellyfish
  def controller; Jellyfish::Sinatra; end
  get %r{^/(?<id>\d+)$} do
    "Jelly ##{params[:id]}\n"
  end
end
use Rack::ContentLength
use Rack::ContentType, 'text/plain'
run Tank.new
```

## Jellyfish 0.3.0 -- 2012-10-13

* Birthday!

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jellyfish-0.4.0 CHANGES.md