rails_lens 0.5.0 → 0.5.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: 983d1382bf42b79549a4a504e696814846eccf606cd17f9fc3e521cce211f729
4
- data.tar.gz: 69714d9bfaf91dc139158649596b8111b6910d7515adb9be9928476ff95e6c3a
3
+ metadata.gz: 1bd96547bfc5ae90c3971f787bbb03cad57e8912ed25c4ea0005ab3652401408
4
+ data.tar.gz: 95f1bcfa75b796a22c1fd5fb861c79e41e048608648388d1d9b255b4a3466157
5
5
  SHA512:
6
- metadata.gz: e580de20d715134c6066995921030e9aaf27ecdce188f455b93eb4bfd3b84d1bf9fcce109d75fe0d0fd340fd856c428d8da0e338e5d3b97299efc60098f72ebd
7
- data.tar.gz: b069e0140d3ff3924b4f0ba18695f7646a88167a797e10bdd35d5fb25783ac2f8c7c305e59b22458b1424be22b75c494d2ab37b6f4d4d79448ee189624c869aa
6
+ metadata.gz: 960195b484708f9904f1d96d5f52e5fca70580431deffdc9a5cb56c99ab57af3509c33ad88eb7cdfa84c75067ea04f1d542568152cc60ab6dbcb162b036d1b61
7
+ data.tar.gz: da71bed238e3fa5742039fa0f931d4fc625f52a6d1df3cc831678bd070b65b38e6f3ea4b01b998c7e163409764db0aebfaab83af9a10733081d99513f6a80893
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.5.1](https://github.com/seuros/rails_lens/compare/rails_lens/v0.5.0...rails_lens/v0.5.1) (2025-12-07)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * add by_source ([f6693f3](https://github.com/seuros/rails_lens/commit/f6693f384761de505eac0e525c7b70f4c053d14c))
9
+
3
10
  ## [0.5.0](https://github.com/seuros/rails_lens/compare/rails_lens/v0.3.0...rails_lens/v0.5.0) (2025-12-06)
4
11
 
5
12
 
@@ -148,12 +148,13 @@ module RailsLens
148
148
  end
149
149
 
150
150
  def self.annotate_all(options = {})
151
- results = { annotated: [], skipped: [], failed: [] }
151
+ results = { annotated: [], skipped: [], failed: [], by_source: {} }
152
152
 
153
153
  # Iterate through all model sources
154
154
  ModelSourceLoader.load_sources.each do |source|
155
155
  puts "Annotating #{source.source_name} models..." if options[:verbose]
156
156
  source_results = annotate_source(source, options)
157
+ results[:by_source][source.source_name] = source_results[:annotated].length
157
158
  merge_results(results, source_results)
158
159
  end
159
160
 
@@ -312,12 +313,13 @@ module RailsLens
312
313
  end
313
314
 
314
315
  def self.remove_all(options = {})
315
- results = { removed: [], skipped: [], failed: [] }
316
+ results = { removed: [], skipped: [], failed: [], by_source: {} }
316
317
 
317
318
  # Iterate through all model sources
318
319
  ModelSourceLoader.load_sources.each do |source|
319
320
  puts "Removing annotations from #{source.source_name} models..." if options[:verbose]
320
321
  source_results = remove_source(source, options)
322
+ results[:by_source][source.source_name] = source_results[:removed].length
321
323
  merge_remove_results(results, source_results)
322
324
  end
323
325
 
@@ -11,7 +11,13 @@ namespace :rails_lens do
11
11
 
12
12
  results = RailsLens::Schema::AnnotationManager.annotate_all(options)
13
13
 
14
- puts "Annotated #{results[:annotated].length} models"
14
+ if results[:by_source]&.any?
15
+ results[:by_source].each do |source_name, count|
16
+ puts "Annotated #{count} #{source_name} models" if count.positive?
17
+ end
18
+ else
19
+ puts "Annotated #{results[:annotated].length} models"
20
+ end
15
21
  puts "Skipped #{results[:skipped].length} models" if results[:skipped].any?
16
22
  if results[:failed].any?
17
23
  puts "Failed to annotate #{results[:failed].length} models:"
@@ -27,7 +33,13 @@ namespace :rails_lens do
27
33
 
28
34
  results = RailsLens::Schema::AnnotationManager.remove_all
29
35
 
30
- puts "Removed annotations from #{results[:removed].length} models" if results[:removed].any?
36
+ if results[:by_source]&.any?
37
+ results[:by_source].each do |source_name, count|
38
+ puts "Removed annotations from #{count} #{source_name} models" if count.positive?
39
+ end
40
+ elsif results[:removed].any?
41
+ puts "Removed annotations from #{results[:removed].length} models"
42
+ end
31
43
  puts "Skipped #{results[:skipped].length} models (no annotations)" if results[:skipped].any?
32
44
  if results[:failed].any?
33
45
  puts "Failed to remove annotations from #{results[:failed].length} models:"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsLens
4
- VERSION = '0.5.0'
4
+ VERSION = '0.5.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_lens
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Abdelkader Boudih