Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Bundlerized

  • Loading branch information...
commit 0ccd75657b287c54962b012f876ae5d5128c1c08 1 parent 8089ddf
Adam Cigánek madadam authored
3  .gitignore
View
@@ -1 +1,2 @@
-pkg
+.bundle
+*.gem
2  Gemfile
View
@@ -0,0 +1,2 @@
+source "http://rubygems.org"
+gemspec
28 Gemfile.lock
View
@@ -0,0 +1,28 @@
+PATH
+ remote: .
+ specs:
+ liquidizer (0.5.4)
+ actionpack (~> 2.3.5)
+ activerecord (~> 2.3.5)
+ liquid (>= 2.0.0)
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ actionpack (2.3.8)
+ activesupport (= 2.3.8)
+ rack (~> 1.1.0)
+ activerecord (2.3.8)
+ activesupport (= 2.3.8)
+ activesupport (2.3.8)
+ liquid (2.2.2)
+ rack (1.1.0)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ actionpack (~> 2.3.5)
+ activerecord (~> 2.3.5)
+ liquid (>= 2.0.0)
+ liquidizer!
26 Rakefile
View
@@ -2,34 +2,12 @@
require 'rake'
require 'rake/testtask'
-
+
desc 'Default: run unit tests.'
task :default => :test
-
+
desc 'Run unit tests.'
Rake::TestTask.new(:test) do |t|
t.pattern = 'test/**/*_test.rb'
t.verbose = true
end
-
-begin
- require 'jeweler'
-
- Jeweler::Tasks.new do |gemspec|
- gemspec.name = 'liquidizer'
- gemspec.summary = 'Support for Ruby on Rails views powered by Liquid and loaded from database'
- gemspec.description = <<END
-WIth this gem, you can render your Ruby on Rails views with liquid templates that are loaded from database. This way, the look and feel of your site can be safely configured by it's users.
-END
-
- gemspec.email = 'adam.ciganek@gmail.com'
- gemspec.homepage = 'http://github.com/madadam/liquidizer'
- gemspec.authors = ['Adam Cigánek']
-
- gemspec.add_dependency 'liquid', '>= 2.0.0'
- end
-
- Jeweler::GemcutterTasks.new
-rescue LoadError
- puts "Jeweler not available. Install it with: gem install jeweler"
-end
1  VERSION
View
@@ -1 +0,0 @@
-0.5.3
3  lib/liquidizer.rb
View
@@ -1,7 +1,8 @@
require 'liquidizer/controller_extensions'
require 'liquidizer/migration_extensions'
require 'liquidizer/liquid_template'
-
+require 'liquidizer/version'
+
module Liquidizer
# The path the default liquid templates are stored.
mattr_accessor :template_paths
3  lib/liquidizer/version.rb
View
@@ -0,0 +1,3 @@
+module Liquidizer
+ VERSION = '0.5.4'
+end
93 liquidizer.gemspec
View
@@ -1,75 +1,28 @@
-# Generated by jeweler
-# DO NOT EDIT THIS FILE DIRECTLY
-# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
# -*- encoding: utf-8 -*-
-
+lib = File.expand_path('../lib/', __FILE__)
+$:.unshift lib unless $:.include?(lib)
+
+require 'liquidizer/version'
+
Gem::Specification.new do |s|
- s.name = %q{liquidizer}
- s.version = "0.5.3"
-
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
- s.authors = ["Adam Cigánek"]
- s.date = %q{2010-06-01}
- s.description = %q{WIth this gem, you can render your Ruby on Rails views with liquid templates that are loaded from database. This way, the look and feel of your site can be safely configured by it's users.
-}
- s.email = %q{adam.ciganek@gmail.com}
- s.extra_rdoc_files = [
- "README.rdoc"
- ]
- s.files = [
- ".gitignore",
- "README.rdoc",
- "Rakefile",
- "VERSION",
- "app/models/liquid_template.rb",
- "lib/liquidizer.rb",
- "lib/liquidizer/controller_extensions.rb",
- "lib/liquidizer/file_system.rb",
- "lib/liquidizer/liquid_template.rb",
- "lib/liquidizer/migration_extensions.rb",
- "lib/liquidizer/support.rb",
- "liquidizer.gemspec",
- "rails/init.rb",
- "test/controller_extensions_test.rb",
- "test/file_system_test.rb",
- "test/fixtures/comments/_stuff.html.erb",
- "test/fixtures/comments/index.html.erb",
- "test/fixtures/layouts/layout.html.erb",
- "test/fixtures/path_one/template_one.liquid",
- "test/fixtures/path_two/template_one.liquid",
- "test/fixtures/path_two/template_two.liquid",
- "test/fixtures/posts/index.liquid",
- "test/fixtures/posts/show.html.erb",
- "test/fixtures/ratings/edit.html.erb",
- "test/fixtures/spams/index.html.erb",
- "test/liquid_template_test.rb",
- "test/support_test.rb",
- "test/test_helper.rb"
- ]
- s.homepage = %q{http://github.com/madadam/liquidizer}
- s.rdoc_options = ["--charset=UTF-8"]
- s.require_paths = ["lib"]
- s.rubygems_version = %q{1.3.6}
- s.summary = %q{Support for Ruby on Rails views powered by Liquid and loaded from database}
- s.test_files = [
- "test/support_test.rb",
- "test/liquid_template_test.rb",
- "test/controller_extensions_test.rb",
- "test/test_helper.rb",
- "test/file_system_test.rb"
- ]
+ s.name = 'liquidizer'
+ s.version = Liquidizer::VERSION
+ s.platform = Gem::Platform::RUBY
+ s.authors = ["Adam Cigánek"]
+ s.email = 'adam.ciganek@gmail.com'
+ s.homepage = 'http://github.com/madadam/liquidizer'
+ s.summary = 'Support for Ruby on Rails views powered by Liquid and loaded from database'
+ s.description = <<END
+WIth this gem, you can render your Ruby on Rails views with liquid templates that are loaded from database. This way, the look and feel of your site can be safely configured by it's users.
+END
- if s.respond_to? :specification_version then
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
- s.specification_version = 3
+ s.required_rubygems_version = ">= 1.3.7"
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
- s.add_runtime_dependency(%q<liquid>, [">= 2.0.0"])
- else
- s.add_dependency(%q<liquid>, [">= 2.0.0"])
- end
- else
- s.add_dependency(%q<liquid>, [">= 2.0.0"])
- end
+ s.add_dependency 'actionpack', '~> 2.3.5'
+ s.add_dependency 'activerecord', '~> 2.3.5'
+ s.add_dependency 'liquid', '>= 2.0.0'
+
+ s.files = Dir.glob('{lib,bin}/**/*')
+ s.files << 'README.rdoc'
+ s.files << 'Rakefile'
end
-
40 test/controller_extensions_test.rb
View
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/test_helper'
+require File.expand_path(File.dirname(__FILE__) + '/test_helper')
class BaseController < ActionController::Base
append_view_path File.dirname(__FILE__) + '/fixtures'
@@ -15,7 +15,7 @@ class PostsController < BaseController
liquify
def index
- @title = 'Hello blog!'
+ @title = 'Hello blog!'
@posts = [Post.new(:title => 'First post'), Post.new(:title => 'Second post')]
end
@@ -49,7 +49,7 @@ def index
def show
end
-
+
def new
render :partial => 'stuff'
end
@@ -113,10 +113,10 @@ def setup
def teardown
Liquidizer.drop_module = nil
end
-
+
test 'renders with liquid template' do
setup_controller(PostsController)
-
+
LiquidTemplate.create!(:name => 'posts/index', :content => "<p>This is liquid template</p>")
get :index
@@ -125,7 +125,7 @@ def teardown
test 'passes instance variables to liquid template' do
setup_controller(PostsController)
-
+
LiquidTemplate.create!(:name => 'posts/index', :content => "<h1>{{ title }}</h1>")
get :index
@@ -141,7 +141,7 @@ def teardown
get :update
assert_select 'p', 'edit post'
end
-
+
test 'renders with liquid template when explicit template specified' do
setup_controller(PostsController)
@@ -151,10 +151,10 @@ def teardown
get :new
assert_select 'p', 'more awesome new'
end
-
+
test 'preserves additional render options' do
setup_controller(PostsController)
-
+
LiquidTemplate.create!(:name => 'posts/create', :content => "<p>create post</p>")
get :create
@@ -185,7 +185,7 @@ def teardown
get :show
assert_select '#layout p', 'This is liquid template'
end
-
+
test 'renders solid template with liquid layout' do
setup_controller(PostsController)
@@ -214,7 +214,7 @@ def teardown
get :edit
assert_select '#awesome_layout p'
end
-
+
test 'does not render liquid layout if disabled' do
setup_controller(RatingsController)
@@ -226,27 +226,27 @@ def teardown
assert_select 'p', 'This is liquid template'
assert_select '#layout', false
end
-
+
test 'does not apply liquid layout to render :partial' do
setup_controller(CommentsController)
-
+
LiquidTemplate.create!(:name => 'layout',
:content => '<div id="layout">{{ content_for_layout }}</div>')
get :new
assert_select '#layout', false
end
-
+
test 'does not apply liquid layout to render :text' do
setup_controller(CommentsController)
-
+
LiquidTemplate.create!(:name => 'layout',
:content => '<div id="layout">{{ content_for_layout }}</div>')
get :create
assert_select '#layout', false
end
-
+
test 'applies liquid layout to render :template' do
setup_controller(PostsController)
@@ -266,7 +266,7 @@ def teardown
get :show
assert_select 'h1 em', 'Liquidizer is awesome!'
end
-
+
test 'dropifies instance variables using namespaced drop' do
setup_controller(PostsController)
Liquidizer.drop_module = CoolDrops
@@ -276,7 +276,7 @@ def teardown
get :show
assert_select 'h1 strong', 'Liquidizer is awesome!'
end
-
+
test 'dropifies array elements' do
setup_controller(PostsController)
@@ -298,14 +298,14 @@ def teardown
get :show
assert_select 'p', 'This is a template'
- assert_select 'p', 'This is a partial'
+ assert_select 'p', 'This is a partial'
end
private
def setup_controller(controller_class)
self.class.prepare_controller_class(controller_class)
-
+
# This is copied over from ActionController::TestCase.setup_controller_request_and_response
@controller = controller_class.new
@controller.request = @request
2  test/file_system_test.rb
View
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/test_helper'
+require File.expand_path(File.dirname(__FILE__) + '/test_helper')
require 'liquidizer/file_system'
class FileSystemTest < ActiveSupport::TestCase
2  test/liquid_template_test.rb
View
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/test_helper'
+require File.expand_path(File.dirname(__FILE__) + '/test_helper')
class LiquidTemplateTest < ActiveSupport::TestCase
def setup
2  test/support_test.rb
View
@@ -1,4 +1,4 @@
-require File.dirname(__FILE__) + '/test_helper'
+require File.expand_path(File.dirname(__FILE__) + '/test_helper')
module Foo
class Bar
1  test/test_helper.rb
View
@@ -1,4 +1,3 @@
-require 'rubygems'
require 'test/unit'
require 'action_controller'
require 'active_record'
Please sign in to comment.
Something went wrong with that request. Please try again.