bootswatch_rails 3.2.0.34 → 3.2.0.35
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bootswatch_rails/version.rb +1 -1
- data/lib/generators/bootswatch_rails/created_by/created_by_generator.rb +8 -5
- data/lib/generators/bootswatch_rails/skip_login/skip_login_generator.rb +21 -0
- data/lib/generators/bootswatch_rails/sorcery/sorcery_generator.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c316e5e4688f2cf80c9997d742056a59854f5ff4
|
4
|
+
data.tar.gz: 488aa1abd7129b69aa3d2a2ff51bfa933f183e05
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7fe86f9efcaec443dfbb36b927b98639c0b8816b3f659afba3461712346aff9aae31d23d4997bc0ac100894ff2badbef26d018e360e4818f05ea95a158e87c11
|
7
|
+
data.tar.gz: fe45ced5879c9500737dc2f0ac1a5c2b89f2c7cdb99e265f9546a6ed6405b84e87020312d376ecc9b7e0958a8ae30a29d0c67212f3c7b71cc3b5e60b6f60e594
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module BootswatchRails
|
2
2
|
BOOTSTRAP = "3.2.0"
|
3
|
-
VERSION = "3.2.0.34"
|
4
3
|
FONT_AWESOME = "4.2.0"
|
4
|
+
VERSION = "3.2.0.35"
|
5
5
|
|
6
6
|
THEMES = [:amelia, :cerulean, :cosmo, :custom, :cyborg, :darkly, :flatly, :journal, :lumen, :paper, :readable, :sandstone, :simplex, :slate, :spacelab, :superhero, :united, :yeti]
|
7
7
|
DEFAULT = 1
|
@@ -7,20 +7,23 @@ module BootswatchRails
|
|
7
7
|
argument :name, type: :string,
|
8
8
|
desc: "The resource to be updated"
|
9
9
|
argument :user, type: :string, default: "user",
|
10
|
-
banner: "
|
10
|
+
banner: "name of the user model"
|
11
|
+
class_option :helper, type: :boolean, default: false,
|
12
|
+
banner: "create helper for view shortcuts"
|
11
13
|
class_option :migration, type: :boolean, default: false,
|
12
14
|
desc: 'Create a migration for added attributes'
|
13
15
|
source_root File.expand_path('../templates', __FILE__)
|
14
16
|
|
17
|
+
def add_helper
|
18
|
+
return unless options.helper?
|
19
|
+
template "created_by_helper.rb", "app/helpers/created_by_helper.rb"
|
20
|
+
end
|
21
|
+
|
15
22
|
def add_migration
|
16
23
|
return unless options.migration?
|
17
24
|
migration_template 'created_by_migration.rb', "db/migrate/#{migration_name}.rb"
|
18
25
|
end
|
19
26
|
|
20
|
-
def add_helper
|
21
|
-
template "created_by_helper.rb", "app/helpers/created_by_helper.rb"
|
22
|
-
end
|
23
|
-
|
24
27
|
def update_controller
|
25
28
|
file = "app/controllers/#{table_name}_controller.rb"
|
26
29
|
curr = "current_#{user}"
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'rails/generators/active_record'
|
2
|
+
|
3
|
+
module BootswatchRails
|
4
|
+
module Generators
|
5
|
+
class SkipLoginGenerator < ActiveRecord::Generators::Base
|
6
|
+
desc "Add skip_require_login to resource"
|
7
|
+
argument :name, type: :string,
|
8
|
+
desc: "The resource to be updated"
|
9
|
+
argument :actions, type: :array,
|
10
|
+
banner: "the actions to be publicly available"
|
11
|
+
|
12
|
+
def update_controller
|
13
|
+
file = "app/controllers/#{table_name}_controller.rb"
|
14
|
+
list = actions.map{|a| ":#{a}"}.join(', ')
|
15
|
+
inject_into_file file, after: /before_action :set.*$/ do
|
16
|
+
"\n skip_before_action :require_login, only: [#{list}]"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -132,7 +132,7 @@ module BootswatchRails
|
|
132
132
|
|
133
133
|
def update_application_controller
|
134
134
|
file = "app/controllers/application_controller.rb"
|
135
|
-
inject_into_class file, "ApplicationController", "
|
135
|
+
inject_into_class file, "ApplicationController", " before_action :require_login\n\n"
|
136
136
|
inject_into_file file, "\n\n private", after: /protect_from_forgery.*$/
|
137
137
|
lines = [
|
138
138
|
"",
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bootswatch_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.0.
|
4
|
+
version: 3.2.0.35
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Volker Wiegand
|
@@ -121,6 +121,7 @@ files:
|
|
121
121
|
- lib/generators/bootswatch_rails/install/templates/lib/templates/erb/scaffold/index.html.erb
|
122
122
|
- lib/generators/bootswatch_rails/install/templates/lib/templates/erb/scaffold/new.html.erb
|
123
123
|
- lib/generators/bootswatch_rails/install/templates/lib/templates/erb/scaffold/show.html.erb
|
124
|
+
- lib/generators/bootswatch_rails/skip_login/skip_login_generator.rb
|
124
125
|
- lib/generators/bootswatch_rails/sorcery/sorcery_generator.rb
|
125
126
|
- lib/generators/bootswatch_rails/sorcery/templates/_form.html.erb
|
126
127
|
- lib/generators/bootswatch_rails/sorcery/templates/ability_migration.rb
|