how_is 24.0.0 → 25.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/.github_changelog_generator +0 -1
  3. data/.rubocop.yml +37 -12
  4. data/.travis.yml +6 -3
  5. data/CHANGELOG.md +56 -0
  6. data/CONTRIBUTING.md +34 -0
  7. data/Gemfile +8 -4
  8. data/ISSUES.md +30 -54
  9. data/README.md +16 -91
  10. data/Rakefile +3 -31
  11. data/bin/prerelease-generate-changelog +1 -1
  12. data/bin/setup +0 -0
  13. data/build-debug.rb +20 -0
  14. data/exe/how_is +25 -22
  15. data/fixtures/vcr_cassettes/how-is-example-empty-repository.yml +334 -1
  16. data/fixtures/vcr_cassettes/how-is-example-repository.yml +350 -1
  17. data/fixtures/vcr_cassettes/how-is-from-config-frontmatter.yml +15234 -1
  18. data/fixtures/vcr_cassettes/how-is-how-is-travis-api-repos-builds.yml +2694 -1
  19. data/fixtures/vcr_cassettes/how-is-with-config-file.yml +15234 -1
  20. data/fixtures/vcr_cassettes/how_is_contributions_additions_count.yml +70 -1
  21. data/fixtures/vcr_cassettes/how_is_contributions_all_contributors.yml +70 -1
  22. data/fixtures/vcr_cassettes/how_is_contributions_changed_files.yml +70 -1
  23. data/fixtures/vcr_cassettes/how_is_contributions_changes.yml +70 -1
  24. data/fixtures/vcr_cassettes/how_is_contributions_commits.yml +70 -1
  25. data/fixtures/vcr_cassettes/how_is_contributions_compare_url.yml +70 -1
  26. data/fixtures/vcr_cassettes/how_is_contributions_default_branch.yml +70 -1
  27. data/fixtures/vcr_cassettes/how_is_contributions_deletions_count.yml +70 -1
  28. data/fixtures/vcr_cassettes/how_is_contributions_new_contributors.yml +70 -1
  29. data/fixtures/vcr_cassettes/how_is_contributions_summary.yml +70 -1
  30. data/fixtures/vcr_cassettes/how_is_contributions_summary_2.yml +70 -1
  31. data/how_is.gemspec +12 -6
  32. data/lib/how_is/cacheable.rb +71 -0
  33. data/lib/how_is/cli.rb +121 -124
  34. data/lib/how_is/config.rb +123 -0
  35. data/lib/how_is/constants.rb +9 -0
  36. data/lib/how_is/date_time_helpers.rb +48 -0
  37. data/lib/how_is/frontmatter.rb +14 -9
  38. data/lib/how_is/report.rb +86 -58
  39. data/lib/how_is/report_collection.rb +113 -0
  40. data/lib/how_is/sources/ci/appveyor.rb +88 -0
  41. data/lib/how_is/sources/ci/travis.rb +159 -0
  42. data/lib/how_is/sources/github/contributions.rb +169 -128
  43. data/lib/how_is/sources/github/issue_fetcher.rb +148 -0
  44. data/lib/how_is/sources/github/issues.rb +86 -235
  45. data/lib/how_is/sources/github/pulls.rb +19 -18
  46. data/lib/how_is/sources/github.rb +40 -18
  47. data/lib/how_is/sources/github_helpers.rb +8 -91
  48. data/lib/how_is/sources.rb +2 -0
  49. data/lib/how_is/template.rb +9 -0
  50. data/lib/how_is/templates/contributions_partial.html +1 -0
  51. data/lib/how_is/templates/{issues_or_pulls_partial.html_template → issues_or_pulls_partial.html} +0 -0
  52. data/lib/how_is/templates/new_contributors_partial.html +5 -0
  53. data/lib/how_is/templates/{report.html_template → report.html} +0 -8
  54. data/lib/how_is/templates/{report_partial.html_template → report_partial.html} +3 -3
  55. data/lib/how_is/text.rb +26 -0
  56. data/lib/how_is/version.rb +2 -1
  57. data/lib/how_is.rb +33 -60
  58. metadata +28 -47
  59. data/.hound.yml +0 -2
  60. data/.rubocop_todo.yml +0 -21
  61. data/lib/how_is/sources/travis.rb +0 -37
  62. data/roadmap.markdown +0 -82
