bootswatch_rails 3.1.1.11 → 3.1.1.13

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: d292cd0ac0502d539ba38469e004f251b674d568
4
- data.tar.gz: 3e0147c90db10cbda94cd6fd83e253def48ab807
3
+ metadata.gz: 277159fe829dec481e3483ba9ced4cbf462ba513
4
+ data.tar.gz: 55876bfef80f2fdae6b697864ed8f2937464643a
5
5
  SHA512:
6
- metadata.gz: 9a01fcf1875935a31e1802631ced3df739e4a9c38e28f884c9bb2810e540786a87b4ad9a492e46f1495019152d9f2b06ab0054aa8abfcfd237e31d9e3a17978f
7
- data.tar.gz: c3c17f7bbd24e92e2bf0d627f928d752963d3ff23b2ade8824e7eac12586ef764da0727ffdfcd3c227f1379d6e43aeb4bd3d62618ea7b3351100110738f5a864
6
+ metadata.gz: 334f1abb47c528e096fce1b6aa91fa0aab95220c4996339636a7306c174ea61aaa8cda2dc9b04fb31a1c349924144edc3c31685a359b1429b0fa2b9cad7f5401
7
+ data.tar.gz: a5ebf20d243bf52b69cd060420c34bef4d885f89cecdb360635c1950dd532643e78308f7649467802cf777c6f0641c6d18a60ba57d27828b555d6c0553423cdf
@@ -1,5 +1,5 @@
1
1
  module BootswatchRails
2
- VERSION = "3.1.1.11"
2
+ VERSION = "3.1.1.13"
3
3
  THEMES = [:amelia, :cerulean, :cosmo, :custom, :cyborg, :darkly, :flatly, :journal, :lumen, :readable, :simplex, :slate, :spacelab, :superhero, :united, :yeti]
4
4
  DEFAULT = 1
5
5
  end
@@ -8,37 +8,28 @@ module BootswatchRails
8
8
 
9
9
  def update_javascripts
10
10
  return unless options.bootstrap?
11
- inside "app/assets/javascripts" do
12
- inject_into_file "application.js", after: /require jquery_ujs$/ do
13
- "\n//= require bootstrap"
14
- end
15
- end
11
+ file = "app/assets/javascripts/application.js"
12
+ inject_into_file file, "\n//= require bootstrap", after: /require jquery_ujs$/
16
13
  end
17
14
 
18
15
  def update_application_controller
19
- inside "app/controllers" do
20
- file = "application_controller.rb"
21
- inject_into_file file, after: /protect_from_forgery.*$/ do
22
- "\n\n private"
23
- end
24
- lines = [
25
- "",
26
- " def default_theme",
27
- " BootswatchRails::THEMES[BootswatchRails::DEFAULT].to_s",
28
- " end",
29
- " helper_method :default_theme",
30
- "",
31
- " def current_theme",
32
- " @current_theme = current_user.theme if current_user.present?",
33
- " @current_theme ||= default_theme",
34
- " end",
35
- " helper_method :current_theme",
36
- ""
37
- ]
38
- inject_into_file file, before: /^end$/ do
39
- lines.join("\n")
40
- end
41
- end
16
+ file = "app/controllers/application_controller.rb"
17
+ inject_into_file file, "\n\n private", after: /protect_from_forgery.*$/
18
+ lines = [
19
+ "",
20
+ " def default_theme",
21
+ " BootswatchRails::THEMES[BootswatchRails::DEFAULT].to_s",
22
+ " end",
23
+ " helper_method :default_theme",
24
+ "",
25
+ " def current_theme",
26
+ " @current_theme = current_user.theme if current_user.present?",
27
+ " @current_theme ||= default_theme",
28
+ " end",
29
+ " helper_method :current_theme",
30
+ ""
31
+ ]
32
+ inject_into_file file, lines.join("\n"), before: /^end$/
42
33
  end
43
34
 
44
35
  def copy_directories
@@ -49,4 +40,3 @@ module BootswatchRails
49
40
  end
50
41
  end
51
42
  end
52
-
@@ -78,6 +78,8 @@ module BootswatchRails
78
78
  ] if reset_password?
79
79
  lines << [
80
80
  " end",
81
+ "get '/login' => '#{table_name}#log_in', as: :login",
82
+ "get '/logout' => '#{table_name}#log_out', as: :logout",
81
83
  ""
82
84
  ]
83
85
  route lines.join("\n")
@@ -93,6 +95,20 @@ module BootswatchRails
93
95
  end
94
96
  end
95
97
 
98
+ def update_application_controller
99
+ file = "app/controllers/application_controller.rb"
100
+ inject_into_class file, "ApplicationController", " before_filter :require_login\n\n"
101
+ inject_into_file file, "\n\n private", after: /protect_from_forgery.*$/
102
+ lines = [
103
+ "",
104
+ " def not_authenticated",
105
+ " redirect_to login_path, alert: t('sorcery.required')",
106
+ " end",
107
+ ""
108
+ ]
109
+ inject_into_file file, lines.join("\n"), before: /^end$/
110
+ end
111
+
96
112
  protected
97
113
 
98
114
  def user_activation?
@@ -22,6 +22,7 @@ de:
22
22
  failed: "E-Mail oder Kennwort ungültig"
23
23
  success: "Willkommen und frohes Schaffen!"
24
24
  goodbye: "Tschüss und bis bald."
25
+ required: "Bitte melden Sie sich zurerst an."
25
26
 
26
27
  <%= name %>_mailer:
27
28
  reset_password_email:
@@ -1,4 +1,5 @@
1
1
  class <%= controller_name.camelize %> < ApplicationController
2
+ skip_before_filter :require_login, only: [:log_in, :access, :password, :reset, :change, :refresh]
2
3
  before_action :set_<%= name %>, only: [:show, :edit, :update, :destroy]
3
4
 
4
5
  # GET /<%= table_name %>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootswatch_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.1.11
4
+ version: 3.1.1.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Volker Wiegand
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-14 00:00:00.000000000 Z
11
+ date: 2014-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties