simple-page-layout 0.0.2 → 0.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c0859aa519b22f55fef998a0ec201d51209ab13a
4
- data.tar.gz: 4a81bdd886b9a4cfe2959f3460375c1cdad85540
3
+ metadata.gz: 315fe110f3bd75023c71bbd2d173cc23653404c2
4
+ data.tar.gz: e73fd85d0c4e831aed2b7d70d20788f2debba38d
5
5
  SHA512:
6
- metadata.gz: 86a6df197aa542cdcd7f2e146ef73b9e9d9bf2657e8051d0a168c06c9b3ac55e8de36a560799f95e99ab5fe79d72ca2cb97ba17c6da14f4ad1f6eee8fbe8cd15
7
- data.tar.gz: 58b6cfcae74a3c9946ac32de71f0c50f22e50ea7e3c828abcbbd76b8abcf9cb64a1bac11794ed82a9e2f12469dc801e033bd740c983f557fd9667ff15a0b4f7a
6
+ metadata.gz: db2738cc9834292f900aad04853bd1270f0efc986e2d621a73c479132ec43e57d62321fc4571c23554001af40095fec4e0fd694cf82c17827fb855a1cb11ad01
7
+ data.tar.gz: a9fd37bcc7344778a21d0294b688a0c29e5d1f918a2932ed356e462a880466e92c579c978d06575e8878e153be03ab85aaf5ef8bbb548ac52682c28e902e2cb6
data/README.md CHANGED
@@ -2,19 +2,27 @@
2
2
 
3
3
  layouts made easy for rails 3
4
4
 
5
+ [![Gem Version](https://badge.fury.io/rb/simple-page-layout.png)](http://badge.fury.io/rb/simple-page-layout)
6
+ [![Code Climate](https://codeclimate.com/github/mindpin/simple-page-layout.png)](https://codeclimate.com/github/mindpin/simple-page-layout)
7
+
5
8
  ## dependencies
6
9
 
7
10
  * haml
8
11
 
9
12
  ## Usage
10
13
 
14
+ include in Gemfile:
15
+ ```ruby
16
+ gem 'simple-navbar'
17
+ ```
18
+
11
19
  in your layout file:
12
20
 
13
21
  ```haml
14
22
  -# in file views/layouts/my_layout.html.haml
15
23
 
16
24
  !!!
17
- - simple_page_layout :html_lang => :zh, :site_title => 'My Site' do
25
+ - simple_page_layout 'My Site', :html_lang => :zh do
18
26
  -# your code here with yaml
19
27
  .page-content
20
28
  yield
@@ -1,3 +1,4 @@
1
+ # coding: utf-8
1
2
  module SimplePageLayout
2
3
  module Helper
3
4
  class PageLayout
@@ -6,8 +7,10 @@ module SimplePageLayout
6
7
 
7
8
  def initialize(view, site_name, options = {})
8
9
  @view = view
10
+
9
11
  @site_name = site_name
10
12
  @html_lang = options[:html_lang]
13
+ @body_class = options[:body_class]
11
14
  end
12
15
 
13
16
  def render(&block)
@@ -33,7 +36,7 @@ module SimplePageLayout
33
36
  def render_page_layout_body(&block)
34
37
  javascript_ext = @view.content_for :javascript
35
38
 
36
- @view.haml_tag :body do
39
+ @view.haml_tag :body, :class => @body_class do
37
40
  yield
38
41
  @view.haml_concat @view.javascript_include_tag(:application)
39
42
  @view.haml_concat @view.javascript_ext if javascript_ext.present?
@@ -64,8 +67,8 @@ module SimplePageLayout
64
67
 
65
68
  class Railtie < Rails::Railtie
66
69
  initializer 'SimplePageLayout.helper' do |app|
67
- ActionView::Base.send :include, SimplePageLayout::Helper
68
- ActionView::Base.send :include, SimplePageLayout::ExtHelper
70
+ ActionView::Base.send :include, Helper
71
+ ActionView::Base.send :include, ExtHelper
69
72
  end
70
73
  end
71
74
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple-page-layout
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - ben7th
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-03-09 00:00:00.000000000 Z
11
+ date: 2013-03-10 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: layouts made easy for rails 3.
14
14
  email: ben7th@sina.com