bootstrap_helperized 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in bootstrap_helperized.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Seb Weston
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,40 @@
1
+ # Bootstrap Helperized
2
+
3
+ Some (one so far) helper methods for creating Bootstrap HTML.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'bootstrap_helperized'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install bootstrap_helperized
18
+
19
+ ## Modal box
20
+
21
+ If you're using Ajax to send in the form:
22
+
23
+ = standard_modal_box(:id => 'new_user', :title => 'New user')
24
+
25
+ If you want to add the form beforehand you can pass as a block:
26
+
27
+ = standard_modal_box(:id => 'new_user', :title => 'New user') do
28
+ = YOUR FORM HERE
29
+
30
+ To trigger the modal box:
31
+
32
+ = link_to 'New user', '#new_user', :class => 'btn', 'data-toggle' => 'modal'
33
+
34
+ ## Contributing
35
+
36
+ 1. Fork it
37
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
38
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
39
+ 4. Push to the branch (`git push origin my-new-feature`)
40
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,19 @@
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'bootstrap_helperized/version'
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = "bootstrap_helperized"
8
+ gem.version = BootstrapHelperized::VERSION
9
+ gem.authors = ["Seb Weston"]
10
+ gem.email = ["sebweston@gmail.com"]
11
+ gem.description = %q{Bootstrap helper methods}
12
+ gem.summary = %q{Bootstrap helper methods that create Bootstrap HTML}
13
+ gem.homepage = ""
14
+
15
+ gem.files = `git ls-files`.split($/)
16
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
+ gem.require_paths = ["lib"]
19
+ end
@@ -0,0 +1,10 @@
1
+ require "bootstrap_helperized/helper"
2
+ module BootstrapHelperized
3
+ module Rails
4
+ class Engine < ::Rails::Engine
5
+ initializer "bootstrap_helperized.view_helpers" do
6
+ ActionView::Base.send :include, BootstrapHelperized::Helper
7
+ end
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,37 @@
1
+ module BootstrapHelperized
2
+
3
+ module Helper
4
+
5
+ def standard_modal_box(options = {}, &block)
6
+ css_id = options[:id]
7
+ box_title = options[:title]
8
+
9
+ modal_options = { :id => css_id,
10
+ :class => 'modal hide fade',
11
+ :role => 'dialog',
12
+ :tabindex => '-1' }
13
+
14
+ content_tag :div, modal_options do
15
+ standard_modal_header(box_title) + standard_modal_content(&block)
16
+ end
17
+ end
18
+
19
+ protected
20
+
21
+ def standard_modal_header(box_title)
22
+ content_tag :div, :class => 'modal-header' do
23
+ content_tag(:button, 'x', :class => 'close', 'data-dismiss' => 'modal', :type => 'button')+
24
+ content_tag(:h3, box_title)
25
+ end
26
+ end
27
+
28
+ def standard_modal_content
29
+ content_tag :div, :class => 'modal-body' do
30
+ content_tag :div, :class => 'modal-body-content' do
31
+ yield if block_given?
32
+ end
33
+ end
34
+ end
35
+
36
+ end
37
+ end
@@ -0,0 +1,6 @@
1
+ module BootstrapHelperized
2
+ module Rails
3
+ class Railtie < ::Rails::Railtie
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,3 @@
1
+ module BootstrapHelperized
2
+ VERSION = "0.0.7"
3
+ end
@@ -0,0 +1,11 @@
1
+ require "bootstrap_helperized/version"
2
+
3
+ module BootstrapHelperized
4
+ module Rails
5
+ if ::Rails.version < "3.1"
6
+ require "bootstrap_helperized/railtie"
7
+ else
8
+ require "bootstrap_helperized/engine"
9
+ end
10
+ end
11
+ end
metadata ADDED
@@ -0,0 +1,56 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bootstrap_helperized
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.7
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Seb Weston
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-02-07 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: Bootstrap helper methods
15
+ email:
16
+ - sebweston@gmail.com
17
+ executables: []
18
+ extensions: []
19
+ extra_rdoc_files: []
20
+ files:
21
+ - .gitignore
22
+ - Gemfile
23
+ - LICENSE.txt
24
+ - README.md
25
+ - Rakefile
26
+ - bootstrap_helperized.gemspec
27
+ - lib/bootstrap_helperized.rb
28
+ - lib/bootstrap_helperized/engine.rb
29
+ - lib/bootstrap_helperized/helper.rb
30
+ - lib/bootstrap_helperized/railtie.rb
31
+ - lib/bootstrap_helperized/version.rb
32
+ homepage: ''
33
+ licenses: []
34
+ post_install_message:
35
+ rdoc_options: []
36
+ require_paths:
37
+ - lib
38
+ required_ruby_version: !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ required_rubygems_version: !ruby/object:Gem::Requirement
45
+ none: false
46
+ requirements:
47
+ - - ! '>='
48
+ - !ruby/object:Gem::Version
49
+ version: '0'
50
+ requirements: []
51
+ rubyforge_project:
52
+ rubygems_version: 1.8.23
53
+ signing_key:
54
+ specification_version: 3
55
+ summary: Bootstrap helper methods that create Bootstrap HTML
56
+ test_files: []