how_is 8.0.0 → 9.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: 4048011b690428fb1074409a0c6407cb1b9b8543
4
- data.tar.gz: b31f1009e81f94a45c5bb7c24b7250e8e77072e9
3
+ metadata.gz: d7243c84fe47a38ab1ebe38586797bfab2e859bb
4
+ data.tar.gz: 51107d4818272e4019f38592b0b7d2ce55dbdf1d
5
5
  SHA512:
6
- metadata.gz: 8c15a561a6d278c9a371b56005abea0a5a3e85829f4d84c38fc1e1c888b684f61818cc9b60313aecd509cc641bc93389afdfcaf1a99dd9ee15407c0b04d2d860
7
- data.tar.gz: b1319f6338fdc68839064f398b0fdb6503be6ce794b0888293726d0f1bd3912b143a0d9928d3f77a1fac674d01059f5429e56ac0836490882cd72ea550331aa3
6
+ metadata.gz: 9b9edbd04e8104938e57015d8615f2d49d3503675648b7b6b7a2662f5a6f692689cf5dbc877bf1d62342e64a1d2549af9c93c825782f20266feb9664801130d5
7
+ data.tar.gz: e60c288394b391aab576498d6b068963d49a030a6211674123b9ad322b01d3b32c786e892b3cc618232a481ec0803bbaed71c3b5357c56b1ba2cc71e0bb57b01
data/.gitignore CHANGED
@@ -1,15 +1,15 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
10
- report.pdf
11
- report.json
12
- report.html
13
- *.dat
14
- *.png
15
- Thumbs.db
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ report.pdf
11
+ report.json
12
+ report.html
13
+ *.dat
14
+ *.png
15
+ Thumbs.db
data/.rspec CHANGED
@@ -1,2 +1,6 @@
1
1
  --format documentation
2
2
  --color
3
+
4
+ # Skip all tests tagged with "integration" or "slow"
5
+ --tag ~integration
6
+ --tag ~slow
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
data/.travis.yml CHANGED
@@ -1,4 +1,8 @@
1
- language: ruby
2
- rvm:
3
- - 2.2
4
- before_install: gem install bundler -v 1.11.2
1
+ language: ruby
2
+ env:
3
+ - TEST_SUITE=units
4
+ - TEST_SUITE=integration
5
+ script: "bundle exec rake test:$TEST_SUITE"
6
+ rvm:
7
+ - 2.2
8
+ before_install: gem install bundler -v 1.11.2
data/Gemfile CHANGED
@@ -2,3 +2,4 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in how_is.gemspec
4
4
  gemspec
5
+
data/README.md CHANGED
@@ -1,76 +1,76 @@
1
- [![Stories in Ready](https://badge.waffle.io/duckinator/how_is.png?label=ready&title=Ready)](https://waffle.io/duckinator/how_is)
2
- [![Build Status](https://travis-ci.org/duckinator/how_is.svg?branch=master)](https://travis-ci.org/duckinator/how_is)
3
-
4
- # How is [your repo]?
5
-
6
- `how_is` is tool for generating summaries of the health of a codebase. It uses information available from issues and pull requests to provide an overview of a repository and highlight problem areas of the codebase.
7
-
8
- The summary includes:
9
-
10
- * repository name,
11
- * number of open issues,
12
- * number of open pull requests,
13
- * number of open issues associated with each label and with no label,
14
- * average issue age,
15
- * average pull request age,
16
- * date oldest issue was opened,
17
- * date oldest pull request was opened.
18
-
19
- ## Installation
20
-
21
- Make sure you have [gnuplot](http://gnuplot.info/) installed, then:
22
-
23
- $ gem install how_is
24
-
25
- ## Usage
26
-
27
- $ how_is <orgname>/<reponame> [--report-file FILENAME]
28
-
29
- E.g.,
30
-
31
- $ how_is rubygems/rubygems --report-file report.pdf
32
-
33
- The above command creates a PDF containing the summary at `./report.pdf`.
34
-
35
- ### Generating reports from a config file
36
-
37
- Beyond the above, you can also create a config file &mdash; typically called
38
- how_is.yml &mdash; and run `how_is --config YAML_CONFIG_FILE`. If your config
39
- file is called how_is.yml, you can just run `how_is --config`.
40
-
41
- You can see [the how_is.yml in the how-is-rubygems repository](https://github.com/how-is/how-is-rubygems/blob/gh-pages/how_is.yml)
42
- for an example.
43
-
44
- The config file is a YAML file. The two root keys are `repository` (the
45
- repository name, of format USER_OR_ORG/REPOSITORY &mdash; e.g. how-is/how_is)
46
- and `reports`.
47
-
48
- `reports` is a hash of key/value pairs, with the keys being the type of report
49
- ("html", "pdf", or "json") and the values being another hash.
50
-
51
- That hash can have the following keys: `directory` (the directory to place the
52
- report in), `filename` (the format string for filenames), and (optionally)
53
- `frontmatter`.
54
-
55
- `frontmatter` is a set of key/value pairs specifying frontmatter as used by
56
- various blog engines (e.g. Jekyll), so you can set title, layout, etc.
57
-
58
- Every value under `reports` is a format string, so you can do e.g.
59
- `filename: "%{date}-report.html"` or (under `frontmatter`)
60
- `title: "%{date} Report"`.
61
-
62
-
63
- ## Development
64
-
65
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. Run `bundle exec how_is` to use the gem in this directory, ignoring other installed copies of this gem.
66
-
67
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
68
-
69
- ## Contributing
70
-
71
- Bug reports and pull requests are welcome on GitHub at https://github.com/duckinator/how_is. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
72
-
73
-
74
- ## License
75
-
76
- The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
1
+ [![Stories in Ready](https://badge.waffle.io/duckinator/how_is.png?label=ready&title=Ready)](https://waffle.io/duckinator/how_is)
2
+ [![Build Status](https://travis-ci.org/duckinator/how_is.svg?branch=master)](https://travis-ci.org/duckinator/how_is)
3
+
4
+ # How is [your repo]?
5
+
6
+ `how_is` is tool for generating summaries of the health of a codebase. It uses information available from issues and pull requests to provide an overview of a repository and highlight problem areas of the codebase.
7
+
8
+ The summary includes:
9
+
10
+ * repository name,
11
+ * number of open issues,
12
+ * number of open pull requests,
13
+ * number of open issues associated with each label and with no label,
14
+ * average issue age,
15
+ * average pull request age,
16
+ * date oldest issue was opened,
17
+ * date oldest pull request was opened.
18
+
19
+ ## Installation
20
+
21
+ Make sure you have [gnuplot](http://gnuplot.info/) installed, then:
22
+
23
+ $ gem install how_is
24
+
25
+ ## Usage
26
+
27
+ $ how_is <orgname>/<reponame> [--report-file FILENAME]
28
+
29
+ E.g.,
30
+
31
+ $ how_is rubygems/rubygems --report-file report.pdf
32
+
33
+ The above command creates a PDF containing the summary at `./report.pdf`.
34
+
35
+ ### Generating reports from a config file
36
+
37
+ Beyond the above, you can also create a config file &mdash; typically called
38
+ how_is.yml &mdash; and run `how_is --config YAML_CONFIG_FILE`. If your config
39
+ file is called how_is.yml, you can just run `how_is --config`.
40
+
41
+ You can see [the how_is.yml in the how-is-rubygems repository](https://github.com/how-is/how-is-rubygems/blob/gh-pages/how_is.yml)
42
+ for an example.
43
+
44
+ The config file is a YAML file. The two root keys are `repository` (the
45
+ repository name, of format USER_OR_ORG/REPOSITORY &mdash; e.g. how-is/how_is)
46
+ and `reports`.
47
+
48
+ `reports` is a hash of key/value pairs, with the keys being the type of report
49
+ ("html", "pdf", or "json") and the values being another hash.
50
+
51
+ That hash can have the following keys: `directory` (the directory to place the
52
+ report in), `filename` (the format string for filenames), and (optionally)
53
+ `frontmatter`.
54
+
55
+ `frontmatter` is a set of key/value pairs specifying frontmatter as used by
56
+ various blog engines (e.g. Jekyll), so you can set title, layout, etc.
57
+
58
+ Every value under `reports` is a format string, so you can do e.g.
59
+ `filename: "%{date}-report.html"` or (under `frontmatter`)
60
+ `title: "%{date} Report"`.
61
+
62
+
63
+ ## Development
64
+
65
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. Run `bundle exec how_is` to use the gem in this directory, ignoring other installed copies of this gem.
66
+
67
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
68
+
69
+ ## Contributing
70
+
71
+ Bug reports and pull requests are welcome on GitHub at https://github.com/duckinator/how_is. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
72
+
73
+
74
+ ## License
75
+
76
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
data/Rakefile CHANGED
@@ -4,3 +4,27 @@ require "rspec/core/rake_task"
4
4
  RSpec::Core::RakeTask.new(:spec)
5
5
 
6
6
  task :default => :spec
7
+
8
+ namespace :test do
9
+ task :units => :spec
10
+
11
+ desc 'Run integration tests tag'
12
+ RSpec::Core::RakeTask.new('integration') do |task|
13
+ task.pattern = './spec/**/*_spec.rb'
14
+ task.rspec_opts = '--tag integration'
15
+ end
16
+
17
+ desc 'Run slow tests tag'
18
+ RSpec::Core::RakeTask.new('integration') do |task|
19
+ task.pattern = './spec/**/*_spec.rb'
20
+ task.rspec_opts = '--tag slow'
21
+ end
22
+
23
+
24
+ desc 'Run all tests regardless of tags'
25
+ RSpec::Core::RakeTask.new('all') do |task|
26
+ task.pattern = './spec/**/*_spec.rb'
27
+ # Load the tagless options file
28
+ task.rspec_opts = '-O .rspec-ignore-tags'
29
+ end
30
+ end
data/data/issues.plg CHANGED
@@ -1,22 +1,22 @@
1
- if (!exists("chartsize")) chartsize = '500,500'
2
- if (!exists("labelfont")) labelfont = 'Helvetica,12'
3
- if (!exists("chartfont")) chartfont = 'Helvetica,12'
4
- if (!exists("data")) data = 'issues-per-label.dat'
5
- if (!exists("pngfile")) data = 'issues-per-label.png'
6
-
7
- set terminal png size chartsize font chartfont
8
-
9
- set output pngfile
10
-
11
- unset key
12
- unset border
13
- set tics nomirror
14
- unset xtics
15
-
16
- set style fill solid 0.15 border
17
-
18
- plot data using 1:2 with boxes, data using 1:(0):3 with \
19
- labels left \
20
- rotate by 90 \
21
- font labelfont \
22
- offset 0,0.45
1
+ if (!exists("chartsize")) chartsize = '500,500'
2
+ if (!exists("labelfont")) labelfont = 'Helvetica,12'
3
+ if (!exists("chartfont")) chartfont = 'Helvetica,12'
4
+ if (!exists("data")) data = 'issues-per-label.dat'
5
+ if (!exists("pngfile")) data = 'issues-per-label.png'
6
+
7
+ set terminal png size chartsize font chartfont
8
+
9
+ set output pngfile
10
+
11
+ unset key
12
+ unset border
13
+ set tics nomirror
14
+ unset xtics
15
+
16
+ set style fill solid 0.15 border
17
+
18
+ plot data using 1:2 with boxes, data using 1:(0):3 with \
19
+ labels left \
20
+ rotate by 90 \
21
+ font labelfont \
22
+ offset 0,0.45
data/exe/how_is CHANGED
@@ -1,75 +1,30 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "how_is"
4
- require "how_is/cli"
5
- require "optparse"
6
-
7
- options = {
8
- repository: nil,
9
- report_file: "report.pdf",
10
- from_file: nil,
11
- use_config_file: false,
12
- config_file: nil,
13
- }
14
-
15
- opts = OptionParser.new do |opts|
16
- opts.banner =
17
- <<-EOF.gsub(/ *\| ?/, '')
18
- | Usage: how_is REPOSITORY [--report REPORT_FILE]
19
- |
20
- | Where REPOSITORY is of the format <GitHub username or org>/<repository name>.
21
- |
22
- | E.g., if you wanted to check https://github.com/duckinator/how_is,
23
- | you'd run `how_is duckinator/how_is`.
24
- |
25
- EOF
26
-
27
- opts.separator ""
28
- opts.separator "Options:"
29
-
30
- opts.on("-h", "--help", "Print this help") do
31
- puts opts
32
- exit 0
33
- end
34
-
35
- opts.on("--config [YAML_CONFIG_FILE]", "generate reports as specified in YAML_CONFIG_FILE") do |file|
36
- options[:use_config_file] = true
37
- options[:config_file] = file
38
- end
39
-
40
- opts.on("--from JSON_REPORT_FILE", "import JSON_REPORT_FILE instead of fetching the data again") do |file|
41
- options[:from_file] = file
42
- end
43
-
44
- opts.on("--report REPORT_FILE", "file containing the report") do |file|
45
- options[:report_file] = file
46
- end
47
-
48
- opts.on("-v", "--version", "prints the version") do
49
- puts HowIs::VERSION
50
- exit
51
- end
52
- end
53
- opts.parse!
54
-
55
- if options[:use_config_file]
56
- HowIs::CLI.new.from_config_file(options[:config_file])
57
- exit
58
- end
59
-
60
-
61
- unless HowIs.can_export_to?(options[:report_file])
62
- abort "Invalid file: #{options[:report_file]}. Supported formats: #{HowIs.supported_formats.join(', ')}"
63
- end
64
-
65
- if options[:from_file]
66
- # Opening this file here seems a bit messy, but it works.
67
- options[:repository] = JSON.parse(open(options[:from_file]).read)['repository']
68
- abort "Error: Invalid JSON report file." unless options[:repository]
69
- elsif ARGV.length >= 1
70
- options[:repository] = ARGV.delete_at(0)
71
- else
72
- abort "Error: No repository specified."
73
- end
74
-
75
- HowIs.generate_report_file(options)
1
+ #!/usr/bin/env ruby
2
+
3
+ require "how_is"
4
+ require "how_is/cli"
5
+ require "how_is/cli/parser"
6
+
7
+ begin
8
+ parser = HowIs::CLI::Parser.new
9
+ result = parser.call(ARGV)
10
+ rescue HowIs::CLI::OptionsError => e
11
+ if ENV['SHOW_TRACE']
12
+ raise
13
+ else
14
+ abort "Error: #{e.message}"
15
+ end
16
+ end
17
+
18
+ opts = result[:opts]
19
+ options = result[:options]
20
+ arguments = result[:arguments]
21
+
22
+ if options[:help]
23
+ puts result[:opts]
24
+ elsif options[:version]
25
+ puts HowIs::VERSION
26
+ elsif options[:config]
27
+ HowIs::CLI.new.from_config_file(options[:config])
28
+ else
29
+ HowIs.generate_report_file(options)
30
+ end
data/how_is.gemspec CHANGED
@@ -1,37 +1,38 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'how_is/version'
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = "how_is"
8
- spec.version = HowIs::VERSION
9
- spec.authors = ["Ellen Marie Dash"]
10
- spec.email = ["me@duckie.co"]
11
-
12
- spec.summary = %q{Quantify the health of a GitHub repository is.}
13
- spec.homepage = "https://github.com/duckinator/how_is"
14
- spec.license = "MIT"
15
-
16
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
- spec.bindir = "exe"
18
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
- spec.require_paths = ["lib"]
20
-
21
- spec.add_runtime_dependency "github_api", "~> 0.13.1"
22
- spec.add_runtime_dependency "contracts"
23
- spec.add_runtime_dependency "prawn"
24
-
25
- spec.add_runtime_dependency "mini_magick"
26
-
27
- # Travis CI only supports up to Ruby 2.2.0, but Rack 2.0+ requires Ruby 2.2.2+,
28
- # so this pegs Rack to the latest version that works with Ruby 2.2.0.
29
- spec.add_runtime_dependency "rack", "< 2.0"
30
-
31
- spec.add_runtime_dependency "tessellator-fetcher", "~> 4.0.1"
32
-
33
- spec.add_development_dependency "bundler", "~> 1.11"
34
- spec.add_development_dependency "rake", "~> 10.0"
35
- spec.add_development_dependency "rspec", "~> 3.0"
36
- spec.add_development_dependency 'timecop', '~> 0.8.1'
37
- end
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'how_is/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "how_is"
8
+ spec.version = HowIs::VERSION
9
+ spec.authors = ["Ellen Marie Dash"]
10
+ spec.email = ["me@duckie.co"]
11
+
12
+ spec.summary = %q{Quantify the health of a GitHub repository is.}
13
+ spec.homepage = "https://github.com/duckinator/how_is"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
+ spec.bindir = "exe"
18
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_runtime_dependency "github_api", "~> 0.13.1"
22
+ spec.add_runtime_dependency "contracts"
23
+ spec.add_runtime_dependency "slop"
24
+ spec.add_runtime_dependency "prawn"
25
+
26
+ spec.add_runtime_dependency "mini_magick"
27
+
28
+ # Travis CI only supports up to Ruby 2.2.0, but Rack 2.0+ requires Ruby 2.2.2+,
29
+ # so this pegs Rack to the latest version that works with Ruby 2.2.0.
30
+ spec.add_runtime_dependency "rack", "< 2.0"
31
+
32
+ spec.add_runtime_dependency "tessellator-fetcher", "~> 5.0.0"
33
+
34
+ spec.add_development_dependency "bundler", "~> 1.11"
35
+ spec.add_development_dependency "rake", "~> 10.0"
36
+ spec.add_development_dependency "rspec", "~> 3.0"
37
+ spec.add_development_dependency "timecop", "~> 0.8.1"
38
+ end