gruff 0.6.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. checksums.yaml +5 -5
  2. data/.editorconfig +14 -0
  3. data/.github/ISSUE_TEMPLATE.md +18 -0
  4. data/.gitignore +3 -0
  5. data/.rubocop.yml +109 -0
  6. data/.rubocop_todo.yml +112 -0
  7. data/.travis.yml +24 -15
  8. data/.yardopts +1 -0
  9. data/{History.txt → CHANGELOG.md} +72 -25
  10. data/Gemfile +3 -7
  11. data/README.md +57 -25
  12. data/Rakefile +21 -192
  13. data/assets/plastik/blue.png +0 -0
  14. data/assets/plastik/green.png +0 -0
  15. data/assets/plastik/red.png +0 -0
  16. data/docker/Dockerfile +14 -0
  17. data/docker/build.sh +4 -0
  18. data/docker/launch.sh +4 -0
  19. data/gruff.gemspec +21 -13
  20. data/init.rb +2 -0
  21. data/lib/gruff.rb +26 -2
  22. data/lib/gruff/accumulator_bar.rb +18 -8
  23. data/lib/gruff/area.rb +33 -19
  24. data/lib/gruff/bar.rb +76 -45
  25. data/lib/gruff/base.rb +435 -704
  26. data/lib/gruff/bezier.rb +32 -17
  27. data/lib/gruff/bullet.rb +62 -68
  28. data/lib/gruff/dot.rb +38 -82
  29. data/lib/gruff/helper/bar_conversion.rb +47 -0
  30. data/lib/gruff/helper/bar_value_label_mixin.rb +30 -0
  31. data/lib/gruff/helper/stacked_mixin.rb +23 -0
  32. data/lib/gruff/histogram.rb +60 -0
  33. data/lib/gruff/line.rb +134 -170
  34. data/lib/gruff/mini/bar.rb +17 -10
  35. data/lib/gruff/mini/legend.rb +24 -36
  36. data/lib/gruff/mini/pie.rb +18 -12
  37. data/lib/gruff/mini/side_bar.rb +26 -12
  38. data/lib/gruff/net.rb +68 -81
  39. data/lib/gruff/patch/rmagick.rb +33 -0
  40. data/lib/gruff/patch/string.rb +10 -0
  41. data/lib/gruff/photo_bar.rb +39 -42
  42. data/lib/gruff/pie.rb +180 -89
  43. data/lib/gruff/renderer/bezier.rb +21 -0
  44. data/lib/gruff/renderer/circle.rb +21 -0
  45. data/lib/gruff/renderer/dash_line.rb +22 -0
  46. data/lib/gruff/renderer/dot.rb +39 -0
  47. data/lib/gruff/renderer/ellipse.rb +21 -0
  48. data/lib/gruff/renderer/line.rb +42 -0
  49. data/lib/gruff/renderer/polygon.rb +23 -0
  50. data/lib/gruff/renderer/polyline.rb +21 -0
  51. data/lib/gruff/renderer/rectangle.rb +19 -0
  52. data/lib/gruff/renderer/renderer.rb +132 -0
  53. data/lib/gruff/renderer/text.rb +53 -0
  54. data/lib/gruff/scatter.rb +163 -182
  55. data/lib/gruff/scene.rb +31 -41
  56. data/lib/gruff/side_bar.rb +81 -65
  57. data/lib/gruff/side_stacked_bar.rb +78 -62
  58. data/lib/gruff/spider.rb +49 -57
  59. data/lib/gruff/stacked_area.rb +40 -32
  60. data/lib/gruff/stacked_bar.rb +86 -53
  61. data/lib/gruff/store/base_data.rb +38 -0
  62. data/lib/gruff/store/custom_data.rb +38 -0
  63. data/lib/gruff/store/store.rb +80 -0
  64. data/lib/gruff/store/xy_data.rb +59 -0
  65. data/lib/gruff/themes.rb +32 -33
  66. data/lib/gruff/version.rb +3 -1
  67. metadata +80 -89
  68. data/Manifest.txt +0 -81
  69. data/RELEASE.md +0 -30
  70. data/assets/bubble.png +0 -0
  71. data/assets/city_scene/background/0000.png +0 -0
  72. data/assets/city_scene/background/0600.png +0 -0
  73. data/assets/city_scene/background/2000.png +0 -0
  74. data/assets/city_scene/clouds/cloudy.png +0 -0
  75. data/assets/city_scene/clouds/partly_cloudy.png +0 -0
  76. data/assets/city_scene/clouds/stormy.png +0 -0
  77. data/assets/city_scene/grass/default.png +0 -0
  78. data/assets/city_scene/haze/true.png +0 -0
  79. data/assets/city_scene/number_sample/1.png +0 -0
  80. data/assets/city_scene/number_sample/2.png +0 -0
  81. data/assets/city_scene/number_sample/default.png +0 -0
  82. data/assets/city_scene/sky/0000.png +0 -0
  83. data/assets/city_scene/sky/0200.png +0 -0
  84. data/assets/city_scene/sky/0400.png +0 -0
  85. data/assets/city_scene/sky/0600.png +0 -0
  86. data/assets/city_scene/sky/0800.png +0 -0
  87. data/assets/city_scene/sky/1000.png +0 -0
  88. data/assets/city_scene/sky/1200.png +0 -0
  89. data/assets/city_scene/sky/1400.png +0 -0
  90. data/assets/city_scene/sky/1500.png +0 -0
  91. data/assets/city_scene/sky/1700.png +0 -0
  92. data/assets/city_scene/sky/2000.png +0 -0
  93. data/assets/pc306715.jpg +0 -0
  94. data/lib/gruff/bar_conversion.rb +0 -46
  95. data/lib/gruff/deprecated.rb +0 -39
  96. data/lib/gruff/stacked_mixin.rb +0 -23
  97. data/test/gruff_test_case.rb +0 -154
  98. data/test/image_compare.rb +0 -58
  99. data/test/test_accumulator_bar.rb +0 -51
  100. data/test/test_area.rb +0 -134
  101. data/test/test_bar.rb +0 -505
  102. data/test/test_base.rb +0 -8
  103. data/test/test_bezier.rb +0 -33
  104. data/test/test_bullet.rb +0 -26
  105. data/test/test_dot.rb +0 -263
  106. data/test/test_labels_for_null_data.rb +0 -27
  107. data/test/test_legend.rb +0 -68
  108. data/test/test_line.rb +0 -657
  109. data/test/test_mini_bar.rb +0 -33
  110. data/test/test_mini_pie.rb +0 -25
  111. data/test/test_mini_side_bar.rb +0 -36
  112. data/test/test_net.rb +0 -231
  113. data/test/test_photo.rb +0 -41
  114. data/test/test_pie.rb +0 -161
  115. data/test/test_scatter.rb +0 -233
  116. data/test/test_scene.rb +0 -100
  117. data/test/test_side_bar.rb +0 -56
  118. data/test/test_sidestacked_bar.rb +0 -105
  119. data/test/test_spider.rb +0 -226
  120. data/test/test_stacked_area.rb +0 -52
  121. data/test/test_stacked_bar.rb +0 -68
