githubchart 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.prospectus +11 -0
- data/CHANGELOG.md +4 -0
- data/README.md +4 -4
- data/bin/githubchart +5 -5
- data/circle.yml +12 -0
- data/githubchart.gemspec +6 -6
- data/lib/githubchart.rb +3 -3
- data/lib/githubchart/svg.rb +3 -3
- data/lib/githubchart/version.rb +1 -1
- data/spec/githubchart_spec.rb +3 -3
- data/spec/spec_helper.rb +7 -6
- metadata +18 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5b97eb7ceecad0e89eb0b4656223434f2f0ed4b8
|
4
|
+
data.tar.gz: 7c5d787fa39f84aa3e35d9ca4f41e1b987689fc9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a906582a33f89c0bbcd419d0d5fedb82137e3e917f3a5a0f20a9221756edbf8d88412e730b40ae963cc3a2fbd4d782ed1a4ba600d223e7fe0febe4e38643542c
|
7
|
+
data.tar.gz: f9078318fe62638941647021185aa404495dec8cd43e1c58bf3a742dba99f440d3974c45fc8415bf015eff2b4d05ac5a9d2ea11a18143b135f732b06f2c57c53
|
data/.prospectus
ADDED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -3,9 +3,9 @@ GithubChart
|
|
3
3
|
|
4
4
|
[![Gem Version](https://img.shields.io/gem/v/githubchart.svg)](https://rubygems.org/gems/githubchart)
|
5
5
|
[![Dependency Status](https://img.shields.io/gemnasium/akerl/githubchart.svg)](https://gemnasium.com/akerl/githubchart)
|
6
|
-
[![
|
7
|
-
[![Coverage Status](https://img.shields.io/
|
8
|
-
[![
|
6
|
+
[![Build Status](https://img.shields.io/circleci/project/akerl/githubchart.svg)](https://circleci.com/gh/akerl/githubchart)
|
7
|
+
[![Coverage Status](https://img.shields.io/codecov/c/github/akerl/githubchart.svg)](https://codecov.io/github/akerl/githubchart)
|
8
|
+
[![Code Quality](https://img.shields.io/codacy/e8ee7e2aba4c4a01b93d5c0493bef68b.svg)](https://www.codacy.com/app/akerl/githubchart)
|
9
9
|
[![MIT Licensed](https://img.shields.io/badge/license-MIT-green.svg)](https://tldrlegal.com/license/mit-license)
|
10
10
|
|
11
11
|
Generates an SVG of your Github contributions:
|
@@ -26,7 +26,7 @@ To modify the color scheme used, you can provide `-c SCHEME`. For example, `gith
|
|
26
26
|
|
27
27
|
### Hosted SVG
|
28
28
|
|
29
|
-
A hosted service for loading these SVGs was made by
|
29
|
+
A hosted service for loading these SVGs was made by [2016rshah](https://github.com/2016rshah): http://ghchart.rshah.org/ ([source code](https://github.com/2016rshah/githubchart-api))
|
30
30
|
|
31
31
|
## Installation
|
32
32
|
|
data/bin/githubchart
CHANGED
@@ -10,20 +10,20 @@ OptionParser.new do |opts|
|
|
10
10
|
opts.banner << 'Supported types: ' + GithubChart.supported.join(' ')
|
11
11
|
opts.on('-uUSER', '--user=USER', 'Specify GitHub user to graph') do |user|
|
12
12
|
if options.include? :input
|
13
|
-
|
13
|
+
raise 'The --user and --input flags are incompatible with each other.'
|
14
14
|
end
|
15
15
|
options[:user] = user
|
16
16
|
end
|
17
17
|
opts.on('-iFILE', '--input=FILE', 'Specify JSON file, - for stdin') do |input|
|
18
18
|
if options.include? :user
|
19
|
-
|
19
|
+
raise 'The --user and --input flags are incompatible with each other.'
|
20
20
|
end
|
21
21
|
|
22
22
|
if input.eql? '-'
|
23
|
-
|
23
|
+
raise 'No data provided on stdin' if STDIN.tty?
|
24
24
|
contents = STDIN.read
|
25
25
|
else
|
26
|
-
|
26
|
+
raise 'File does not exist' unless File.exist? input
|
27
27
|
contents = File.read input
|
28
28
|
end
|
29
29
|
|
@@ -39,7 +39,7 @@ OptionParser.new do |opts|
|
|
39
39
|
if GithubChart::COLOR_SCHEMES.include? scheme.to_sym
|
40
40
|
options[:colors] = scheme.to_sym
|
41
41
|
else
|
42
|
-
|
42
|
+
raise 'Unknown color scheme provided'
|
43
43
|
end
|
44
44
|
end
|
45
45
|
opts.on('-s', '--schemes', 'List known color schemes') do
|
data/circle.yml
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
dependencies:
|
2
|
+
override:
|
3
|
+
- 'rvm-exec 1.9.3-p551 bundle install'
|
4
|
+
- 'rvm-exec 2.0.0-p645 bundle install'
|
5
|
+
- 'rvm-exec 2.1.6 bundle install'
|
6
|
+
- 'rvm-exec 2.2.2 bundle install'
|
7
|
+
test:
|
8
|
+
override:
|
9
|
+
- 'rvm-exec 1.9.3-p551 bundle exec rake'
|
10
|
+
- 'rvm-exec 2.0.0-p645 bundle exec rake'
|
11
|
+
- 'rvm-exec 2.1.6 bundle exec rake'
|
12
|
+
- 'rvm-exec 2.2.2 bundle exec rake'
|
data/githubchart.gemspec
CHANGED
@@ -16,13 +16,13 @@ Gem::Specification.new do |s|
|
|
16
16
|
s.test_files = `git ls-files spec/*`.split
|
17
17
|
s.executables = ['githubchart']
|
18
18
|
|
19
|
-
s.add_runtime_dependency 'githubstats', '~> 1.
|
20
|
-
s.add_runtime_dependency 'svgplot', '~> 0.
|
19
|
+
s.add_runtime_dependency 'githubstats', '~> 1.2.0'
|
20
|
+
s.add_runtime_dependency 'svgplot', '~> 1.0.0'
|
21
21
|
|
22
|
-
s.add_development_dependency 'rubocop', '~> 0.
|
23
|
-
s.add_development_dependency 'rake', '~>
|
24
|
-
s.add_development_dependency '
|
25
|
-
s.add_development_dependency 'rspec', '~> 3.
|
22
|
+
s.add_development_dependency 'rubocop', '~> 0.40.0'
|
23
|
+
s.add_development_dependency 'rake', '~> 11.1.0'
|
24
|
+
s.add_development_dependency 'codecov', '~> 0.1.1'
|
25
|
+
s.add_development_dependency 'rspec', '~> 3.4.0'
|
26
26
|
s.add_development_dependency 'fuubar', '~> 2.0.0'
|
27
27
|
end
|
28
28
|
|
data/lib/githubchart.rb
CHANGED
@@ -42,7 +42,7 @@ module GithubChart
|
|
42
42
|
COLOR_SCHEMES = {
|
43
43
|
default: ['#eeeeee', '#d6e685', '#8cc665', '#44a340', '#1e6823'],
|
44
44
|
halloween: ['#EEEEEE', '#FFEE4A', '#FFC501', '#FE9600', '#03001C']
|
45
|
-
}
|
45
|
+
}.freeze
|
46
46
|
|
47
47
|
##
|
48
48
|
# Object for parsing and outputing Github stats data
|
@@ -81,8 +81,8 @@ class Integer
|
|
81
81
|
# Add ordinalize to simplify converting to spoken string
|
82
82
|
|
83
83
|
def ordinalize
|
84
|
-
return to_s if
|
85
|
-
return "#{self}th" if (11..13).
|
84
|
+
return to_s if zero?
|
85
|
+
return "#{self}th" if (11..13).cover?(abs % 100)
|
86
86
|
case abs % 10
|
87
87
|
when 1 then "#{self}st"
|
88
88
|
when 2 then "#{self}nd"
|
data/lib/githubchart/svg.rb
CHANGED
@@ -35,7 +35,7 @@ module GithubChart
|
|
35
35
|
:font => '9px Helvetica, arial, freesans, clean, sans-serif',
|
36
36
|
:'white-space' => 'nowrap',
|
37
37
|
:display => 'display'
|
38
|
-
}
|
38
|
+
}.freeze
|
39
39
|
|
40
40
|
##
|
41
41
|
# Define Style for month labels
|
@@ -46,7 +46,7 @@ module GithubChart
|
|
46
46
|
:font => '10px Helvetica, arial, freesans, clean, sans-serif',
|
47
47
|
:'white-space' => 'nowrap',
|
48
48
|
:display => 'block'
|
49
|
-
}
|
49
|
+
}.freeze
|
50
50
|
|
51
51
|
def svg_point_style(point)
|
52
52
|
{
|
@@ -71,7 +71,7 @@ module GithubChart
|
|
71
71
|
def svg_add_weekday(chart, point)
|
72
72
|
index = point.date.wday
|
73
73
|
letter = point.date.strftime('%a')[0]
|
74
|
-
style = SVG_WEEKDAY_STYLE.
|
74
|
+
style = SVG_WEEKDAY_STYLE.dup
|
75
75
|
style[:display] = 'none' unless [1, 3, 5].include? index
|
76
76
|
chart.text(4, 13 * index + 23, style: style) { raw letter }
|
77
77
|
end
|
data/lib/githubchart/version.rb
CHANGED
data/spec/githubchart_spec.rb
CHANGED
@@ -15,8 +15,8 @@ describe GithubChart do
|
|
15
15
|
|
16
16
|
describe '#supports?' do
|
17
17
|
it 'checks for type support' do
|
18
|
-
expect(GithubChart.supports?
|
19
|
-
expect(GithubChart.supports?
|
18
|
+
expect(GithubChart.supports?(:svg)).to be_truthy
|
19
|
+
expect(GithubChart.supports?(:fish)).to be_falsey
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
@@ -28,7 +28,7 @@ describe GithubChart do
|
|
28
28
|
expect(GithubChart.new(colors: [1, 2, 3, 4, 5]).colors.last).to eql 5
|
29
29
|
end
|
30
30
|
it 'lets you pass external data' do
|
31
|
-
data = JSON.parse(File.read
|
31
|
+
data = JSON.parse(File.read('spec/examples/input.json'))
|
32
32
|
expect(GithubChart.new(data: data).stats).to eql data
|
33
33
|
end
|
34
34
|
it 'creates a data object when not provided' do
|
data/spec/spec_helper.rb
CHANGED
@@ -1,9 +1,10 @@
|
|
1
|
-
|
2
|
-
require '
|
3
|
-
|
4
|
-
SimpleCov.formatter =
|
5
|
-
SimpleCov.start do
|
6
|
-
|
1
|
+
if ENV['CI'] == 'true'
|
2
|
+
require 'simplecov'
|
3
|
+
require 'codecov'
|
4
|
+
SimpleCov.formatter = SimpleCov::Formatter::Codecov
|
5
|
+
SimpleCov.start do
|
6
|
+
add_filter '/spec/'
|
7
|
+
end
|
7
8
|
end
|
8
9
|
|
9
10
|
require 'rspec'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: githubchart
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Les Aker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-05-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: githubstats
|
@@ -16,84 +16,84 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: 1.2.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.
|
26
|
+
version: 1.2.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: svgplot
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 1.0.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 1.0.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rubocop
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.
|
47
|
+
version: 0.40.0
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.
|
54
|
+
version: 0.40.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: 11.1.0
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: 11.1.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: codecov
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 0.
|
75
|
+
version: 0.1.1
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 0.
|
82
|
+
version: 0.1.1
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: rspec
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 3.
|
89
|
+
version: 3.4.0
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 3.
|
96
|
+
version: 3.4.0
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: fuubar
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -117,6 +117,7 @@ extensions: []
|
|
117
117
|
extra_rdoc_files: []
|
118
118
|
files:
|
119
119
|
- ".gitignore"
|
120
|
+
- ".prospectus"
|
120
121
|
- ".rspec"
|
121
122
|
- ".rubocop.yml"
|
122
123
|
- ".travis.yml"
|
@@ -126,6 +127,7 @@ files:
|
|
126
127
|
- README.md
|
127
128
|
- Rakefile
|
128
129
|
- bin/githubchart
|
130
|
+
- circle.yml
|
129
131
|
- examples/chart.svg
|
130
132
|
- examples/other_user.svg
|
131
133
|
- githubchart.gemspec
|
@@ -156,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
156
158
|
version: '0'
|
157
159
|
requirements: []
|
158
160
|
rubyforge_project:
|
159
|
-
rubygems_version: 2.
|
161
|
+
rubygems_version: 2.5.1
|
160
162
|
signing_key:
|
161
163
|
specification_version: 4
|
162
164
|
summary: Generate an SVG of Github contributions data
|