rails_layout 1.0.19 → 1.0.20

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f1e07207c60b7d8b3623df2eb72f374b65afb535
4
- data.tar.gz: 5aeb798561567c2e1ff59bfba742eecb76590ebd
3
+ metadata.gz: e64744c20d753039c9cd6f7f4f265c03ee873da5
4
+ data.tar.gz: 5412d21ea097dbef9823a7f2949819526fcaee95
5
5
  SHA512:
6
- metadata.gz: a1b2125276bd039726ae56821459ea5ab236b2f536cf6ce88dc044a918d8415cc0a0ffed29853c519e6486c952eb8f378dc2aea86e0d44b354e50b346bb4a91d
7
- data.tar.gz: e4d3f583cd06b06ac3f5bc4a9a4b890d98c5ec12fbe49c39b787fa362bfbf3fe1ed1268ac0bfa10e0f73df3b17711bb2c082aaead07ed1e7a0fa20baebf26db3
6
+ metadata.gz: 6360f95afec10ef1c440ee43f0b8fdc74ba175985a725500d5c81a17e1e0aa172fa3f5fb76c518b977e6459412b56c3be9d9945a2162787eb8e735a936e86820
7
+ data.tar.gz: da6cfbef17d88dfb3ebe8dfed8a65b4a45dfdd2bff705360df1795e11b9c439f426e93b5ceff1b093abbbcc1857d7400b8357c2b2dad5788fb2f6473e3ae89da
data/CHANGELOG.textile CHANGED
@@ -1,5 +1,9 @@
1
1
  h1. CHANGELOG
2
2
 
3
+ h3. 1.0.20 June 19, 2014
4
+
5
+ * generate admin links when OmniAuth is used with Pundit
6
+
3
7
  h3. 1.0.19 June 4, 2014
4
8
 
5
9
  * "require 'rails_helper'" not needed when it is include in the '.rspec' file
@@ -26,46 +26,42 @@ module Layout
26
26
  <li><%= link_to 'Sign in', new_user_session_path %></li>
27
27
  <li><%= link_to 'Sign up', new_user_registration_path %></li>
28
28
  <% end %>
29
+ LINKS
30
+ end
31
+ end
32
+ # OMNIAUTH
33
+ if File.exists?('config/initializers/omniauth.rb')
34
+ append_file 'app/views/layouts/_navigation_links.html.erb' do <<-LINKS
35
+ <% if user_signed_in? %>
36
+ <li><%= link_to 'Sign out', signout_path %></li>
37
+ <% else %>
38
+ <li><%= link_to 'Sign in', signin_path %></li>
39
+ <% end %>
29
40
  LINKS
30
41
  end
31
42
  end
32
43
  # USERS
33
- if Object.const_defined?('User')
44
+ if Dir.glob("app/views/users/index.html.{#{ext},erb}").any?
34
45
  if User.column_names.include? 'role'
35
46
  # suitable for role-based authorization
36
- if Dir.glob("app/views/users/index.html.{#{ext},erb}").any?
37
- append_file 'app/views/layouts/_navigation_links.html.erb' do <<-LINKS
47
+ append_file 'app/views/layouts/_navigation_links.html.erb' do <<-LINKS
38
48
  <% if user_signed_in? %>
39
49
  <% if current_user.admin? %>
40
50
  <li><%= link_to 'Users', users_path %></li>
41
51
  <% end %>
42
52
  <% end %>
43
53
  LINKS
44
- end
45
54
  end
46
55
  else
47
56
  # suitable for simple authentication
48
- if Dir.glob("app/views/users/index.html.{#{ext},erb}").any?
49
- append_file 'app/views/layouts/_navigation_links.html.erb' do <<-LINKS
57
+ append_file 'app/views/layouts/_navigation_links.html.erb' do <<-LINKS
50
58
  <% if user_signed_in? %>
51
59
  <li><%= link_to 'Users', users_path %></li>
52
60
  <% end %>
53
61
  LINKS
54
- end
55
62
  end
56
63
  end
57
64
  end
58
- # OMNIAUTH
59
- if File.exists?('config/initializers/omniauth.rb')
60
- append_file 'app/views/layouts/_navigation_links.html.erb' do <<-LINKS
61
- <% if user_signed_in? %>
62
- <li><%= link_to 'Sign out', signout_path %></li>
63
- <% else %>
64
- <li><%= link_to 'Sign in', signin_path %></li>
65
- <% end %>
66
- LINKS
67
- end
68
- end
69
65
  end
70
66
 
71
67
  def add_tests
@@ -1,3 +1,3 @@
1
1
  module RailsLayout
2
- VERSION = "1.0.19"
2
+ VERSION = "1.0.20"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_layout
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.19
4
+ version: 1.0.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Kehoe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-04 00:00:00.000000000 Z
11
+ date: 2014-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler