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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b2b65ff449257c6508ede703082ebc309690e91b
4
- data.tar.gz: 90ee226dc8b0fa7deb328aa2d5dda9e0b8df5f9c
3
+ metadata.gz: 8e3b3c837c2dcc1689f6fcf69dfdb490336fd772
4
+ data.tar.gz: d9a5c380e96e93dcd52a059228344c1ba3e29115
5
5
  SHA512:
6
- metadata.gz: 2669c512c36a804723bc50d36c11ee0a767fb2194bada96faae9ace24927c625b1311c3a4203097d69028afb43481b10662a5661c8aecf5ce025d75d89cb0995
7
- data.tar.gz: 36e589b4289dfe0cd9d654c260fdfba4adfe8bccb859311c6ca97f0db14b5909e6f5f318cce3ebdc346dc8ba78fab8a9b4ceb66bdc3b7b18508b65ad37bd0c7d
6
+ metadata.gz: 06f4880fd79bbeed1c8b0f310216d9b14902ea4fe65228c2001b333e4eb19341f0d9d60a64b607c35028050277f53b926bbccfd15c1b7a0c31aa7f1e233ad5e3
7
+ data.tar.gz: f7e3971af14c793bf6685fe416350a6d17c670dcd284d18dcfafc36441c60345193eeb4e9f2c53a57e86c45f3630506010f1608d444c16e9f7af31d5d5d74840
data/Gemfile CHANGED
@@ -6,6 +6,7 @@ gemspec
6
6
  group :development do
7
7
  gem 'guard'
8
8
  gem 'guard-rubocop'
9
+ gem 'guard-rspec'
9
10
  gem 'rubocop'
10
11
  end
11
12
 
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
- There is currently only a single option that can be passed to this guard. *all_on_start* which is *true* by default.
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$})
@@ -4,8 +4,8 @@ module Guard
4
4
  module YardstickVersion
5
5
  # http://semver.org/
6
6
  MAJOR = 0
7
- MINOR = 0
8
- PATCH = 3
7
+ MINOR = 1
8
+ PATCH = 0
9
9
 
10
10
  # Returns a formatted version string
11
11
  #
@@ -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(_paths = [])
79
- measurements = ::Yardstick.measure
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 ' \
@@ -14,6 +14,11 @@ RSpec.describe Guard::Yardstick do
14
14
  subject { super()[:all_on_start] }
15
15
  it { should be_truthy }
16
16
  end
17
+
18
+ describe '[:path]' do
19
+ subject { super()[:path] }
20
+ it { should eq(['lib/**/*.rb']) }
21
+ end
17
22
  end
18
23
  end
19
24
  end
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.3
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-04-23 00:00:00.000000000 Z
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.3
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