gitGraph 0.0.1
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 +7 -0
- data/.gitignore +41 -0
- data/.rspec +3 -0
- data/Gemfile +10 -0
- data/LICENSE +22 -0
- data/LICENSE.txt +22 -0
- data/README.md +67 -0
- data/Rakefile +2 -0
- data/gitGraph.gemspec +23 -0
- data/lib/gitGraph.rb +6 -0
- data/lib/gitGraph/configuration.rb +16 -0
- data/lib/gitGraph/github/client.rb +71 -0
- data/lib/gitGraph/github/feature.rb +11 -0
- data/lib/gitGraph/github/feature/compare_languages.rb +51 -0
- data/lib/gitGraph/github/graphable_data.rb +107 -0
- data/lib/gitGraph/github/graphable_object.rb +62 -0
- data/lib/gitGraph/renderer.rb +55 -0
- data/lib/gitGraph/version.rb +3 -0
- data/lib/utils.rb +9 -0
- data/spec/configuration/configuration_spec.rb +46 -0
- data/spec/github/client_spec.rb +77 -0
- data/spec/github/graphable_data_spec.rb +94 -0
- data/spec/github/graphable_object_spec.rb +53 -0
- data/spec/spec_helper.rb +9 -0
- data/spec/version/version_spec.rb +7 -0
- data/vendor/Chartjs.min.js +10 -0
- data/vendor/jquery-1.10.1.min.js +6 -0
- data/vendor/legend.js +31 -0
- metadata +106 -0
data/vendor/legend.js
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
function legend(parent, data) {
|
2
|
+
parent.className = 'legend';
|
3
|
+
var datas = data.hasOwnProperty('datasets') ? data.datasets : data;
|
4
|
+
|
5
|
+
// remove possible children of the parent
|
6
|
+
while(parent.hasChildNodes()) {
|
7
|
+
parent.removeChild(parent.lastChild);
|
8
|
+
}
|
9
|
+
|
10
|
+
$(parent).after("<div id='legend' style='display:inline-block; vertical-align: top; margin-left:20px;' class='legend-container'><h2 style='font-weight: 200; margin-bottom: 0;'>Legend</h2><hr/></div>");
|
11
|
+
|
12
|
+
datas.forEach(function(d) {
|
13
|
+
var title = document.createElement('div');
|
14
|
+
title.className = 'title';
|
15
|
+
parent.insertBefore(title);
|
16
|
+
|
17
|
+
var colorSample = document.createElement('div');
|
18
|
+
colorSample.className = 'color-sample';
|
19
|
+
colorSample.style.backgroundColor = d.hasOwnProperty('strokeColor') ? d.strokeColor : d.color;
|
20
|
+
colorSample.style.width = '20px';
|
21
|
+
colorSample.style.display = 'inline-block';
|
22
|
+
colorSample.style.marginRight = '5px';
|
23
|
+
colorSample.style.height = '20px';
|
24
|
+
colorSample.style.borderColor = d.hasOwnProperty('fillColor') ? d.fillColor : d.color;
|
25
|
+
title.appendChild(colorSample);
|
26
|
+
|
27
|
+
var text = document.createTextNode(d.label);
|
28
|
+
title.appendChild(text);
|
29
|
+
$("#legend").append(title);
|
30
|
+
});
|
31
|
+
}
|
metadata
ADDED
@@ -0,0 +1,106 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: gitGraph
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- caneroj1
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-04-02 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.7'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.7'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
description: Displays nice graphs of GitHub usage through a Rack App. Can help you
|
42
|
+
analyze things like what languages you most frequently push in, etc.
|
43
|
+
email:
|
44
|
+
- caneroj1@tcnj.edu
|
45
|
+
executables: []
|
46
|
+
extensions: []
|
47
|
+
extra_rdoc_files: []
|
48
|
+
files:
|
49
|
+
- ".gitignore"
|
50
|
+
- ".rspec"
|
51
|
+
- Gemfile
|
52
|
+
- LICENSE
|
53
|
+
- LICENSE.txt
|
54
|
+
- README.md
|
55
|
+
- Rakefile
|
56
|
+
- gitGraph.gemspec
|
57
|
+
- lib/gitGraph.rb
|
58
|
+
- lib/gitGraph/configuration.rb
|
59
|
+
- lib/gitGraph/github/client.rb
|
60
|
+
- lib/gitGraph/github/feature.rb
|
61
|
+
- lib/gitGraph/github/feature/compare_languages.rb
|
62
|
+
- lib/gitGraph/github/graphable_data.rb
|
63
|
+
- lib/gitGraph/github/graphable_object.rb
|
64
|
+
- lib/gitGraph/renderer.rb
|
65
|
+
- lib/gitGraph/version.rb
|
66
|
+
- lib/utils.rb
|
67
|
+
- spec/configuration/configuration_spec.rb
|
68
|
+
- spec/github/client_spec.rb
|
69
|
+
- spec/github/graphable_data_spec.rb
|
70
|
+
- spec/github/graphable_object_spec.rb
|
71
|
+
- spec/spec_helper.rb
|
72
|
+
- spec/version/version_spec.rb
|
73
|
+
- vendor/Chartjs.min.js
|
74
|
+
- vendor/jquery-1.10.1.min.js
|
75
|
+
- vendor/legend.js
|
76
|
+
homepage: https://github.com/caneroj1/GitGraph
|
77
|
+
licenses:
|
78
|
+
- MIT
|
79
|
+
metadata: {}
|
80
|
+
post_install_message:
|
81
|
+
rdoc_options: []
|
82
|
+
require_paths:
|
83
|
+
- lib
|
84
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
89
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
90
|
+
requirements:
|
91
|
+
- - ">="
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
requirements: []
|
95
|
+
rubyforge_project:
|
96
|
+
rubygems_version: 2.4.3
|
97
|
+
signing_key:
|
98
|
+
specification_version: 4
|
99
|
+
summary: Displays nice graphs of GitHub usage through a Rack App.
|
100
|
+
test_files:
|
101
|
+
- spec/configuration/configuration_spec.rb
|
102
|
+
- spec/github/client_spec.rb
|
103
|
+
- spec/github/graphable_data_spec.rb
|
104
|
+
- spec/github/graphable_object_spec.rb
|
105
|
+
- spec/spec_helper.rb
|
106
|
+
- spec/version/version_spec.rb
|