githubchart 0.0.4 → 0.0.5

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
  SHA1:
3
- metadata.gz: 2508152bbf1729a5470fa92be644742658c49311
4
- data.tar.gz: 295999d47b7f4e0236bd1677742305475003b028
3
+ metadata.gz: b0b4acb9c99bd3d2114742101ccf8891a0183754
4
+ data.tar.gz: a78455803cf4ca8a3f3f9f9624858a6750a93807
5
5
  SHA512:
6
- metadata.gz: d4a29711557847b8891df0017954ce77310d62caff893bec26516b50ec8a106cc36c9090cff4c87fc4276a6f3de2970401a25942682b2fcb377d42a27a91837e
7
- data.tar.gz: 373e8a1d09cf426ed5442d09891cadc16939df098a3eb191fc1826f0c3a7bf36d167044d072006227b4778cc2502b5d331f153012a9de4bbe5b04ef5fbb23605
6
+ metadata.gz: 13bcc0b1e98b456c527680cd234a184bcd7a5780da4dc82188ea2ede5961b8ec7f33e094bdafa73bd14e08b089a6427c61efdb420ba20cf4442a2e2b418f378a
7
+ data.tar.gz: 22b4fc2ff8ea121c5cd4d50e2889fbd9b4f3bb2add321331d9d379aec244c68e6e1d0913c255381ec6bf534abb2459d1f49e53b654e5b808e3cf5691dd3f5563
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- githubchart (0.0.3)
4
+ githubchart (0.0.5)
5
5
  githubstats
6
6
  rasem
7
7
 
@@ -9,7 +9,7 @@ GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
11
  ast (1.1.0)
12
- basiccache (0.0.25)
12
+ basiccache (0.0.26)
13
13
  coveralls (0.7.0)
14
14
  multi_json (~> 1.3)
15
15
  rest-client
@@ -19,11 +19,10 @@ GEM
19
19
  curb (0.8.5)
20
20
  diff-lcs (1.2.5)
21
21
  docile (1.1.1)
22
- fuubar (1.2.1)
23
- rspec (~> 2.0)
24
- rspec-instafail (~> 0.2.0)
25
- ruby-progressbar (~> 1.0)
26
- githubstats (0.2.4)
22
+ fuubar (1.3.2)
23
+ rspec (>= 2.14.0, < 3.1.0)
24
+ ruby-progressbar (~> 1.3)
25
+ githubstats (0.2.5)
27
26
  basiccache (< 2)
28
27
  curb
29
28
  json
@@ -31,12 +30,12 @@ GEM
31
30
  json (1.8.1)
32
31
  mime-types (2.0)
33
32
  multi_json (1.8.2)
34
- parser (2.1.0.pre2)
33
+ parser (2.1.1)
35
34
  ast (~> 1.1)
36
35
  slop (~> 3.4, >= 3.4.5)
37
36
  powerpack (0.0.9)
38
37
  rainbow (1.1.4)
39
- rake (10.1.0)
38
+ rake (10.1.1)
40
39
  rasem (0.6.1)
41
40
  rest-client (1.6.7)
42
41
  mime-types (>= 1.16)
@@ -47,13 +46,12 @@ GEM
47
46
  rspec-core (2.14.7)
48
47
  rspec-expectations (2.14.4)
49
48
  diff-lcs (>= 1.1.3, < 2.0)
50
- rspec-instafail (0.2.4)
51
49
  rspec-mocks (2.14.4)
52
- rubocop (0.15.0)
53
- parser (~> 2.0)
50
+ rubocop (0.16.0)
51
+ parser (~> 2.1)
54
52
  powerpack (~> 0.0.6)
55
53
  rainbow (>= 1.1.4)
56
- ruby-progressbar (1.2.0)
54
+ ruby-progressbar (1.3.2)
57
55
  simplecov (0.8.2)
58
56
  docile (~> 1.1.0)
59
57
  multi_json
@@ -74,7 +72,7 @@ DEPENDENCIES
74
72
  coveralls
75
73
  fuubar
76
74
  githubchart!
77
- parser (~> 2.1.0.pre1)
75
+ parser
78
76
  rake
79
77
  rspec
80
78
  rubocop
