rails_stats 0.1.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9af14747fe8ba3a62bfd8f9a6429b8ee15575dde
4
- data.tar.gz: 7332aa9e39e69ddec3247ceac542f13560fa7ccb
3
+ metadata.gz: c524b65e7fd49275893acdb29dc435202055ef68
4
+ data.tar.gz: 99a102a7895c4ae933e8d7f76db192f5d633cb2d
5
5
  SHA512:
6
- metadata.gz: 4a64731b6ae1560acf963a4f30d9c14f80e10cd050c5fa841f354f186002a219be0939d3fb2f45cf14dfb99a9381ff4a318c3bfdd2da0e93f496878981e8ac42
7
- data.tar.gz: b7580dcd7f47e03728156d5ce0c0e5bc61904ddaf366010ba9f7414d27dff70d196413683f6be3beef09bae5181d8e4136000caf53e77dbc8c193130bc694570
6
+ metadata.gz: bb7f37c55f35120a8efd53f6a77ad7e3076f3d55e50b9772dbc360e0742a4744c1946ca3eab116129221c023fa13549db2d5d58614c4c3e09032d5852171e9da
7
+ data.tar.gz: 6f218fb511a3cb977c20a883216b2c7c84634a93a0ca6a20041f0ffcba0f55c18b3bb0a658ff07051fba83bbe73b67518e2a09c5ba69ec1e3b6cfceb96a6ff1e
data/Gemfile CHANGED
@@ -2,5 +2,3 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in rails_stats.gemspec
4
4
  gemspec
5
-
6
- gem 'debugger'
data/README.md CHANGED
@@ -3,12 +3,13 @@
3
3
  See stuff about a Rails app.
4
4
 
5
5
  There were a few things missing to the included `rake stats`
6
- 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.
6
+ 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.
7
7
 
8
8
  ### Run it
9
9
 
10
10
  ```bash
11
- $ bundle exec rake:stats[/path/to/app/]
11
+
12
+ $ bundle exec rake stats[/path/to/app/]
12
13
 
13
14
  Directory: /path/to/app/
14
15
 
@@ -35,14 +36,27 @@ Directory: /path/to/app/
35
36
 
36
37
  ```
37
38
 
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
+
38
52
  ### Things it knows about
39
53
 
40
- RailsStats also adds more coverage than the default.
54
+ RailsStats adds more coverage than the default.
41
55
 
42
56
  * Any concepts you've added within an `app` directory
43
57
  * Configuration files
44
58
  * Library files
45
- * Gems that you've embedded in the project
59
+ * Gems that you've created and embedded in the project
46
60
  * Engines and their code
47
61
  * RSpec/Unit/Cucumber Tests
48
62
 
data/Rakefile CHANGED
@@ -1,8 +1 @@
1
1
  require "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 "\nDirectory: #{root_directory}\n\n"
7
- RailsStats::CodeStatistics.new(root_directory).to_s
8
- end
@@ -0,0 +1,10 @@
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'
@@ -0,0 +1,13 @@
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 "\nDirectory: #{root_directory}\n\n" if args[:path]
12
+ RailsStats::CodeStatistics.new(root_directory).to_s
13
+ end
@@ -1,3 +1,3 @@
1
1
  module RailsStats
2
- VERSION = "0.1.0"
2
+ VERSION = "1.0.0"
3
3
  end
data/lib/rails_stats.rb CHANGED
@@ -4,15 +4,5 @@ module RailsStats
4
4
 
5
5
  end
6
6
 
7
- require 'debugger'
7
+ require 'rails_stats/tasks'
8
8
 
9
- require 'rails_stats/inflector'
10
- require 'rails_stats/code_statistics_calculator'
11
- require 'rails_stats/util'
12
- require 'rails_stats/app_statistics'
13
- require 'rails_stats/test_statistics'
14
- require 'rails_stats/spec_statistics'
15
- require 'rails_stats/cucumber_statistics'
16
- require 'rails_stats/root_statistics'
17
- require 'rails_stats/gem_statistics'
18
- require 'rails_stats/code_statistics'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_stats
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Leonard
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-07 00:00:00.000000000 Z
11
+ date: 2014-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -51,6 +51,7 @@ files:
51
51
  - README.md
52
52
  - Rakefile
53
53
  - lib/rails_stats.rb
54
+ - lib/rails_stats/all.rb
54
55
  - lib/rails_stats/app_statistics.rb
55
56
  - lib/rails_stats/code_statistics.rb
56
57
  - lib/rails_stats/code_statistics_calculator.rb
@@ -59,6 +60,7 @@ files:
59
60
  - lib/rails_stats/inflector.rb
60
61
  - lib/rails_stats/root_statistics.rb
61
62
  - lib/rails_stats/spec_statistics.rb
63
+ - lib/rails_stats/tasks.rb
62
64
  - lib/rails_stats/test_statistics.rb
63
65
  - lib/rails_stats/util.rb
64
66
  - lib/rails_stats/version.rb