layout 0.2.0 → 0.2.1

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.
@@ -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 :rubygems
1
+ source "https://rubygems.org"
2
2
  gemspec
@@ -1,110 +1,135 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- layout (0.2.0)
4
+ layout (0.2.1)
5
5
  rails
6
6
 
7
7
  GEM
8
- remote: http://rubygems.org/
8
+ remote: https://rubygems.org/
9
9
  specs:
10
- actionmailer (3.2.8)
11
- actionpack (= 3.2.8)
12
- mail (~> 2.4.4)
13
- actionpack (3.2.8)
14
- activemodel (= 3.2.8)
15
- activesupport (= 3.2.8)
16
- builder (~> 3.0.0)
17
- erubis (~> 2.7.0)
18
- journey (~> 1.0.4)
19
- rack (~> 1.4.0)
20
- rack-cache (~> 1.2)
21
- rack-test (~> 0.6.1)
22
- sprockets (~> 2.1.3)
23
- activemodel (3.2.8)
24
- activesupport (= 3.2.8)
25
- builder (~> 3.0.0)
26
- activerecord (3.2.8)
27
- activemodel (= 3.2.8)
28
- activesupport (= 3.2.8)
29
- arel (~> 3.0.2)
30
- tzinfo (~> 0.3.29)
31
- activeresource (3.2.8)
32
- activemodel (= 3.2.8)
33
- activesupport (= 3.2.8)
34
- activesupport (3.2.8)
35
- i18n (~> 0.6)
36
- multi_json (~> 1.0)
37
- arel (3.0.2)
38
- awesome_print (1.1.0)
39
- builder (3.0.4)
40
- coderay (1.0.8)
41
- diff-lcs (1.1.3)
42
- erubis (2.7.0)
43
- hike (1.2.1)
44
- i18n (0.6.1)
45
- journey (1.0.4)
46
- json (1.7.5)
47
- mail (2.4.4)
48
- i18n (>= 0.4.0)
49
- mime-types (~> 1.16)
50
- treetop (~> 1.4.8)
51
- method_source (0.8.1)
52
- mime-types (1.19)
53
- multi_json (1.3.6)
54
- polyglot (0.3.3)
55
- pry (0.9.10)
56
- coderay (~> 1.0.5)
57
- method_source (~> 0.8)
58
- slop (~> 3.3.1)
59
- rack (1.4.1)
60
- rack-cache (1.2)
61
- rack (>= 0.4)
62
- rack-ssl (1.3.2)
63
- rack
64
- rack-test (0.6.2)
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 (3.2.8)
67
- actionmailer (= 3.2.8)
68
- actionpack (= 3.2.8)
69
- activerecord (= 3.2.8)
70
- activeresource (= 3.2.8)
71
- activesupport (= 3.2.8)
72
- bundler (~> 1.0)
73
- railties (= 3.2.8)
74
- railties (3.2.8)
75
- actionpack (= 3.2.8)
76
- activesupport (= 3.2.8)
77
- rack-ssl (~> 1.3.2)
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
- rdoc (~> 3.4)
80
- thor (>= 0.14.6, < 2.0)
81
- rake (0.9.2.2)
82
- rdoc (3.12)
83
- json (~> 1.4)
84
- rspec (2.11.0)
85
- rspec-core (~> 2.11.0)
86
- rspec-expectations (~> 2.11.0)
87
- rspec-mocks (~> 2.11.0)
88
- rspec-core (2.11.1)
89
- rspec-expectations (2.11.3)
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 (~> 2.11.0)
97
- slop (3.3.3)
98
- sprockets (2.1.3)
99
- hike (~> 1.2)
100
- rack (~> 1.0)
101
- tilt (~> 1.1, != 1.3.0)
102
- thor (0.16.0)
103
- tilt (1.3.3)
104
- treetop (1.4.12)
105
- polyglot
106
- polyglot (>= 0.3.1)
107
- tzinfo (0.3.34)
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
@@ -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.
@@ -1,26 +1,28 @@
1
- = Layout
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
- == Instalation
6
+ ## Instalation
7
7
 
8
8
  gem install layout
9
9
 
10
- == Usage
10
+ ## Usage
11
11
 
12
12
  Add the method call `set_layout` to your controller.
13
13
 
14
- class PagesController < ApplicationController
15
- set_layout 'site', :only => %w(faq feedback)
16
- set_layout 'custom', :except => %w(faq feedback)
17
- end
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
- == Maintainer
21
+ ## Maintainer
20
22
 
21
23
  * Nando Vieira (http://nandovieira.com.br)
22
24
 
23
- == License
25
+ ## License
24
26
 
25
27
  (The MIT License)
26
28
 
data/Rakefile CHANGED
@@ -1,5 +1,5 @@
1
- require 'bundler'
1
+ require "bundler"
2
2
  Bundler::GemHelper.install_tasks
3
3
 
4
- require 'rspec/core/rake_task'
4
+ require "rspec/core/rake_task"
5
5
  RSpec::Core::RakeTask.new
@@ -1,6 +1,4 @@
1
- # -*- encoding: utf-8 -*-
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 3 apps"
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{ |f| File.basename(f) }
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"
@@ -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.collect(&:to_sym).include?(action_name.to_sym) == compares_to
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
@@ -2,7 +2,7 @@ module Layout
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 2
5
- PATCH = 0
5
+ PATCH = 1
6
6
  STRING = "#{MAJOR}.#{MINOR}.#{PATCH}"
7
7
  end
8
8
  end
@@ -1,6 +1,6 @@
1
1
  require "spec_helper"
2
2
 
3
- describe InheritedController do
3
+ describe InheritedController, type: :controller do
4
4
  render_views
5
5
 
6
6
  context "GET :index" do
@@ -1,6 +1,6 @@
1
1
  require "spec_helper"
2
2
 
3
- describe NoLayoutFileController do
3
+ describe NoLayoutFileController, type: :controller do
4
4
  render_views
5
5
 
6
6
  context "GET :index" do
@@ -1,6 +1,6 @@
1
1
  require "spec_helper"
2
2
 
3
- describe SamplesController do
3
+ describe SamplesController, type: :controller do
4
4
  render_views
5
5
 
6
6
  context "GET :index" do
@@ -5,7 +5,3 @@ require "layout"
5
5
  require "support/config/boot"
6
6
  require "rspec/rails"
7
7
  require "support/custom_layout_shared"
8
-
9
- RSpec.configure do |config|
10
- config.treat_symbols_as_metadata_keys_with_true_values = true
11
- end
@@ -1,5 +1,5 @@
1
1
  class InheritedController < SamplesController
2
- set_layout :missing, :only => :index
2
+ set_layout :missing, only: :index
3
3
 
4
4
  def index
5
5
  render "/action"
@@ -1,8 +1,8 @@
1
1
  class SamplesController < ApplicationController
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
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"
@@ -10,6 +10,8 @@ module Layout
10
10
  class Application < Rails::Application
11
11
  config.root = File.dirname(__FILE__) + "/.."
12
12
  config.active_support.deprecation = :log
13
+ config.eager_load = false
14
+ config.secret_key_base = SecureRandom.hex(100)
13
15
  end
14
16
  end
15
17
 
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.0
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: 2012-10-31 00:00:00.000000000 Z
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 3 apps
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
- - README.rdoc
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: layout
138
- rubygems_version: 1.8.23
127
+ rubyforge_project:
128
+ rubygems_version: 2.6.11
139
129
  signing_key:
140
- specification_version: 3
141
- summary: Specify which layout will be rendered on Rails 3 apps
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