data/Rakefile CHANGED
@@ -2,6 +2,11 @@ require 'bundler/gem_tasks'
2
2
  require 'rspec/core/rake_task'
3
3
  require 'rubocop/rake_task'
4
4
 
5
+ desc 'Update bundle'
6
+ task :bundle do
7
+ `bundle update`
8
+ end
9
+
5
10
  desc 'Run tests'
6
11
  RSpec::Core::RakeTask.new(:spec)
7
12
 
@@ -17,3 +22,4 @@ task :travislint do
17
22
  end
18
23
 
19
24
  task default: [:spec, :travislint, :rubocop, :build, :install]
25
+ task release: [:bundle]
data/githubchart.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'githubchart'
3
- s.version = '0.0.4'
3
+ s.version = '0.0.5'
4
4
  s.date = Time.now.strftime("%Y-%m-%d")
5
5
  s.summary = 'Generate an SVG of Github contributions data'
6
6
  s.description = "Uses GithubStats to grab Github contributions scores and converts that into an SVG"
@@ -22,6 +22,6 @@ Gem::Specification.new do |s|
22
22
  s.add_development_dependency 'coveralls'
23
23
  s.add_development_dependency 'rspec'
24
24
  s.add_development_dependency 'fuubar'
25
- s.add_development_dependency 'parser', '~> 2.1.0.pre1'
25
+ s.add_development_dependency 'parser'
26
26
  end
27
27
 
data/lib/githubchart.rb CHANGED
@@ -58,7 +58,7 @@ module GithubChart
58
58
  def initialize(params = {})
59
59
  params = { username: params } unless params.is_a? Hash
60
60
  @stats = GithubStats.new(params[:username])
61
- @colors = params['colors'] || GithubChart::COLORS
61
+ @colors = params[:colors] || GithubChart::COLORS
62
62
  end
63
63
 
64
64
  private
@@ -81,7 +81,7 @@ class ::Integer
81
81
  # Add ordinalize to simplify converting to spoken string
82
82
 
83
83
  def ordinalize
84
- return self if self == 0
84
+ return to_s if self == 0
85
85
  return "#{self}th" if (11..13).include?(abs % 100)
86
86
  case abs % 10
87
87
  when 1 then "#{self}st"
@@ -0,0 +1,21 @@
1
+ require 'spec_helper'
2
+ require 'tempfile'
3
+
4
+ describe GithubChart::Chart do
5
+ let(:svg) { GithubChart.new.svg }
6
+
7
+ before(:all) do
8
+ @file = Tempfile.new('svg')
9
+ @file.write(GithubChart.new.svg)
10
+ @path = @file.path
11
+ @file.close
12
+ end
13
+
14
+ after(:all) { @file.unlink }
15
+
16
+ describe '.svg' do
17
+ it 'makes an SVG' do
18
+ expect(`file #{@path}`).to include('Scalable Vector Graphic')
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,51 @@
1
+ require 'spec_helper'
2
+
3
+ describe GithubChart do
4
+ describe '.new' do
5
+ it 'creates a new Chart object' do
6
+ expect(GithubChart.new).to be_an_instance_of GithubChart::Chart
7
+ end
8
+ end
9
+
10
+ describe '.supported' do
11
+ it 'lists supported types' do
12
+ expect(GithubChart.supported).to include(:svg)
13
+ end
14
+ end
15
+
16
+ describe '.supports?' do
17
+ it 'checks for type support' do
18
+ expect(GithubChart.supports? :svg).to be_true
19
+ expect(GithubChart.supports? :fish).to be_false
20
+ end
21
+ end
22
+
23
+ describe GithubChart::Chart do
24
+ it 'has default colors' do
25
+ expect(GithubChart.new.colors.last).to eql '#1e6823'
26
+ end
27
+ it 'lets you override the colors' do
28
+ expect(GithubChart.new(colors: [1, 2, 3, 4, 5]).colors.last).to eql 5
29
+ end
30
+ it 'lets you override the username' do
31
+ expect(GithubChart.new(username: 'fly').stats.name).to eql 'fly'
32
+ end
33
+ end
34
+ end
35
+
36
+ describe ::Integer do
37
+ describe '.ordinalize' do
38
+ it 'returns a spoken string for a number' do
39
+ [
40
+ [0, '0'],
41
+ [13, '13th'],
42
+ [21, '21st'],
43
+ [32, '32nd'],
44
+ [43, '43rd'],
45
+ [54, '54th']
46
+ ].each do |i, o|
47
+ expect(i.ordinalize).to eql o
48
+ end
49
+ end
50
+ end
51
+ end
Binary file
Binary file
Binary file
Binary file
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: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Les Aker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-04 00:00:00.000000000 Z
11
+ date: 2013-12-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: githubstats
@@ -126,16 +126,16 @@ dependencies:
126
126
  name: parser
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - "~>"
129
+ - - ">="
130
130
  - !ruby/object:Gem::Version
