guard-coffeelint 0.1.4 → 0.1.5
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/README.md +35 -5
- data/lib/guard/coffeelint.rb +4 -3
- data/lib/guard/coffeelint/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd4e2523a12b6cea39a38f3b4898e770f16acc19
|
4
|
+
data.tar.gz: b8123ab39f1be1eb673059673f3320924fabc6f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f90cf08f32cf609b6815ec01928fbb740ae0e089ffdee9658b304a9721309e7f14a071f88c9c52a0f7d3d85f5a8d48d588d93a7a40cce53cd66c74361be3d680
|
7
|
+
data.tar.gz: 457a60889e8c3c5d4e2509530a4b94d086d6c1c8bfb2c48ca49fbea65ca7b84de8afe695f644ba7417774d53735f0ff2d7b8919171ca4b018c89c63af8e3f674
|
data/README.md
CHANGED
@@ -16,16 +16,25 @@ Or install it yourself as:
|
|
16
16
|
|
17
17
|
$ gem install guard-coffeelint
|
18
18
|
|
19
|
+
## Requirements
|
20
|
+
With `guard-coffeelint@^0.1.2`, you must have the `coffeelint` executable
|
21
|
+
in your path. The easiest way to accomplish this is to install CoffeeLint
|
22
|
+
globally prior to using guard-coffeelint: `npm i -g coffeelint`
|
23
|
+
|
24
|
+
If this doesn't work for you, use
|
25
|
+
`guard-coffeelint@0.1.1` or lower.
|
26
|
+
|
19
27
|
## Usage
|
20
28
|
|
21
|
-
1. Create and customize your config file:
|
29
|
+
1. Create and customize your config file in the root of your project:
|
22
30
|
|
23
31
|
```
|
24
|
-
coffeelint --makeconfig >
|
32
|
+
coffeelint --makeconfig > coffeelint.json
|
25
33
|
```
|
26
34
|
|
27
|
-
By default guard-coffeelint will look in
|
28
|
-
but you can override the location with `:config_file` in
|
35
|
+
By default guard-coffeelint will look in the root of your project for
|
36
|
+
`coffeelint.json`, but you can override the location with `:config_file` in
|
37
|
+
your Guardfile.
|
29
38
|
|
30
39
|
2. Add Coffeelint to your Guardfile:
|
31
40
|
|
@@ -35,7 +44,28 @@ Or install it yourself as:
|
|
35
44
|
watch %r{^app/assets/javascripts/.*\.coffee$}
|
36
45
|
end
|
37
46
|
```
|
38
|
-
|
47
|
+
|
48
|
+
### Configuration options
|
49
|
+
|
50
|
+
You can pass some options in `Guardfile` like the following example:
|
51
|
+
|
52
|
+
```ruby
|
53
|
+
guard :coffeelint, config_file: 'config/coffeelint.json', paths: %w(app/assets/javascripts) do
|
54
|
+
# ...
|
55
|
+
end
|
56
|
+
```
|
57
|
+
|
58
|
+
#### Available Options
|
59
|
+
|
60
|
+
```ruby
|
61
|
+
config_file: 'config/coffeelint.json' # Change the config file loaded
|
62
|
+
# default: 'coffeelint.json'
|
63
|
+
|
64
|
+
paths: %w(app/assets/javascripts) # An array of paths passed to coffeelint to look for
|
65
|
+
# coffeescript files.
|
66
|
+
# default: '.'
|
67
|
+
```
|
68
|
+
|
39
69
|
## Contributing
|
40
70
|
|
41
71
|
1. Fork it
|
data/lib/guard/coffeelint.rb
CHANGED
@@ -9,6 +9,7 @@ module Guard
|
|
9
9
|
def initialize(options = {})
|
10
10
|
super
|
11
11
|
@config_file = options[:config_file]
|
12
|
+
@default_paths = options[:paths] || ['.']
|
12
13
|
end
|
13
14
|
|
14
15
|
def start
|
@@ -22,7 +23,7 @@ module Guard
|
|
22
23
|
def run_on_modifications(paths)
|
23
24
|
lint_and_report paths
|
24
25
|
end
|
25
|
-
|
26
|
+
|
26
27
|
def run_all
|
27
28
|
lint_and_report
|
28
29
|
end
|
@@ -42,11 +43,11 @@ module Guard
|
|
42
43
|
|
43
44
|
def lint_and_report(paths = nil)
|
44
45
|
command = 'coffeelint -c --reporter raw'
|
45
|
-
command += "-f #{@config_file}" if @config_file
|
46
|
+
command += " -f #{@config_file}" if @config_file
|
46
47
|
command += if paths && paths.length > 0
|
47
48
|
" #{paths.join ' '}"
|
48
49
|
else
|
49
|
-
|
50
|
+
" #{@default_paths.join(' ')}"
|
50
51
|
end
|
51
52
|
|
52
53
|
results = `#{command} 2>&1`
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: guard-coffeelint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthew Eagar
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-06-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: guard
|
@@ -102,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
102
102
|
version: '0'
|
103
103
|
requirements: []
|
104
104
|
rubyforge_project:
|
105
|
-
rubygems_version: 2.
|
105
|
+
rubygems_version: 2.5.1
|
106
106
|
signing_key:
|
107
107
|
specification_version: 4
|
108
108
|
summary: Guard plugin for Coffeelint
|