File tree Expand file tree Collapse file tree 6 files changed +42
-21
lines changed
Expand file tree Collapse file tree 6 files changed +42
-21
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ RailsStats mainly adds the ability to be run from outside the project in questio
88### Run it
99
1010``` bash
11+
1112$ bundle exec rake stats[/path/to/app/]
1213
1314Directory: /path/to/app/
@@ -35,14 +36,27 @@ Directory: /path/to/app/
3536
3637```
3738
39+ ### Within your Rails project
40+
41+ You can also include it within your Rails application to _ replace_ the default ` rake stats ` implementation.
42+
43+ Just add rails_stats to your Gemfile.
44+ Depending on your setup, you might need to ` require rails_stats ` in your Rakefile.
45+
46+ Then you'll be able to just run:
47+
48+ ``` bash
49+ $ bundle exec rake stats
50+ ```
51+
3852### Things it knows about
3953
40- RailsStats also adds more coverage than the default.
54+ RailsStats adds more coverage than the default.
4155
4256* Any concepts you've added within an ` app ` directory
4357* Configuration files
4458* Library files
45- * Gems that you've embedded in the project
59+ * Gems that you've created and embedded in the project
4660* Engines and their code
4761* RSpec/Unit/Cucumber Tests
4862
@@ -249,4 +263,3 @@ Directory: /users/brian/examples/spree
249263* Add CSS but don't count towards ratios
250264* Output other metrics like number of tables and columns
251265* Different output formatters
252- * replace current rake stats if included in a Rails project
Original file line number Diff line number Diff line change 11require "rails_stats"
2-
3- desc "Calculates the statistsics for a given Rails project"
4- task :stats , [ :path ] do |t , args |
5- root_directory = File . absolute_path ( args [ :path ] )
6- puts "\n Directory: #{ root_directory } \n \n "
7- RailsStats ::CodeStatistics . new ( root_directory ) . to_s
8- end
Original file line number Diff line number Diff line change @@ -4,13 +4,5 @@ module RailsStats
44
55end
66
7- require 'rails_stats/inflector'
8- require 'rails_stats/code_statistics_calculator'
9- require 'rails_stats/util'
10- require 'rails_stats/app_statistics'
11- require 'rails_stats/test_statistics'
12- require 'rails_stats/spec_statistics'
13- require 'rails_stats/cucumber_statistics'
14- require 'rails_stats/root_statistics'
15- require 'rails_stats/gem_statistics'
16- require 'rails_stats/code_statistics'
7+ require 'rails_stats/tasks'
8+
Original file line number Diff line number Diff line change 1+ require 'rails_stats/inflector'
2+ require 'rails_stats/code_statistics_calculator'
3+ require 'rails_stats/util'
4+ require 'rails_stats/app_statistics'
5+ require 'rails_stats/test_statistics'
6+ require 'rails_stats/spec_statistics'
7+ require 'rails_stats/cucumber_statistics'
8+ require 'rails_stats/root_statistics'
9+ require 'rails_stats/gem_statistics'
10+ require 'rails_stats/code_statistics'
Original file line number Diff line number Diff line change 1+ desc "Report code statistics (KLOCs, etc) from the current (or given) application"
2+ task :stats , [ :path ] do |t , args |
3+ Rake ::Task [ "stats" ] . clear # clear out normal one if there
4+ require 'rails_stats/all'
5+
6+ path = args [ :path ]
7+ path = Rails . root . to_s if defined? ( Rails )
8+ raise "no path given for stats" unless path
9+
10+ root_directory = File . absolute_path ( path )
11+ puts "\n Directory: #{ root_directory } \n \n " if args [ :path ]
12+ RailsStats ::CodeStatistics . new ( root_directory ) . to_s
13+ end
Original file line number Diff line number Diff line change 11module RailsStats
2- VERSION = "0.1 .0"
2+ VERSION = "1.0 .0"
33end
You can’t perform that action at this time.
0 commit comments