This repository was archived by the owner on Aug 7, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,11 @@ Your Config in Atom menu):
21
21
# ruby path. run `which ruby` to find the path.
22
22
' rubyExecutablePath' : null
23
23
24
+ # additional arguments arguments passed to ruby.
25
+ # default: -c -w --external-encoding=utf-8 --internal-encoding=utf-8
26
+ # add -Ku if you experience problems with utf-8 encoding on macOS.
27
+ ' rubyAdditionalArgs' : ' -Ku'
28
+
24
29
# ignored extensions, ERB and markdown files by default.
25
30
' ignoredExtensions' : ' erb, md'
26
31
```
Original file line number Diff line number Diff line change @@ -14,6 +14,9 @@ export default {
14
14
atom . config . observe ( 'linter-ruby.rubyExecutablePath' , ( value ) => {
15
15
this . executablePath = value ;
16
16
} ) ,
17
+ atom . config . observe ( 'linter-ruby.rubyAdditionalArgs' , ( value ) => {
18
+ this . additionalArgs = value ;
19
+ } ) ,
17
20
atom . config . observe ( 'linter-ruby.ignoredExtensions' , ( value ) => {
18
21
this . ignoredExtensions = value ;
19
22
} ) ,
@@ -44,13 +47,16 @@ export default {
44
47
return [ ] ;
45
48
}
46
49
47
- const execArgs = [
50
+ const defaultExecArgs = [
48
51
'-c' , // Check syntax only, no execution
49
52
'-w' , // Turns on warnings
50
53
// Set the encoding to UTF-8
51
54
'--external-encoding=utf-8' ,
52
55
'--internal-encoding=utf-8' ,
53
56
] ;
57
+ const additionalArgs = this . additionalArgs . split ( / \s + / ) ;
58
+
59
+ const execArgs = defaultExecArgs . concat ( additionalArgs ) ;
54
60
const execOpts = {
55
61
stdin : fileText ,
56
62
stream : 'stderr' ,
Original file line number Diff line number Diff line change 17
17
"type" : " string" ,
18
18
"default" : " ruby"
19
19
},
20
+ "rubyAdditionalArgs" : {
21
+ "title" : " Additional arguments passed to Ruby" ,
22
+ "description" : " Default arguments: `-c -w --external-encoding=utf-8 --internal-encoding=utf-8`" ,
23
+ "type" : " string" ,
24
+ "default" : " "
25
+ },
20
26
"ignoredExtensions" : {
21
27
"type" : " array" ,
22
28
"default" : [
You can’t perform that action at this time.
0 commit comments