sinatra-effigy 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -0
- data/Rakefile +14 -0
- data/VERSION +1 -0
- data/lib/sinatra/effigy.rb +19 -0
- data/sinatra-effigy.gemspec +41 -0
- metadata +68 -0
data/.gitignore
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'jeweler'
|
2
|
+
|
3
|
+
Jeweler::Tasks.new do |gem|
|
4
|
+
gem.name = "sinatra-effigy"
|
5
|
+
gem.summary = "An Effigy extenstion for Sinatra."
|
6
|
+
gem.description = "HTML in .html files. Ruby in .rb files."
|
7
|
+
gem.email = "dcroak@thoughtbot.com"
|
8
|
+
gem.homepage = "http://github.com/dancroak/sinatra-effigy"
|
9
|
+
gem.authors = ["Dan Croak"]
|
10
|
+
|
11
|
+
gem.add_dependency("sinatra")
|
12
|
+
end
|
13
|
+
|
14
|
+
Jeweler::GemcutterTasks.new
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.0.1
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'sinatra/base'
|
2
|
+
require 'effigy'
|
3
|
+
|
4
|
+
module Sinatra
|
5
|
+
module EffigyHelper
|
6
|
+
if File.directory?('views')
|
7
|
+
Dir['views/*'].each {|view| require view }
|
8
|
+
end
|
9
|
+
|
10
|
+
def effigy(name)
|
11
|
+
template = File.read(File.join(options.root, "templates", "#{name}.html"))
|
12
|
+
camel_name = "#{name}_view".gsub(' ', '_').gsub(/(?:^|_)(.)/) { $1.upcase }
|
13
|
+
view = Object.const_get(camel_name).new
|
14
|
+
view.render(template)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
helpers EffigyHelper
|
19
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{sinatra-effigy}
|
8
|
+
s.version = "0.0.1"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Dan Croak"]
|
12
|
+
s.date = %q{2010-01-11}
|
13
|
+
s.description = %q{HTML in .html files. Ruby in .rb files.}
|
14
|
+
s.email = %q{dcroak@thoughtbot.com}
|
15
|
+
s.files = [
|
16
|
+
".gitignore",
|
17
|
+
"Rakefile",
|
18
|
+
"VERSION",
|
19
|
+
"lib/sinatra/effigy.rb",
|
20
|
+
"sinatra-effigy.gemspec"
|
21
|
+
]
|
22
|
+
s.homepage = %q{http://github.com/dancroak/sinatra-effigy}
|
23
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
24
|
+
s.require_paths = ["lib"]
|
25
|
+
s.rubygems_version = %q{1.3.5}
|
26
|
+
s.summary = %q{An Effigy extenstion for Sinatra.}
|
27
|
+
|
28
|
+
if s.respond_to? :specification_version then
|
29
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
30
|
+
s.specification_version = 3
|
31
|
+
|
32
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
33
|
+
s.add_runtime_dependency(%q<sinatra>, [">= 0"])
|
34
|
+
else
|
35
|
+
s.add_dependency(%q<sinatra>, [">= 0"])
|
36
|
+
end
|
37
|
+
else
|
38
|
+
s.add_dependency(%q<sinatra>, [">= 0"])
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
metadata
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: sinatra-effigy
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Dan Croak
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2010-01-11 00:00:00 -05:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: sinatra
|
17
|
+
type: :runtime
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: "0"
|
24
|
+
version:
|
25
|
+
description: HTML in .html files. Ruby in .rb files.
|
26
|
+
email: dcroak@thoughtbot.com
|
27
|
+
executables: []
|
28
|
+
|
29
|
+
extensions: []
|
30
|
+
|
31
|
+
extra_rdoc_files: []
|
32
|
+
|
33
|
+
files:
|
34
|
+
- .gitignore
|
35
|
+
- Rakefile
|
36
|
+
- VERSION
|
37
|
+
- lib/sinatra/effigy.rb
|
38
|
+
- sinatra-effigy.gemspec
|
39
|
+
has_rdoc: true
|
40
|
+
homepage: http://github.com/dancroak/sinatra-effigy
|
41
|
+
licenses: []
|
42
|
+
|
43
|
+
post_install_message:
|
44
|
+
rdoc_options:
|
45
|
+
- --charset=UTF-8
|
46
|
+
require_paths:
|
47
|
+
- lib
|
48
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
49
|
+
requirements:
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: "0"
|
53
|
+
version:
|
54
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- - ">="
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: "0"
|
59
|
+
version:
|
60
|
+
requirements: []
|
61
|
+
|
62
|
+
rubyforge_project:
|
63
|
+
rubygems_version: 1.3.5
|
64
|
+
signing_key:
|
65
|
+
specification_version: 3
|
66
|
+
summary: An Effigy extenstion for Sinatra.
|
67
|
+
test_files: []
|
68
|
+
|