Class: RailsFixPermissions
- Inherits:
-
Object
- Object
- RailsFixPermissions
- Defined in:
- lib/rails-fix-permissions.rb
Instance Method Summary collapse
-
#initialize ⇒ RailsFixPermissions
constructor
A new instance of RailsFixPermissions.
Constructor Details
#initialize ⇒ RailsFixPermissions
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/rails-fix-permissions.rb', line 2 def initialize # Get the current dir and the name of the current folder. current_dir = `pwd` basename = `basename #{current_dir}` app_path = '../' + basename.chomp("\n") # Run shell scripts to set permissions. directories = `chmod 755 $(find #{app_path} -type d)` files = `chmod 644 $(find #{app_path} -type f)` bundle = `chmod 755 #{app_path+'/bin/bundle'}` rails = `chmod 755 #{app_path+'/bin/rails'}` rake = `chmod 755 #{app_path+'/bin/rake'}` spring = `chmod 755 #{app_path+'/bin/spring'}` puts 'Done!' end |