data/Gemfile CHANGED
@@ -1,10 +1,6 @@
1
- source 'http://rubygems.org'
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\./
8
- gem 'minitest-reporters', '<1.0.0'
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.png?branch=master)](https://travis-ci.org/topfunky/gruff)
4
- [![Gem Version](https://badge.fury.io/rb/gruff.png)](http://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
- gem 'gruff'
15
+ ```sh
16
+ gem 'gruff'
17
+ ```
13
18
 
14
19
  And then execute:
15
20
 
16
- $ bundle
21
+ ```sh
22
+ $ bundle
23
+ ```
17
24
 
18
25
  Or install it yourself as:
19
26
 
20
- $ gem install gruff
27
+ ```sh
28
+ $ gem install gruff
29
+ ```
21
30
 
22
31
  ## Usage
23
32
 
24
- ```Ruby
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
- [output](https://github.com/topfunky/gruff/tree/master/test/output) directory.
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/output/accum_bar.png)
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/output/area_keynote.png)
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/output/bar_rails_keynote.png)
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/output/bezier_3.png)
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/output/bullet_greyscale.png)
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/output/dot.png)
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/output/line_theme_rails_keynote_.png)
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/output/line_xy.png)
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/output/net_wide_graph.png)
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/output/pie_pastel.png)
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/output/scatter_basic.png)
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/output/side_bar.png)
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/output/side_stacked_bar_keynote.png)
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/output/spider_37signals.png)
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/output/stacked_area_keynote.png)
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/output/stacked_bar_keynote.png)
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,47 @@
1
- require 'rubygems'
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 << %w(pkg test/output/*)
7
+ CLEAN.concat %w[pkg test/output/*]
7
8
 
8
9
  desc 'Run tests'
9
- task :default => :test
10
+ task default: :test
10
11
 
11
- task :gem => :build
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 :mini => :clean do
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
- 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
23
 
89
- counts_per_month = Hash.new { |h, k| h[k] = Hash.new { |mh, mk| mh[mk] = 0 } }
90
- total = 0
24
+ desc 'Update expected image with output'
25
+ task :"image:update" do
26
+ require 'rmagick'
27
+ require 'fileutils'
91
28
 
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")}"
29
+ update_expected_images = lambda do |expect_dir, output_dir|
30
+ Dir.glob("#{output_dir}/*.png") do |output_path|
31
+ file_name = File.basename(output_path)
32
+ expected_path = "#{expect_dir}/#{file_name}"
98
33
 
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
34
+ expected_image = Magick::Image.read(expected_path).first
35
+ output_image = Magick::Image.read(output_path).first
36
+ _, error = expected_image.compare_channel(output_image, Magick::PeakAbsoluteErrorMetric)
126
37
 
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
38
+ if error != 0.0
39
+ FileUtils.copy(output_path, expected_path)
139
40
  end
140
- print count > ((20-l) * 100) ? '*' : ' '
141
41
  end
142
42
  end
143
- puts
144
- end
145
- puts ' ' + years.map { |year| '%-12s' % year }.join
146
-
147
- puts "\nTotal: #{total}\n\n"
148
- end
149
-
150
43
 
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
44
+ update_expected_images.call('test/expected', 'test/output')
45
+ update_expected_images.call('test/expected_java', 'test/output_java')
161
46
  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
47
  end
214
-
215
- def wrap(string, indent = 0)
216
- string.scan(/\S.{0,72}\S(?=\s|$)|\S+/).join("\n" + ' ' * indent)
217
- end
218
-
Binary file
Binary file
Binary file
@@ -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
@@ -0,0 +1,4 @@
1
+ #!/bin/bash
2
+
3
+ script_dir=$(cd $(dirname ${BASH_SOURCE:-$0}); pwd)
4
+ docker build -t gruff ${script_dir}
@@ -0,0 +1,4 @@
1
+ #!/bin/bash
2
+
3
+ prject_dir="$(cd $(dirname ${BASH_SOURCE:-$0}); pwd)/.."
4
+ docker run -v $prject_dir:/opt/gruff --rm -it gruff bash