Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
grosser committed Nov 13, 2012
1 parent a751cf3 commit 94defe0
Show file tree
Hide file tree
Showing 17 changed files with 58 additions and 134 deletions.
12 changes: 5 additions & 7 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
source :rubygems

group :dev do
gem 'appraisal'
gem 'actionpack'
gem 'rake'
gem 'rspec', '~>2'
gem 'jeweler'
end
gem 'bump'
gem 'appraisal'
gem 'actionpack'
gem 'rake'
gem 'rspec', '~>2'
12 changes: 2 additions & 10 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,19 @@ GEM
bundler
rake
builder (3.0.4)
bump (0.3.5)
diff-lcs (1.1.3)
erubis (2.7.0)
git (1.2.5)
hike (1.2.1)
i18n (0.6.1)
jeweler (1.8.4)
bundler (~> 1.0)
git (>= 1.2.5)
rake
rdoc
journey (1.0.4)
json (1.7.5)
multi_json (1.3.7)
rack (1.4.1)
rack-cache (1.2)
rack (>= 0.4)
rack-test (0.6.2)
rack (>= 1.0)
rake (10.0.0)
rdoc (3.12)
json (~> 1.4)
rspec (2.11.0)
rspec-core (~> 2.11.0)
rspec-expectations (~> 2.11.0)
Expand All @@ -63,6 +55,6 @@ PLATFORMS
DEPENDENCIES
actionpack
appraisal
jeweler
bump
rake
rspec (~> 2)
17 changes: 1 addition & 16 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require 'rake/testtask'
require 'appraisal'
require 'bump/tasks'

Rake::TestTask.new(:test) do |test|
test.libs << 'lib'
Expand All @@ -10,19 +11,3 @@ end
task :default do
sh "bundle exec rake appraisal:install && bundle exec rake appraisal test"
end

begin
require 'jeweler'
Jeweler::Tasks.new do |gem|
gem.name = 'easy_esi'
gem.summary = "Rails: Cached pages with updated partials"
gem.email = "michael@grosser.it"
gem.homepage = "http://github.com/grosser/#{gem.name}"
gem.authors = ["Michael Grosser"]
gem.add_runtime_dependency 'activerecord'
end

