layout 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +123 -95
- data/LICENSE.txt +20 -0
- data/{README.rdoc → README.md} +11 -9
- data/Rakefile +2 -2
- data/layout.gemspec +3 -7
- data/lib/layout/base.rb +3 -2
- data/lib/layout/version.rb +1 -1
- data/spec/controllers/inherited_controller_spec.rb +1 -1
- data/spec/controllers/no_layout_file_controller_spec.rb +1 -1
- data/spec/controllers/samples_controller_spec.rb +1 -1
- data/spec/spec_helper.rb +0 -4
- data/spec/support/app/controllers/inherited_controller.rb +1 -1
- data/spec/support/app/controllers/samples_controller.rb +4 -4
- data/spec/support/config/boot.rb +2 -0
- metadata +43 -32
- data/.rspec +0 -1
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: bb5e4704634b6bb13990063223f3abfc7f97cf85
|
4
|
+
data.tar.gz: 901613030e1f9482e63e9c5023eca78b704d06c0
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: eee67511dd0c79984d38fa3566ac3bdf0f0a80950526acd3be671311ff88ddf3ea44c988b12c82eea839cccb44f1250dc416748c7f5c2a7b7b402b4a3cbeae60
|
7
|
+
data.tar.gz: 511e84ce2fdb9e3b1ac4a2e9802e1f4351111bb1761e08a9e4a07b589a3d6b180ec0378b4d24759def082a302917cb7f5185aa7d28a89641ee497982262ebca1
|
data/Gemfile
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
source
|
1
|
+
source "https://rubygems.org"
|
2
2
|
gemspec
|
data/Gemfile.lock
CHANGED
@@ -1,110 +1,135 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
layout (0.2.
|
4
|
+
layout (0.2.1)
|
5
5
|
rails
|
6
6
|
|
7
7
|
GEM
|
8
|
-
remote:
|
8
|
+
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
|
11
|
-
actionpack (=
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
activesupport (=
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
10
|
+
actioncable (5.1.2)
|
11
|
+
actionpack (= 5.1.2)
|
12
|
+
nio4r (~> 2.0)
|
13
|
+
websocket-driver (~> 0.6.1)
|
14
|
+
actionmailer (5.1.2)
|
15
|
+
actionpack (= 5.1.2)
|
16
|
+
actionview (= 5.1.2)
|
17
|
+
activejob (= 5.1.2)
|
18
|
+
mail (~> 2.5, >= 2.5.4)
|
19
|
+
rails-dom-testing (~> 2.0)
|
20
|
+
actionpack (5.1.2)
|
21
|
+
actionview (= 5.1.2)
|
22
|
+
activesupport (= 5.1.2)
|
23
|
+
rack (~> 2.0)
|
24
|
+
rack-test (~> 0.6.3)
|
25
|
+
rails-dom-testing (~> 2.0)
|
26
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
27
|
+
actionview (5.1.2)
|
28
|
+
activesupport (= 5.1.2)
|
29
|
+
builder (~> 3.1)
|
30
|
+
erubi (~> 1.4)
|
31
|
+
rails-dom-testing (~> 2.0)
|
32
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
33
|
+
activejob (5.1.2)
|
34
|
+
activesupport (= 5.1.2)
|
35
|
+
globalid (>= 0.3.6)
|
36
|
+
activemodel (5.1.2)
|
37
|
+
activesupport (= 5.1.2)
|
38
|
+
activerecord (5.1.2)
|
39
|
+
activemodel (= 5.1.2)
|
40
|
+
activesupport (= 5.1.2)
|
41
|
+
arel (~> 8.0)
|
42
|
+
activesupport (5.1.2)
|
43
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
44
|
+
i18n (~> 0.7)
|
45
|
+
minitest (~> 5.1)
|
46
|
+
tzinfo (~> 1.1)
|
47
|
+
arel (8.0.0)
|
48
|
+
awesome_print (1.8.0)
|
49
|
+
builder (3.2.3)
|
50
|
+
coderay (1.1.1)
|
51
|
+
concurrent-ruby (1.0.5)
|
52
|
+
diff-lcs (1.3)
|
53
|
+
erubi (1.6.1)
|
54
|
+
globalid (0.4.0)
|
55
|
+
activesupport (>= 4.2.0)
|
56
|
+
i18n (0.8.6)
|
57
|
+
loofah (2.0.3)
|
58
|
+
nokogiri (>= 1.5.9)
|
59
|
+
mail (2.6.6)
|
60
|
+
mime-types (>= 1.16, < 4)
|
61
|
+
method_source (0.8.2)
|
62
|
+
mime-types (3.1)
|
63
|
+
mime-types-data (~> 3.2015)
|
64
|
+
mime-types-data (3.2016.0521)
|
65
|
+
mini_portile2 (2.2.0)
|
66
|
+
minitest (5.10.2)
|
67
|
+
nio4r (2.1.0)
|
68
|
+
nokogiri (1.8.0)
|
69
|
+
mini_portile2 (~> 2.2.0)
|
70
|
+
pry (0.10.4)
|
71
|
+
coderay (~> 1.1.0)
|
72
|
+
method_source (~> 0.8.1)
|
73
|
+
slop (~> 3.4)
|
74
|
+
rack (2.0.3)
|
75
|
+
rack-test (0.6.3)
|
65
76
|
rack (>= 1.0)
|
66
|
-
rails (
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
77
|
+
rails (5.1.2)
|
78
|
+
actioncable (= 5.1.2)
|
79
|
+
actionmailer (= 5.1.2)
|
80
|
+
actionpack (= 5.1.2)
|
81
|
+
actionview (= 5.1.2)
|
82
|
+
activejob (= 5.1.2)
|
83
|
+
activemodel (= 5.1.2)
|
84
|
+
activerecord (= 5.1.2)
|
85
|
+
activesupport (= 5.1.2)
|
86
|
+
bundler (>= 1.3.0, < 2.0)
|
87
|
+
railties (= 5.1.2)
|
88
|
+
sprockets-rails (>= 2.0.0)
|
89
|
+
rails-dom-testing (2.0.3)
|
90
|
+
activesupport (>= 4.2.0)
|
91
|
+
nokogiri (>= 1.6)
|
92
|
+
rails-html-sanitizer (1.0.3)
|
93
|
+
loofah (~> 2.0)
|
94
|
+
railties (5.1.2)
|
95
|
+
actionpack (= 5.1.2)
|
96
|
+
activesupport (= 5.1.2)
|
97
|
+
method_source
|
78
98
|
rake (>= 0.8.7)
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
rspec-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
rspec-
|
90
|
-
diff-lcs (~> 1.1.3)
|
91
|
-
rspec-mocks (2.11.3)
|
92
|
-
rspec-rails (2.11.4)
|
99
|
+
thor (>= 0.18.1, < 2.0)
|
100
|
+
rake (12.0.0)
|
101
|
+
rspec-core (3.6.0)
|
102
|
+
rspec-support (~> 3.6.0)
|
103
|
+
rspec-expectations (3.6.0)
|
104
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
105
|
+
rspec-support (~> 3.6.0)
|
106
|
+
rspec-mocks (3.6.0)
|
107
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
108
|
+
rspec-support (~> 3.6.0)
|
109
|
+
rspec-rails (3.6.0)
|
93
110
|
actionpack (>= 3.0)
|
94
111
|
activesupport (>= 3.0)
|
95
112
|
railties (>= 3.0)
|
96
|
-
rspec (~>
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
113
|
+
rspec-core (~> 3.6.0)
|
114
|
+
rspec-expectations (~> 3.6.0)
|
115
|
+
rspec-mocks (~> 3.6.0)
|
116
|
+
rspec-support (~> 3.6.0)
|
117
|
+
rspec-support (3.6.0)
|
118
|
+
slop (3.6.0)
|
119
|
+
sprockets (3.7.1)
|
120
|
+
concurrent-ruby (~> 1.0)
|
121
|
+
rack (> 1, < 3)
|
122
|
+
sprockets-rails (3.2.0)
|
123
|
+
actionpack (>= 4.0)
|
124
|
+
activesupport (>= 4.0)
|
125
|
+
sprockets (>= 3.0.0)
|
126
|
+
thor (0.19.4)
|
127
|
+
thread_safe (0.3.6)
|
128
|
+
tzinfo (1.2.3)
|
129
|
+
thread_safe (~> 0.1)
|
130
|
+
websocket-driver (0.6.5)
|
131
|
+
websocket-extensions (>= 0.1.0)
|
132
|
+
websocket-extensions (0.1.2)
|
108
133
|
|
109
134
|
PLATFORMS
|
110
135
|
ruby
|
@@ -114,3 +139,6 @@ DEPENDENCIES
|
|
114
139
|
layout!
|
115
140
|
pry
|
116
141
|
rspec-rails
|
142
|
+
|
143
|
+
BUNDLED WITH
|
144
|
+
1.15.2
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
(The MIT License)
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
'Software'), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
17
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
18
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
19
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
20
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/{README.rdoc → README.md}
RENAMED
@@ -1,26 +1,28 @@
|
|
1
|
-
|
1
|
+
# Layout
|
2
2
|
|
3
3
|
Layout is plugin that allow to choose the layout with options like
|
4
4
|
`:except` and `:only`.
|
5
5
|
|
6
|
-
|
6
|
+
## Instalation
|
7
7
|
|
8
8
|
gem install layout
|
9
9
|
|
10
|
-
|
10
|
+
## Usage
|
11
11
|
|
12
12
|
Add the method call `set_layout` to your controller.
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
14
|
+
```ruby
|
15
|
+
class PagesController < ApplicationController
|
16
|
+
set_layout 'site', only: %w(faq feedback)
|
17
|
+
set_layout 'custom', except: %w(faq feedback)
|
18
|
+
end
|
19
|
+
```
|
18
20
|
|
19
|
-
|
21
|
+
## Maintainer
|
20
22
|
|
21
23
|
* Nando Vieira (http://nandovieira.com.br)
|
22
24
|
|
23
|
-
|
25
|
+
## License
|
24
26
|
|
25
27
|
(The MIT License)
|
26
28
|
|
data/Rakefile
CHANGED
data/layout.gemspec
CHANGED
@@ -1,6 +1,4 @@
|
|
1
|
-
|
2
|
-
$:.push File.expand_path("../lib", __FILE__)
|
3
|
-
require "layout/version"
|
1
|
+
require "./lib/layout/version"
|
4
2
|
|
5
3
|
Gem::Specification.new do |s|
|
6
4
|
s.name = "layout"
|
@@ -9,14 +7,12 @@ Gem::Specification.new do |s|
|
|
9
7
|
s.authors = ["Nando Vieira"]
|
10
8
|
s.email = ["fnando.vieira@gmail.com"]
|
11
9
|
s.homepage = "http://rubygems.org/gems/layout"
|
12
|
-
s.summary = "Specify which layout will be rendered on Rails
|
10
|
+
s.summary = "Specify which layout will be rendered on Rails apps"
|
13
11
|
s.description = s.summary
|
14
12
|
|
15
|
-
s.rubyforge_project = "layout"
|
16
|
-
|
17
13
|
s.files = `git ls-files`.split("\n")
|
18
14
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
19
|
-
s.executables = `git ls-files -- bin/*`.split("\n").map{
|
15
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{|f| File.basename(f) }
|
20
16
|
s.require_paths = ["lib"]
|
21
17
|
|
22
18
|
s.add_dependency "rails"
|
data/lib/layout/base.rb
CHANGED
@@ -28,6 +28,7 @@ module Layout
|
|
28
28
|
|
29
29
|
module InstanceMethods
|
30
30
|
private
|
31
|
+
|
31
32
|
def choose_layout
|
32
33
|
layout_name = nil
|
33
34
|
|
@@ -53,8 +54,8 @@ module Layout
|
|
53
54
|
end
|
54
55
|
|
55
56
|
def validates_action_for_layout(compares_to, actions)
|
56
|
-
[actions].flatten.
|
57
|
+
[actions].flatten.map(&:to_sym).include?(action_name.to_sym) == compares_to
|
57
58
|
end
|
58
59
|
end
|
59
60
|
end
|
60
|
-
end
|
61
|
+
end
|
data/lib/layout/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
class SamplesController < ApplicationController
|
2
|
-
set_layout "application", :
|
3
|
-
set_layout "site", :
|
4
|
-
set_layout "modal", :
|
5
|
-
set_layout "window", :
|
2
|
+
set_layout "application", only: :index
|
3
|
+
set_layout "site", only: :show
|
4
|
+
set_layout "modal", except: [:index, :show, :remove]
|
5
|
+
set_layout "window", only: :remove
|
6
6
|
|
7
7
|
def index
|
8
8
|
render "/action"
|
data/spec/support/config/boot.rb
CHANGED
metadata
CHANGED
@@ -1,92 +1,83 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: layout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
5
|
-
prerelease:
|
4
|
+
version: 0.2.1
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Nando Vieira
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2017-07-28 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rails
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '0'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: rspec-rails
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - ">="
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '0'
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - ">="
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '0'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: pry
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- -
|
45
|
+
- - ">="
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: '0'
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- -
|
52
|
+
- - ">="
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: '0'
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: awesome_print
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
|
-
- -
|
59
|
+
- - ">="
|
68
60
|
- !ruby/object:Gem::Version
|
69
61
|
version: '0'
|
70
62
|
type: :development
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
|
-
- -
|
66
|
+
- - ">="
|
76
67
|
- !ruby/object:Gem::Version
|
77
68
|
version: '0'
|
78
|
-
description: Specify which layout will be rendered on Rails
|
69
|
+
description: Specify which layout will be rendered on Rails apps
|
79
70
|
email:
|
80
71
|
- fnando.vieira@gmail.com
|
81
72
|
executables: []
|
82
73
|
extensions: []
|
83
74
|
extra_rdoc_files: []
|
84
75
|
files:
|
85
|
-
- .gitignore
|
86
|
-
- .rspec
|
76
|
+
- ".gitignore"
|
87
77
|
- Gemfile
|
88
78
|
- Gemfile.lock
|
89
|
-
-
|
79
|
+
- LICENSE.txt
|
80
|
+
- README.md
|
90
81
|
- Rakefile
|
91
82
|
- layout.gemspec
|
92
83
|
- lib/layout.rb
|
@@ -117,26 +108,46 @@ files:
|
|
117
108
|
- spec/support/tmp/pagseguro-test.yml
|
118
109
|
homepage: http://rubygems.org/gems/layout
|
119
110
|
licenses: []
|
111
|
+
metadata: {}
|
120
112
|
post_install_message:
|
121
113
|
rdoc_options: []
|
122
114
|
require_paths:
|
123
115
|
- lib
|
124
116
|
required_ruby_version: !ruby/object:Gem::Requirement
|
125
|
-
none: false
|
126
117
|
requirements:
|
127
|
-
- -
|
118
|
+
- - ">="
|
128
119
|
- !ruby/object:Gem::Version
|
129
120
|
version: '0'
|
130
121
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
131
|
-
none: false
|
132
122
|
requirements:
|
133
|
-
- -
|
123
|
+
- - ">="
|
134
124
|
- !ruby/object:Gem::Version
|
135
125
|
version: '0'
|
136
126
|
requirements: []
|
137
|
-
rubyforge_project:
|
138
|
-
rubygems_version:
|
127
|
+
rubyforge_project:
|
128
|
+
rubygems_version: 2.6.11
|
139
129
|
signing_key:
|
140
|
-
specification_version:
|
141
|
-
summary: Specify which layout will be rendered on Rails
|
142
|
-
test_files:
|
130
|
+
specification_version: 4
|
131
|
+
summary: Specify which layout will be rendered on Rails apps
|
132
|
+
test_files:
|
133
|
+
- spec/controllers/inherited_controller_spec.rb
|
134
|
+
- spec/controllers/no_layout_file_controller_spec.rb
|
135
|
+
- spec/controllers/samples_controller_spec.rb
|
136
|
+
- spec/spec_helper.rb
|
137
|
+
- spec/support/.DS_Store
|
138
|
+
- spec/support/app/.DS_Store
|
139
|
+
- spec/support/app/controllers/application_controller.rb
|
140
|
+
- spec/support/app/controllers/inherited_controller.rb
|
141
|
+
- spec/support/app/controllers/no_layout_file_controller.rb
|
142
|
+
- spec/support/app/controllers/samples_controller.rb
|
143
|
+
- spec/support/app/views/action.html.erb
|
144
|
+
- spec/support/app/views/layouts/application.html.erb
|
145
|
+
- spec/support/app/views/layouts/modal.html.erb
|
146
|
+
- spec/support/app/views/layouts/samples.html.erb
|
147
|
+
- spec/support/app/views/layouts/site.html.erb
|
148
|
+
- spec/support/config/boot.rb
|
149
|
+
- spec/support/config/routes.rb
|
150
|
+
- spec/support/custom_layout_shared.rb
|
151
|
+
- spec/support/log/.gitkeep
|
152
|
+
- spec/support/tmp/.gitkeep
|
153
|
+
- spec/support/tmp/pagseguro-test.yml
|
data/.rspec
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
--color --format documentation --order random
|