scaffold_plus 1.4.15 → 1.4.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Makefile +3 -1
- data/lib/generators/scaffold_plus/force_ssl/force_ssl_generator.rb +8 -8
- data/lib/scaffold_plus/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cfe850e68fb470d89fe657192af96933d6a2d8e6
|
4
|
+
data.tar.gz: 35a241fc5cc772f80b327374a6027ec12ee70f04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 328b0f2324d9874a611211e57ef87b54c2ebb24320482aa221a81c10f206c4eb9307fa7284bd3e1914ace4f4ed878139c1884e1e16d114afcd73dd35d48015ca
|
7
|
+
data.tar.gz: 892e75b8c5096796849833fade07d38d0d5fd8499030cf400651684841099257c1f00b6c64c1882991756df5eed452c8b2e4e630144b408f9ac8a74c563a298a
|
data/Makefile
CHANGED
@@ -9,13 +9,15 @@ all: build
|
|
9
9
|
rel: build
|
10
10
|
vim lib/scaffold_plus/version.rb
|
11
11
|
git commit -a
|
12
|
-
sudo gem uninstall scaffold_plus --all
|
13
12
|
rake release
|
13
|
+
sudo gem uninstall scaffold_plus --all
|
14
14
|
sudo rake install
|
15
15
|
|
16
16
|
|
17
17
|
install: build
|
18
18
|
git commit -a
|
19
|
+
sudo gem uninstall scaffold_plus --all
|
20
|
+
sudo rake install
|
19
21
|
|
20
22
|
build:
|
21
23
|
git add lib
|
@@ -6,17 +6,17 @@ module ScaffoldPlus
|
|
6
6
|
desc "Enforce SSL for this controller in production"
|
7
7
|
argument :name, type: :string,
|
8
8
|
desc: "The resource that is SSL protected"
|
9
|
-
class_option :
|
10
|
-
desc: 'Enforce for these actions'
|
11
|
-
class_option :
|
12
|
-
desc: 'Do not enforce for these actions'
|
9
|
+
class_option :only_for, type: :array,
|
10
|
+
desc: 'Enforce SSL for these actions'
|
11
|
+
class_option :except_for, type: :array,
|
12
|
+
desc: 'Do not enforce SSL for these actions'
|
13
13
|
|
14
14
|
def update_controller
|
15
15
|
file = "app/controllers/#{table_name}_controller.rb"
|
16
16
|
inject_into_file file, after: /^class.*ApplicationController$/ do
|
17
17
|
text = "\n force_ssl if: :ssl_configured?"
|
18
|
-
text << ", only: [
|
19
|
-
text << ", except: [
|
18
|
+
text << ", only: [#{only_list}]" if options.only_for.present?
|
19
|
+
text << ", except: [#{except_list}]" if options.except_for.present?
|
20
20
|
text
|
21
21
|
end
|
22
22
|
inject_into_file file, after: /private$/ do
|
@@ -35,11 +35,11 @@ module ScaffoldPlus
|
|
35
35
|
protected
|
36
36
|
|
37
37
|
def only_list
|
38
|
-
|
38
|
+
options.only_for.map { |o| ":#{o}" }.join(", ")
|
39
39
|
end
|
40
40
|
|
41
41
|
def except_list
|
42
|
-
|
42
|
+
options.except_for.map { |o| ":#{o}" }.join(", ")
|
43
43
|
end
|
44
44
|
end
|
45
45
|
end
|