guard-slimlint 1.1.1 → 1.1.2
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/lib/guard/slimlint/notifier.rb +19 -0
- data/lib/guard/slimlint/version.rb +1 -1
- data/lib/guard/slimlint.rb +9 -9
- metadata +3 -3
- data/Guardfile +0 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe50bcb5638910f5b742fc62891657e5757af270
|
4
|
+
data.tar.gz: e3dd7e09a2cb2eee5fd6b4547d11aee6218d23b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80a2eae52b816ae9a7defc2ea259511d54a20aa448361265617d99435cf49b7ec1800676b4f514b41f642f37ce2d62c6ecd96bf08ea1d044189f9ac325a2f263
|
7
|
+
data.tar.gz: 7159a1dbdde8b7a06c5a8738b1c53f9dc4ce4c652e7a3c1dc7a3780752510ce44d17a8917ac8fc43697c972f5c0e156af381882e6d47e32f1380373515f2de6c
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'guard/slimlint'
|
4
|
+
|
5
|
+
module Guard
|
6
|
+
class SlimLint < Plugin
|
7
|
+
class Notifier
|
8
|
+
class << self
|
9
|
+
def image(result)
|
10
|
+
result ? :success : :failed
|
11
|
+
end
|
12
|
+
|
13
|
+
def notify(result, message)
|
14
|
+
Compat::UI.notify(message, title: 'Slimlint results!', image: image(result))
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/lib/guard/slimlint.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'guard/compat/plugin'
|
2
2
|
require 'colorize'
|
3
|
+
require 'guard/slimlint/notifier'
|
3
4
|
|
4
5
|
module Guard
|
5
6
|
class SlimLint < Plugin
|
@@ -15,23 +16,22 @@ module Guard
|
|
15
16
|
run
|
16
17
|
end
|
17
18
|
|
18
|
-
def run_on_modifications(
|
19
|
-
run(
|
19
|
+
def run_on_modifications(path)
|
20
|
+
run(path)
|
20
21
|
end
|
21
22
|
|
22
|
-
def run_on_additions(
|
23
|
-
run(
|
23
|
+
def run_on_additions(path)
|
24
|
+
run(path)
|
24
25
|
end
|
25
26
|
|
26
27
|
private
|
27
28
|
|
28
|
-
def run(
|
29
|
-
|
30
|
-
if system "bundle exec slim-lint #{paths}"
|
29
|
+
def run(path = ['.'])
|
30
|
+
if system("slim-lint #{path.join(" ")}")
|
31
31
|
UI.info 'No Slim offences detected'.green
|
32
32
|
else
|
33
|
-
UI.info '
|
34
|
-
Notifier.notify('Slim offences detected'
|
33
|
+
UI.info 'Slim offences has been detected'.red
|
34
|
+
Notifier.notify(false, 'Slim offences detected')
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: guard-slimlint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michal Gajowiak
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-01-
|
11
|
+
date: 2016-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -121,7 +121,6 @@ files:
|
|
121
121
|
- ".travis.yml"
|
122
122
|
- CODE_OF_CONDUCT.md
|
123
123
|
- Gemfile
|
124
|
-
- Guardfile
|
125
124
|
- LICENSE.txt
|
126
125
|
- README.md
|
127
126
|
- Rakefile
|
@@ -129,6 +128,7 @@ files:
|
|
129
128
|
- bin/setup
|
130
129
|
- guard-slimlint.gemspec
|
131
130
|
- lib/guard/slimlint.rb
|
131
|
+
- lib/guard/slimlint/notifier.rb
|
132
132
|
- lib/guard/slimlint/templates/Guardfile
|
133
133
|
- lib/guard/slimlint/version.rb
|
134
134
|
homepage: https://github.com/mike927/guard-slimlint
|
data/Guardfile
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
# A sample Guardfile
|
2
|
-
# More info at https://github.com/guard/guard#readme
|
3
|
-
|
4
|
-
## Uncomment and set this to only include directories you want to watch
|
5
|
-
# directories %w(app lib config test spec features) \
|
6
|
-
# .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")}
|
7
|
-
|
8
|
-
## Note: if you are using the `directories` clause above and you are not
|
9
|
-
## watching the project directory ('.'), then you will want to move
|
10
|
-
## the Guardfile to a watched dir and symlink it back, e.g.
|
11
|
-
#
|
12
|
-
# $ mkdir config
|
13
|
-
# $ mv Guardfile config/
|
14
|
-
# $ ln -s config/Guardfile .
|
15
|
-
#
|
16
|
-
# and, you'll have to watch "config/Guardfile" instead of "Guardfile"
|
17
|
-
|
18
|
-
guard :slimlint do
|
19
|
-
watch(/^.+(\.html\.slim)$/)
|
20
|
-
end
|