Jeweler::GemcutterTasks.new
rescue LoadError
puts "Jeweler, or one of its dependencies, is not available. Install it with: gem install jeweler"
end
3 changes: 0 additions & 3 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ Basics
[Rails 2 Version](http://github.com/grosser/easy_esi/tree/rails2)

gem install easy_esi
Or

rails plugin install git://github.com/grosser/easy_esi.git

### Action-cache the controller (5s)
class UsersController < ApplicationController
Expand Down
1 change: 0 additions & 1 deletion VERSION

This file was deleted.

56 changes: 8 additions & 48 deletions easy_esi.gemspec
Original file line number Diff line number Diff line change
@@ -1,53 +1,13 @@
# Generated by jeweler
# DO NOT EDIT THIS FILE DIRECTLY
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
# -*- encoding: utf-8 -*-
$LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
name = "easy_esi"
require "#{name}/version"

Gem::Specification.new do |s|
s.name = "easy_esi"
s.version = "0.2.3"

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Michael Grosser"]
s.date = "2011-10-27"
Gem::Specification.new name, EasyEsi::VERSION do |s|
s.authors = "Michael Grosser"
s.email = "michael@grosser.it"
s.files = [
"CHANGELOG",
"Gemfile",
"Gemfile.lock",
"Rakefile",
"Readme.md",
"VERSION",
"easy_esi.gemspec",
"init.rb",
"lib/easy_esi.rb",
"test/easy_esi_test.rb",
"test/test_helper.rb",
"test/views/esi_disabled/_a_partial.erb",
"test/views/esi_disabled/show.erb",
"test/views/esi_disabled/test_filter.erb",
"test/views/esi_disabled/with_hash.erb",
"test/views/esi_enabled/_a_partial.erb",
"test/views/esi_enabled/_unserialize.erb",
"test/views/esi_enabled/serialize.erb",
"test/views/esi_enabled/show.erb",
"test/views/esi_enabled/with_hash.erb"
]
s.homepage = "http://github.com/grosser/easy_esi"
s.require_paths = ["lib"]
s.rubygems_version = "1.8.10"
s.files = `git ls-files`.split("\n")
s.homepage = "http://github.com/grosser/#{name}"
s.summary = "Rails: Cached pages with updated partials"

if s.respond_to? :specification_version then
s.specification_version = 3

if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
s.add_runtime_dependency(%q<activerecord>, [">= 0"])
else
s.add_dependency(%q<activerecord>, [">= 0"])
end
else
s.add_dependency(%q<activerecord>, [">= 0"])
end
s.add_runtime_dependency "actionpack", ">= 2"
end

1 change: 1 addition & 0 deletions gemfiles/rails.3.0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

source :rubygems

gem "bump"
gem "actionpack", "~>3.0.0"
gem "rake"
gem "appraisal"
Expand Down
2 changes: 2 additions & 0 deletions gemfiles/rails.3.0.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ GEM
bundler
rake
builder (2.1.2)
bump (0.3.5)
diff-lcs (1.1.3)
erubis (2.6.6)
abstract (>= 1.0.0)
Expand All @@ -47,5 +48,6 @@ PLATFORMS
DEPENDENCIES
actionpack (~> 3.0.0)
appraisal
bump
rake
rspec
1 change: 1 addition & 0 deletions gemfiles/rails.3.1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

source :rubygems

gem "bump"
gem "actionpack", "~>3.1.0"
gem "rake"
gem "appraisal"
Expand Down
2 changes: 2 additions & 0 deletions gemfiles/rails.3.1.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ GEM
bundler
rake
builder (3.0.4)
bump (0.3.5)
diff-lcs (1.1.3)
erubis (2.7.0)
hike (1.2.1)
Expand Down Expand Up @@ -55,5 +56,6 @@ PLATFORMS
DEPENDENCIES
actionpack (~> 3.1.0)
appraisal
bump
rake
rspec
1 change: 1 addition & 0 deletions gemfiles/rails.3.2.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

source :rubygems

gem "bump"
gem "actionpack", "~>3.2.0"
gem "rake"
gem "appraisal"
Expand Down
2 changes: 2 additions & 0 deletions gemfiles/rails.3.2.gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ GEM
bundler
rake
builder (3.0.4)
bump (0.3.5)
diff-lcs (1.1.3)
erubis (2.7.0)
hike (1.2.1)
Expand Down Expand Up @@ -54,5 +55,6 @@ PLATFORMS
DEPENDENCIES
actionpack (~> 3.2.0)
appraisal
bump
rake
rspec
1 change: 0 additions & 1 deletion init.rb

This file was deleted.

4 changes: 2 additions & 2 deletions lib/easy_esi.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class EasyEsi
VERSION = File.read( File.join(File.dirname(__FILE__),'..','VERSION') ).strip
require "easy_esi/version"

module EasyEsi
def self.include_for(data)
%{<esi:include src="#{serialize(data)}"/>}.html_safe
end
Expand Down
3 changes: 3 additions & 0 deletions lib/easy_esi/version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module EasyEsi
Version = VERSION = "0.2.3"
end
4 changes: 2 additions & 2 deletions test/easy_esi_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def test_filter
end

def send_a_file
send_file "VERSION"
send_file "Rakefile"
end
end

Expand Down Expand Up @@ -123,7 +123,7 @@ def setup

test "it can send a file" do
get :send_a_file
@response.body.should == File.read('VERSION')
@response.body.should =~ /task :default/
end
end

Expand Down
70 changes: 26 additions & 44 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,63 +5,45 @@
require 'action_controller'
require 'test/unit'
$LOAD_PATH << 'lib'
require './init'

# rails 2 vs ruby 1.9.3
MissingSourceFile::REGEXPS << [/^cannot load such file -- (.+)$/i, 1]
require 'easy_esi'

ActionController::Base.cache_store = :memory_store

if ActionPack::VERSION::MAJOR > 2
require 'action_dispatch/testing/test_process'
require 'action_dispatch/testing/test_process'

# fake checks
require 'ostruct'
module ActionController::UrlFor
def _routes
helpers = OpenStruct.new
helpers.url_helpers = Module.new
helpers
end
require 'ostruct'
module ActionController::UrlFor
def _routes
helpers = OpenStruct.new
helpers.url_helpers = Module.new
helpers
end
end

ROUTES = ActionDispatch::Routing::RouteSet.new
ROUTES.draw do
match ':controller(/:action(/:id(.:format)))'
end
ROUTES.finalize!
ROUTES = ActionDispatch::Routing::RouteSet.new
ROUTES.draw do
match ':controller(/:action(/:id(.:format)))'
end
ROUTES.finalize!

# funky patch to get @routes working, in 'setup' did not work
module ActionController::TestCase::Behavior
def process_with_routes(*args)
@routes = ROUTES
process_without_routes(*args)
end
alias_method_chain :process, :routes
module ActionController::TestCase::Behavior
def process_with_routes(*args)
@routes = ROUTES
process_without_routes(*args)
end
alias_method_chain :process, :routes
end

class ActionController::Base
self.view_paths = 'test/views'

def self._routes
ROUTES
end
class ActionController::Base
self.view_paths = 'test/views'

def url_for(*args)
'xxx'
end
def self._routes
ROUTES
end
else
require 'action_controller/test_process'

ActionController::Routing::Routes.reload rescue nil
ActionController::Base.cache_store = :memory_store

class ActionController::Base
before_filter :set_view_paths

def set_view_paths
@template.view_paths = 'test/views'
end
def url_for(*args)
'xxx'
end
end

0 comments on commit 94defe0

Please sign in to comment.