JunKikuchi-sinatra-block-html 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG ADDED
File without changes
data/COPYING ADDED
@@ -0,0 +1,18 @@
1
+ Copyright (c) 2009 Jun Kikuchi
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to
5
+ deal in the Software without restriction, including without limitation the
6
+ rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7
+ sell copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
16
+ THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
18
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1 @@
1
+ = sinatra-block-html
data/Rakefile ADDED
@@ -0,0 +1,31 @@
1
+ require 'rubygems'
2
+ require 'spec/rake/spectask'
3
+
4
+ NAME = 'sinatra-block-html'
5
+
6
+ begin
7
+ require 'jeweler'
8
+ Jeweler::Tasks.new do |s|
9
+ s.name = NAME
10
+ s.platform = Gem::Platform::RUBY
11
+ s.summary = NAME
12
+ s.description = NAME
13
+ s.author = "Jun Kikuchi"
14
+ s.email = "kikuchi@bonnou.com"
15
+ s.homepage = "http://github.com/JunKikuchi/sinatra-block-html"
16
+ s.files = %w(
17
+ COPYING CHANGELOG README.rdoc Rakefile VERSION
18
+ ) + Dir.glob("{bin,doc,spec,lib}/**/*")
19
+ s.require_path = "lib"
20
+ s.has_rdoc = true
21
+ s.add_dependency('block-html','>= 0.0.0')
22
+ end
23
+ rescue LoadError
24
+ puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
25
+ end
26
+
27
+ Spec::Rake::SpecTask.new do |t|
28
+ #t.spec_opts = ['-c --format specdoc']
29
+ t.spec_opts = ['-c']
30
+ t.spec_files = FileList['spec/**/*_spec.rb']
31
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.1
@@ -0,0 +1,27 @@
1
+ require 'sinatra/base'
2
+ require 'block_html'
3
+
4
+ module Sinatra
5
+ module BlockHTML
6
+ def bhtml(template=nil, options={}, locals={}, &block)
7
+ require_warn('BlockHTML') unless defined?(::BlockHTML)
8
+
9
+ options, template = template, nil if template.is_a?(Hash)
10
+ template = lambda { block } if template.nil?
11
+ render(:bhtml, template, options, locals).to_s
12
+ end
13
+
14
+ protected
15
+ def render_bhtml(template, data, options, locals, &block)
16
+ if data.respond_to?(:to_str)
17
+ ::BlockHTML.new(self) do
18
+ instance_eval(data)
19
+ end
20
+ elsif data.kind_of?(Proc)
21
+ ::BlockHTML.new(self, &data)
22
+ end
23
+ end
24
+ end
25
+
26
+ helpers BlockHTML
27
+ end
metadata ADDED
@@ -0,0 +1,67 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: JunKikuchi-sinatra-block-html
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Jun Kikuchi
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-08-26 00:00:00 -07:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: block-html
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 0.0.0
24
+ version:
25
+ description: sinatra-block-html
26
+ email: kikuchi@bonnou.com
27
+ executables: []
28
+
29
+ extensions: []
30
+
31
+ extra_rdoc_files:
32
+ - README.rdoc
33
+ files:
34
+ - CHANGELOG
35
+ - COPYING
36
+ - README.rdoc
37
+ - Rakefile
38
+ - VERSION
39
+ - lib/sinatra-block-html.rb
40
+ has_rdoc: false
41
+ homepage: http://github.com/JunKikuchi/sinatra-block-html
42
+ post_install_message:
43
+ rdoc_options:
44
+ - --charset=UTF-8
45
+ require_paths:
46
+ - lib
47
+ required_ruby_version: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - ">="
50
+ - !ruby/object:Gem::Version
51
+ version: "0"
52
+ version:
53
+ required_rubygems_version: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: "0"
58
+ version:
59
+ requirements: []
60
+
61
+ rubyforge_project:
62
+ rubygems_version: 1.2.0
63
+ signing_key:
64
+ specification_version: 3
65
+ summary: sinatra-block-html
66
+ test_files: []
67
+