guard-yardstick 0.0.3 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/Guardfile +26 -0
- data/README.md +5 -2
- data/lib/guard/yardstick/templates/Guardfile +4 -0
- data/lib/guard/yardstick/version.rb +2 -2
- data/lib/guard/yardstick.rb +8 -5
- data/spec/yardstick_spec.rb +5 -0
- metadata +3 -4
- data/.rubocop.yml +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e3b3c837c2dcc1689f6fcf69dfdb490336fd772
|
4
|
+
data.tar.gz: d9a5c380e96e93dcd52a059228344c1ba3e29115
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06f4880fd79bbeed1c8b0f310216d9b14902ea4fe65228c2001b333e4eb19341f0d9d60a64b607c35028050277f53b926bbccfd15c1b7a0c31aa7f1e233ad5e3
|
7
|
+
data.tar.gz: f7e3971af14c793bf6685fe416350a6d17c670dcd284d18dcfafc36441c60345193eeb4e9f2c53a57e86c45f3630506010f1608d444c16e9f7af31d5d5d74840
|
data/Gemfile
CHANGED
data/Guardfile
CHANGED
@@ -10,3 +10,29 @@ guard :rubocop, all_on_start: true, cli: ['--display-cop-name']do
|
|
10
10
|
watch(/^(|Rakefile|Guardfile)/)
|
11
11
|
watch(/.+\.rb$/)
|
12
12
|
end
|
13
|
+
|
14
|
+
# Note: The cmd option is now required due to the increasing number of ways
|
15
|
+
# rspec may be run, below are examples of the most common uses.
|
16
|
+
# * bundler: 'bundle exec rspec'
|
17
|
+
# * bundler binstubs: 'bin/rspec'
|
18
|
+
# * spring: 'bin/rspec' (This will use spring if running and you have
|
19
|
+
# installed the spring binstubs per the docs)
|
20
|
+
# * zeus: 'zeus rspec' (requires the server to be started separately)
|
21
|
+
# * 'just' rspec: 'rspec'
|
22
|
+
|
23
|
+
guard :rspec, cmd: 'bundle exec rspec' do
|
24
|
+
require 'guard/rspec/dsl'
|
25
|
+
dsl = Guard::RSpec::Dsl.new(self)
|
26
|
+
|
27
|
+
# Feel free to open issues for suggestions and improvements
|
28
|
+
|
29
|
+
# RSpec files
|
30
|
+
rspec = dsl.rspec
|
31
|
+
watch(rspec.spec_helper) { rspec.spec_dir }
|
32
|
+
watch(rspec.spec_support) { rspec.spec_dir }
|
33
|
+
watch(rspec.spec_files)
|
34
|
+
|
35
|
+
# Ruby files
|
36
|
+
ruby = dsl.ruby
|
37
|
+
dsl.watch_spec_files_for(ruby.lib_files)
|
38
|
+
end
|
data/README.md
CHANGED
@@ -38,10 +38,13 @@ Please read the [Guard usage documentation](https://github.com/guard/guard#readm
|
|
38
38
|
|
39
39
|
## Options
|
40
40
|
|
41
|
-
|
41
|
+
*all_on_start:* Same as on any other Guard plugin. Run yardstick on all files on start or not.
|
42
|
+
|
43
|
+
*path:* Tells yardstick which paths to run the yardoc analysis on. Defaults to yardsticks default of *'lib'* directory.
|
44
|
+
|
42
45
|
|
43
46
|
```ruby
|
44
|
-
guard :yardstick, all_on_start: false do
|
47
|
+
guard :yardstick, all_on_start: false, path: ['app', 'config', 'lib'] do
|
45
48
|
# ...
|
46
49
|
end
|
47
50
|
```
|
@@ -1,5 +1,9 @@
|
|
1
|
+
# Options to guard-yardstick
|
2
|
+
# all_on_start: true
|
3
|
+
# path: ['app', 'config', 'lib']
|
1
4
|
guard :yardstick do
|
2
5
|
# Typical Rails setup
|
6
|
+
# Set path option to ['app', 'config', 'lib']
|
3
7
|
# watch(%r{^app\/(.+)\.rb$})
|
4
8
|
# watch(%r{^config\/initializers\/(.+)\.rb$})
|
5
9
|
watch(%r{^lib\/(.+)\.rb$})
|
data/lib/guard/yardstick.rb
CHANGED
@@ -18,7 +18,10 @@ module Guard
|
|
18
18
|
super
|
19
19
|
|
20
20
|
@options = {
|
21
|
-
all_on_start: true
|
21
|
+
all_on_start: true,
|
22
|
+
# Taken from yardsitck:
|
23
|
+
# https://github.com/dkubb/yardstick/blob/0aa394dd64baf5155775e6be5018d6c9844654b7/lib/yardstick/config.rb#L167
|
24
|
+
path: ['lib/**/*.rb']
|
22
25
|
}.merge(args)
|
23
26
|
end
|
24
27
|
|
@@ -36,8 +39,7 @@ module Guard
|
|
36
39
|
# @return [Void]
|
37
40
|
def run_all
|
38
41
|
UI.info 'Inspecting Yarddoc in all files'
|
39
|
-
|
40
|
-
inspect_with_yardstick
|
42
|
+
inspect_with_yardstick(options[:path])
|
41
43
|
end
|
42
44
|
|
43
45
|
# Will run when files are added
|
@@ -75,8 +77,9 @@ module Guard
|
|
75
77
|
#
|
76
78
|
# @api private
|
77
79
|
# @return [Void]
|
78
|
-
def inspect_with_yardstick(
|
79
|
-
|
80
|
+
def inspect_with_yardstick(paths)
|
81
|
+
config = ::Yardstick::Config.coerce(path: paths)
|
82
|
+
measurements = ::Yardstick.measure(config)
|
80
83
|
measurements.puts
|
81
84
|
rescue => error
|
82
85
|
UI.error 'The following exception occurred while running ' \
|
data/spec/yardstick_spec.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: guard-yardstick
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Lee
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: guard
|
@@ -76,7 +76,6 @@ extra_rdoc_files: []
|
|
76
76
|
files:
|
77
77
|
- ".gitignore"
|
78
78
|
- ".rspec"
|
79
|
-
- ".rubocop.yml"
|
80
79
|
- Gemfile
|
81
80
|
- Guardfile
|
82
81
|
- LICENSE.txt
|
@@ -108,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
107
|
version: '0'
|
109
108
|
requirements: []
|
110
109
|
rubyforge_project:
|
111
|
-
rubygems_version: 2.4.
|
110
|
+
rubygems_version: 2.4.7
|
112
111
|
signing_key:
|
113
112
|
specification_version: 4
|
114
113
|
summary: Guard plugin for Yardstick
|
data/.rubocop.yml
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
# This configuration was generated by `rubocop --auto-gen-config`
|
2
|
-
# on 2015-04-23 14:11:59 -0600 using RuboCop version 0.27.1.
|
3
|
-
# The point is for the user to remove these configuration records
|
4
|
-
# one by one as the offenses are removed from the code base.
|
5
|
-
# Note that changes in the inspected code, or installation of new
|
6
|
-
# versions of RuboCop, may require this file to be generated again.
|
7
|
-
|
8
|
-
# Offense count: 3
|
9
|
-
Style/RegexpLiteral:
|
10
|
-
MaxSlashes: 0
|