data/exe/how_is CHANGED
@@ -4,40 +4,43 @@
4
4
 
5
5
  require "how_is"
6
6
  require "how_is/cli"
7
- require "date"
7
+ require "how_is/config"
8
+ require "how_is/text"
8
9
 
9
10
  begin
10
- result = HowIs::CLI.parse(ARGV)
11
- rescue HowIs::CLI::OptionsError => e
12
- raise if ENV["SHOW_TRACE"]
13
-
14
- abort "Error: #{e.message} (See --help for usage.)"
11
+ cli = HowIs::CLI.parse(ARGV)
12
+ rescue OptionParser::ParseError => e
13
+ abort "how_is: error: #{e.message}"
15
14
  end
16
15
 
17
- options = result[:options]
16
+ options = cli.options
18
17
 
19
- if options[:help]
20
- puts result[:opts]
21
- exit
22
- elsif options[:version]
23
- puts HowIs::VERSION
24
- exit
25
- end
18
+ abort cli.help_text if options[:help]
19
+ abort HowIs::VERSION_STRING if options[:version]
26
20
 
27
21
  date = options[:date]
28
22
 
29
23
  begin
30
- if options[:config]
31
- reports = HowIs.from_config(YAML.load_file(options[:config]), date)
24
+ config = HowIs::Config.new
32
25
 
33
- reports.each { |file, report| report.save_as(file) }
34
- else
35
- report = HowIs.new(options[:repository], date)
26
+ config.load_defaults unless options[:no_user_config]
27
+ config.load_env if options[:env_config]
36
28
 
37
- report.save_as(options[:report])
29
+ if options[:config]
30
+ config.load_files(options[:config])
31
+ else
32
+ config.load(HowIs.default_config(options[:repository]))
38
33
  end
34
+
35
+ reports = HowIs.from_config(config, date)
36
+
37
+ files = reports.save_all
38
+ HowIs::Text.puts "Saved reports to:"
39
+ files.each { |file| HowIs::Text.puts "- #{file}" }
39
40
  rescue => e
40
- raise if ENV["SHOW_TRACE"]
41
+ raise if options[:verbose]
41
42
 
42
- abort "Error: #{e.message} (Set the SHOW_TRACE variable for a stack trace.)"
43
+ warn "how_is: error: #{e.message} (Pass --verbose for more details.)"
44
+ warn " at: #{e.backtrace_locations.first}"
45
+ exit 1
43
46
  end
@@ -975342,4 +975342,337 @@ http_interactions:
975342
975342
  string: '{"data":null,"errors":[{"message":"API rate limit exceeded","type":"RATE_LIMITED"}]}'
975343
975343
  http_version:
975344
975344
  recorded_at: Sat, 06 Jan 2018 21:50:39 GMT
