# SslRequirement module

**URL:** <https://www.ruby-forum.com/t/sslrequirement-module/170525>\
**Category:** Ruby\
**Created:** [June 26, 2007, 10:46pm UTC](https://www.ruby-forum.com/t/sslrequirement-module/170525 "2007-06-26T22:46:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dissolved](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b3f665/32.png) [@dissolved](https://www.ruby-forum.com/u/dissolved)\
**Post date:** [June 26, 2007, 10:46pm UTC](https://www.ruby-forum.com/t/sslrequirement-module/170525/1 "2007-06-26T22:46:35Z")

</div>

This is a question is about the SslRequirement rails plugin. However,  
it’s also about core concepts behind ruby modules.

Here’s the code for the plugin.

[http://pastie.caboo.se/73773](http://pastie.caboo.se/73773)

Here’s an example of how you use it.

[http://pastie.caboo.se/73774](http://pastie.caboo.se/73774)

I’ve used this plugin all over the place in my app. But now, I want  
to do some performance testing on the app WITHOUT using https (mainly  
because I don’t have control over port 443 on the test machine).  
Ideally, I want to add a toggle variable to the module that I can set  
from an environment file or application\_controller if I must. What I  
don’t want to do is go around the app and comment out all my  
ssl\_required statements.

I’m at a loss as where to inject this toggle, and whether it should be  
a class variable or class instance variable or maybe something  
completely different. Any and all advice is welcome.

–RYAN

PS - Yes, I’ve double posted this in the rails talk and ruby  
discussion groups.
