bamboolab_contact_form 0.0.16 → 0.0.17
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 +4 -4
- data/bin/bamboolab_contact_form +34 -30
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b7fdb3d0ae9782895e9da88777ad8e63f21a54d
|
4
|
+
data.tar.gz: 495e129539b47297f0621f49cfa09e6ab35d09d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e16a0674790d7abdca010b308b7ae7f18a3fbc26ed136aac0b444c91007a3bcddec7a8c57b211f1db893cca2d408c5383e231eb37c1eb849362213191ed9327
|
7
|
+
data.tar.gz: b4a8765bc1644a482b4d3a34fd034911623b67580495225aa9985e95285958fc6774c211677e2e7a25e068580597b57fd44eb09130af66c03ae376e0437e3ff2
|
data/bin/bamboolab_contact_form
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
arg = ARGV
|
4
|
-
name_arg = arg[0]
|
4
|
+
name_arg = arg[0] || "message"
|
5
5
|
fields = arg[1].split(", ") || "[name:text_field, email:email_field, content:text_area]"
|
6
6
|
fields.first.slice!(0)
|
7
7
|
fields.last.slice!(-1)
|
@@ -11,7 +11,6 @@ if name_arg
|
|
11
11
|
save = name_arg.split(":")[1]
|
12
12
|
end
|
13
13
|
|
14
|
-
|
15
14
|
mailer_arg = arg[2] || "[kvesic.mislav@gmail.com, name]"
|
16
15
|
mailer = mailer_arg.split(", ") unless mailer_arg == "nil"
|
17
16
|
unless mailer_arg == "nil"
|
@@ -23,32 +22,37 @@ require 'bamboolab_contact_form'
|
|
23
22
|
|
24
23
|
form = Bamboolab_contact_form.new(name, fields, mailer)
|
25
24
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
end
|
47
|
-
|
48
|
-
form.helper
|
49
|
-
form.view
|
25
|
+
if save == "destroy"
|
26
|
+
system("rails generate controller #{name}s")
|
27
|
+
|
28
|
+
unless save
|
29
|
+
form.model
|
30
|
+
form.controller
|
31
|
+
else
|
32
|
+
fields_string = ""
|
33
|
+
fields.each do |field|
|
34
|
+
type = field.split(":")[1]
|
35
|
+
if type == "text_field" or type == "email_field"
|
36
|
+
fields_string << " #{field.split(":")[0]}:string"
|
37
|
+
elsif type == "text_area"
|
38
|
+
fields_string << " #{field.split(":")[0]}:text"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
system("rails generate model #{name.capitalize}#{fields_string}")
|
43
|
+
form.model_save
|
44
|
+
form.controller_save
|
45
|
+
end
|
46
|
+
|
47
|
+
form.helper
|
48
|
+
form.view
|
49
|
+
|
50
|
+
system("rails generate mailer #{name}s") unless mailer_arg=="nil"
|
51
|
+
form.mailer unless mailer_arg=="nil"
|
52
|
+
form.notice
|
53
|
+
else
|
54
|
+
system("rails destroy controller #{name}s")
|
55
|
+
system("rails destroy model #{name}")
|
56
|
+
system("rails destroy mailer #{name}s")
|
50
57
|
|
51
|
-
|
52
|
-
form.mailer unless mailer_arg=="nil"
|
53
|
-
|
54
|
-
form.notice
|
58
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bamboolab_contact_form
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mislav Kvesić
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-05 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Form out of the box.
|
14
14
|
email: kvesic.mislav@gmail.com
|