rails_layout 0.1.0
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.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/CHANGELOG.textile +5 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.textile +72 -0
- data/Rakefile +1 -0
- data/lib/generators/layout/USAGE +8 -0
- data/lib/generators/layout/layout_generator.rb +21 -0
- data/lib/generators/layout/templates/bootstrap2-application.html.erb +34 -0
- data/lib/generators/layout/templates/bootstrap2-messages.html.erb +8 -0
- data/lib/generators/layout/templates/bootstrap2-navigation.html.erb +5 -0
- data/lib/rails_layout.rb +5 -0
- data/lib/rails_layout/version.rb +3 -0
- data/rails_layout.gemspec +23 -0
- metadata +88 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: f74d50ef762f58b99f8f7fbc26444cff696743cc
|
4
|
+
data.tar.gz: 4bc0b744a904ece0fcb7be49109f7ab67fc41046
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9b89e7b685ba558b47a553f7e1863c2d6c4234fb1acb6af6dac4c6321dda272b5e2581cfb436ce87414be553604609f3b4062d4546f7d33dd1f2e9ef08fe61de
|
7
|
+
data.tar.gz: 6f533442ff9c11a59117ced1f1fa4029a2716ef6913c31cab63c7440d42d0fb2377ecbf62b6f67e3aa41487bce75da8d17540d3682bd6dfa3d77bd3ab26f6f41
|
data/.gitignore
ADDED
data/CHANGELOG.textile
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Daniel Kehoe
|
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.textile
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
h1. !http://railsapps.github.io/images/rails-36x36.jpg(Rails Layout Gem)! Rails Layout Gem
|
2
|
+
|
3
|
+
The Rails Layout gem creates application layout files. It is a Rails generator that you add to your Rails application Gemfile.
|
4
|
+
|
5
|
+
The Rails Layout gem generates application layout files suitable for use with the following front-end frameworks:
|
6
|
+
|
7
|
+
* Twitter Bootstrap 2.3
|
8
|
+
* (more to come)
|
9
|
+
|
10
|
+
h2. Installation
|
11
|
+
|
12
|
+
Add it to your Rails application Gemfile:
|
13
|
+
|
14
|
+
<pre>
|
15
|
+
group :development do
|
16
|
+
gem 'rails_layout'
|
17
|
+
end
|
18
|
+
</pre>
|
19
|
+
|
20
|
+
If you want to use a newer unreleased version from GitHub:
|
21
|
+
|
22
|
+
<pre>
|
23
|
+
group :development do
|
24
|
+
gem 'rails_layout', github: 'RailsApps/rails_layout'
|
25
|
+
end
|
26
|
+
</pre>
|
27
|
+
|
28
|
+
Use Bundler to install the gem:
|
29
|
+
|
30
|
+
<pre>
|
31
|
+
$ bundle install
|
32
|
+
</pre>
|
33
|
+
|
34
|
+
h2. Generating Layouts
|
35
|
+
|
36
|
+
To create layout files for use with Twitter Bootstrap 2.3:
|
37
|
+
|
38
|
+
<pre>
|
39
|
+
$ rails generate layout bootstrap2
|
40
|
+
</pre>
|
41
|
+
|
42
|
+
Creates files:
|
43
|
+
|
44
|
+
* app/views/layouts/application.html.erb
|
45
|
+
* app/views/layouts/_messages.html.erb
|
46
|
+
* app/views/layouts/_navigation.html.erb
|
47
|
+
|
48
|
+
h2. Help
|
49
|
+
|
50
|
+
To see help messages:
|
51
|
+
|
52
|
+
<pre>
|
53
|
+
$ rails generate layout --help
|
54
|
+
</pre>
|
55
|
+
|
56
|
+
h2. Issues
|
57
|
+
|
58
|
+
Any issues? Please create an "issue":http://github.com/RailsApps/rails_layout/issues on GitHub. Reporting issues (and patching!) helps everyone.
|
59
|
+
|
60
|
+
h2. Credits
|
61
|
+
|
62
|
+
Daniel Kehoe maintains this gem as part of the "RailsApps project":http://railsapps.github.io/.
|
63
|
+
|
64
|
+
Please see the "CHANGELOG":https://github.com/RailsApps/rails_layout/blob/master/CHANGELOG.textile for a list of contributors.
|
65
|
+
|
66
|
+
Is the gem useful to you? Follow the project on Twitter: "@rails_apps":http://twitter.com/rails_apps. I'd love to know you were helped out by the gem.
|
67
|
+
|
68
|
+
h2. MIT License
|
69
|
+
|
70
|
+
"MIT License":http://www.opensource.org/licenses/mit-license
|
71
|
+
|
72
|
+
Copyright © 2013 Daniel Kehoe
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'rails/generators'
|
2
|
+
|
3
|
+
module Layout
|
4
|
+
module Generators
|
5
|
+
class LayoutGenerator < ::Rails::Generators::Base
|
6
|
+
source_root File.expand_path("../templates", __FILE__)
|
7
|
+
argument :framework_name, :type => :string, :default => "bootstrap2"
|
8
|
+
|
9
|
+
attr_reader :app_name
|
10
|
+
|
11
|
+
def generate_layout
|
12
|
+
app = ::Rails.application
|
13
|
+
@app_name = app.class.to_s.split("::").first
|
14
|
+
ext = app.config.generators.options[:rails][:template_engine] || :erb
|
15
|
+
template "#{framework_name}-application.html.#{ext}", "app/views/layouts/application.html.#{ext}"
|
16
|
+
copy_file "#{framework_name}-navigation.html.#{ext}", "app/views/layouts/_navigation.html.#{ext}"
|
17
|
+
copy_file "#{framework_name}-messages.html.#{ext}", "app/views/layouts/_messages.html.#{ext}"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
5
|
+
<title><%%= content_for?(:title) ? yield(:title) : "<%= app_name.underscore.titleize %>" %></title>
|
6
|
+
<meta name="description" content="<%%= content_for?(:description) ? yield(:description) : "<%= app_name.underscore.titleize %>" %>">
|
7
|
+
<%%= stylesheet_link_tag "application", :media => "all" %>
|
8
|
+
<%%= javascript_include_tag "application" %>
|
9
|
+
<%%= csrf_meta_tags %>
|
10
|
+
</head>
|
11
|
+
<body>
|
12
|
+
<header class="navbar navbar-fixed-top">
|
13
|
+
<nav class="navbar-inner">
|
14
|
+
<div class="container">
|
15
|
+
<%%= render 'layouts/navigation' %>
|
16
|
+
</div>
|
17
|
+
</nav>
|
18
|
+
</header>
|
19
|
+
<main role="main">
|
20
|
+
<div class="container">
|
21
|
+
<div class="content">
|
22
|
+
<div class="row">
|
23
|
+
<div class="span12">
|
24
|
+
<%%= render 'layouts/messages' %>
|
25
|
+
<%%= yield %>
|
26
|
+
</div>
|
27
|
+
</div>
|
28
|
+
<footer>
|
29
|
+
</footer>
|
30
|
+
</div>
|
31
|
+
</div>
|
32
|
+
</main>
|
33
|
+
</body>
|
34
|
+
</html>
|
@@ -0,0 +1,8 @@
|
|
1
|
+
<% flash.each do |name, msg| %>
|
2
|
+
<% if msg.is_a?(String) %>
|
3
|
+
<div class="alert alert-<%= name == :notice ? "success" : "error" %>">
|
4
|
+
<a class="close" data-dismiss="alert">×</a>
|
5
|
+
<%= content_tag :div, msg, :id => "flash_#{name}" %>
|
6
|
+
</div>
|
7
|
+
<% end %>
|
8
|
+
<% end %>
|
data/lib/rails_layout.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'rails_layout/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "rails_layout"
|
8
|
+
spec.version = RailsLayout::VERSION
|
9
|
+
spec.authors = ["Daniel Kehoe"]
|
10
|
+
spec.email = ["daniel@danielkehoe.com"]
|
11
|
+
spec.description = %q{Generates Rails application layout files for use with various front-end frameworks.}
|
12
|
+
spec.summary = %q{Rails generator creates application layout files for Twitter Bootstrap and other frameworks.}
|
13
|
+
spec.homepage = "http://github.com/RailsApps/rails_layout/"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
22
|
+
spec.add_development_dependency "rake"
|
23
|
+
end
|
metadata
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rails_layout
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Daniel Kehoe
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-09-19 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.3'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description: Generates Rails application layout files for use with various front-end
|
42
|
+
frameworks.
|
43
|
+
email:
|
44
|
+
- daniel@danielkehoe.com
|
45
|
+
executables: []
|
46
|
+
extensions: []
|
47
|
+
extra_rdoc_files: []
|
48
|
+
files:
|
49
|
+
- .gitignore
|
50
|
+
- CHANGELOG.textile
|
51
|
+
- Gemfile
|
52
|
+
- LICENSE.txt
|
53
|
+
- README.textile
|
54
|
+
- Rakefile
|
55
|
+
- lib/generators/layout/USAGE
|
56
|
+
- lib/generators/layout/layout_generator.rb
|
57
|
+
- lib/generators/layout/templates/bootstrap2-application.html.erb
|
58
|
+
- lib/generators/layout/templates/bootstrap2-messages.html.erb
|
59
|
+
- lib/generators/layout/templates/bootstrap2-navigation.html.erb
|
60
|
+
- lib/rails_layout.rb
|
61
|
+
- lib/rails_layout/version.rb
|
62
|
+
- rails_layout.gemspec
|
63
|
+
homepage: http://github.com/RailsApps/rails_layout/
|
64
|
+
licenses:
|
65
|
+
- MIT
|
66
|
+
metadata: {}
|
67
|
+
post_install_message:
|
68
|
+
rdoc_options: []
|
69
|
+
require_paths:
|
70
|
+
- lib
|
71
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
77
|
+
requirements:
|
78
|
+
- - '>='
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: '0'
|
81
|
+
requirements: []
|
82
|
+
rubyforge_project:
|
83
|
+
rubygems_version: 2.1.3
|
84
|
+
signing_key:
|
85
|
+
specification_version: 4
|
86
|
+
summary: Rails generator creates application layout files for Twitter Bootstrap and
|
87
|
+
other frameworks.
|
88
|
+
test_files: []
|