Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Integrate Unpoly with any Rack or Sinatra application

NotificationsYou must be signed in to change notification settings

adam12/rack-unpoly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Installation

Add this line to your application's Gemfile:

gem"rack-unpoly"

And then execute:

$ bundle

Or install it yourself as:

$ gem install rack-unpoly

Usage in a Rails application

Use the officialUnpoly gem from Makandra.

Usage in a Sinatra application

require"sinatra/base"require"sinatra/unpoly"classApp <Sinatra::BaseregisterSinatra::Unpolyget"/"doifup?"Unpoly request!"else"Not Unpoly :("endendend

Usage in a Roda application

Use theroda-unpoly gem.

Usage in a Rack application (that's not Rails, Sinatra, or Roda)

require"rack"require"rack/unpoly/middleware"useRack::Unpoly::Middlewareapp=->(env){ifenv["rack.unpoly"].up?[200,{},["Unpoly request!"]]else[200,{},["Not Unpoly :("]]end}runapp

Where are the Javascript and CSS assets?

I've chosen not to bundle those assets with the gem as they might be updated morefrequently then this library. Most Ruby web libraries outside of Rails are asset-agnostic(for the most part), so it's easier if you bring in your assets as you see fit for yourspecific needs.

Contributing

Bug reports and pull requests are welcome on GitHub athttps://github.com/adam12/rack-unpoly.

I love pull requests! If you fork this project and modify it, please ping me to seeif your changes can be incorporated back into this project.

That said, if your feature idea is nontrivial, you should probably open an issue todiscuss itbefore attempting a pull request.

License

The gem is available as open source under the terms of theMIT License.

About

Integrate Unpoly with any Rack or Sinatra application

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp