how_is 11.0.0 → 12.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: 54f57134fd048db57ac6305e075305d6e26d0bcc
4
- data.tar.gz: 8b822b82157a68d82c4f842af37ebe21b2b98834
3
+ metadata.gz: f94a1942844fecd5d67a87e5bcfa10fa8cfb9218
4
+ data.tar.gz: 71f9b9df67822471f710bb78ecec7e8ce7e7c219
5
5
  SHA512:
6
- metadata.gz: f71efbd4e9393c1f4b93ba3e24b43c4a9bb2ed9ed46d2bfb7de7464337e1eb7788092c5d05a5ff782709114c30512dbc730941d88b1ea035c0b717085bd22232
7
- data.tar.gz: 79f8473db656c9cfd5588345bd4ac9c8055dcae692d55dde7dfaa4d4af457511d499f456dbf1031041126ae16ea6e5adb193d25db5c9ccf0b67953aba01bc4c3
6
+ metadata.gz: 4ed0992ecdf4d9a7f4b0351ede0961e3daa82a33d759652b20643b7238fcc515487a4b820c0e4643c95e60f9ee76e1a88566c83f5ea115e4298a24b1b9cac425
7
+ data.tar.gz: 1fbe9fd60239c6f478164ffc3feb2e890053a87c7fd44e7cb821da869ca976f881b5c368948c00d9c48f7b4cdd87b6396d35ef039b7ff6ed9f9c2bc51822af10
data/.rspec CHANGED
@@ -1,6 +1,2 @@
1
1
  --format documentation
2
2
  --color
3
-
4
- # Skip all tests tagged with "integration" or "slow"
5
- --tag ~integration
6
- --tag ~slow
data/.travis.yml CHANGED
@@ -1,8 +1,5 @@
1
1
  language: ruby
2
- env:
3
- - TEST_SUITE=units
4
- - TEST_SUITE=integration
5
- script: "bundle exec rake test:$TEST_SUITE"
2
+ script: "bundle exec rake spec"
6
3
  rvm:
7
4
  - 2.2
8
5
  before_install: gem install bundler -v 1.11.2
