@@ -5,7 +5,6 @@ class InstallGenerator < Rails::Generators::Base
5
5
desc 'Forest Rails Liana installation generator'
6
6
7
7
argument :env_secret , type : :string , required : true , desc : 'required' , banner : 'env_secret'
8
- argument :application_url , type : :string , required : false , desc : 'optional' , banner : 'application_url' , default : 'http://localhost:3000'
9
8
10
9
def install
11
10
if ForestLiana . env_secret . present?
@@ -28,42 +27,35 @@ def install
28
27
if File . exist? 'config/secrets.yml'
29
28
inject_into_file 'config/secrets.yml' , after : "development:\n " do
30
29
" forest_env_secret: #{ env_secret } \n " +
31
- " forest_auth_secret: #{ auth_secret } \n " +
32
- " forest_application_url: #{ application_url } \n "
30
+ " forest_auth_secret: #{ auth_secret } \n "
33
31
end
34
32
35
33
inject_into_file 'config/secrets.yml' , after : "staging:\n " , force : true do
36
34
" forest_env_secret: <%= ENV[\" FOREST_ENV_SECRET\" ] %>\n " +
37
- " forest_auth_secret: <%= ENV[\" FOREST_AUTH_SECRET\" ] %>\n " +
38
- " forest_application_url: <%= ENV[\" FOREST_APPLICATION_URL\" ] %>\n "
35
+ " forest_auth_secret: <%= ENV[\" FOREST_AUTH_SECRET\" ] %>\n "
39
36
end
40
37
41
38
inject_into_file 'config/secrets.yml' , after : "production:\n " , force : true do
42
39
" forest_env_secret: <%= ENV[\" FOREST_ENV_SECRET\" ] %>\n " +
43
- " forest_auth_secret: <%= ENV[\" FOREST_AUTH_SECRET\" ] %>\n " +
44
- " forest_application_url: <%= ENV[\" FOREST_APPLICATION_URL\" ] %>\n "
40
+ " forest_auth_secret: <%= ENV[\" FOREST_AUTH_SECRET\" ] %>\n "
45
41
end
46
42
else
47
43
create_file 'config/secrets.yml' do
48
44
"development:\n " +
49
45
" forest_env_secret: #{ env_secret } \n " +
50
46
" forest_auth_secret: #{ auth_secret } \n " +
51
- " forest_application_url: #{ application_url } \n " +
52
47
"staging:\n " +
53
48
" forest_env_secret: <%= ENV[\" FOREST_ENV_SECRET\" ] %>\n " +
54
49
" forest_auth_secret: <%= ENV[\" FOREST_AUTH_SECRET\" ] %>\n " +
55
- " forest_application_url: <%= ENV[\" FOREST_APPLICATION_URL\" ] %>\n " +
56
50
"production:\n " +
57
51
" forest_env_secret: <%= ENV[\" FOREST_ENV_SECRET\" ] %>\n " +
58
- " forest_auth_secret: <%= ENV[\" FOREST_AUTH_SECRET\" ] %>\n " +
59
- " forest_application_url: <%= ENV[\" FOREST_APPLICATION_URL\" ] %>\n "
52
+ " forest_auth_secret: <%= ENV[\" FOREST_AUTH_SECRET\" ] %>\n "
60
53
end
61
54
end
62
55
63
56
initializer 'forest_liana.rb' do
64
57
"ForestLiana.env_secret = Rails.application.secrets.forest_env_secret" +
65
- "\n ForestLiana.auth_secret = Rails.application.secrets.forest_auth_secret" +
66
- "\n ForestLiana.application_url = Rails.application.secrets.forest_application_url"
58
+ "\n ForestLiana.auth_secret = Rails.application.secrets.forest_auth_secret"
67
59
end
68
60
end
69
61
end
0 commit comments