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
Add a standalone `rails-stats` executable so the tool can be run against a
directory without setting up a Rakefile. It accepts both absolute and relative
paths, defaults to the current directory when none is given, and optionally
takes a `json` second argument for JSON output.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,6 @@
1
1
# main ([unreleased](https://github.com/fastruby/rails_stats/compare/v2.1.0...main))
2
2
3
+
*[FEATURE: Add a `rails-stats` command line executable that accepts an absolute or relative directory](https://github.com/fastruby/rails_stats/pull/49)
3
4
*[FEATURE: Support component-based and Packwerk (packs) applications with a per-pack and Core breakdown](https://github.com/fastruby/rails_stats/issues/23)
4
5
*[BUGFIX: Respect an explicit path argument (e.g. `rake stats[packs/pack1]`) when running inside a booted Rails app](https://github.com/fastruby/rails_stats/issues/23)
5
6
*[CHORE: Improve the GH Test Workflow](https://github.com/fastruby/rails_stats/pull/35)
Copy file name to clipboardExpand all lines: README.md
+23Lines changed: 23 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,29 @@ There were a few things missing to the included `rake stats`
6
6
7
7
RailsStats mainly adds the ability to be run from outside the project in question. This can be helpful if the app you are interested in can not be booted for some reason.
8
8
9
+
### Run it as a command line tool
10
+
11
+
Once the gem is installed you can point the `rails-stats` executable at any
12
+
directory, without setting up a `Rakefile`. It accepts both absolute and
13
+
relative paths:
14
+
15
+
```bash
16
+
$ rails-stats /path/to/app
17
+
$ rails-stats path/to/app
18
+
```
19
+
20
+
When no path is given it defaults to the current directory:
21
+
22
+
```bash
23
+
$ rails-stats
24
+
```
25
+
26
+
You can also request JSON output by passing `json` as a second argument:
27
+
28
+
```bash
29
+
$ rails-stats path/to/app json
30
+
```
31
+
9
32
### Run it outside Rails project
10
33
11
34
You will need a `Rakefile` in the directory where you call `rake` and you will
0 commit comments