data/CHANGELOG.md CHANGED
@@ -9,6 +9,30 @@ this project adheres to [Semantic Versioning](http://semver.org).
9
9
 
10
10
  (Nothing so far.)
11
11
 
12
+ ## [v12.0.0]
13
+
14
+ This release largely focused on refactoring and developer experience
15
+ improvements (e.g. adding Rake tasks and improving the generated JSON and HTML).
16
+
17
+ Pull Requests for this release can be [viewed on
18
+ GitHub](https://github.com/how-is/how_is/pulls?utf8=&q=is%3Apr%20created%3A2016-11-11..2016-12-11).
19
+
20
+ ### Added
21
+
22
+ - Include newest PR/issue in reports.
23
+ ([#85](https://github.com/how-is/how_is/pull/85))
24
+
25
+ ### Changed
26
+
27
+ - Refactoring. ([#79](https://github.com/how-is/how_is/pull/79), [#80](https://github.com/how-is/how_is/pull/80), [#82](https://github.com/how-is/how_is/pull/82), [#88](https://github.com/how-is/how_is/pull/88))
28
+ - JSON and HTML reports have nicer source.
29
+ ([#82](https://github.com/how-is/how_is/pulls/82),
30
+ [#84](https://github.com/how-is/how_is/pulls/84))
31
+ - Handle generating a report on a repository with no open issues.
32
+ ([#92](https://github.com/how-is/how_is/pull/92))
33
+ - Add Rake tasks to make development easier. ([#86](https://github.com/how-is/how_is/pull/86), [#94](https://github.com/how-is/how_is/pull/94), [#96](https://github.com/how-is/how_is/pull/96))
34
+ - PR/issue info is now displayed as lists instead of paragraphs. ([#83](https://github.com/how-is/how_is/pull/83))
35
+
12
36
  ## [11.0.0]
13
37
 
14
38
  ### Added
data/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  # How is [your repo]?
5
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.
6
+ `how_is` is tool for generating summaries of the health of a codebase hosted on GitHub. It uses information available from issues and pull requests to provide an overview of a repository and highlight problem areas of the codebase.
7
7
 
8
8
  The summary includes:
9
9
 
@@ -37,11 +37,24 @@ The above command creates a HTML file containing the summary at `./report.html`.
37
37
  #### Generating reports from a config file
38
38
 
39
39
  Beyond the above, you can also create a config file — typically called
40
- how_is.yml — and run `how_is --config YAML_CONFIG_FILE`. If your config
41
- file is called how_is.yml, you can just run `how_is --config`.
42
-
43
- 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)
44
- for an example.
40
+ how_is.yml — and run `how_is --config YAML_CONFIG_FILE`. (E.g., if
41
+ the config file is how_is.yml, you would run `how_is --config how_is.yml`.)
42
+
43
+ Below is an example config file, [from the how-is-rubygems repository](https://github.com/how-is/how-is-rubygems/blob/gh-pages/how_is.yml).
44
+
45
+ ```yaml
46
+ repository: rubygems/rubygems
47
+ reports:
48
+ html:
49
+ directory: _posts
50
+ frontmatter:
51
+ title: "%{date} Report"
52
+ layout: default
53
+ filename: "%{date}-report.html"
54
+ json:
55
+ directory: json
56
+ filename: "%{date}.json"
57
+ ```
45
58
 
46
59
  The config file is a YAML file. The two root keys are `repository` (the
47
60
  repository name, of format USER_OR_ORG/REPOSITORY — e.g. how-is/how_is)
@@ -55,7 +68,8 @@ report in), `filename` (the format string for filenames), and (optionally)
55
68
  `frontmatter`.
56
69
 
57
70
  `frontmatter` is a set of key/value pairs specifying frontmatter as used by
58
- various blog engines (e.g. Jekyll), so you can set title, layout, etc.
71
+ various blog engines (e.g. Jekyll), so you can set the title, layout, etc of
72
+ the page.
59
73
 
60
74
  Every value under `reports` is a format string, so you can do e.g.
61
75
  `filename: "%{date}-report.html"` or (under `frontmatter`)
data/Rakefile CHANGED
@@ -1,30 +1,62 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
+ require 'timecop'
4
+ #require 'vcr'
5
+ require './spec/vcr_helper.rb'
6
+ require 'how_is'
3
7
 
4
8
  RSpec::Core::RakeTask.new(:spec)
5
9
 
6
10
  task :default => :spec
7
11
 
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'
12
+ class HelperFunctions
13
+ def self.freeze_time(&block)
14
+ date = DateTime.parse('2016-11-01').new_offset(0)
15
+ Timecop.freeze(date) do
16
+ yield
17
+ end
15
18
  end
16
19
 
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'
20
+ def self.generate_report(repository, format)
21
+ freeze_time do
22
+ report = nil
23
+
24
+ options = {
25
+ repository: repository,
26
+ format: format,
27
+ }
28
+
29
+ cassette = repository.gsub('/', '-')
30
+ VCR.use_cassette(cassette) do
31
+ report = HowIs.generate_report(**options)
32
+ end
33
+
34
+ filename = "#{cassette}-report.#{format}"
35
+ path = File.expand_path("spec/data/#{filename}", __dir__)
36
+ File.open(path, 'w') do |f|
37
+ f.puts report
38
+ # HACK: Trailing newline is missing, otherwise.
39
+ f.puts if format == 'html'
40
+ end
41
+ end
21
42
  end
43
+ end
22
44
 
45
+ namespace :generate_reports do
46
+ desc 'Generate example HTML reports.'
47
+ task :html do
48
+ %w[
49
+ how-is/example-repository
50
+ how-is/example-empty-repository
51
+ ].each do |repo|
52
+ HelperFunctions.generate_report(repo, 'html')
53
+ end
54
+ end
23
55
 
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'
56
+ desc 'Generate example JSON reports.'
57
+ task :json do
58
+ HelperFunctions.generate_report('how-is/example-repository', 'json')
29
59
  end
60
+
61
+ task :all => [:html, :json]
30
62
  end