nova_git_stats 2.4.1 → 2.4.2

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
  SHA256:
3
- metadata.gz: b1996d0d582611faf605fd506c883aae035ed6fae7a79132c65ae5cd38b89556
4
- data.tar.gz: d14c12fcfeb98b89e5601fb7d308acaa974283aa854b55f69f18b61af92a9318
3
+ metadata.gz: ce15e1b60aa22dd74720e59cf5db6825ae48bb3bf33142b55413717e47c23233
4
+ data.tar.gz: 53f03d8888c3ae30bb15a8a1c2a21cc2f6a9d5de0c7ca0c8fcfdde0c935e166e
5
5
  SHA512:
6
- metadata.gz: fdb84a88af7f80f77aa0ada0d71a29104461fed0367bb79b4876d649b19bc0719c26bab0a85bf59b30c614b335d68f065879ecb713d3f4bcd6d76b1dff8ed1d2
7
- data.tar.gz: b86533d24e059ad0680b87d0e22a6b40e462c5f3e298420496f5c322171665bdfd4a84972dd80f4ee65288504f24c74cb2b76cbc0196c564ad3d147016c09433
6
+ metadata.gz: a913190d4e023315a6796bc4ce8ed324afe95c502d9abfe1d48cb8a699218cfc1639dc6b5dcff5bdcba3c006b90a038003484f21cd62fac0d460e8848f6dba07
7
+ data.tar.gz: b9f205474969fd8a00435151da1bde903334c26e9c638c7e4c99ee8d8c3e900ab90d690856b5b7e2e913854ab53453d80f04f4cb712d7fb945eb618c284e18ab
data/CHANGELOG.md CHANGED
@@ -2,7 +2,22 @@
2
2
 
3
3
  ## [master]
4
4
 
5
- [master]: https://github.com/mishina2228/nova_git_stats/compare/v2.4.1...master
5
+ [master]: https://github.com/mishina2228/nova_git_stats/compare/v2.4.2...master
6
+
7
+ ## [2.4.2]
8
+
9
+ [2.4.2]: https://github.com/mishina2228/nova_git_stats/compare/v2.4.1...v2.4.2
10
+
11
+ * Changes
12
+ * Add support for actionview 8
13
+ * Add support for activesupport 8
14
+ * Bugfixes
15
+ * Now templates are returned in alphabetical order
16
+ * `GitStats::StatsView::View#all_templates` should return all templates in alphabetical order.
17
+ * `Dir.[]` returns sorted results by default from Ruby 3.0, but earlier than 2.7 does not.
18
+ * refs:
19
+ * https://ruby-doc.org/core-2.7.6/Dir.html#method-c-5B-5D
20
+ * https://ruby-doc.org/core-3.0.4/Dir.html#method-c-5B-5D
6
21
 
7
22
  ## [2.4.1]
