bootstrap_helper 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/Gemfile +6 -0
- data/README.md +141 -0
- data/Rakefile +41 -0
- data/bootstrap_helper.gemspec +23 -0
- data/example/application.html.erb +47 -0
- data/lib/bootstrap_helper/breadcrumb.rb +64 -0
- data/lib/bootstrap_helper/engine.rb +16 -0
- data/lib/bootstrap_helper/helper.rb +178 -0
- data/lib/bootstrap_helper/railtie.rb +6 -0
- data/lib/bootstrap_helper/version.rb +5 -0
- data/lib/bootstrap_helper.rb +11 -0
- metadata +139 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,141 @@
|
|
1
|
+
# Twitter Bootstrap Helper for Rails 3
|
2
|
+
|
3
|
+
Bootstrap is a toolkit from Twitter designed to kickstart development of webapps and sites. It includes base CSS and HTML for typography, forms, buttons, tables, grids, navigation, and more.
|
4
|
+
|
5
|
+
bootstrap_helper auto generates Bootstrap HTML codes.
|
6
|
+
|
7
|
+
## Rails 3.1
|
8
|
+
|
9
|
+
include Bootstrap Helper in Gemfile;
|
10
|
+
|
11
|
+
``` ruby
|
12
|
+
gem 'bootstrap_helper'
|
13
|
+
```
|
14
|
+
or you can install from latest build;
|
15
|
+
|
16
|
+
``` ruby
|
17
|
+
gem 'bootstrap_helper', :git => "git://github.com/xdite/bootstrap_helper.git"
|
18
|
+
```
|
19
|
+
|
20
|
+
## USAGE
|
21
|
+
|
22
|
+
|
23
|
+
### render_page_title
|
24
|
+
|
25
|
+
#### SETUP
|
26
|
+
|
27
|
+
edit your `config/application.rb `
|
28
|
+
|
29
|
+
SITENAME = "YOUR SITE NAME"
|
30
|
+
|
31
|
+
in `application.html.erb`, replace `<title>` with
|
32
|
+
|
33
|
+
<%= render_page_title %>
|
34
|
+
|
35
|
+
define page title in your action
|
36
|
+
|
37
|
+
def index
|
38
|
+
page_title("Posts Index")
|
39
|
+
end
|
40
|
+
|
41
|
+
will render
|
42
|
+
|
43
|
+
<title>Posts Index » YOUR SITE NAME</title>
|
44
|
+
|
45
|
+
### render_list
|
46
|
+
|
47
|
+
render_list generates ul & li, auto append: "first", "last" class . If link matches current controller and acttion, it will auto add "active" class. Perfact for "menu"
|
48
|
+
|
49
|
+
<%= render_list :class => "nav" do |li|
|
50
|
+
li << link_to(t("menu.topics"), topics_path)
|
51
|
+
li << link_to(t("menu.wiki"), wikis_path )
|
52
|
+
li << link_to(t("menu.sites"), sites_path )
|
53
|
+
li << link_to(t("menu.users"), users_path)
|
54
|
+
end %>
|
55
|
+
|
56
|
+
### render_body_tag
|
57
|
+
|
58
|
+
in `application.html.erb`, replace `<body>` with
|
59
|
+
|
60
|
+
<%= render_body_tag %>
|
61
|
+
|
62
|
+
render_body_tag auto inserts "controller name" & "action name" in to body class, and generates IE conditional comment.
|
63
|
+
|
64
|
+
<!--[if lt IE 7 ]>
|
65
|
+
<body class="topics-controller index-action ie6"><![endif]-->
|
66
|
+
<!--[if gte IE 7 ]>
|
67
|
+
<body class="topics-controller index-action ie"><![endif]-->
|
68
|
+
<!--[if !IE]>-->
|
69
|
+
<body class="topics-controller index-action">
|
70
|
+
<!--<![endif]-->
|
71
|
+
|
72
|
+
### breadcrumb
|
73
|
+
|
74
|
+
in `application.html.erb`, place this helper
|
75
|
+
|
76
|
+
<%= render_breadcrumb %>
|
77
|
+
|
78
|
+
drop breadcrumb in your action
|
79
|
+
|
80
|
+
def show
|
81
|
+
@post = Posts.find(params[:id])
|
82
|
+
drop_breadcrumb("Posts", posts_path)
|
83
|
+
drop_breadcrumb(@post.title)
|
84
|
+
end
|
85
|
+
|
86
|
+
it will generate breadcrumb with link for you
|
87
|
+
|
88
|
+
Home / Post / YourPostTitle
|
89
|
+
|
90
|
+
### notice_message
|
91
|
+
|
92
|
+
in `application.html.erb`, place this helper
|
93
|
+
|
94
|
+
<%= notice_message %>
|
95
|
+
|
96
|
+
write notice message in your action, will generate bootstrap style notice message
|
97
|
+
|
98
|
+
def create
|
99
|
+
# ….
|
100
|
+
redirect_to posts_path, :notice => "Create Success!"
|
101
|
+
end
|
102
|
+
|
103
|
+
## Example
|
104
|
+
|
105
|
+
see [example](bootstrap_helper/tree/master/example/application.html.erb)
|
106
|
+
|
107
|
+
## Other
|
108
|
+
|
109
|
+
### Form
|
110
|
+
|
111
|
+
You can use simple_form 2.0 with bootstrap form template
|
112
|
+
|
113
|
+
* Gemfile
|
114
|
+
|
115
|
+
```
|
116
|
+
gem "simple_form", :git => "git://github.com/plataformatec/simple_form.git"
|
117
|
+
```
|
118
|
+
|
119
|
+
place <https://github.com/rafaelfranca/simple_form-bootstrap/blob/master/config/initializers/simple_form.rb> to `config/initailizers/simple_form.rb`
|
120
|
+
|
121
|
+
```
|
122
|
+
<%= simple_form_for @article, :wrapper => :inline do |f| %>
|
123
|
+
<%= f.input :title, :input_html => {:class => "xxlarge"} , :hint => "this is post title" %>
|
124
|
+
<% end >
|
125
|
+
```
|
126
|
+
|
127
|
+
## Thanks
|
128
|
+
|
129
|
+
Thanks Twitter for Bootstrap <http://twitter.github.com/bootstrap>
|
130
|
+
|
131
|
+
Thanks Handlino for HandicraftHelper <https://github.com/handlino/handicraft_helper>
|
132
|
+
|
133
|
+
## License
|
134
|
+
|
135
|
+
Copyright (C) 2011 by xdite
|
136
|
+
|
137
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
138
|
+
|
139
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
140
|
+
|
141
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Rakefile
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
require "bundler/gem_tasks"
|
3
|
+
|
4
|
+
desc "Update Twitter's Bootstrap"
|
5
|
+
task "update-twitter" do
|
6
|
+
boostrap_version = "1.3.0"
|
7
|
+
Dir["vendor/assets/stylesheets/*.*"].each {|f| FileUtils.rm(f)}
|
8
|
+
Dir["vendor/twitter/lib/*.scss"].each do |file|
|
9
|
+
cp file, "vendor/assets/stylesheets/", :verbose => true
|
10
|
+
end
|
11
|
+
bootstrap_scss = File.read("vendor/assets/stylesheets/bootstrap.scss")
|
12
|
+
|
13
|
+
bootstrap_scss.gsub!(/@VERSION/, "v#{boostrap_version}")
|
14
|
+
bootstrap_scss.gsub!(/^.*@DATE.*/, " *")
|
15
|
+
|
16
|
+
File.open("vendor/assets/stylesheets/bootstrap.scss", "w") do |f|
|
17
|
+
f.write(bootstrap_scss)
|
18
|
+
end
|
19
|
+
|
20
|
+
Dir["vendor/assets/javascripts/*.*"].each {|f| FileUtils.rm(f)}
|
21
|
+
js_files = Dir["vendor/twitter/js/*.js"].map()
|
22
|
+
js_files.each do |file|
|
23
|
+
cp file, "vendor/assets/javascripts/", :verbose => true
|
24
|
+
end
|
25
|
+
|
26
|
+
js_priorities = {}
|
27
|
+
js_files.each {|f| js_priorities[File.basename(f)] = 0}
|
28
|
+
|
29
|
+
# popover depend on twipsy
|
30
|
+
js_priorities["bootstrap-twipsy.js"] = 1
|
31
|
+
js_priorities["bootstrap-popover.js"] = 2
|
32
|
+
|
33
|
+
js_list = js_priorities.to_a.sort {|a,b| a[1] <=> b[1]}.map{|p| p[0]}
|
34
|
+
|
35
|
+
File.open("vendor/assets/javascripts/bootstrap.js", "w") do |f|
|
36
|
+
f.write "// Bootstrap v#{boostrap_version}\n"
|
37
|
+
js_list.each do |js|
|
38
|
+
f.write "//= require #{js}\n"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/bootstrap_helper/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.authors = ["xdite"]
|
6
|
+
gem.email = ["xuite.joke@gmail.com"]
|
7
|
+
gem.description = %q{Twitter Bootstrap HTML Helper}
|
8
|
+
gem.summary = %q{Twitter Bootstrap HTML Helper}
|
9
|
+
gem.homepage = "https://github.com/xdite/bootstrap_helper"
|
10
|
+
|
11
|
+
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
12
|
+
gem.files = `git ls-files`.split("\n")
|
13
|
+
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
14
|
+
gem.name = "bootstrap_helper"
|
15
|
+
gem.require_paths = ["lib"]
|
16
|
+
gem.version = "1.4.0"
|
17
|
+
|
18
|
+
gem.add_dependency "railties", "~> 3.0"
|
19
|
+
gem.add_dependency "thor", "~> 0.14"
|
20
|
+
gem.add_development_dependency "bundler", ">= 1.0.0"
|
21
|
+
gem.add_development_dependency "rails", "~> 3.0"
|
22
|
+
end
|
23
|
+
|
@@ -0,0 +1,47 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<%= render_page_title %>
|
5
|
+
<%= csrf_meta_tag %>
|
6
|
+
<%= stylesheet_link_tag "application"%>
|
7
|
+
</head>
|
8
|
+
<%= render_body_tag %>
|
9
|
+
<div class="topbar" data-dropdown="dropdown">
|
10
|
+
<div class="topbar-inner">
|
11
|
+
<div class="container">
|
12
|
+
<h3>
|
13
|
+
<a href="/"><%= Setting.app_name %></a>
|
14
|
+
</h3>
|
15
|
+
<%= render_list :class => "nav" do |li|
|
16
|
+
li << link_to(t("menu.topics"), topics_path)
|
17
|
+
li << link_to(t("menu.wiki"), wikis_path )
|
18
|
+
li << link_to(t("menu.sites"), sites_path )
|
19
|
+
li << link_to(t("menu.users"), users_path)
|
20
|
+
end %>
|
21
|
+
<%= render "common/search_form" %>
|
22
|
+
<%= render "common/user_navigation" %>
|
23
|
+
</div>
|
24
|
+
</div>
|
25
|
+
</div>
|
26
|
+
<div class="container">
|
27
|
+
<%= render_breadcrumb %>
|
28
|
+
<div id="main" class="container-fluid">
|
29
|
+
<%= notice_message %>
|
30
|
+
<%= yield %>
|
31
|
+
</div>
|
32
|
+
</div>
|
33
|
+
<footer class="footer">
|
34
|
+
<div class="container">
|
35
|
+
<%= render :partial => "common/footer" %>
|
36
|
+
</div>
|
37
|
+
</footer>
|
38
|
+
|
39
|
+
<%= javascript_include_tag "application" %>
|
40
|
+
|
41
|
+
<%= yield :page_specific_javascripts %>
|
42
|
+
|
43
|
+
<%= render :partial => "common/facebook_js" %>
|
44
|
+
<%= render :partial => "common/google_analytics"%>
|
45
|
+
|
46
|
+
</body>
|
47
|
+
</html>
|
@@ -0,0 +1,64 @@
|
|
1
|
+
module BootstrapHelper
|
2
|
+
module Breadcrumb
|
3
|
+
def self.included(receiver)
|
4
|
+
receiver.extend ClassMethods
|
5
|
+
receiver.send :include, InstanceMethods
|
6
|
+
receiver.send :helper, Helpers
|
7
|
+
receiver.send :before_filter, :set_breadcrumbs
|
8
|
+
end
|
9
|
+
|
10
|
+
module ClassMethods
|
11
|
+
|
12
|
+
end
|
13
|
+
|
14
|
+
module InstanceMethods
|
15
|
+
protected
|
16
|
+
|
17
|
+
def set_breadcrumbs
|
18
|
+
@breadcrumbs = ["<a href='/'>Home</a>".html_safe]
|
19
|
+
end
|
20
|
+
|
21
|
+
def drop_breadcrumb(title=nil, url=nil)
|
22
|
+
title ||= @page_title
|
23
|
+
url ||= url_for
|
24
|
+
if title
|
25
|
+
@breadcrumbs.push("<a href=\"#{url}\">#{title}</a>".html_safe)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def drop_page_title(title)
|
30
|
+
@page_title = title
|
31
|
+
return @page_title
|
32
|
+
end
|
33
|
+
|
34
|
+
def no_breadcrumbs
|
35
|
+
@breadcrumbs = []
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
module Helpers
|
40
|
+
|
41
|
+
def render_breadcrumb
|
42
|
+
return "" if @breadcrumbs.size <= 0
|
43
|
+
prefix = "".html_safe
|
44
|
+
crumb = "".html_safe
|
45
|
+
|
46
|
+
@breadcrumbs.each_with_index do |c, i|
|
47
|
+
breadcrumb_class = []
|
48
|
+
breadcrumb_class << "first" if i == 0
|
49
|
+
breadcrumb_class << "last active" if i == (@breadcrumbs.length - 1)
|
50
|
+
|
51
|
+
if i == (@breadcrumbs.length - 1)
|
52
|
+
breadcrumb_content = c
|
53
|
+
else
|
54
|
+
breadcrumb_content = c + content_tag(:span, "/", :class => "divider")
|
55
|
+
end
|
56
|
+
|
57
|
+
crumb += content_tag(:li, breadcrumb_content ,:class => breadcrumb_class )
|
58
|
+
end
|
59
|
+
return prefix + content_tag(:ul, crumb, :class => "breadcrumb menu clearfix")
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require "bootstrap_helper/helper"
|
2
|
+
require "bootstrap_helper/breadcrumb"
|
3
|
+
module BootstrapHelper
|
4
|
+
module Rails
|
5
|
+
class Engine < ::Rails::Engine
|
6
|
+
initializer "bootstrap_helper.view_helpers" do
|
7
|
+
ActionView::Base.send :include, BootstrapHelper::Helper
|
8
|
+
end
|
9
|
+
|
10
|
+
config.to_prepare do
|
11
|
+
ApplicationController.send :include, BootstrapHelper::Breadcrumb
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,178 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
module BootstrapHelper
|
3
|
+
|
4
|
+
module Helper
|
5
|
+
def yield_or_default(message, default_message = "")
|
6
|
+
message.nil? ? default_message : message
|
7
|
+
end
|
8
|
+
|
9
|
+
|
10
|
+
def render_page_title
|
11
|
+
title = @page_title ? "#{SITE_NAME} | #{@page_title}" : SITE_NAME rescue "SITE_NAME"
|
12
|
+
content_tag("title", title, nil, false)
|
13
|
+
end
|
14
|
+
|
15
|
+
def render_body_tag
|
16
|
+
class_attribute = ["#{controller_name}-controller","#{action_name}-action"].join(" ")
|
17
|
+
id_attribute = (@body_id)? " id=\"#{@body_id}-page\"" : ""
|
18
|
+
|
19
|
+
raw(%Q|<!--[if lt IE 7 ]>
|
20
|
+
<body class="#{class_attribute} ie6"><![endif]-->
|
21
|
+
<!--[if gte IE 7 ]>
|
22
|
+
<body class="#{class_attribute} ie"><![endif]-->
|
23
|
+
<!--[if !IE]>-->
|
24
|
+
<body#{id_attribute} class="#{class_attribute}">
|
25
|
+
<!--<![endif]-->|)
|
26
|
+
|
27
|
+
end
|
28
|
+
|
29
|
+
def notice_message
|
30
|
+
flash_messages = []
|
31
|
+
|
32
|
+
flash.each do |type, message|
|
33
|
+
type = :success if type == :notice
|
34
|
+
text = content_tag(:div, link_to("x", "#", :class => "close") + content_tag(:p,message), :class => "alert-message #{type}", "data-alert" => "alert")
|
35
|
+
flash_messages << text if message
|
36
|
+
end
|
37
|
+
|
38
|
+
flash_messages.join("\n").html_safe
|
39
|
+
end
|
40
|
+
|
41
|
+
def s(html)
|
42
|
+
sanitize( html, :tags => %w(table thead tbody tr td th ol ul li div span font img sup sub br hr a pre p h1 h2 h3 h4 h5 h6), :attributes => %w(id class style src href size color) )
|
43
|
+
end
|
44
|
+
|
45
|
+
def render_table(rows, renderrers, table_options = {})
|
46
|
+
table_options = {
|
47
|
+
:has_header => true,
|
48
|
+
:has_row_info => false,
|
49
|
+
:caption => "",
|
50
|
+
:id => nil,
|
51
|
+
:class_name => "auto"
|
52
|
+
}.merge(table_options)
|
53
|
+
|
54
|
+
table_tag_options = table_options[:id] ? { :id => table_options[:id], :class => table_options[:class_name] } : { :class => table_options[:class_name] }
|
55
|
+
|
56
|
+
table = TagNode.new('table', table_tag_options)
|
57
|
+
|
58
|
+
if !table_options[:caption].blank?
|
59
|
+
table << caption = TagNode.new(:caption)
|
60
|
+
caption << table_options[:caption]
|
61
|
+
end
|
62
|
+
|
63
|
+
if table_options[:has_header] == true
|
64
|
+
table << thead = TagNode.new(:thead)
|
65
|
+
thead << tr = TagNode.new(:tr, :class => 'odd')
|
66
|
+
|
67
|
+
renderrers.each do |renderrer|
|
68
|
+
tr << th = TagNode.new(:th)
|
69
|
+
th << renderrer[0]
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
table << tbody = TagNode.new('tbody')
|
74
|
+
row_info = {}
|
75
|
+
row_info[:total] = rows.length
|
76
|
+
rows.each_with_index do |row,i|
|
77
|
+
row_info[:current] = i
|
78
|
+
tbody << tr = TagNode.new('tr', :class => cycle("","odd") )
|
79
|
+
renderrers.each do |renderrer|
|
80
|
+
tr << td = TagNode.new('td')
|
81
|
+
|
82
|
+
if renderrer[1].class == Proc
|
83
|
+
if table_options[:has_row_info] == true
|
84
|
+
td << renderrer[1].call(row, row_info)
|
85
|
+
else
|
86
|
+
td << renderrer[1].call(row)
|
87
|
+
end
|
88
|
+
else
|
89
|
+
td << renderrer[1]
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
return table.to_s
|
95
|
+
end
|
96
|
+
|
97
|
+
# .current will be added to current action, but if you want to add .current to another link, you can set @current = ['/other_link']
|
98
|
+
# TODO: hot about render_list( *args )
|
99
|
+
def render_list(list=[], options={})
|
100
|
+
if list.is_a? Hash
|
101
|
+
options = list
|
102
|
+
list = []
|
103
|
+
end
|
104
|
+
|
105
|
+
yield(list) if block_given?
|
106
|
+
|
107
|
+
list_type ||= "ul"
|
108
|
+
|
109
|
+
if options[:type]
|
110
|
+
if ["ul", "dl", "ol"].include?(options[:type])
|
111
|
+
list_type = options[:type]
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
ul = TagNode.new(list_type, :id => options[:id], :class => options[:class] )
|
116
|
+
ul.addClass("unstyled") if (options[:type] && options[:type] == "unstyled")
|
117
|
+
|
118
|
+
list.each_with_index do |content, i|
|
119
|
+
item_class = []
|
120
|
+
item_class << "first" if i == 0
|
121
|
+
item_class << "last" if i == (list.length - 1)
|
122
|
+
|
123
|
+
item_content = content
|
124
|
+
item_options = {}
|
125
|
+
|
126
|
+
if content.is_a? Array
|
127
|
+
item_content = content[0]
|
128
|
+
item_options = content[1]
|
129
|
+
end
|
130
|
+
|
131
|
+
if item_options[:class]
|
132
|
+
item_class << item_options[:class]
|
133
|
+
end
|
134
|
+
|
135
|
+
link = item_content.match(/href=(["'])(.*?)(\1)/)[2] rescue nil
|
136
|
+
|
137
|
+
if ( link && current_page?(link) ) || ( @current && @current.include?(link) )
|
138
|
+
item_class << "active"
|
139
|
+
end
|
140
|
+
|
141
|
+
item_class = (item_class.empty?)? nil : item_class.join(" ")
|
142
|
+
ul << li = TagNode.new('li', :class => item_class )
|
143
|
+
li << item_content
|
144
|
+
end
|
145
|
+
|
146
|
+
return ul.to_s
|
147
|
+
end
|
148
|
+
|
149
|
+
# Composite pattern
|
150
|
+
class TagNode
|
151
|
+
include ActionView::Helpers::TagHelper
|
152
|
+
|
153
|
+
def initialize(name, options = {})
|
154
|
+
@name = name.to_s
|
155
|
+
@attributes = options
|
156
|
+
@children = []
|
157
|
+
end
|
158
|
+
|
159
|
+
def addClass(x)
|
160
|
+
if @attributes[:class].blank?
|
161
|
+
@attributes[:class] = x.to_s
|
162
|
+
else
|
163
|
+
@attributes[:class] = @attributes[:class] + " #{x}"
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
167
|
+
def to_s
|
168
|
+
value = @children.each { |c| c.to_s }.join
|
169
|
+
content_tag(@name, value.to_s, @attributes, false)
|
170
|
+
end
|
171
|
+
|
172
|
+
def <<(tag_node)
|
173
|
+
@children << tag_node
|
174
|
+
end
|
175
|
+
end
|
176
|
+
end
|
177
|
+
|
178
|
+
end
|
metadata
ADDED
@@ -0,0 +1,139 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: bootstrap_helper
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 7
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 4
|
9
|
+
- 0
|
10
|
+
version: 1.4.0
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- xdite
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2011-12-14 00:00:00 +08:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: railties
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 7
|
30
|
+
segments:
|
31
|
+
- 3
|
32
|
+
- 0
|
33
|
+
version: "3.0"
|
34
|
+
type: :runtime
|
35
|
+
version_requirements: *id001
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: thor
|
38
|
+
prerelease: false
|
39
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
41
|
+
requirements:
|
42
|
+
- - ~>
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
hash: 23
|
45
|
+
segments:
|
46
|
+
- 0
|
47
|
+
- 14
|
48
|
+
version: "0.14"
|
49
|
+
type: :runtime
|
50
|
+
version_requirements: *id002
|
51
|
+
- !ruby/object:Gem::Dependency
|
52
|
+
name: bundler
|
53
|
+
prerelease: false
|
54
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
55
|
+
none: false
|
56
|
+
requirements:
|
57
|
+
- - ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
hash: 23
|
60
|
+
segments:
|
61
|
+
- 1
|
62
|
+
- 0
|
63
|
+
- 0
|
64
|
+
version: 1.0.0
|
65
|
+
type: :development
|
66
|
+
version_requirements: *id003
|
67
|
+
- !ruby/object:Gem::Dependency
|
68
|
+
name: rails
|
69
|
+
prerelease: false
|
70
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
71
|
+
none: false
|
72
|
+
requirements:
|
73
|
+
- - ~>
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
hash: 7
|
76
|
+
segments:
|
77
|
+
- 3
|
78
|
+
- 0
|
79
|
+
version: "3.0"
|
80
|
+
type: :development
|
81
|
+
version_requirements: *id004
|
82
|
+
description: Twitter Bootstrap HTML Helper
|
83
|
+
email:
|
84
|
+
- xuite.joke@gmail.com
|
85
|
+
executables: []
|
86
|
+
|
87
|
+
extensions: []
|
88
|
+
|
89
|
+
extra_rdoc_files: []
|
90
|
+
|
91
|
+
files:
|
92
|
+
- .gitignore
|
93
|
+
- Gemfile
|
94
|
+
- README.md
|
95
|
+
- Rakefile
|
96
|
+
- bootstrap_helper.gemspec
|
97
|
+
- example/application.html.erb
|
98
|
+
- lib/bootstrap_helper.rb
|
99
|
+
- lib/bootstrap_helper/breadcrumb.rb
|
100
|
+
- lib/bootstrap_helper/engine.rb
|
101
|
+
- lib/bootstrap_helper/helper.rb
|
102
|
+
- lib/bootstrap_helper/railtie.rb
|
103
|
+
- lib/bootstrap_helper/version.rb
|
104
|
+
has_rdoc: true
|
105
|
+
homepage: https://github.com/xdite/bootstrap_helper
|
106
|
+
licenses: []
|
107
|
+
|
108
|
+
post_install_message:
|
109
|
+
rdoc_options: []
|
110
|
+
|
111
|
+
require_paths:
|
112
|
+
- lib
|
113
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
114
|
+
none: false
|
115
|
+
requirements:
|
116
|
+
- - ">="
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
hash: 3
|
119
|
+
segments:
|
120
|
+
- 0
|
121
|
+
version: "0"
|
122
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
123
|
+
none: false
|
124
|
+
requirements:
|
125
|
+
- - ">="
|
126
|
+
- !ruby/object:Gem::Version
|
127
|
+
hash: 3
|
128
|
+
segments:
|
129
|
+
- 0
|
130
|
+
version: "0"
|
131
|
+
requirements: []
|
132
|
+
|
133
|
+
rubyforge_project:
|
134
|
+
rubygems_version: 1.5.2
|
135
|
+
signing_key:
|
136
|
+
specification_version: 3
|
137
|
+
summary: Twitter Bootstrap HTML Helper
|
138
|
+
test_files: []
|
139
|
+
|