forest_liana 2.8.2 → 2.8.3
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/forest_liana/version.rb +1 -1
- data/lib/generators/forest_liana/install_generator.rb +37 -16
- 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: 3f8a110de97c7549661abca45b0a64d007761f81
|
4
|
+
data.tar.gz: e4f6330c222dde8972c7a265c550b846589e990b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4873a75514f82752ea362470f7d28424b97b2ced4ef140d19970fed6fb959198a90f3ea88e86c1605ec1fd33a900277eff5b10dbc93ab231c3f51ecbd38b4372
|
7
|
+
data.tar.gz: df50c529a44f907d9414b713419cb2495216b18551494ad665d0c00e10872c23a867dd4b9d11c4afe6ebac68ce075484c08bae73bce4a0924593ad52838329cf
|
data/lib/forest_liana/version.rb
CHANGED
@@ -7,32 +7,53 @@ module ForestLiana
|
|
7
7
|
argument :env_secret, type: :string, required: true, desc: 'required', banner: 'env_secret'
|
8
8
|
|
9
9
|
def install
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
"ForestLiana.env_secret = Rails.application.secrets.forest_env_secret" +
|
14
|
-
"\nForestLiana.auth_secret = Rails.application.secrets.forest_auth_secret"
|
10
|
+
if ForestLiana.env_secret.present?
|
11
|
+
puts "\nForest liana already installed on this app (environment secret: #{ForestLiana.env_secret})"
|
12
|
+
return
|
15
13
|
end
|
16
14
|
|
15
|
+
route "mount ForestLiana::Engine => '/forest'"
|
16
|
+
|
17
17
|
auth_secret = SecureRandom.urlsafe_base64
|
18
18
|
|
19
19
|
puts "\nForest generated a random authentication secret to secure the " +
|
20
20
|
"data access of your local project.\nYou can change it at any time in " +
|
21
21
|
"your config/secrets.yml file.\n\n"
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
23
|
+
# NOTICE: If it is a Rails 5.2+ apps, the secrets.yml file might not exist
|
24
|
+
# (replaced by credentials.yml.enc but still supported).
|
25
|
+
if File.exist? 'config/secrets.yml'
|
26
|
+
inject_into_file 'config/secrets.yml', after: "development:\n" do
|
27
|
+
" forest_env_secret: #{env_secret}\n" +
|
28
|
+
" forest_auth_secret: #{auth_secret}\n"
|
29
|
+
end
|
30
|
+
|
31
|
+
inject_into_file 'config/secrets.yml', after: "staging:\n", force: true do
|
32
|
+
" forest_env_secret: <%= ENV[\"FOREST_ENV_SECRET\"] %>\n" +
|
33
|
+
" forest_auth_secret: <%= ENV[\"FOREST_AUTH_SECRET\"] %>\n"
|
34
|
+
end
|
35
|
+
|
36
|
+
inject_into_file 'config/secrets.yml', after: "production:\n", force: true do
|
37
|
+
" forest_env_secret: <%= ENV[\"FOREST_ENV_SECRET\"] %>\n" +
|
38
|
+
" forest_auth_secret: <%= ENV[\"FOREST_AUTH_SECRET\"] %>\n"
|
39
|
+
end
|
40
|
+
else
|
41
|
+
create_file 'config/secrets.yml' do
|
42
|
+
"development:\n" +
|
43
|
+
" forest_env_secret: #{env_secret}\n" +
|
44
|
+
" forest_auth_secret: #{auth_secret}\n" +
|
45
|
+
"staging:\n" +
|
46
|
+
" forest_env_secret: <%= ENV[\"FOREST_ENV_SECRET\"] %>\n" +
|
47
|
+
" forest_auth_secret: <%= ENV[\"FOREST_AUTH_SECRET\"] %>\n" +
|
48
|
+
"production:\n" +
|
49
|
+
" forest_env_secret: <%= ENV[\"FOREST_ENV_SECRET\"] %>\n" +
|
50
|
+
" forest_auth_secret: <%= ENV[\"FOREST_AUTH_SECRET\"] %>\n"
|
51
|
+
end
|
31
52
|
end
|
32
53
|
|
33
|
-
|
34
|
-
"
|
35
|
-
"
|
54
|
+
initializer 'forest_liana.rb' do
|
55
|
+
"ForestLiana.env_secret = Rails.application.secrets.forest_env_secret" +
|
56
|
+
"\nForestLiana.auth_secret = Rails.application.secrets.forest_auth_secret"
|
36
57
|
end
|
37
58
|
end
|
38
59
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: forest_liana
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.8.
|
4
|
+
version: 2.8.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sandro Munda
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-06-
|
11
|
+
date: 2018-06-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|