Skip to content

Commit

Permalink
Skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
grimen committed Oct 19, 2011
0 parents commit 6f9ff32
Show file tree
Hide file tree
Showing 12 changed files with 212 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .gitignore
@@ -0,0 +1,9 @@
.DS_Store
.bundle
.rbx
.*~
Gemfile.lock
pkg/*
*.gem
*.rbc
*~
10 changes: 10 additions & 0 deletions .travis.yml
@@ -0,0 +1,10 @@
rvm:
- 1.8.7
- 1.9.2
- ree
- ruby-head
- rbx
- rbx-2.0
- jruby
notifications:
disabled: true
9 changes: 9 additions & 0 deletions Gemfile
@@ -0,0 +1,9 @@
source "http://rubygems.org"

gemspec

group :test do
group :darwin do
gem 'rb-fsevent'
end
end
10 changes: 10 additions & 0 deletions Guardfile
@@ -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
20 changes: 20 additions & 0 deletions MIT-LICENSE
@@ -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.
44 changes: 44 additions & 0 deletions README.textile
@@ -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
9 changes: 9 additions & 0 deletions Rakefile
@@ -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
19 changes: 19 additions & 0 deletions lib/rack/iframe.rb
@@ -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
5 changes: 5 additions & 0 deletions lib/rack/iframe/version.rb
@@ -0,0 +1,5 @@
module Rack
class Iframe
VERSION = "0.0.1"
end
end
30 changes: 30 additions & 0 deletions rack-alive.gemspec
@@ -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
38 changes: 38 additions & 0 deletions spec/rack-alive_spec.rb
@@ -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
9 changes: 9 additions & 0 deletions spec/spec_helper.rb
@@ -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'

0 comments on commit 6f9ff32

Please sign in to comment.