975345
- recorded_with: VCR 3.0.3
975345
+ - request:
975346
+ method: get
975347
+ uri: https://api.travis-ci.org/repo/how-is%2Fexample-empty-repository/branches?sort_by=default_branch
975348
+ body:
975349
+ encoding: US-ASCII
975350
+ string: ''
975351
+ headers:
975352
+ Accept-Encoding:
975353
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
975354
+ Accept:
975355
+ - application/json
975356
+ User-Agent:
975357
+ - how_is/24.0.0 (https://github.com/how-is/how_is/)
975358
+ Host:
975359
+ - api.travis-ci.org
975360
+ Travis-Api-Version:
975361
+ - '3'
975362
+ response:
975363
+ status:
975364
+ code: 200
975365
+ message: OK
975366
+ headers:
975367
+ Connection:
975368
+ - keep-alive
975369
+ Server:
975370
+ - nginx
975371
+ Date:
975372
+ - Fri, 30 Mar 2018 22:04:08 GMT
975373
+ Content-Type:
975374
+ - application/json
975375
+ Transfer-Encoding:
975376
+ - chunked
975377
+ Access-Control-Allow-Origin:
975378
+ - "*"
975379
+ Access-Control-Allow-Credentials:
975380
+ - 'true'
975381
+ Access-Control-Expose-Headers:
975382
+ - Content-Type, Cache-Control, Expires, Etag, Last-Modified, X-Request-ID
975383
+ Strict-Transport-Security:
975384
+ - max-age=31536000
975385
+ X-Endpoint:
975386
+ - Travis::API::V3::Services::Branches::Find
975387
+ X-Oauth-Scopes:
975388
+ - ''
975389
+ Vary:
975390
+ - Accept-Encoding
975391
+ X-Rack-Cache:
975392
+ - miss
975393
+ X-Request-Id:
975394
+ - ac2a4544-e1cd-4335-9ed1-b99c80bf1e3c
975395
+ Via:
975396
+ - 1.1 vegur
975397
+ body:
975398
+ encoding: ASCII-8BIT
975399
+ string: |-
975400
+ {
975401
+ "@type": "branches",
975402
+ "@href": "/repo/how-is%2Fexample-empty-repository/branches?sort_by=default_branch",
975403
+ "@representation": "standard",
975404
+ "@pagination": {
975405
+ "limit": 25,
975406
+ "offset": 0,
975407
+ "count": 0,
975408
+ "is_first": true,
975409
+ "is_last": true,
975410
+ "next": null,
975411
+ "prev": null,
975412
+ "first": {
975413
+ "@href": "/repo/how-is%2Fexample-empty-repository/branches?sort_by=default_branch",
975414
+ "offset": 0,
975415
+ "limit": 25
975416
+ },
975417
+ "last": {
975418
+ "@href": "/repo/how-is%2Fexample-empty-repository/branches?limit=25&offset=-25&sort_by=default_branch",
975419
+ "offset": -25,
975420
+ "limit": 25
975421
+ }
975422
+ },
975423
+ "branches": [
975424
+
975425
+ ]
975426
+ }
975427
+ http_version:
975428
+ recorded_at: Fri, 30 Mar 2018 22:04:08 GMT
975429
+ - request:
975430
+ method: get
975431
+ uri: https://api.travis-ci.org/repo/how-is%2Fexample-empty-repository/builds?branch.name&event_type=push
975432
+ body:
975433
+ encoding: US-ASCII
975434
+ string: ''
975435
+ headers:
975436
+ Accept-Encoding:
975437
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
975438
+ Accept:
975439
+ - application/json
975440
+ User-Agent:
975441
+ - how_is/24.0.0 (https://github.com/how-is/how_is/)
975442
+ Host:
975443
+ - api.travis-ci.org
975444
+ Travis-Api-Version:
975445
+ - '3'
975446
+ response:
975447
+ status:
975448
+ code: 200
975449
+ message: OK
975450
+ headers:
975451
+ Connection:
975452
+ - keep-alive
975453
+ Server:
975454
+ - nginx
975455
+ Date:
975456
+ - Sat, 31 Mar 2018 00:06:57 GMT
975457
+ Content-Type:
975458
+ - application/json
975459
+ Transfer-Encoding:
975460
+ - chunked
975461
+ Access-Control-Allow-Origin:
975462
+ - "*"
975463
+ Access-Control-Allow-Credentials:
975464
+ - 'true'
975465
+ Access-Control-Expose-Headers:
975466
+ - Content-Type, Cache-Control, Expires, Etag, Last-Modified, X-Request-ID
975467
+ Strict-Transport-Security:
975468
+ - max-age=31536000
975469
+ X-Endpoint:
975470
+ - Travis::API::V3::Services::Builds::Find
975471
+ X-Oauth-Scopes:
975472
+ - ''
975473
+ Vary:
975474
+ - Accept-Encoding
975475
+ X-Rack-Cache:
975476
+ - miss
975477
+ X-Request-Id:
975478
+ - 64807ed2-3986-4b7f-92f7-7e0fa4c29a05
975479
+ Via:
975480
+ - 1.1 vegur
975481
+ body:
975482
+ encoding: ASCII-8BIT
975483
+ string: |-
975484
+ {
975485
+ "@type": "builds",
975486
+ "@href": "/repo/how-is%2Fexample-empty-repository/builds?event_type=push&branch.name",
975487
+ "@representation": "standard",
975488
+ "@pagination": {
975489
+ "limit": 25,
975490
+ "offset": 0,
975491
+ "count": 0,
975492
+ "is_first": true,
975493
+ "is_last": true,
975494
+ "next": null,
975495
+ "prev": null,
975496
+ "first": {
975497
+ "@href": "/repo/how-is%2Fexample-empty-repository/builds?event_type=push&branch.name",
975498
+ "offset": 0,
975499
+ "limit": 25
975500
+ },
975501
+ "last": {
975502
+ "@href": "/repo/how-is%2Fexample-empty-repository/builds?branch.name&event_type=push&limit=25&offset=-25",
975503
+ "offset": -25,
975504
+ "limit": 25
975505
+ }
975506
+ },
975507
+ "builds": [
975508
+
975509
+ ]
975510
+ }
975511
+ http_version:
975512
+ recorded_at: Sat, 31 Mar 2018 00:06:57 GMT
975513
+ - request:
975514
+ method: get
975515
+ uri: https://ci.appveyor.com/api/projects/how-is/example-empty-repository
975516
+ body:
975517
+ encoding: US-ASCII
975518
+ string: ''
975519
+ headers:
975520
+ Accept-Encoding:
975521
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
975522
+ Accept:
975523
+ - application/json
975524
+ User-Agent:
975525
+ - how_is/24.0.0 (https://github.com/how-is/how_is/)
975526
+ Host:
975527
+ - ci.appveyor.com
975528
+ response:
975529
+ status:
975530
+ code: 404
975531
+ message: Not Found
975532
+ headers:
975533
+ Cache-Control:
975534
+ - no-cache
975535
+ Pragma:
975536
+ - no-cache
975537
+ Content-Type:
975538
+ - application/json; charset=utf-8
975539
+ Expires:
975540
+ - "-1"
975541
+ X-Xss-Protection:
975542
+ - 1; mode=block
975543
+ X-Frame-Options:
975544
+ - SAMEORIGIN
975545
+ Strict-Transport-Security:
975546
+ - max-age=31536000
975547
+ X-Content-Type-Options:
975548
+ - nosniff
975549
+ Date:
975550
+ - Sat, 31 Mar 2018 00:07:00 GMT
975551
+ Content-Length:
975552
+ - '49'
975553
+ body:
975554
+ encoding: UTF-8
975555
+ string: '{"message":"Project not found or access denied."}'
975556
+ http_version:
975557
+ recorded_at: Sat, 31 Mar 2018 00:07:00 GMT
975558
+ - request:
975559
+ method: get
975560
+ uri: https://ci.appveyor.com/api/projects/how-is/example-empty-repository/history?recordsNumber=100
975561
+ body:
975562
+ encoding: US-ASCII
975563
+ string: ''
975564
+ headers:
975565
+ Accept-Encoding:
975566
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
975567
+ Accept:
975568
+ - application/json
975569
+ User-Agent:
975570
+ - how_is/24.0.0 (https://github.com/how-is/how_is/)
975571
+ Host:
975572
+ - ci.appveyor.com
975573
+ response:
975574
+ status:
975575
+ code: 404
975576
+ message: Not Found
975577
+ headers:
975578
+ Cache-Control:
975579
+ - no-cache
975580
+ Pragma:
975581
+ - no-cache
975582
+ Content-Type:
975583
+ - application/json; charset=utf-8
975584
+ Expires:
975585
+ - "-1"
975586
+ X-Xss-Protection:
975587
+ - 1; mode=block
975588
+ X-Frame-Options:
975589
+ - SAMEORIGIN
975590
+ Strict-Transport-Security:
975591
+ - max-age=31536000
975592
+ X-Content-Type-Options:
975593
+ - nosniff
975594
+ Date:
975595
+ - Fri, 25 May 2018 15:55:29 GMT
975596
+ Content-Length:
975597
+ - '49'
975598
+ body:
975599
+ encoding: UTF-8
975600
+ string: '{"message":"Project not found or access denied."}'
975601
+ http_version:
975602
+ recorded_at: Fri, 25 May 2018 15:55:30 GMT
975603
+ - request:
975604
+ method: get
975605
+ uri: https://api.github.com/repos/how-is/example-empty-repository/commits?author=me@duckie.co&until=2016-12-01
975606
+ body:
975607
+ encoding: US-ASCII
975608
+ string: ''
975609
+ headers:
975610
+ Accept:
975611
+ - application/vnd.github.v3+json,application/vnd.github.beta+json;q=0.5,application/json;q=0.1
975612
+ Accept-Charset:
975613
+ - utf-8
975614
+ User-Agent:
975615
+ - Github API Ruby Gem 0.18.2
975616
+ Authorization:
975617
+ - Basic ZHVja2luYXRvcjo5MTgyNzc3ZmYzYzAwNjc5NTE5M2E1NzBjZGFjMzI2YjY0NDU5ZGM5
975618
+ Accept-Encoding:
975619
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
975620
+ response:
975621
+ status:
975622
+ code: 200
975623
+ message: OK
975624
+ headers:
975625
+ Server:
975626
+ - GitHub.com
975627
+ Date:
975628
+ - Fri, 15 Mar 2019 21:54:15 GMT
975629
+ Content-Type:
975630
+ - application/json; charset=utf-8
975631
+ Content-Length:
975632
+ - '2'
975633
+ Status:
975634
+ - 200 OK
975635
+ X-Ratelimit-Limit:
975636
+ - '5000'
975637
+ X-Ratelimit-Remaining:
975638
+ - '4300'
975639
+ X-Ratelimit-Reset:
975640
+ - '1552689075'
975641
+ Cache-Control:
975642
+ - private, max-age=60, s-maxage=60
975643
+ Vary:
975644
+ - Accept, Authorization, Cookie, X-GitHub-OTP
975645
+ Etag:
975646
+ - '"74b5718094ce8869d8149d99338cb4f8"'
975647
+ X-Oauth-Scopes:
975648
+ - ''
975649
+ X-Accepted-Oauth-Scopes:
975650
+ - ''
975651
+ X-Github-Media-Type:
975652
+ - github.v3; format=json
975653
+ Access-Control-Expose-Headers:
975654
+ - ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining,
975655
+ X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval,
975656
+ X-GitHub-Media-Type
975657
+ Access-Control-Allow-Origin:
975658
+ - "*"
975659
+ Strict-Transport-Security:
975660
+ - max-age=31536000; includeSubdomains; preload
975661
+ X-Frame-Options:
975662
+ - deny
975663
+ X-Content-Type-Options:
975664
+ - nosniff
975665
+ X-Xss-Protection:
975666
+ - 1; mode=block
975667
+ Referrer-Policy:
975668
+ - origin-when-cross-origin, strict-origin-when-cross-origin
975669
+ Content-Security-Policy:
975670
+ - default-src 'none'
975671
+ X-Github-Request-Id:
975672
+ - '0481:36F9:CA51E9:1C279AE:5C8C1F07'
975673
+ body:
975674
+ encoding: UTF-8
975675
+ string: "[]"
975676
+ http_version:
975677
+ recorded_at: Fri, 15 Mar 2019 21:54:15 GMT
975678
+ recorded_with: VCR 4.0.0