gruff 0.5.1 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.editorconfig +14 -0
- data/.github/ISSUE_TEMPLATE.md +18 -0
- data/.gitignore +3 -0
- data/.rubocop.yml +109 -0
- data/.rubocop_todo.yml +130 -0
- data/.travis.yml +24 -12
- data/.yardopts +1 -0
- data/{History.txt → CHANGELOG.md} +61 -25
- data/Gemfile +3 -7
- data/README.md +57 -25
- data/Rakefile +6 -201
- data/assets/plastik/blue.png +0 -0
- data/assets/plastik/green.png +0 -0
- data/assets/plastik/red.png +0 -0
- data/docker/Dockerfile +14 -0
- data/docker/build.sh +4 -0
- data/docker/launch.sh +4 -0
- data/gruff.gemspec +19 -14
- data/init.rb +2 -0
- data/lib/gruff.rb +26 -2
- data/lib/gruff/accumulator_bar.rb +18 -8
- data/lib/gruff/area.rb +33 -19
- data/lib/gruff/bar.rb +76 -45
- data/lib/gruff/base.rb +337 -613
- data/lib/gruff/bezier.rb +34 -19
- data/lib/gruff/bullet.rb +51 -62
- data/lib/gruff/dot.rb +38 -62
- data/lib/gruff/helper/bar_conversion.rb +47 -0
- data/lib/gruff/helper/bar_value_label_mixin.rb +30 -0
- data/lib/gruff/helper/stacked_mixin.rb +23 -0
- data/lib/gruff/histogram.rb +59 -0
- data/lib/gruff/line.rb +130 -150
- data/lib/gruff/mini/bar.rb +17 -10
- data/lib/gruff/mini/legend.rb +24 -36
- data/lib/gruff/mini/pie.rb +18 -12
- data/lib/gruff/mini/side_bar.rb +26 -12
- data/lib/gruff/net.rb +60 -84
- data/lib/gruff/patch/rmagick.rb +33 -0
- data/lib/gruff/patch/string.rb +10 -0
- data/lib/gruff/photo_bar.rb +27 -30
- data/lib/gruff/pie.rb +190 -93
- data/lib/gruff/renderer/bezier.rb +21 -0
- data/lib/gruff/renderer/circle.rb +21 -0
- data/lib/gruff/renderer/dash_line.rb +22 -0
- data/lib/gruff/renderer/dot.rb +39 -0
- data/lib/gruff/renderer/ellipse.rb +21 -0
- data/lib/gruff/renderer/line.rb +34 -0
- data/lib/gruff/renderer/polygon.rb +23 -0
- data/lib/gruff/renderer/polyline.rb +21 -0
- data/lib/gruff/renderer/rectangle.rb +19 -0
- data/lib/gruff/renderer/renderer.rb +127 -0
- data/lib/gruff/renderer/text.rb +42 -0
- data/lib/gruff/scatter.rb +156 -180
- data/lib/gruff/scene.rb +31 -41
- data/lib/gruff/side_bar.rb +77 -63
- data/lib/gruff/side_stacked_bar.rb +77 -60
- data/lib/gruff/spider.rb +37 -50
- data/lib/gruff/stacked_area.rb +32 -30
- data/lib/gruff/stacked_bar.rb +87 -49
- data/lib/gruff/store/base_data.rb +34 -0
- data/lib/gruff/store/custom_data.rb +34 -0
- data/lib/gruff/store/store.rb +80 -0
- data/lib/gruff/store/xy_data.rb +55 -0
- data/lib/gruff/themes.rb +32 -33
- data/lib/gruff/version.rb +3 -1
- metadata +99 -92
- data/Manifest.txt +0 -81
- data/RELEASE.md +0 -30
- data/assets/bubble.png +0 -0
- data/assets/city_scene/background/0000.png +0 -0
- data/assets/city_scene/background/0600.png +0 -0
- data/assets/city_scene/background/2000.png +0 -0
- data/assets/city_scene/clouds/cloudy.png +0 -0
- data/assets/city_scene/clouds/partly_cloudy.png +0 -0
- data/assets/city_scene/clouds/stormy.png +0 -0
- data/assets/city_scene/grass/default.png +0 -0
- data/assets/city_scene/haze/true.png +0 -0
- data/assets/city_scene/number_sample/1.png +0 -0
- data/assets/city_scene/number_sample/2.png +0 -0
- data/assets/city_scene/number_sample/default.png +0 -0
- data/assets/city_scene/sky/0000.png +0 -0
- data/assets/city_scene/sky/0200.png +0 -0
- data/assets/city_scene/sky/0400.png +0 -0
- data/assets/city_scene/sky/0600.png +0 -0
- data/assets/city_scene/sky/0800.png +0 -0
- data/assets/city_scene/sky/1000.png +0 -0
- data/assets/city_scene/sky/1200.png +0 -0
- data/assets/city_scene/sky/1400.png +0 -0
- data/assets/city_scene/sky/1500.png +0 -0
- data/assets/city_scene/sky/1700.png +0 -0
- data/assets/city_scene/sky/2000.png +0 -0
- data/assets/pc306715.jpg +0 -0
- data/lib/gruff/bar_conversion.rb +0 -46
- data/lib/gruff/deprecated.rb +0 -39
- data/lib/gruff/stacked_mixin.rb +0 -23
- data/test/gruff_test_case.rb +0 -154
- data/test/image_compare.rb +0 -58
- data/test/test_accumulator_bar.rb +0 -51
- data/test/test_area.rb +0 -134
- data/test/test_bar.rb +0 -505
- data/test/test_base.rb +0 -8
- data/test/test_bezier.rb +0 -33
- data/test/test_bullet.rb +0 -26
- data/test/test_dot.rb +0 -263
- data/test/test_legend.rb +0 -68
- data/test/test_line.rb +0 -657
- data/test/test_mini_bar.rb +0 -33
- data/test/test_mini_pie.rb +0 -25
- data/test/test_mini_side_bar.rb +0 -36
- data/test/test_net.rb +0 -231
- data/test/test_photo.rb +0 -41
- data/test/test_pie.rb +0 -154
- data/test/test_scatter.rb +0 -233
- data/test/test_scene.rb +0 -100
- data/test/test_side_bar.rb +0 -56
- data/test/test_sidestacked_bar.rb +0 -105
- data/test/test_spider.rb +0 -226
- data/test/test_stacked_area.rb +0 -52
- data/test/test_stacked_bar.rb +0 -52
data/Gemfile
CHANGED
@@ -1,10 +1,6 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
source 'https://rubygems.org'
|
2
4
|
|
3
5
|
# Specify your gem's dependencies in gruff.gemspec
|
4
6
|
gemspec
|
5
|
-
|
6
|
-
group :test do
|
7
|
-
if RUBY_VERSION =~ /^1\.9\./ || RUBY_VERSION =~ /^2\.0\./
|
8
|
-
gem 'minitest-reporters'
|
9
|
-
end
|
10
|
-
end
|
data/README.md
CHANGED
@@ -1,27 +1,36 @@
|
|
1
1
|
# Gruff Graphs
|
2
2
|
|
3
|
-
[![Build Status](https://travis-ci.org/topfunky/gruff.
|
4
|
-
[![Gem Version](https://badge.fury.io/rb/gruff.
|
3
|
+
[![Build Status](https://travis-ci.org/topfunky/gruff.svg?branch=master)](https://travis-ci.org/topfunky/gruff)
|
4
|
+
[![Gem Version](https://badge.fury.io/rb/gruff.svg)](https://badge.fury.io/rb/gruff)
|
5
5
|
|
6
6
|
A library for making beautiful graphs.
|
7
7
|
|
8
|
+
Built on top of [rmagick](https://github.com/rmagick/rmagick); see its web page
|
9
|
+
for a list of the system-level prerequisities (ImageMagick etc) and how to install them.
|
10
|
+
|
8
11
|
## Installation
|
9
12
|
|
10
13
|
Add this line to your application's Gemfile:
|
11
14
|
|
12
|
-
|
15
|
+
```sh
|
16
|
+
gem 'gruff'
|
17
|
+
```
|
13
18
|
|
14
19
|
And then execute:
|
15
20
|
|
16
|
-
|
21
|
+
```sh
|
22
|
+
$ bundle
|
23
|
+
```
|
17
24
|
|
18
25
|
Or install it yourself as:
|
19
26
|
|
20
|
-
|
27
|
+
```sh
|
28
|
+
$ gem install gruff
|
29
|
+
```
|
21
30
|
|
22
31
|
## Usage
|
23
32
|
|
24
|
-
```
|
33
|
+
```ruby
|
25
34
|
require 'gruff'
|
26
35
|
g = Gruff::Line.new
|
27
36
|
g.title = 'Wow! Look at this!'
|
@@ -40,83 +49,106 @@ g.write('exciting.png')
|
|
40
49
|
|
41
50
|
You can find many examples in the [test](https://github.com/topfunky/gruff/tree/master/test)
|
42
51
|
directory along with their resulting charts in the
|
43
|
-
[
|
44
|
-
|
45
|
-
You can find older examples here: http://nubyonrails.com/pages/gruff
|
52
|
+
[expected](https://github.com/topfunky/gruff/tree/master/test/expected) directory.
|
46
53
|
|
47
54
|
### Accumulator bar chart
|
48
55
|
|
49
|
-
![Accumulator bar chart](https://raw.github.com/topfunky/gruff/master/test/
|
56
|
+
![Accumulator bar chart](https://raw.github.com/topfunky/gruff/master/test/expected/accum_bar.png)
|
50
57
|
|
51
58
|
### Area chart
|
52
59
|
|
53
|
-
![Area chart](https://raw.github.com/topfunky/gruff/master/test/
|
60
|
+
![Area chart](https://raw.github.com/topfunky/gruff/master/test/expected/area_keynote.png)
|
54
61
|
|
55
62
|
### Bar chart
|
56
63
|
|
57
|
-
![Bar chart](https://raw.github.com/topfunky/gruff/master/test/
|
64
|
+
![Bar chart](https://raw.github.com/topfunky/gruff/master/test/expected/bar_rails_keynote.png)
|
58
65
|
|
59
66
|
### Bezier chart
|
60
67
|
|
61
68
|
In progress!
|
62
69
|
|
63
|
-
![Bezier chart](https://raw.github.com/topfunky/gruff/master/test/
|
70
|
+
![Bezier chart](https://raw.github.com/topfunky/gruff/master/test/expected/bezier_3.png)
|
64
71
|
|
65
72
|
### Bullet chart
|
66
73
|
|
67
74
|
In progress!
|
68
75
|
|
69
|
-
![Bullet chart](https://raw.github.com/topfunky/gruff/master/test/
|
76
|
+
![Bullet chart](https://raw.github.com/topfunky/gruff/master/test/expected/bullet_greyscale.png)
|
70
77
|
|
71
78
|
### Dot chart
|
72
79
|
|
73
|
-
![Dot chart](https://raw.github.com/topfunky/gruff/master/test/
|
80
|
+
![Dot chart](https://raw.github.com/topfunky/gruff/master/test/expected/dot.png)
|
74
81
|
|
75
82
|
### Line chart
|
76
83
|
|
77
|
-
![Line chart](https://raw.github.com/topfunky/gruff/master/test/
|
84
|
+
![Line chart](https://raw.github.com/topfunky/gruff/master/test/expected/line_theme_rails_keynote_.png)
|
78
85
|
|
79
86
|
### LineXY chart
|
80
87
|
|
81
|
-
![LineXY chart](https://raw.github.com/topfunky/gruff/master/test/
|
88
|
+
![LineXY chart](https://raw.github.com/topfunky/gruff/master/test/expected/line_xy.png)
|
82
89
|
|
83
90
|
### Net chart
|
84
91
|
|
85
|
-
![Net chart](https://raw.github.com/topfunky/gruff/master/test/
|
92
|
+
![Net chart](https://raw.github.com/topfunky/gruff/master/test/expected/net_wide_graph.png)
|
86
93
|
|
87
94
|
### Pie chart
|
88
95
|
|
89
|
-
![Pie chart](https://raw.github.com/topfunky/gruff/master/test/
|
96
|
+
![Pie chart](https://raw.github.com/topfunky/gruff/master/test/expected/pie_pastel.png)
|
90
97
|
|
91
98
|
### Scatter chart
|
92
99
|
|
93
|
-
![Scatter chart](https://raw.github.com/topfunky/gruff/master/test/
|
100
|
+
![Scatter chart](https://raw.github.com/topfunky/gruff/master/test/expected/scatter_basic.png)
|
94
101
|
|
95
102
|
### Side bar chart
|
96
103
|
|
97
|
-
![Side bar chart](https://raw.github.com/topfunky/gruff/master/test/
|
104
|
+
![Side bar chart](https://raw.github.com/topfunky/gruff/master/test/expected/side_bar.png)
|
98
105
|
|
99
106
|
### Side stacked bar chart
|
100
107
|
|
101
|
-
![Side stacked bar chart](https://raw.github.com/topfunky/gruff/master/test/
|
108
|
+
![Side stacked bar chart](https://raw.github.com/topfunky/gruff/master/test/expected/side_stacked_bar_keynote.png)
|
102
109
|
|
103
110
|
### Spider chart
|
104
111
|
|
105
|
-
![Spider chart](https://raw.github.com/topfunky/gruff/master/test/
|
112
|
+
![Spider chart](https://raw.github.com/topfunky/gruff/master/test/expected/spider_37signals.png)
|
106
113
|
|
107
114
|
### Stacked area chart
|
108
115
|
|
109
|
-
![Stacked area chart](https://raw.github.com/topfunky/gruff/master/test/
|
116
|
+
![Stacked area chart](https://raw.github.com/topfunky/gruff/master/test/expected/stacked_area_keynote.png)
|
110
117
|
|
111
118
|
### Stacked bar chart
|
112
119
|
|
113
|
-
![Stacked bar chart](https://raw.github.com/topfunky/gruff/master/test/
|
120
|
+
![Stacked bar chart](https://raw.github.com/topfunky/gruff/master/test/expected/stacked_bar_keynote.png)
|
121
|
+
|
122
|
+
### Histogram chart
|
123
|
+
|
124
|
+
![Histogram chart](https://raw.github.com/topfunky/gruff/master/test/expected/histogram.png)
|
114
125
|
|
115
126
|
|
116
127
|
## Documentation
|
117
128
|
|
118
129
|
http://www.rubydoc.info/github/topfunky/gruff/frames
|
119
130
|
|
131
|
+
## Supported Ruby Versions
|
132
|
+
|
133
|
+
We aim to support all Ruby implementations supporting Ruby language level 1.9.3
|
134
|
+
or later. Currently we are running CI for MRI, JRuby, and Rubinius.
|
135
|
+
|
136
|
+
## Development Setup
|
137
|
+
1. Build docker image
|
138
|
+
```sh
|
139
|
+
$ ./docker/build.sh
|
140
|
+
```
|
141
|
+
|
142
|
+
2. Launch docker image
|
143
|
+
```sh
|
144
|
+
$ ./docker/launch.sh
|
145
|
+
```
|
146
|
+
|
147
|
+
3. Run tests
|
148
|
+
```sh
|
149
|
+
$ bundle install
|
150
|
+
$ bundle exec rake
|
151
|
+
```
|
120
152
|
|
121
153
|
## Contributing
|
122
154
|
|
data/Rakefile
CHANGED
@@ -1,218 +1,23 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require 'bundler/gem_tasks'
|
3
4
|
require 'rake/testtask'
|
4
5
|
require 'rake/clean'
|
5
6
|
|
6
|
-
CLEAN
|
7
|
+
CLEAN.concat %w[pkg test/output/*]
|
7
8
|
|
8
9
|
desc 'Run tests'
|
9
|
-
task :
|
10
|
+
task default: :test
|
10
11
|
|
11
|
-
task :
|
12
|
+
task gem: :build
|
12
13
|
|
13
14
|
Rake::TestTask.new
|
14
15
|
|
15
16
|
namespace :test do
|
16
17
|
desc 'Run mini tests'
|
17
|
-
task :
|
18
|
+
task mini: :clean do
|
18
19
|
Dir['test/test_mini*'].each do |file|
|
19
20
|
system "ruby #{file}"
|
20
21
|
end
|
21
22
|
end
|
22
23
|
end
|
23
|
-
|
24
|
-
desc 'Generate release docs for a given milestone'
|
25
|
-
task :release_docs do
|
26
|
-
raise "\n This task requires Ruby 1.9 or newer to parse JSON as YAML.\n\n" if RUBY_VERSION == '1.8.7'
|
27
|
-
categories, grouped_issues, milestone, milestone_description, milestone_name = get_github_issues
|
28
|
-
|
29
|
-
puts '=' * 80
|
30
|
-
puts
|
31
|
-
release_doc = <<EOF
|
32
|
-
Subject: [ANN] Gruff #{milestone_name} released!
|
33
|
-
|
34
|
-
The Gruff team is pleased to announce the release of Gruff #{milestone_name}.
|
35
|
-
|
36
|
-
New in version #{milestone_name}:
|
37
|
-
|
38
|
-
#{milestone_description}
|
39
|
-
|
40
|
-
#{(categories.keys & grouped_issues.keys).map do |cat|
|
41
|
-
"#{cat}:\n
|
42
|
-
#{grouped_issues[cat].map { |i| wrap(%Q{* Issue ##{i['number']} #{i['title']}},2) }.join("\n")}
|
43
|
-
"
|
44
|
-
end.join("\n")}
|
45
|
-
You can find a complete list of issues here:
|
46
|
-
|
47
|
-
* https://github.com/topfunky/gruff/issues?state=closed&milestone=#{milestone}
|
48
|
-
|
49
|
-
|
50
|
-
Installation:
|
51
|
-
|
52
|
-
gem install gruff
|
53
|
-
|
54
|
-
You can find an introductory tutorial at
|
55
|
-
https://github.com/topfunky/gruff
|
56
|
-
|
57
|
-
Enjoy!
|
58
|
-
|
59
|
-
|
60
|
-
--
|
61
|
-
The Gruff Team
|
62
|
-
EOF
|
63
|
-
|
64
|
-
puts release_doc
|
65
|
-
puts
|
66
|
-
puts '=' * 80
|
67
|
-
|
68
|
-
unless Gem::Version.new(Gruff::VERSION).prerelease?
|
69
|
-
File.write('RELEASE.md', release_doc)
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
|
-
desc 'Fetch download stats form rubygems.org'
|
74
|
-
task :stats do
|
75
|
-
require 'time'
|
76
|
-
require 'date'
|
77
|
-
require 'rubygems'
|
78
|
-
require 'uri'
|
79
|
-
require 'net/http'
|
80
|
-
require 'net/https'
|
81
|
-
require 'openssl'
|
82
|
-
require 'yaml'
|
83
|
-
host = 'rubygems.org'
|
84
|
-
base_uri = "https://#{host}/api/v1"
|
85
|
-
https = Net::HTTP.new(host, 443)
|
86
|
-
https.use_ssl = true
|
87
|
-
https.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
88
|
-
|
89
|
-
counts_per_month = Hash.new { |h, k| h[k] = Hash.new { |mh, mk| mh[mk] = 0 } }
|
90
|
-
total = 0
|
91
|
-
|
92
|
-
%w{gruff}.each do |gem|
|
93
|
-
versions_uri = URI("#{base_uri}/versions/#{gem}.yaml")
|
94
|
-
req = Net::HTTP::Get.new(versions_uri.request_uri)
|
95
|
-
res = https.start { |http| http.request(req) }
|
96
|
-
versions = YAML.load(res.body).sort_by { |v| Gem::Version.new(v['number']) }
|
97
|
-
puts "\n#{gem}:\n#{versions.map { |v| "#{Time.parse(v['built_at']).strftime('%Y-%m-%d')} #{'%10s' % v['number']} #{v['downloads_count']}" }.join("\n")}"
|
98
|
-
|
99
|
-
versions.each do |v|
|
100
|
-
downloads_uri = URI("#{base_uri}/versions/#{gem}-#{v['number']}/downloads/search.yaml?from=#{Time.parse(v['built_at']).strftime('%Y-%m-%d')}&to=#{Date.today}")
|
101
|
-
req = Net::HTTP::Get.new(downloads_uri.request_uri)
|
102
|
-
res = https.start { |http| http.request(req) }
|
103
|
-
counts = YAML.load(res.body)
|
104
|
-
counts.delete_if { |date_str, count| count == 0 }
|
105
|
-
counts.each do |date_str, count|
|
106
|
-
date = Date.parse(date_str)
|
107
|
-
counts_per_month[date.year][date.month] += count
|
108
|
-
total += count
|
109
|
-
end
|
110
|
-
print '.'; STDOUT.flush
|
111
|
-
end
|
112
|
-
puts
|
113
|
-
end
|
114
|
-
|
115
|
-
puts "\nDownloads statistics per month:"
|
116
|
-
years = counts_per_month.keys
|
117
|
-
puts "\n #{years.map { |year| '%6s:' % year }.join(' ')}"
|
118
|
-
(1..12).each do |month|
|
119
|
-
print "#{'%2d' % month}:"
|
120
|
-
years.each do |year|
|
121
|
-
count = counts_per_month[year][month]
|
122
|
-
print count > 0 ? '%8d' % count : ' ' * 8
|
123
|
-
end
|
124
|
-
puts
|
125
|
-
end
|
126
|
-
|
127
|
-
puts "\nTotal: #{total}\n\n"
|
128
|
-
|
129
|
-
puts "\nRubyGems download statistics per month:"
|
130
|
-
years = counts_per_month.keys
|
131
|
-
puts ' ' + years.map { |year| '%-12s' % year }.join
|
132
|
-
(0..20).each do |l|
|
133
|
-
print (l % 10 == 0) ? '%4d' % ((20-l) * 100) : ' '
|
134
|
-
years.each do |year|
|
135
|
-
(1..12).each do |month|
|
136
|
-
count = counts_per_month[year][month]
|
137
|
-
if [year, month] == [Date.today.year, Date.today.month]
|
138
|
-
count *= (Date.new(Date.today.year, Date.today.month, -1).day.to_f / Date.today.day).to_i
|
139
|
-
end
|
140
|
-
print count > ((20-l) * 100) ? '*' : ' '
|
141
|
-
end
|
142
|
-
end
|
143
|
-
puts
|
144
|
-
end
|
145
|
-
puts ' ' + years.map { |year| '%-12s' % year }.join
|
146
|
-
|
147
|
-
puts "\nTotal: #{total}\n\n"
|
148
|
-
end
|
149
|
-
|
150
|
-
|
151
|
-
def get_github_issues
|
152
|
-
puts 'GitHub login:'
|
153
|
-
begin
|
154
|
-
require 'rubygems'
|
155
|
-
require 'highline/import'
|
156
|
-
user = ask('login : ') { |q| q.echo = true }
|
157
|
-
pass = ask('password: ') { |q| q.echo = '*' }
|
158
|
-
rescue Exception
|
159
|
-
print 'user name: '; user = STDIN.gets.chomp
|
160
|
-
print ' password: '; pass = STDIN.gets.chomp
|
161
|
-
end
|
162
|
-
require 'uri'
|
163
|
-
require 'net/http'
|
164
|
-
require 'net/https'
|
165
|
-
require 'openssl'
|
166
|
-
require 'yaml'
|
167
|
-
host = 'api.github.com'
|
168
|
-
base_uri = "https://#{host}/repos/topfunky/gruff"
|
169
|
-
https = Net::HTTP.new(host, 443)
|
170
|
-
https.use_ssl = true
|
171
|
-
https.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
172
|
-
|
173
|
-
milestone_uri = URI("#{base_uri}/milestones")
|
174
|
-
req = Net::HTTP::Get.new(milestone_uri.request_uri)
|
175
|
-
req.basic_auth(user, pass)
|
176
|
-
res = https.start { |http| http.request(req) }
|
177
|
-
milestones = YAML.load(res.body).sort_by { |i| Date.parse(i['due_on']) }
|
178
|
-
puts milestones.map { |m| "#{'%2d' % m['number']} #{m['title']}" }.join("\n")
|
179
|
-
|
180
|
-
if defined? ask
|
181
|
-
milestone = ask('milestone: ', Integer) { |q| q.echo = true }
|
182
|
-
else
|
183
|
-
print 'milestone: '; milestone = STDIN.gets.chomp
|
184
|
-
end
|
185
|
-
|
186
|
-
uri = URI("#{base_uri}/issues?milestone=#{milestone}&state=closed&per_page=1000")
|
187
|
-
req = Net::HTTP::Get.new(uri.request_uri)
|
188
|
-
req.basic_auth(user, pass)
|
189
|
-
res = https.start { |http| http.request(req) }
|
190
|
-
issues = YAML.load(res.body).sort_by { |i| i['number'] }
|
191
|
-
milestone_name = issues[0] ? issues[0]['milestone']['title'] : "No issues for milestone #{milestone}"
|
192
|
-
milestone_description = issues[0] ? issues[0]['milestone']['description'] : "No issues for milestone #{milestone}"
|
193
|
-
milestone_description = milestone_description.split("\r\n").map{|l|wrap l}.join("\r\n")
|
194
|
-
categories = {
|
195
|
-
'Features' => 'feature', 'Bugfixes' => 'bug', 'Support' => 'support',
|
196
|
-
'Documentation' => 'documentation', 'Pull requests' => nil,
|
197
|
-
'Internal' => 'internal', 'Rejected' => 'rejected', 'Other' => nil
|
198
|
-
}
|
199
|
-
grouped_issues = issues.group_by do |i|
|
200
|
-
labels = i['labels'].map { |l| l['name'] }
|
201
|
-
cat = nil
|
202
|
-
categories.each do |k, v|
|
203
|
-
if labels.include? v
|
204
|
-
cat = k
|
205
|
-
break
|
206
|
-
end
|
207
|
-
end
|
208
|
-
cat ||= i['pull_request'] && i['pull_request']['html_url'] && 'Pull requests'
|
209
|
-
cat ||= 'Other'
|
210
|
-
cat
|
211
|
-
end
|
212
|
-
return categories, grouped_issues, milestone, milestone_description, milestone_name
|
213
|
-
end
|
214
|
-
|
215
|
-
def wrap(string, indent = 0)
|
216
|
-
string.scan(/\S.{0,72}\S(?=\s|$)|\S+/).join("\n" + ' ' * indent)
|
217
|
-
end
|
218
|
-
|
data/assets/plastik/blue.png
CHANGED
Binary file
|
data/assets/plastik/green.png
CHANGED
Binary file
|
data/assets/plastik/red.png
CHANGED
Binary file
|
data/docker/Dockerfile
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
FROM ubuntu:18.04
|
2
|
+
|
3
|
+
RUN apt update && apt install -y gcc libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev \
|
4
|
+
libmagickwand-dev wget git pkg-config && \
|
5
|
+
wget https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.1.tar.gz && \
|
6
|
+
tar xvzf ruby-2.7.1.tar.gz && \
|
7
|
+
cd ruby-2.7.1 && \
|
8
|
+
./configure --prefix=/usr --disable-install-rdoc && \
|
9
|
+
make -j install && \
|
10
|
+
cd .. && rm -rf ruby-2.7.1 && \
|
11
|
+
gem install bundler -v 1.17.3 && \
|
12
|
+
/usr/bin/bundle config set --local path 'vendor/bundle'
|
13
|
+
|
14
|
+
WORKDIR /opt/gruff
|
data/docker/build.sh
ADDED
data/docker/launch.sh
ADDED
data/gruff.gemspec
CHANGED
@@ -1,33 +1,38 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
lib = File.expand_path('lib')
|
3
5
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
6
|
require 'date'
|
5
7
|
require 'gruff/version'
|
6
8
|
|
7
9
|
Gem::Specification.new do |s|
|
8
|
-
s.name =
|
10
|
+
s.name = 'gruff'
|
9
11
|
s.version = Gruff::VERSION
|
10
12
|
s.authors = ['Geoffrey Grosenbach', 'Uwe Kubosch']
|
11
13
|
s.date = Date.today.to_s
|
12
|
-
s.description =
|
13
|
-
s.email =
|
14
|
-
|
15
|
-
s.
|
16
|
-
|
17
|
-
s.
|
18
|
-
|
19
|
-
s.require_paths = %w(lib)
|
20
|
-
# s.rubyforge_project = %q{gruff}
|
21
|
-
s.summary = %q{Beautiful graphs for one or multiple datasets.}
|
14
|
+
s.description = 'Beautiful graphs for one or multiple datasets. Can be used on websites or in documents.'
|
15
|
+
s.email = 'boss@topfunky.com'
|
16
|
+
s.files = `git ls-files`.split($/).reject { |f| f =~ /^test/ }
|
17
|
+
s.homepage = 'https://github.com/topfunky/gruff'
|
18
|
+
s.require_paths = %w[lib]
|
19
|
+
s.summary = 'Beautiful graphs for one or multiple datasets.'
|
20
|
+
s.license = 'MIT'
|
22
21
|
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
23
22
|
s.executables = s.files.grep(%r{^bin/}).map { |f| File.basename(f) }
|
24
23
|
s.specification_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
24
|
+
|
25
25
|
if defined? JRUBY_VERSION
|
26
26
|
s.platform = 'java'
|
27
27
|
s.add_dependency 'rmagick4j'
|
28
28
|
else
|
29
29
|
s.add_dependency 'rmagick'
|
30
|
+
s.add_development_dependency 'rubocop', '~> 0.81.0'
|
30
31
|
end
|
31
|
-
s.
|
32
|
-
s.
|
32
|
+
s.add_dependency 'histogram'
|
33
|
+
s.required_ruby_version = '>= 1.9.3'
|
34
|
+
|
35
|
+
s.add_development_dependency 'rake'
|
36
|
+
s.add_development_dependency 'minitest-reporters'
|
37
|
+
s.add_development_dependency 'yard', '~> 0.9.25'
|
33
38
|
end
|