rails-fix-permissions 1.2 → 1.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/bin/rails-fix-permissions +1 -1
- data/lib/rails-fix-permissions.rb +23 -14
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 12209fbee3ec744398d760f456e73ea9d3400734
|
4
|
+
data.tar.gz: c1e08a44c8c24fd71853d6c7c4f8ea1af1d9cade
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b03022ea4d018e75de341f4382fff62d933e28ee401571c2c8b0237e233a249aa12c3f48136eb779696d158f1185f2ec3b608f7d025bdd7998515faf99ae0a4
|
7
|
+
data.tar.gz: 2a1289071fa1c55e6c0eb4ad9c71685293de33dc3606b46a4eb887b356a45e4cfe969b930f8bf40be9e6786e62bf37a7ae50f77b70bc0f877c8c96b0446d9a39
|
data/bin/rails-fix-permissions
CHANGED
@@ -1,19 +1,28 @@
|
|
1
1
|
class RailsFixPermissions
|
2
2
|
def initialize
|
3
|
-
#
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
rails = `chmod 755 #{app_path+'/bin/rails'}`
|
13
|
-
rake = `chmod 755 #{app_path+'/bin/rake'}`
|
14
|
-
spring = `chmod 755 #{app_path+'/bin/spring'}`
|
15
|
-
|
16
|
-
puts 'Done!'
|
3
|
+
# Relational path of the current folder (app folder).
|
4
|
+
@app_path = '../' + File.basename(Dir.getwd)
|
5
|
+
if File.exist?(@app_path+'/bin/rails')
|
6
|
+
set_permissions
|
7
|
+
else
|
8
|
+
puts "It's not a Rails application."
|
9
|
+
puts "Exiting..."
|
10
|
+
end
|
11
|
+
end
|
17
12
|
|
13
|
+
# Shell scripts to recursively set the Rails defaults permissions.
|
14
|
+
def set_permissions
|
15
|
+
if File.directory?(@app_path)
|
16
|
+
puts "Running shell scripts into '"+@app_path+"' to set permissions..."
|
17
|
+
directories = `chmod 755 $(find #{@app_path} -type d)`
|
18
|
+
files = `chmod 644 $(find #{@app_path} -type f)`
|
19
|
+
bundle = `chmod 755 #{@app_path+'/bin/bundle'}`
|
20
|
+
rails = `chmod 755 #{@app_path+'/bin/rails'}`
|
21
|
+
rake = `chmod 755 #{@app_path+'/bin/rake'}`
|
22
|
+
spring = `chmod 755 #{@app_path+'/bin/spring'}`
|
23
|
+
puts 'Done!'
|
24
|
+
else
|
25
|
+
puts "Something went wrong, rails-fix-permissions can't find the current working path: '"+@app_path+"'"
|
26
|
+
end
|
18
27
|
end
|
19
28
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails-fix-permissions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.3'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fernando Schuindt
|
@@ -10,13 +10,13 @@ bindir: bin
|
|
10
10
|
cert_chain: []
|
11
11
|
date: 2014-09-18 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description: Sometimes you
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
13
|
+
description: Sometimes you mess your Rails application Unix permissions and get some
|
14
|
+
annoying errors with git. This gem runs a simple shell script to fix that. Granting
|
15
|
+
755 permissions to folders and 644 to files, it also ensures that some special files
|
16
|
+
inside the 'bin/' will recive special 755 permissions (bundle, rails, rake and spring)
|
17
|
+
which is pretty much the Rails default. Works with all versions of Ruby on Rails;
|
18
|
+
After install run 'rails-fix-permissions' on terminal inside the application folder
|
19
|
+
to fix. Note that in some cases you may need to run it as superuser with 'sudo'.
|
20
20
|
email: f.schuindtcs@gmail.com
|
21
21
|
executables:
|
22
22
|
- rails-fix-permissions
|
@@ -35,12 +35,12 @@ require_paths:
|
|
35
35
|
- lib
|
36
36
|
required_ruby_version: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
42
42
|
requirements:
|
43
|
-
- -
|
43
|
+
- - '>='
|
44
44
|
- !ruby/object:Gem::Version
|
45
45
|
version: '0'
|
46
46
|
requirements: []
|