histocane 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/bin/histocane +17 -0
  2. metadata +69 -0
data/bin/histocane ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'cane'
4
+ require 'aggregate'
5
+
6
+ lines = Cane::StyleCheck.new(:files => '{app,lib}/**/*.rb', :measure => 0).violations.map do |x|
7
+ x.message =~ /Line is >0 characters \((\d+)\)/ && Integer($1)
8
+ end
9
+
10
+ slice = Float(ARGV.shift || 10)
11
+ max = lines.max ? (lines.max / slice).ceil * slice : slice
12
+
13
+ histogram = Aggregate.new(0, max, slice)
14
+ lines.each do |length|
15
+ histogram << length
16
+ end
17
+ puts histogram
metadata ADDED
@@ -0,0 +1,69 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: histocane
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - halorgium
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-05-23 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: cane
16
+ requirement: &70283725668080 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *70283725668080
25
+ - !ruby/object:Gem::Dependency
26
+ name: aggregate
27
+ requirement: &70283725667460 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *70283725667460
36
+ description:
37
+ email: gemcutter@spork.in
38
+ executables:
39
+ - histocane
40
+ extensions: []
41
+ extra_rdoc_files: []
42
+ files:
43
+ - !binary |-
44
+ YmluL2hpc3RvY2FuZQ==
45
+ homepage:
46
+ licenses: []
47
+ post_install_message:
48
+ rdoc_options: []
49
+ require_paths:
50
+ - lib
51
+ required_ruby_version: !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ! '>='
55
+ - !ruby/object:Gem::Version
56
+ version: '0'
57
+ required_rubygems_version: !ruby/object:Gem::Requirement
58
+ none: false
59
+ requirements:
60
+ - - ! '>='
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ requirements: []
64
+ rubyforge_project:
65
+ rubygems_version: 1.8.11
66
+ signing_key:
67
+ specification_version: 3
68
+ summary: Simple histograms using cane
69
+ test_files: []