susana 0.0.3 → 0.0.4
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/lib/susana.rb +6 -8
- 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: 3d6d3ab75c395a9b7d2e001b9905715fa774596e
|
|
4
|
+
data.tar.gz: ed625c28876aabc03cf46c85657d8eb9b1d92710
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c0be28c2feabde0e3532268a00517e31000c7affd2e0f03d1577a17fcb24054fc81e17f33c199933cccdffc98fa7efcc9a8d0c942e58f2174143142e47907f7b
|
|
7
|
+
data.tar.gz: d52192edc08c19acc5b9d79c2c9a078291b36d5b635acf711a45bcf3cfdd43a827523b447fa3ce6778f2f6bb983838697c81d899d39eb890b4cddf8404eba3b1
|
data/lib/susana.rb
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
# This script downloads and installs your new application
|
|
7
7
|
|
|
8
8
|
require 'securerandom'
|
|
9
|
+
require 'fileutils'
|
|
9
10
|
|
|
10
11
|
puts "\n * S U S A N A *\n\n"
|
|
11
12
|
|
|
@@ -18,25 +19,22 @@ if !name or name == ''
|
|
|
18
19
|
exit
|
|
19
20
|
end
|
|
20
21
|
|
|
21
|
-
# Get working dir
|
|
22
|
-
dir = Dir.pwd
|
|
23
|
-
|
|
24
22
|
# Install new susana app
|
|
25
23
|
`git clone https://github.com/fugroup/susana #{name}`
|
|
26
24
|
|
|
27
|
-
|
|
28
|
-
Dir.chdir(name)
|
|
25
|
+
FileUtils.cd(name)
|
|
29
26
|
|
|
30
27
|
# Cleanup
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
FileUtils.remove_dir(".git")
|
|
29
|
+
FileUtils.remove_dir("gem")
|
|
33
30
|
|
|
34
31
|
# Create cookie secret
|
|
35
32
|
secret = SecureRandom::hex(26)
|
|
36
33
|
|
|
37
34
|
# Install secret
|
|
38
35
|
key = 'a8976c0df4fb8a28f8fe979270443d37f239cf8da8f1bf9734ba'
|
|
39
|
-
|
|
36
|
+
file = File.read("config.ru").gsub(key, secret)
|
|
37
|
+
File.open("config.ru", 'w'){|f| f.write(file)}
|
|
40
38
|
|
|
41
39
|
puts "\nApp #{name} created, please review your settings in the config directory\n\n"
|
|
42
40
|
puts "To start the application, go to the #{name} directory and run 'puma'\n"
|