mini-guard 0.1.0 → 0.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f001b81ccfda3679858442acc17dba4336286c6b67ecd4da8df944cfe1046408
4
- data.tar.gz: 8ecb04d9008f39f645f9174fb6aac0aeeda468104c842e2875a9c075187ff40d
3
+ metadata.gz: '08500a2731eed3057b51aa49f881ef56c1710122018fa17e710881439a5ec169'
4
+ data.tar.gz: c6a430f3e14be8d330d88464f9dcf5f2c3168d9a33303e788aa4c7f3ad6c5d45
5
5
  SHA512:
6
- metadata.gz: a05f931a4244988d2e58ffe596c46ac057272f96c17122ba41fda050037ff7682a78b76929c1fe64fe6f6b352feb9bbafe5ffd771d319315e7bff53a78946b26
7
- data.tar.gz: da0bbd69e0a33a014b3fcd84fce8c657c16ff536f3c6b36413ebd22043f921c22309ea854355b821f59cc6f0c0045991240d89ebdc3f33c3a0bc1b98876f84c4
6
+ metadata.gz: 668a3f67b903eeef20e3df94592a8b29798ee7ebcaaec8409fa314110468f542b60d92fa0773528f46a997229e543831ece932f2d261d8bff1b6c571e4824d76
7
+ data.tar.gz: 0dd6cda1fd6d9e6faec973d4c605f8257eed35798ff284d99b33c5d000c3a400f1b6cd5539d6a3aa3a2e65f0e1c5fd23af0b6064a81503fa432a8d2c41d8cace
@@ -52,12 +52,12 @@ module Mini
52
52
  class XFile
53
53
  attr_reader :path, :size, :last_modified, :associations
54
54
 
55
- def initialize(path, code:, specs:, views:)
55
+ def initialize(path, code:, specs:, views:, factories:)
56
56
  @path = path
57
57
  stat = File.stat(path)
58
58
  @size = stat.size
59
59
  @last_modified = stat.ctime
60
- @associations = find_associations(code: code, specs: specs, views: views)
60
+ @associations = find_associations(code: code, specs: specs, views: views, factories: factories)
61
61
  end
62
62
 
63
63
  def to_s; "file: #{path} size: #{size} last modified: #{last_modified} associations: #{associations}"; end
@@ -73,7 +73,7 @@ module Mini
73
73
  def basename; File.basename(path, ".*"); end
74
74
  def view_path; path.split('/')[2..-2].join('/'); end
75
75
 
76
- def find_associations(code:, specs:, views:)
76
+ def find_associations(code:, specs:, views:, factories:)
77
77
  if is_view?
78
78
  specs.select{|e| e =~ /^spec\/controllers\/#{view_path}/}
79
79
  elsif is_code?
@@ -114,11 +114,12 @@ module Mini
114
114
 
115
115
  class XIndex
116
116
  def XIndex.run
117
- code = FileList.new('app/**/*.rb')
118
- specs = FileList.new('spec/**/*_spec.rb', 'spec/factories/*.rb')
119
- views = FileList.new('app/views/**/*.*')
120
- (code + specs + views).collect do |path|
121
- XFile.new(path, code: code, specs: specs, views: views)
117
+ code = FileList.new('app/**/*.rb')
118
+ specs = FileList.new('spec/**/*_spec.rb')
119
+ views = FileList.new('app/views/**/*.*')
120
+ factories = FileList.new('spec/factories/*.rb')
121
+ (code + specs + views + factories).collect do |path|
122
+ XFile.new(path, code: code, specs: specs, views: views, factories: factories)
122
123
  end
123
124
  end
124
125
  end
@@ -1,5 +1,5 @@
1
1
  module Mini
2
2
  module Guard
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mini-guard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Kasyanchuk