You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I run rake stats from inside my_rails_app, it correctly shows stats including files from the main app as well as each of my packwerk packs living in packs/*:
$rake stats
+----------------------+-------+-------+---------+---------+-----+-------+
| Name | Lines | LOC | Classes | Methods | M/C | LOC/M |
+----------------------+-------+-------+---------+---------+-----+-------+
|...real output removed but it's correctly including all files |
| from . and from packs/* |
+----------------------+-------+-------+---------+---------+-----+-------+
| Total | xxxx | xxxx | xxxx | xxxx | xx | xx |
+----------------------+-------+-------+---------+---------+-----+-------+
Code LOC: xxx Test LOC: xxx Code to Test Ratio: 1:x.x
Trying to get stats about a specific pack's files, from inside the app's root directory (my_rails_app), doesn't work as expected. The stats are still calculated for the whole app, but it includes the header stating the directory too:
$rake stats[packs/pack1]
Directory: /home/oboxodo/Code/my_rails_app
+----------------------+-------+-------+---------+---------+-----+-------+
| Name | Lines | LOC | Classes | Methods | M/C | LOC/M |
+----------------------+-------+-------+---------+---------+-----+-------+
| ...real output removed but it's the same output |
| as running it for the whole app |
+----------------------+-------+-------+---------+---------+-----+-------+
| Total | xxxx | xxxx | xxxx | xxxx | xx | xx |
+----------------------+-------+-------+---------+---------+-----+-------+
Code LOC: xxx Test LOC: xxx Code to Test Ratio: 1:x.x
Now, if I move outside the app's directory, to the parent, and I create a Rakefile with require "rails_stats", then this works as expected:
$for pack in my_rails_app/packs/*; do rake stats[$pack]; done
Directory: /home/oboxodo/Code/my_rails_app/packs/pack1
+----------------------+-------+-------+---------+---------+-----+-------+
| Name | Lines | LOC | Classes | Methods | M/C | LOC/M |
+----------------------+-------+-------+---------+---------+-----+-------+
|...real output removed... |
+----------------------+-------+-------+---------+---------+-----+-------+
| Total | xxxx | xxxx | xxxx | xxxx | xx | xx |
+----------------------+-------+-------+---------+---------+-----+-------+
Code LOC: xxx Test LOC: xxx Code to Test Ratio: 1:x.x
Directory: /home/oboxodo/Code/my_rails_app/packs/pack2
+----------------------+-------+-------+---------+---------+-----+-------+
| Name | Lines | LOC | Classes | Methods | M/C | LOC/M |
+----------------------+-------+-------+---------+---------+-----+-------+
|...real output removed... |
+----------------------+-------+-------+---------+---------+-----+-------+
| Total | xxxx | xxxx | xxxx | xxxx | xx | xx |
+----------------------+-------+-------+---------+---------+-----+-------+
Code LOC: xxx Test LOC: xxx Code to Test Ratio: 1:x.x
I hope I was able to express the problem 😅
The text was updated successfully, but these errors were encountered:
Using rails_stats v1.0.2
Given I have added
gem "rails_stats"
to myGemfile
and I have the following app's file structure (typical when using packs-rails):If I run
rake stats
from insidemy_rails_app
, it correctly shows stats including files from the main app as well as each of my packwerk packs living in packs/*:Trying to get stats about a specific pack's files, from inside the app's root directory (
my_rails_app
), doesn't work as expected. The stats are still calculated for the whole app, but it includes the header stating the directory too:Now, if I move outside the app's directory, to the parent, and I create a Rakefile with
require "rails_stats"
, then this works as expected:I hope I was able to express the problem 😅
The text was updated successfully, but these errors were encountered: