rails-template-inheritance 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009 Jakub Šťastný aka Botanicus
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.textile ADDED
@@ -0,0 +1,10 @@
1
+ h1. About
2
+
3
+ h2. Template Inheritance
4
+
5
+ h2. Rango
6
+
7
+ h1. Usage
8
+
9
+ # As a plugin: @./script/plugin install git://github.com/botanicus/rails-template-inheritance.git@
10
+ # As a gem:
data/init.rb ADDED
@@ -0,0 +1,7 @@
1
+ # encoding: utf-8
2
+
3
+ if RUBY_VERSION < "1.9.1"
4
+ abort "Don't forget that Rango requires at least Ruby 1.9.1!"
5
+ end
6
+
7
+ require_relative "lib/rails-template-inheritance"
@@ -0,0 +1,34 @@
1
+ # encoding: utf-8
2
+
3
+ if RUBY_VERSION < "1.9.1"
4
+ abort "Don't forget that Rango requires at least Ruby 1.9.1!"
5
+ end
6
+
7
+ require "tilt"
8
+ require "rango/mixins/render"
9
+
10
+ # Rango setup
11
+ Tilt.register "erb", Tilt::ErubisTemplate # extension "erb" => erubis template
12
+ Rango.logger = Rails.logger
13
+
14
+ # Rango::Template has just getter, because then it holds just one object,
15
+ # so if you create a reference, it will just work.
16
+ # You can use Rango::Template.template.paths.clear.unshift(path)
17
+ module Rango
18
+ class Template
19
+ def self.template_paths=(paths)
20
+ @@template_paths = paths
21
+ end
22
+ end
23
+ end
24
+
25
+ module ActionController
26
+ class Base
27
+ def render_for_file(template_path, status = nil, layout = nil, locals = {}) #:nodoc:
28
+ Rango::Template.template_paths = @template.view_paths
29
+ path = template_path.respond_to?(:path_without_format_and_extension) ? template_path.path_without_format_and_extension : template_path
30
+ logger.info("Rendering #{path}" + (status ? " (#{status})" : '')) if logger
31
+ render_for_text Rango::RenderMixin.render(template_path.template_path, self, locals), status
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env gem build
2
+ # encoding: utf-8
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = "rails-template-inheritance"
6
+ s.version = "0.0.1"
7
+ s.authors = ["Jakub Šťastný aka Botanicus"]
8
+ s.homepage = "http://github.com/botanicus/rails-template-inheritance"
9
+ s.summary = "Template inheritance provided by Rango in Rails!"
10
+ s.description = "" # TODO: long description
11
+ s.cert_chain = nil
12
+ s.email = ["knava.bestvinensis", "gmail.com"].join("@")
13
+ s.has_rdoc = true
14
+
15
+ # files
16
+ s.files = Dir.glob("{lib,spec}/**/*") + Dir["*"]
17
+ s.require_paths = ["lib"]
18
+
19
+ # Ruby version
20
+ s.required_ruby_version = ::Gem::Requirement.new("~> 1.9")
21
+
22
+ # dependencies
23
+ s.add_dependency "tilt"
24
+ s.add_dependency "rango"
25
+ end
metadata ADDED
@@ -0,0 +1,77 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rails-template-inheritance
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - "Jakub \xC5\xA0\xC5\xA5astn\xC3\xBD aka Botanicus"
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain:
11
+ date: 2009-12-14 00:00:00 +00:00
12
+ default_executable:
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: tilt
16
+ type: :runtime
17
+ version_requirement:
18
+ version_requirements: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: "0"
23
+ version:
24
+ - !ruby/object:Gem::Dependency
25
+ name: rango
26
+ type: :runtime
27
+ version_requirement:
28
+ version_requirements: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: "0"
33
+ version:
34
+ description: ""
35
+ email: knava.bestvinensis@gmail.com
36
+ executables: []
37
+
38
+ extensions: []
39
+
40
+ extra_rdoc_files: []
41
+
42
+ files:
43
+ - lib/rails-template-inheritance.rb
44
+ - init.rb
45
+ - LICENSE
46
+ - rails-template-inheritance.gemspec
47
+ - README.textile
48
+ has_rdoc: true
49
+ homepage: http://github.com/botanicus/rails-template-inheritance
50
+ licenses: []
51
+
52
+ post_install_message:
53
+ rdoc_options: []
54
+
55
+ require_paths:
56
+ - lib
57
+ required_ruby_version: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: "1.9"
62
+ version:
63
+ required_rubygems_version: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: "0"
68
+ version:
69
+ requirements: []
70
+
71
+ rubyforge_project:
72
+ rubygems_version: 1.3.5
73
+ signing_key:
74
+ specification_version: 3
75
+ summary: Template inheritance provided by Rango in Rails!
76
+ test_files: []
77
+