Git Product home page Git Product logo

refraction's People

Contributors

ddollar avatar joshsusser 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

refraction's Issues

Access to routes?

Is there any way to access the application routes in the rewrite rules, or do I need to directly specify the URL/path? I tried calling a route method and it failed, saying undefined variable or method.

Rails 2.3.8 `load_missing_constant':NameError: uninitialized constant Refraction when including Gem via Bundler

I don't know if it's a Bundler issue or a Refraction issue, but when I attempt to use the Gem via Bundler, I receive an error on boot while things work fine if I include Refraction as a plugin. I'd much prefer to use the Gem.

`load_missing_constant':NameError: uninitialized constant Refraction

My environment files includes:
config.middleware.insert_before(::Rack::Lock, ::Refraction, {})

req.rewrite! :path => "/rack/sinatra/whatever"

NoMethodError: undefined method `empty?' for nil:NilClass

/Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/commonlogger.rb:53:in each' /Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/lint.rb:499:ineach'
/Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/commonlogger.rb:36:in each' /Library/Ruby/Gems/1.8/gems/shotgun-0.4/lib/shotgun.rb:96:inslurp'
/Library/Ruby/Gems/1.8/gems/shotgun-0.4/lib/shotgun.rb:62:in proceed_as_child' /Library/Ruby/Gems/1.8/gems/shotgun-0.4/lib/shotgun.rb:29:incall!'
/Library/Ruby/Gems/1.8/gems/shotgun-0.4/lib/shotgun.rb:15:in call' /Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/content_length.rb:13:incall'
/Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/chunked.rb:15:in call' /Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/handler/mongrel.rb:64:inprocess'
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in process_client' /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:ineach'
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in process_client' /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:inrun'
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in initialize' /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:innew'
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in run' /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:ininitialize'
/Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in new' /Library/Ruby/Gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:inrun'
/Library/Ruby/Gems/1.8/gems/rack-1.0.1/lib/rack/handler/mongrel.rb:34:in run' /Library/Ruby/Gems/1.8/gems/shotgun-0.4/bin/shotgun:129 /usr/bin/shotgun:19:inload'
/usr/bin/shotgun:19

Scheme is always HTTP on Heroku

req.scheme seems to always be http on Heroku. I tried logging the scheme in the Refraction config and it would say http even if the completed in Rails log said https.

Possible problem in config.middleware.insert_before line

Refraction rocks. I just had one small problem setting it up. Using

config.middleware.insert_before(::Rack::Lock, ::Refraction, {})

in production.rb gives me the error

gems/refraction-0.2.0/lib/refraction.rb:98:in `initialize':
wrong number of arguments (2 for 1) (ArgumentError)

(I'm running Rails 3.0.0.beta4.)

I removed the third argument and it worked:

config.middleware.insert_before(::Rack::Lock, ::Refraction)

uninitialized constant Refraction when using plugin with rails 2.3.2 app

Hi,

I recently tried to use refraction as a plugin with my rails 2.3.2 app.

My effort went like this:

$ script/plugin install git://github.com/pivotal/refraction.git

(plugin installed, initializer added)

Add this line to my environment.rb (to try it on development):

Rails::Initializer.run do |config|
  config.middleware.insert_before(::Rack::Lock, ::Refraction, {})
end
$ rake middleware

rake aborted!
uninitialized constant Refraction

$ script/console

/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:443:in load_missing_constant':NameError: uninitialized constant Refraction /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:443:inload_missing_constant':NameError: uninitialized constant ApplicationController

Any help, here?

Thanks!

Exception NoMethodError in application (super: no superclass method `path')

Running the following (in refraction_rules.rb lines 1-3):

Refraction.configure do |req|
  req.found! '/asdf_test' if req.path == "/asdf"
end

puts this error in my apache's error_log:

*** Exception NoMethodError in application (super: no superclass method `path') (process 833):
from /Users/.../vendor/plugins/refraction/lib/refraction.rb:66:in `path'
from /Users/.../config/initializers/refraction_rules.rb:2

This is running with apache + Passenger on OSX. Running with webrick gives no error. Any idea why this might be?

rewrite! not working?

This works:

req.permanent! :host => 'fb.local'

But this does not:

req.rewrite! 'fb.local'

Am I missing something? The syntax is identical to the example. If something is not working, I'm not quite sure how to debug the issue, so let me know what you need and I'll provide it.

Modify request parameters?

When I try:
req.params = [updated params]

I get an error because the request object doesn't have that method (writer).

Anyone know how I can update the parameters? It's Ruby, so I know it's possible.

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.