8
23
 
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # NovaGitStats
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/nova_git_stats.svg)](https://badge.fury.io/rb/nova_git_stats)
4
- ![CI](https://github.com/mishina2228/nova_git_stats/workflows/CI/badge.svg)
4
+ [![Test](https://github.com/mishina2228/nova_git_stats/actions/workflows/test.yml/badge.svg)](https://github.com/mishina2228/nova_git_stats/actions/workflows/test.yml)
5
5
  [![Documentation](https://img.shields.io/badge/docs-rubydoc.info-blue.svg)](https://rubydoc.info/gems/nova_git_stats)
6
6
  [![Maintainability](https://api.codeclimate.com/v1/badges/118cce63cc58fef4ae47/maintainability)](https://codeclimate.com/github/mishina2228/git_stats/maintainability)
7
7
  [![codecov](https://codecov.io/gh/mishina2228/nova_git_stats/branch/master/graph/badge.svg?token=532RLO5L7A)](https://codecov.io/gh/mishina2228/nova_git_stats)
@@ -13,30 +13,30 @@ It browses the repository and outputs html page with statistics.
13
13
 
14
14
  ## Examples
15
15
 
16
- * [Bootstrap](https://mishina2228.github.io/git_stats/bootstrap)
17
- * [Devise](https://mishina2228.github.io/git_stats/devise)
18
- * [DeviseInvitable](https://mishina2228.github.io/git_stats/devise_invitable)
19
- * [John](https://mishina2228.github.io/git_stats/john)
20
- * [jQuery](https://mishina2228.github.io/git_stats/jquery)
21
- * [Rails](https://mishina2228.github.io/git_stats/rails)
22
- * [React](https://mishina2228.github.io/git_stats/react)
23
- * [Vue](https://mishina2228.github.io/git_stats/vue)
16
+ * [Bootstrap](https://mishina2228.github.io/nova_git_stats_sample/bootstrap/)
17
+ * [Devise](https://mishina2228.github.io/nova_git_stats_sample/devise/)
18
+ * [DeviseInvitable](https://mishina2228.github.io/nova_git_stats_sample/devise_invitable/)
19
+ * [John](https://mishina2228.github.io/nova_git_stats_sample/john/)
20
+ * [jQuery](https://mishina2228.github.io/nova_git_stats_sample/jquery/)
21
+ * [Rails](https://mishina2228.github.io/nova_git_stats_sample/rails/)
22
+ * [React](https://mishina2228.github.io/nova_git_stats_sample/react/)
23
+ * [Vue](https://mishina2228.github.io/nova_git_stats_sample/vue/)
24
24
 
25
25
  ## Installation
26
26
 
27
27
  ### Existing ruby/gem environment
28
28
 
29
- $ gem install git_stats
29
+ $ gem install nova_git_stats
30
30
 
31
31
  ### debian stretch (9.*)
32
32
 
33
33
  # apt-get install ruby ruby-nokogiri ruby-nokogiri-diff ruby-nokogumbo
34
- # gem install git_stats
34
+ # gem install nova_git_stats
35
35
 
36
36
  ### Ubuntu
37
37
 
38
38
  $ sudo apt-get install ruby ruby-dev gcc zlib1g-dev make
39
- $ sudo gem install git_stats
39
+ $ sudo gem install nova_git_stats
40
40
 
41
41
  ## Prerequisites
42
42
 
data/lib/git_stats/cli.rb CHANGED
@@ -24,7 +24,7 @@ module GitStats
24
24
  def generate
25
25
  I18n.locale = options[:language]
26
26
  GitStats::Generator.new(options) do |g|
27
- g.add_command_observer { |command, _result| puts command.to_s } unless options[:silent]
27
+ g.add_command_observer { |command, _result| puts command } unless options[:silent]
28
28
  end.render_all
29
29
  end
30
30
 
@@ -5,7 +5,7 @@ module GitStats
5
5
  def parse(command, result)
6
6
  cmd, params = command.scan(/git (.*) (.*)/).first.map(&:split).flatten
7
7
  # TODO: params is not needed?
8
- send("parse_#{cmd.underscore}", result, params)
8
+ send(:"parse_#{cmd.underscore}", result, params)
9
9
  end
10
10
 
11
11
  def parse_shortlog(result, _params)
@@ -40,7 +40,7 @@ module GitStats
40
40
  end
41
41
 
42
42
  [:insertions, :deletions, :changed_lines].each do |method|
43
- define_method "total_#{method}_by_date" do
43
+ define_method :"total_#{method}_by_date" do
44
44
  sum = 0
45
45
  commits.map do |commit|
46
46
  sum += commit.short_stat.send(method)
@@ -48,7 +48,7 @@ module GitStats
48
48
  end
49
49
  end
50
50
 
51
- define_method "#{method}_by_date" do
51
+ define_method :"#{method}_by_date" do
52
52
  commits.group_by { |c| c.date.to_date }.map { |arr| [arr[0], arr[1].sum { |c| c.short_stat.send(method) }] }
53
53
  end
54
54
  end
@@ -25,7 +25,7 @@ module GitStats
25
25
  escaped_string = escape_characters_in_string(commit.repo.comment_string)
26
26
  command = "git show #{commit.sha} | " \
27
27
  "awk 'BEGIN {adds=0; dels=0} " \
28
- "{if ($0 ~ /^\\+#{escaped_string}/) adds++; if ($0 ~ /^\-#{escaped_string}/) dels++} " \
28
+ "{if ($0 ~ /^\\+#{escaped_string}/) adds++; if ($0 ~ /^-#{escaped_string}/) dels++} " \
29
29
  "END {print adds \" insertions \" dels \" deletes\"}'"
30
30
  stat_line = commit.repo.run(command).lines.to_a[0]
31
31
  if stat_line.blank?
@@ -13,7 +13,7 @@ module GitStats
13
13
  :files_count, :binary_files, :text_files, :lines_count, :comments_count, to: :last_commit
14
14
 
15
15
  def initialize(params)
16
- super(params)
16
+ super
17
17
  @path = File.expand_path(@path)
18
18
  @tree_path ||= '.'
19
19
  end
@@ -70,7 +70,7 @@ module GitStats
70
70
 
71
71
  # TODO: These methods are called from nowhere
72
72
  [:insertions, :deletions, :changed_lines].each do |method|
73
- define_method "#{method}_by_author" do |limit = 4|
73
+ define_method :"#{method}_by_author" do |limit = 4|
74
74
  (authors.map { |author| [author, author.send(method)] }.sort_by { |_author, lines| -lines }[0..limit]).to_h
75
75
  end
76
76
  end
@@ -5,7 +5,7 @@ module GitStats
5
5
  def initialize(params = {})
6
6
  raise "pass a Hash to initialize #{self.class}" unless params.is_a? Hash
7
7
 
8
- params.each { |k, v| instance_variable_set("@#{k}", v) }
8
+ params.each { |k, v| instance_variable_set(:"@#{k}", v) }
9
9
  end
10
10
  end
11
11
  end
@@ -11,11 +11,11 @@ module GitStats
11
11
  end
12
12
 
13
13
  [:commits_sum].each do |method|
14
- define_method "#{method}_by_author_by_date" do |authors = nil|
14
+ define_method :"#{method}_by_author_by_date" do |authors = nil|
15
15
  Chart.new do |f|
16
16
  authors ||= @authors.sort_by { |a| -a.send(method) }[0...AUTHORS_ON_CHART_LIMIT]
17
17
  f.multi_date_chart(
18
- data: authors.map { |a| {name: a.name, data: a.send("#{method}_by_date")} },
18
+ data: authors.map { |a| {name: a.name, data: a.send(:"#{method}_by_date")} },
19
19
  title: :lines_by_date.t,
20
20
  y_text: :lines.t
21
21
  )
@@ -24,21 +24,21 @@ module GitStats
24
24
  end
25
25
 
26
26
  [:insertions, :deletions, :changed_lines].each do |method|
27
- define_method "total_#{method}_by_author_by_date" do |authors = nil|
27
+ define_method :"total_#{method}_by_author_by_date" do |authors = nil|
28
28
  Chart.new do |f|
29
29
  authors ||= @authors.sort_by { |a| -a.send(method) }[0...AUTHORS_ON_CHART_LIMIT]
30
30
  f.multi_date_chart(
31
- data: authors.map { |a| {name: a.name, data: a.send("total_#{method}_by_date")} },
31
+ data: authors.map { |a| {name: a.name, data: a.send(:"total_#{method}_by_date")} },
32
32
  title: :lines_by_date.t,
33
33
  y_text: :lines.t
34
34
  )
35
35
  end
36
36
  end
37
37
 
38
- define_method "#{method}_by_author_by_date" do |author|
38
+ define_method :"#{method}_by_author_by_date" do |author|
39
39
  Chart.new do |f|
40
40
  f.date_column_chart(
41
- data: author.send("#{method}_by_date"),
41
+ data: author.send(:"#{method}_by_date"),
42
42
  title: :lines_by_date.t,
43
43
  y_text: :lines.t
44
44
  )
@@ -42,7 +42,7 @@ module GitStats
42
42
  end
43
43
 
44
44
  def all_templates(root = '')
45
- (Dir[GitStats.root.join("templates/#{root}**/[^_]*.haml")].map do |f|
45
+ (Dir[GitStats.root.join("templates/#{root}**/[^_]*.haml")].sort.map do |f|
46
46
  path = Pathname.new(f)
47
47
  path.relative_path_from(GitStats.root.join('templates')).sub_ext('').to_s
48
48
  end - %w(layout))
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GitStats
4
- VERSION = '2.4.1'
4
+ VERSION = '2.4.2'
5
5
 
6
6
  def self.version
7
7
  VERSION
@@ -7,5 +7,4 @@
7
7
  .tab-pane.active
8
8
  .page-header
9
9
  %h1.text-center= page.t
10
- - if page == :comments_by_date
11
- = high_stock('comments_by_date', charts.comments_by_date)
10
+ = high_stock('comments_by_date', charts.comments_by_date) if page == :comments_by_date
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nova_git_stats
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.1
4
+ version: 2.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomasz Gieniusz
8
8
  - mishina2228
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-10-09 00:00:00.000000000 Z
12
+ date: 2024-12-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionview
@@ -20,7 +20,7 @@ dependencies:
20
20
  version: '5.2'
21
21
  - - "<"
22
22
  - !ruby/object:Gem::Version
23
- version: '8.0'
23
+ version: '9.0'
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
@@ -30,7 +30,7 @@ dependencies:
30
30
  version: '5.2'
31
31
  - - "<"
32
32
  - !ruby/object:Gem::Version
33
- version: '8.0'
33
+ version: '9.0'
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: activesupport
36
36
  requirement: !ruby/object:Gem::Requirement
@@ -40,7 +40,7 @@ dependencies:
40
40
  version: '5.2'
41
41
  - - "<"
42
42
  - !ruby/object:Gem::Version
43
- version: '8.0'
43
+ version: '9.0'
44
44
  type: :runtime
45
45
  prerelease: false
46
46
  version_requirements: !ruby/object:Gem::Requirement
@@ -50,7 +50,7 @@ dependencies:
50
50
  version: '5.2'
51
51
  - - "<"
52
52
  - !ruby/object:Gem::Version
53
- version: '8.0'
53
+ version: '9.0'
54
54
  - !ruby/object:Gem::Dependency
55
55
  name: haml
56
56
  requirement: !ruby/object:Gem::Requirement
@@ -218,16 +218,16 @@ files:
218
218
  - templates/lines/by_date.haml
219
219
  - templates/lines/by_extension.haml
220
220
  - templates/static/index.html
221
- homepage: https://github.com/mishina2228/git_stats
221
+ homepage: https://github.com/mishina2228/nova_git_stats
222
222
  licenses:
223
223
  - MIT
224
224
  metadata:
225
- bug_tracker_uri: https://github.com/mishina2228/git_stats/issues
226
- changelog_uri: https://github.com/mishina2228/git_stats/blob/master/CHANGELOG.md
227
- homepage_uri: https://github.com/mishina2228/git_stats
225
+ bug_tracker_uri: https://github.com/mishina2228/nova_git_stats/issues
226
+ changelog_uri: https://github.com/mishina2228/nova_git_stats/blob/master/CHANGELOG.md
227
+ homepage_uri: https://github.com/mishina2228/nova_git_stats
228
228
  rubygems_mfa_required: 'true'
229
- source_code_uri: https://github.com/mishina2228/git_stats/tree/v2.4.1
230
- post_install_message:
229
+ source_code_uri: https://github.com/mishina2228/nova_git_stats/tree/v2.4.2
230
+ post_install_message:
231
231
  rdoc_options: []
232
232
  require_paths:
233
233
  - lib
@@ -242,8 +242,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
242
242
  - !ruby/object:Gem::Version
243
243
  version: '0'
244
244
  requirements: []
245
- rubygems_version: 3.3.7
246
- signing_key:
245
+ rubygems_version: 3.5.11
246
+ signing_key:
247
247
  specification_version: 4
248
248
  summary: HTML statistics generator from git repository
249
249
  test_files: []