Skip to content

Commit d574981

Browse files
committed
add jsx and tsx files to count
1 parent 0e87202 commit d574981

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

lib/rails_stats/util.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def calculate_statistics(directories, type = :code, &block)
7575
out
7676
end
7777

78-
def calculate_directory_statistics(directory, pattern = /.*\.(rb|js|ts|coffee|feature)$/)
78+
def calculate_directory_statistics(directory, pattern = /.*\.(rb|js|jsx|ts|tsx|coffee|feature)$/)
7979
stats = CodeStatisticsCalculator.new
8080

8181
Dir.foreach(directory) do |file_name|

test/dummy/app/javascript/dummy.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

test/dummy/app/javascript/dummy.tsx

Whitespace-only changes.

test/fixtures/console-output.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
| Configuration | 19 | 417 | 111 | 1 | 0 | 0 | 0 |
2525
| Controllers | 1 | 7 | 6 | 1 | 1 | 1 | 4 |
2626
| Helpers | 1 | 3 | 3 | 0 | 0 | 0 | 0 |
27-
| Javascripts | 4 | 27 | 7 | 0 | 0 | 0 | 0 |
27+
| Javascripts | 6 | 28 | 7 | 0 | 0 | 0 | 0 |
2828
| Jobs | 1 | 7 | 2 | 1 | 0 | 0 | 0 |
2929
| Libraries | 1 | 1 | 1 | 0 | 0 | 0 | 0 |
3030
| Mailers | 1 | 4 | 4 | 1 | 0 | 0 | 0 |
@@ -33,11 +33,11 @@
3333
| Spec Support | 1 | 1 | 1 | 0 | 0 | 0 | 0 |
3434
| Test Support | 1 | 1 | 1 | 0 | 0 | 0 | 0 |
3535
+----------------------+---------+---------+---------+---------+---------+-----+-------+
36-
| Code | 34 | 484 | 152 | 10 | 1 | 0 | 150 |
36+
| Code | 36 | 485 | 152 | 10 | 1 | 0 | 150 |
3737
| Tests | 4 | 7 | 6 | 2 | 0 | 0 | 0 |
38-
| Total | 38 | 491 | 158 | 12 | 1 | 0 | 156 |
38+
| Total | 40 | 492 | 158 | 12 | 1 | 0 | 156 |
3939
+----------------------+---------+---------+---------+---------+---------+-----+-------+
40-
Code LOC: 152 Test LOC: 6 Code to Test Ratio: 1:0.0 Files: 38
40+
Code LOC: 152 Test LOC: 6 Code to Test Ratio: 1:0.0 Files: 40
4141

4242
Polymorphic models count: 1 polymorphic associations
4343
Schema Stats: 2 `create_table` calls in schema.rb

0 commit comments

Comments
 (0)