gruff 0.25.0 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 65feb5dbcbd853713080e3d0abe3afbd2f023fd3975541588989f6566a0596d5
4
- data.tar.gz: a99d0dea53b51b0066d01338502029e2b75a0a8c53ed22a537143fbb009d1ae8
3
+ metadata.gz: e3c04a6fc48f83e530a5a26a084a1f79993cbb7781e7b6b06ad7208ee205a787
4
+ data.tar.gz: 52cd0e2ef0f9f4f6a433e65a9c65cba9c7fb4420203ece2ccd461b876ad43042
5
5
  SHA512:
6
- metadata.gz: ac92183768c0a0921f49b525f003928f45bef16699c55a415c0aec95de7ef54e32351cfa509aac9b06184d41df513b0b4ca1e725809a39416fb37a4518726c16
7
- data.tar.gz: b1d5a8e374ba3ba75f03a6ce4195d14d708eed5bc912e1622f1232efa3c73ee3cc39f6f43d30bdd9ade4c514509e34c6aecb2ae5a12369638a58bfe6f219774c
6
+ metadata.gz: b41c3bcd833b9bbbf2e36541552015c0a714e51b79f168c8875e891ad7d51db5bc1b03438f1ce419c55fcc4b3299274c24f4e817d681b748a649222a8c92db88
7
+ data.tar.gz: f9c017e0264b608160d779526f3ddcd1a9daf129dbd55dbb0eb96193aa2902e5a6cd1c439cdd101c43686fac6fad4130bf0eab2d2ec226439a05df13e12ec07a
data/.editorconfig CHANGED
@@ -7,8 +7,8 @@ end_of_line = lf
7
7
  charset = utf-8
8
8
  trim_trailing_whitespace = true
9
9
  insert_final_newline = true
10
- indent_style = spaces
10
+ indent_style = space
11
11
  tab_width = 2
12
12
 