131
- version: 2.1.0.pre1
131
+ version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - "~>"
136
+ - - ">="
137
137
  - !ruby/object:Gem::Version
138
- version: 2.1.0.pre1
138
+ version: '0'
139
139
  description: Uses GithubStats to grab Github contributions scores and converts that
140
140
  into an SVG
141
141
  email: me@lesaker.org
@@ -159,32 +159,33 @@ files:
159
159
  - githubchart.gemspec
160
160
  - lib/githubchart.rb
161
161
  - lib/githubchart/svg.rb
162
+ - spec/githubchart/svg_spec.rb
163
+ - spec/githubchart_spec.rb
162
164
  - spec/spec_helper.rb
163
165
  - vendor/cache/ast-1.1.0.gem
164
- - vendor/cache/basiccache-0.0.25.gem
166
+ - vendor/cache/basiccache-0.0.26.gem
165
167
  - vendor/cache/coveralls-0.7.0.gem
166
168
  - vendor/cache/curb-0.8.5.gem
167
169
  - vendor/cache/diff-lcs-1.2.5.gem
168
170
  - vendor/cache/docile-1.1.1.gem
169
- - vendor/cache/fuubar-1.2.1.gem
170
- - vendor/cache/githubstats-0.2.4.gem
171
+ - vendor/cache/fuubar-1.3.2.gem
172
+ - vendor/cache/githubstats-0.2.5.gem
171
173
  - vendor/cache/hashr-0.0.22.gem
172
174
  - vendor/cache/json-1.8.1.gem
173
175
  - vendor/cache/mime-types-2.0.gem
174
176
  - vendor/cache/multi_json-1.8.2.gem
175
- - vendor/cache/parser-2.1.0.pre2.gem
177
+ - vendor/cache/parser-2.1.1.gem
176
178
  - vendor/cache/powerpack-0.0.9.gem
177
179
  - vendor/cache/rainbow-1.1.4.gem
178
- - vendor/cache/rake-10.1.0.gem
180
+ - vendor/cache/rake-10.1.1.gem
179
181
  - vendor/cache/rasem-0.6.1.gem
180
182
  - vendor/cache/rest-client-1.6.7.gem
181
183
  - vendor/cache/rspec-2.14.1.gem
182
184
  - vendor/cache/rspec-core-2.14.7.gem
183
185
  - vendor/cache/rspec-expectations-2.14.4.gem
184
- - vendor/cache/rspec-instafail-0.2.4.gem
185
186
  - vendor/cache/rspec-mocks-2.14.4.gem
186
- - vendor/cache/rubocop-0.15.0.gem
187
- - vendor/cache/ruby-progressbar-1.2.0.gem
187
+ - vendor/cache/rubocop-0.16.0.gem
188
+ - vendor/cache/ruby-progressbar-1.3.2.gem
188
189
  - vendor/cache/simplecov-0.8.2.gem
189
190
  - vendor/cache/simplecov-html-0.8.0.gem
190
191
  - vendor/cache/slop-3.4.7.gem
@@ -217,5 +218,7 @@ signing_key:
217
218
  specification_version: 4
218
219
  summary: Generate an SVG of Github contributions data
219
220
  test_files:
221
+ - spec/githubchart/svg_spec.rb
222
+ - spec/githubchart_spec.rb
220
223
  - spec/spec_helper.rb
221
224
  has_rdoc:
Binary file
Binary file
Binary file
Binary file
Binary file