intersect_rails_composer 0.0.2 → 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/recipes/frontend.rb +1 -1
- data/recipes/gems.rb +1 -1
- data/recipes/init.rb +20 -6
- 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: 934697531f4f201cc8c592b9298d94eb575aabbf
|
4
|
+
data.tar.gz: fd998851e223dbf39caa9f82c1b84beef47ffbfe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce2853dfe98e90fc75229433ad669bccc64e59129779893395bfd6f2183ee6b70fa26bff47137f8d84e98971b235f74a9db88fb9d17057601419a528b0062401
|
7
|
+
data.tar.gz: 27868677665e7678df207373121f94caec062954e1185221e079ddbe9a67676ca7db269eb1dbdaa55c1d0853fbd1659ac55522b9250fbfbbe625e0af4933506f
|
data/recipes/frontend.rb
CHANGED
@@ -21,7 +21,7 @@ after_bundler do
|
|
21
21
|
when 'devise'
|
22
22
|
copy_from_repo 'app/views/layouts/_navigation-cancan.html.erb', :prefs => 'cancan'
|
23
23
|
when 'omniauth'
|
24
|
-
copy_from 'https://raw.github.com/
|
24
|
+
copy_from 'https://raw.github.com/IntersectAustralia/rails-composer/master/files/app/views/layouts/_navigation-cancan-omniauth.html.erb', 'app/views/layouts/_navigation.html.erb'
|
25
25
|
end
|
26
26
|
else
|
27
27
|
copy_from_repo 'app/views/layouts/_navigation-devise.html.erb', :prefs => 'devise'
|
data/recipes/gems.rb
CHANGED
@@ -99,7 +99,7 @@ add_gem 'fabrication', :group => [:development, :test] if prefer :fixtures, 'fab
|
|
99
99
|
add_gem 'machinist', :group => :test if prefer :fixtures, 'machinist'
|
100
100
|
|
101
101
|
## Front-end Framework
|
102
|
-
add_gem '
|
102
|
+
add_gem 'intersect_rails_layout', :group => :development
|
103
103
|
case prefs[:frontend]
|
104
104
|
when 'bootstrap2'
|
105
105
|
add_gem 'bootstrap-sass', '~> 2.3.2.2'
|
data/recipes/init.rb
CHANGED
@@ -22,9 +22,19 @@ after_everything do
|
|
22
22
|
## DEFAULT USER
|
23
23
|
unless prefer :starter_app, false
|
24
24
|
append_file 'config/application.yml' do <<-FILE
|
25
|
-
|
26
|
-
|
27
|
-
|
25
|
+
users:
|
26
|
+
- admin:
|
27
|
+
name: Test User 1
|
28
|
+
email: test@intersect.org.au
|
29
|
+
password: Pass.123
|
30
|
+
- user:
|
31
|
+
name: Test User 2
|
32
|
+
email: test2@intersect.org.au
|
33
|
+
password: Pass.123
|
34
|
+
- user:
|
35
|
+
name: Test User 3
|
36
|
+
email: test3@intersect.org.au
|
37
|
+
password: Pass.123
|
28
38
|
FILE
|
29
39
|
end
|
30
40
|
end
|
@@ -38,7 +48,7 @@ FILE
|
|
38
48
|
end
|
39
49
|
## AUTHORIZATION
|
40
50
|
if (prefer :authorization, 'cancan')
|
41
|
-
append_file 'config/application.yml', "ROLES: [admin, user
|
51
|
+
append_file 'config/application.yml', "ROLES: [admin, user]\n"
|
42
52
|
end
|
43
53
|
end
|
44
54
|
### SUBDOMAINS ###
|
@@ -82,8 +92,12 @@ FILE
|
|
82
92
|
if prefer :authentication, 'devise'
|
83
93
|
append_file 'db/seeds.rb' do <<-FILE
|
84
94
|
puts 'DEFAULT USERS'
|
85
|
-
|
86
|
-
|
95
|
+
application = YAML.load_file Rails.root.join('config/application.yml')
|
96
|
+
application['users'].each do |user|
|
97
|
+
type = user.first[0]
|
98
|
+
u = User.find_or_create_by_email name: user['name'], email: user['email'], password: user['password'], password_confirmation: user['password']
|
99
|
+
u.add_role type.to_sym
|
100
|
+
end
|
87
101
|
FILE
|
88
102
|
end
|
89
103
|
# Mongoid doesn't have a 'find_or_create_by' method
|