Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 6f9ff32
Showing
12 changed files
with
212 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.DS_Store | ||
.bundle | ||
.rbx | ||
.*~ | ||
Gemfile.lock | ||
pkg/* | ||
*.gem | ||
*.rbc | ||
*~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
rvm: | ||
- 1.8.7 | ||
- 1.9.2 | ||
- ree | ||
- ruby-head | ||
- rbx | ||
- rbx-2.0 | ||
- jruby | ||
notifications: | ||
disabled: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
source "http://rubygems.org" | ||
|
||
gemspec | ||
|
||
group :test do | ||
group :darwin do | ||
gem 'rb-fsevent' | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
guard 'bundler' do | ||
watch('Gemfile') | ||
watch(/^.+\.gemspec/) | ||
end | ||
|
||
guard 'minitest' do | ||
watch(%r|^spec/(.*)_spec\.rb|) | ||
watch(%r|^lib/(.*)\.rb|) # { |m| "spec/#{m[1]}_spec.rb" } | ||
watch(%r|^spec/spec_helper\.rb|) { "spec" } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Copyright (c) 2011 Jonas Grimfelt, Merchii. http://merchii.com | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
"Software"), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
h1. RACK-IFRAME "!https://secure.travis-ci.org/merchii/rack-iframe.png!":http://travis-ci.org/merchii/rack-iframe | ||
|
||
_Rack middleware for enabling problematic web browsers (Internet Explorer and Safari) to use same cookies in iframes as in parent windows._ | ||
|
||
h2. Installation | ||
|
||
Add to your @Gemfile@: | ||
|
||
<pre> | ||
gem 'rack-iframe' | ||
</pre> | ||
|
||
...and @bundle install@. | ||
|
||
h2. Usage | ||
|
||
*Minimal:* | ||
|
||
<pre> | ||
require 'rack/iframe' | ||
|
||
use Rack::Iframe | ||
</pre> | ||
|
||
h2. Test | ||
|
||
<pre> | ||
$ bundle exec rake test | ||
</pre> | ||
|
||
...or using "Guard":http://github.com/guard/guard | ||
|
||
<pre> | ||
$ bundle exec guard | ||
</pre> | ||
|
||
h2. Notes | ||
|
||
This gem was developed for our own requirements at *"Merchii":http://github.com/merchii*, so feel free to send pull-requests with enhancements of any kind (features, bug-fixes, documentation, tests, etc.) to make it better or useful for you as well. | ||
|
||
h2. License | ||
|
||
Released under the MIT license. | ||
Copyright (c) "Jaakko Suutarla":http://github.com/jaakkos, "Jonas Grimfelt":http://github.com/grimen, "Merchii":http://github.com/merchii |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
require 'bundler/gem_tasks' | ||
require 'rake/testtask' | ||
|
||
task :default => :test | ||
|
||
Rake::TestTask.new do |t| | ||
t.libs << ['lib', 'spec'] | ||
t.pattern = "spec/*_spec.rb" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
require "rack/iframe/version" | ||
|
||
module Rack | ||
class Iframe | ||
|
||
def initialize(app) | ||
@app = app | ||
end | ||
|
||
def call(env) | ||
@app.call(env) | ||
end | ||
|
||
protected | ||
|
||
# TODO: Helpers | ||
|
||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module Rack | ||
class Iframe | ||
VERSION = "0.0.1" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# -*- encoding: utf-8 -*- | ||
$:.push File.expand_path("../lib", __FILE__) | ||
require "rack/iframe/version" | ||
|
||
Gem::Specification.new do |s| | ||
s.name = "rack-iframe" | ||
s.version = Rack::Iframe::VERSION | ||
s.authors = ["Merchii", "Jaakko Suuturla", "Jonas Grimfelt"] | ||
s.email = ["operations@merchii.com", "jaakko@suutarla.com", "grimen@gmail.com"] | ||
s.homepage = "http://github.com/merchii/rack-iframe" | ||
s.summary = %q{Rack middleware for enabling problematic web browsers (Internet Explorer and Safari) to use same cookies in iframes as in parent windows.} | ||
s.description = s.summary | ||
|
||
s.rubyforge_project = s.name | ||
|
||
s.files = `git ls-files`.split("\n") | ||
s.test_files = `git ls-files -- spec/*`.split("\n") | ||
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } | ||
s.require_paths = ["lib"] | ||
|
||
s.add_runtime_dependency 'rack' | ||
|
||
s.add_development_dependency 'rake' | ||
s.add_development_dependency 'bundler' | ||
s.add_development_dependency 'minitest' | ||
s.add_development_dependency 'guard' | ||
s.add_development_dependency 'guard-bundler' | ||
s.add_development_dependency 'guard-minitest' | ||
s.add_development_dependency 'rack-test' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
require 'spec_helper' | ||
|
||
describe Rack::Iframe do | ||
|
||
describe "VERSION" do | ||
it 'should be defined' do | ||
defined?(::Rack::Iframe::VERSION) | ||
end | ||
|
||
it 'should be a valid version string (e.g. "0.0.1", or "0.0.1.rc1")' do | ||
valid_version_string = /^\d+\.\d+\.\d+/ | ||
Rack::Iframe::VERSION.must_match valid_version_string | ||
end | ||
end | ||
|
||
describe "Middleware" do | ||
before do | ||
@app = lambda { |env| [200, {'Content-Type' => 'text/plain'}, [""]] } # TODO: Customize | ||
end | ||
|
||
# TODO: "The specs" :) | ||
end | ||
|
||
private | ||
|
||
def status(response) | ||
response[0] | ||
end | ||
|
||
def headers(response) | ||
response[1] | ||
end | ||
|
||
def body(response) | ||
response[2] | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# -*- encoding: utf-8 -*- | ||
require 'minitest/autorun' | ||
require 'minitest/unit' | ||
require 'minitest/spec' | ||
require 'minitest/pride' | ||
|
||
require 'rack/mock' | ||
|
||
require 'rack/iframe' |