13
- [{*.{rb,yml,md}]
13
+ [*.{rb,yml,md}]
14
14
  indent_size = 2
@@ -0,0 +1,41 @@
1
+ name: Report
2
+ description: Create a report.
3
+ body:
4
+ - type: textarea
5
+ id: description
6
+ attributes:
7
+ label: Description
8
+ description: A description of the bug or feature.
9
+ validations:
10
+ required: true
11
+ - type: textarea
12
+ id: reproduce
13
+ attributes:
14
+ label: Steps to Reproduce
15
+ description: |
16
+ List of steps, sample code, failing test or link to a project that reproduces the behavior.
17
+ Make sure you place a stack trace inside a code (```) block to avoid linking unrelated issues.
18
+ validations:
19
+ required: true
20
+ - type: textarea
21
+ id: environment
22
+ attributes:
23
+ label: System Configuration
24
+ description: Tell us about the environment where you are experiencing the bug.
25
+ value: |
26
+ - ImageMagick version:
27
+ - RMagick version:
28
+ - Gruff version:
29
+ - Ruby version:
30
+ - Environment (Operating system, version and so on):
31
+ - Additional information:
32
+ render: markdown
33
+ validations:
34
+ required: true
35
+ - type: textarea
36
+ id: addtional-context
37
+ attributes:
38
+ label: Additional context
39
+ description: Add any other context about the problem here.
40
+ validations:
41
+ required: false
@@ -11,17 +11,33 @@ permissions:
11
11
 
12
12
  jobs:
13
13
  lint:
14
- runs-on: ubuntu-22.04
14
+ runs-on: ubuntu-24.04
15
15
  timeout-minutes: 20
16
- name: Lint
16
+ strategy:
17
+ matrix:
18
+ ruby-version: ['3.0']
19
+ imagemagick-version:
20
+ - { full: 7.1.1-33, major-minor: '7.1' }
21
+ name: Lint (Ruby ${{ matrix.ruby-version }}, ImageMagick ${{ matrix.imagemagick-version.major-minor }})
17
22
  steps:
18
23
  - uses: actions/checkout@v4
19
24
  with:
20
25
  ref: ${{ github.event.pull_request.head.sha }}
21
- - name: Set up Ruby 3.0
26
+ - name: Cache ImageMagick
27
+ uses: actions/cache@v4
28
+ with:
29
+ path: ./build-ImageMagick
30
+ key: v1-linux-imagemagick-${{ matrix.imagemagick-version.full }}
31
+ restore-keys: |
32
+ v1-linux-imagemagick-${{ matrix.imagemagick-version.full }}
33
+ - name: Install ImageMagick ${{ matrix.imagemagick-version.full }}
34
+ run: |
35
+ export IMAGEMAGICK_VERSION=${{ matrix.imagemagick-version.full }}
36
+ ./before_install_linux.sh
37
+ - name: Set up Ruby ${{ matrix.ruby-version }}
22
38
  uses: ruby/setup-ruby@master
23
39
  with:
24
- ruby-version: '3.0'
40
+ ruby-version: ${{ matrix.ruby-version }}
25
41
  bundler-cache: true
26
42
  - name: Install dependencies
27
43
  run: bundle install --path=vendor/bundle --jobs 4 --retry 3
@@ -31,13 +47,13 @@ jobs:
31
47
  run: bundle exec rubocop
32
48
 
33
49
  test-ruby:
34
- runs-on: ubuntu-22.04
50
+ runs-on: ubuntu-24.04
35
51
  timeout-minutes: 20
36
52
  strategy:
37
53
  matrix:
38
- ruby-version: ['3.0', '3.1', '3.2', '3.3']
54
+ ruby-version: ['3.0', '3.1', '3.2', '3.3', '3.4']
39
55
  imagemagick-version:
40
- - { full: 7.1.1-29, major-minor: '7.1' }
56
+ - { full: 7.1.1-33, major-minor: '7.1' }
41
57
  name: Ruby ${{ matrix.ruby-version }}
42
58
  steps:
43
59
  - uses: actions/checkout@v4
@@ -63,11 +79,11 @@ jobs:
63
79
  run: bundle exec rake
64
80
 
65
81
  test-jruby:
66
- runs-on: ubuntu-22.04
82
+ runs-on: ubuntu-24.04
67
83
  timeout-minutes: 20
68
84
  strategy:
69
85
  matrix:
70
- ruby-version: ['9.4.6.0']
86
+ ruby-version: ['9.4.7.0']
71
87
  name: JRuby ${{ matrix.ruby-version }}
72
88
  steps:
73
89
  - uses: actions/checkout@v4
data/.rubocop.yml CHANGED
@@ -1,4 +1,4 @@
1
- require:
1
+ plugins:
2
2
  - rubocop-minitest
3
3
  - rubocop-performance
4
4
  - rubocop-rake
@@ -9,6 +9,7 @@ AllCops:
9
9
  Exclude:
10
10
  - 'vendor/bundle/**/*'
11
11
  - 'rails_generators/gruff/**/*'
12
+ - 'build-ImageMagick/**/*'
12
13
 
13
14
  Metrics:
14
15
  Enabled: false
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Change Log
2
2
 
3
+ ## 0.26.0
4
+
5
+ - Allow customizing No Data font size (#642)
6
+
3
7
  ## 0.25.0
4
8
  - Add bigdecimal gem as dependency for Ruby 3.4
5
9
  - Update dependent RMagick version to 5.5.0 or later
data/Gemfile CHANGED
@@ -6,10 +6,10 @@ source 'https://rubygems.org'
6
6
  gemspec
7
7
 
8
8
  unless defined? JRUBY_VERSION
9
- gem 'rubocop', '~> 1.63.4'
10
- gem 'rubocop-minitest', '~> 0.35.0'
9
+ gem 'rubocop', '~> 1.66'
10
+ gem 'rubocop-minitest', '~> 0.36'
11
11
  gem 'rubocop-performance', '~> 1.21'
12
- gem 'rubocop-rake', '~> 0.6.0'
12
+ gem 'rubocop-rake', '~> 0.6'
13
13
  end
14
14
 
15
15
  gem 'minitest-reporters'
data/README.md CHANGED
@@ -144,8 +144,8 @@ http://www.rubydoc.info/github/topfunky/gruff/frames
144
144
 
145
145
  ## Supported Ruby Versions
146
146
 
147
- - Ruby 2.6 or later
148
- - JRuby 9.3.x or later
147
+ - Ruby 3.0 or later
148
+ - JRuby 9.4.x or later
149
149
 
150
150
  ## Development
151
151
  1. Build docker image
data/lib/gruff/base.rb CHANGED
@@ -182,6 +182,7 @@ module Gruff
182
182
  @title_font = Gruff::Font.new(size: 36.0, bold: true)
183
183
  @marker_font = Gruff::Font.new(size: 21.0)
184
184
  @legend_font = Gruff::Font.new(size: 20.0)
185
+ @no_data_font = Gruff::Font.new(size: 80.0)
185
186
 
186
187
  @label_margin = LABEL_MARGIN
187
188
  @top_margin = @bottom_margin = @left_margin = @right_margin = DEFAULT_MARGIN
@@ -283,6 +284,7 @@ module Gruff
283
284
  @title_font.path = font_path unless @title_font.path
284
285
  @marker_font.path = font_path
285
286
  @legend_font.path = font_path
287
+ @no_data_font.path = font_path
286
288
  end
287
289
 
288
290
  # Same as {#font=} but for the title.
@@ -320,6 +322,14 @@ module Gruff
320
322
  @legend_font.size = value
321
323
  end
322
324
 
325
+ # Set the font size of the no data message. Default is +80+.
326
+ #
327
+ # @param value [Numeric] no data font size
328
+ #
329
+ def no_data_font_size=(value)
330
+ @no_data_font.size = value
331
+ end
332
+
323
333
  # Specifies whether to draw the title bolded or not. Default is +true+.
324
334
  #
325
335
  # @param value [Boolean] specifies whether to draw the title bolded or not.
@@ -336,6 +346,7 @@ module Gruff
336
346
  @title_font.color = value
337
347
  @marker_font.color = value
338
348
  @legend_font.color = value
349
+ @no_data_font.color = value
339
350
  end
340
351
 
341
352
  # Add a color to the list of available colors for lines.
@@ -791,7 +802,7 @@ module Gruff
791
802
  # Draws column labels below graph, centered over x
792
803
  def draw_label(x, index, gravity = Magick::NorthGravity, &block)
793
804
  draw_unique_label(index) do
794
- if x >= @graph_left && x <= @graph_right
805
+ if x.between?(@graph_left, @graph_right)
795
806
  y = @graph_bottom
796
807
  x_offset, y_offset = calculate_label_offset(@marker_font, @labels[index], @label_margin, @label_rotation)
797
808
 
@@ -826,9 +837,7 @@ module Gruff
826
837
 
827
838
  # Shows an error message because you have no data.
828
839
  def draw_no_data
829
- font = @title_font.dup
830
- font.size = 80
831
- font.bold = false
840
+ font = @no_data_font
832
841
  text_renderer = Gruff::Renderer::Text.new(renderer, @no_data_message, font: font)
833
842
  text_renderer.render(@raw_columns, @raw_rows, 0, 0, Magick::CenterGravity)
834
843
  end
data/lib/gruff/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Gruff
4
- VERSION = '0.25.0'
4
+ VERSION = '0.26.0'
5
5
  end
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gruff
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.25.0
4
+ version: 0.26.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geoffrey Grosenbach
8
8
  - Uwe Kubosch
9
- autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2024-05-09 00:00:00.000000000 Z
11
+ date: 1980-01-02 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rmagick
@@ -63,6 +62,7 @@ files:
63
62
  - ".devcontainer/devcontainer.json"
64
63
  - ".editorconfig"
65
64
  - ".github/ISSUE_TEMPLATE.md"
65
+ - ".github/ISSUE_TEMPLATE/report.yml"
66
66
  - ".github/workflows/ci.yml"
67
67
  - ".gitignore"
68
68
  - ".rubocop.yml"
@@ -135,7 +135,6 @@ metadata:
135
135
  bug_tracker_uri: https://github.com/topfunky/gruff/issues
136
136
  changelog_uri: https://github.com/topfunky/gruff/blob/master/CHANGELOG.md
137
137
  rubygems_mfa_required: 'true'
138
- post_install_message:
139
138
  rdoc_options: []
140
139
  require_paths:
141
140
  - lib
@@ -150,8 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
150
149
  - !ruby/object:Gem::Version
151
150
  version: '0'
152
151
  requirements: []
153
- rubygems_version: 3.5.9
154
- signing_key:
152
+ rubygems_version: 3.6.7
155
153
  specification_version: 4
156
154
  summary: Beautiful graphs for one or multiple datasets.
157
155
  test_files: []