github_analyze 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9131bbb49b782e328f9cccb4ce92432da2d99145998f4bf66a842ba064713dec
4
- data.tar.gz: 01a8066b1484921442f50325bf8ff845b1a6387945744034ed410445b35bcc8f
3
+ metadata.gz: e633aa915941ae43e47ab748e69e519b73d4a9c982e3ed0797d50e4748059a16
4
+ data.tar.gz: 35916e21937e24c9e3b935869a48fef6ff571a99e71940f0b346b09f7a3a50bb
5
5
  SHA512:
6
- metadata.gz: bb1e2b186305710cbcfe24da3fc4be2b397b48e27dbefda179a27958ea0df9963703f1bf7e415738595c80ed3f0668fcdb97be810f0ec13056d145f546a372f1
7
- data.tar.gz: 30dfd012fddcb339063479e8f056a8d86db54c4e043a09c926418c059dea576c52fcb4c4c7dac4b4adae159e0ef60320c92065c4edb5be32e7ec101dfa116d5f
6
+ metadata.gz: a40a8cdc931a183108778ccf6f479f641412658e97a035284bdf2683adb9d25301302cf23254e0c642599fe16722e4800b535e3f33042745da3cdd971f6ddb07
7
+ data.tar.gz: 2c366ac67231dc84bd4a12c836f32b37676671b400c67789abebcfc70786d86cbb23d9c8137b02bfb5ed4cb350870b9d0087a4041b09bf618bf73d9381c5c3ed
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- github_analyze (0.1.0)
5
- graphlient
6
- thor
4
+ github_analyze (0.1.1)
5
+ graphlient (~> 0.3)
6
+ thor (~> 0.20)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
@@ -74,12 +74,12 @@ PLATFORMS
74
74
  DEPENDENCIES
75
75
  bundler (~> 1.17)
76
76
  github_analyze!
77
- prettier
78
- pry
77
+ prettier (~> 0.14)
78
+ pry (~> 0.12)
79
79
  rake (~> 10.0)
80
80
  rspec (~> 3.0)
81
- vcr
82
- webmock
81
+ vcr (~> 5.0)
82
+ webmock (~> 3.6)
83
83
 
84
84
  BUNDLED WITH
85
85
  1.17.2
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2019 George Drummond <georgedrummond@gmail.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/Readme.md CHANGED
@@ -1,4 +1,4 @@
1
- [![Build Status](https://travis-ci.org/georgedrummond/github_analyze.svg?branch=master)](https://travis-ci.org/georgedrummond/github_analyze)
1
+ [![Build Status](https://travis-ci.org/georgedrummond/github_analyze.svg?branch=master)](https://travis-ci.org/georgedrummond/github_analyze) [![Gem Version](https://badge.fury.io/rb/github_analyze.svg)](https://badge.fury.io/rb/github_analyze)
2
2
 
3
3
  # GithubAnalyze
4
4
 
@@ -36,10 +36,50 @@ client = GithubAnalyze::Client.new(
36
36
  organization = client.organization(name: 'github')
37
37
 
38
38
  # Find out the most popular languages used in that organization
39
- organization.most_common_languages # => ['Ruby', 'JavaScript', 'Go', 'C', 'Shell']
39
+ organization.most_common_languages
40
+ # => [
41
+ # 'Ruby',
42
+ # 'JavaScript',
43
+ # 'Go',
44
+ # 'C',
45
+ # 'Shell'
46
+ # ]
40
47
 
41
48
  # Find least common languages used in that organization
42
- organization.least_common_languages # => ['Ragel in Ruby Host', 'PowerShell', 'Scala', 'Clojure', 'Perl']
49
+ organization.least_common_languages
50
+ # => [
51
+ # 'Ragel in Ruby Host',
52
+ # 'PowerShell',
53
+ # 'Scala',
54
+ # 'Clojure',
55
+ # 'Perl'
56
+ # ]
57
+
58
+ organization.ranked_languages
59
+ # => {
60
+ # 'Ruby' => 98,
61
+ # 'JavaScript' => 63,
62
+ # 'Go' => 19,
63
+ # 'C' => 17,
64
+ # 'Shell' => 15,
65
+ # 'Objective-C' => 10,
66
+ # 'HTML' => 9,
67
+ # 'Python' => 9,
68
+ # 'C#' => 6,
69
+ # 'CSS' => 6,
70
+ # 'CoffeeScript' => 6,
71
+ # 'Java' => 6,
72
+ # 'Puppet' => 3,
73
+ # 'Swift' => 3,
74
+ # 'C++' => 2,
75
+ # 'Haskell' => 2,
76
+ # 'TypeScript' => 2,
77
+ # 'Clojure' => 1,
78
+ # 'Perl' => 1,
79
+ # 'PowerShell' => 1,
80
+ # 'Ragel in Ruby Host' => 1,
81
+ # 'Scala' => 1
82
+ # }
43
83
  ```
44
84
 
45
85
  ## Command Line
File without changes
@@ -9,8 +9,9 @@ Gem::Specification.new do |spec|
9
9
  spec.email = %w[georgedrummond@gmail.com]
10
10
 
11
11
  spec.summary = 'Analyze GitHub organizations for language data'
12
- spec.description = 'Analyze GitHub organizations for language data'
12
+ spec.description = 'Analyze GitHub organizations for language data. Check documentation at https://github.com/georgedrummond/github_analyze'
13
13
  spec.homepage = 'https://github.com/georgedrummond/github_analyze'
14
+ spec.licenses = ['MIT']
14
15
 
15
16
  # Specify which files should be added to the gem when it is released.
16
17
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
@@ -27,11 +28,11 @@ Gem::Specification.new do |spec|
27
28
  spec.add_development_dependency 'bundler', '~> 1.17'
28
29
  spec.add_development_dependency 'rake', '~> 10.0'
29
30
  spec.add_development_dependency 'rspec', '~> 3.0'
30
- spec.add_development_dependency 'vcr'
31
- spec.add_development_dependency 'webmock'
32
- spec.add_development_dependency 'pry'
33
- spec.add_development_dependency 'prettier'
31
+ spec.add_development_dependency 'vcr', '~> 5.0'
32
+ spec.add_development_dependency 'webmock', '~> 3.6'
33
+ spec.add_development_dependency 'prettier', '~> 0.14'
34
+ spec.add_development_dependency 'pry', '~> 0.12'
34
35
 
35
- spec.add_dependency 'graphlient'
36
- spec.add_dependency 'thor'
36
+ spec.add_dependency 'graphlient', '~> 0.3'
37
+ spec.add_dependency 'thor', '~> 0.20'
37
38
  end
@@ -6,10 +6,15 @@ module GithubAnalyze
6
6
  class Cli < Thor
7
7
  desc 'stats ORGANIZATION', 'report language stats for said organization'
8
8
  def stats(organization)
9
- client.organization(name: organization)
9
+ languages = []
10
+ languages << ['Rank', 'Language', 'Repo Count']
11
+
12
+ client
13
+ .organization(name: organization)
10
14
  .ranked_languages
11
- .each
12
- .with_index { |language, i| puts "#{i + 1} - #{language}" }
15
+ .each.with_index { |l, i| languages << [i, l[0], l[1]] }
16
+
17
+ print_table languages
13
18
  end
14
19
 
15
20
  desc 'csv ORGANIZATION ABSOLUTE_FILE_PATH','generate CSV of most common languages by repo count'
@@ -36,7 +41,11 @@ module GithubAnalyze
36
41
  github_authentication_token: ENV['GITHUB_AUTHENTICATION_TOKEN']
37
42
  )
38
43
  else
39
- raise 'You must set GITHUB_AUTHENTICATION_TOKEN environment variable'
44
+ say(
45
+ "You must set GITHUB_AUTHENTICATION_TOKEN environment variable\ne.g. GITHUB_AUTHENTICATION_TOKEN=token github_analyze #{ARGV.join(' ')}",
46
+ Thor::Shell::Color::RED
47
+ )
48
+ exit
40
49
  end
41
50
  end
42
51
  end
@@ -12,15 +12,15 @@ module GithubAnalyze
12
12
  end
13
13
 
14
14
  def ranked_languages
15
- languages.sort_by { |k, v| [-v, k] }.map { |k, v| k }
15
+ Hash[languages.to_a.sort_by { |k, v| [-v, k] }]
16
16
  end
17
17
 
18
18
  def most_common_languages
19
- ranked_languages.first(5)
19
+ ranked_languages.to_a.first(5).collect(&:first)
20
20
  end
21
21
 
22
22
  def least_common_languages
23
- ranked_languages.last(5)
23
+ ranked_languages.to_a.last(5).collect(&:first)
24
24
  end
25
25
 
26
26
  private
@@ -1,3 +1,3 @@
1
1
  module GithubAnalyze
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: github_analyze
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - George Drummond
@@ -56,87 +56,88 @@ dependencies:
56
56
  name: vcr
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: '5.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: '0'
68
+ version: '5.0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: webmock
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: '3.6'
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: '3.6'
83
83
  - !ruby/object:Gem::Dependency
84
- name: pry
84
+ name: prettier
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '0'
89
+ version: '0.14'
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: '0'
96
+ version: '0.14'
97
97
  - !ruby/object:Gem::Dependency
98
- name: prettier
98
+ name: pry
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ">="
101
+ - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '0'
103
+ version: '0.12'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ">="
108
+ - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '0'
110
+ version: '0.12'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: graphlient
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ">="
115
+ - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: '0'
117
+ version: '0.3'
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - ">="
122
+ - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: '0'
124
+ version: '0.3'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: thor
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ">="
129
+ - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: '0'
131
+ version: '0.20'
132
132
  type: :runtime
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: '0'
139
- description: Analyze GitHub organizations for language data
138
+ version: '0.20'
139
+ description: Analyze GitHub organizations for language data. Check documentation at
140
+ https://github.com/georgedrummond/github_analyze
140
141
  email:
141
142
  - georgedrummond@gmail.com
142
143
  executables:
@@ -151,6 +152,7 @@ files:
151
152
  - CODE_OF_CONDUCT.md
152
153
  - Gemfile
153
154
  - Gemfile.lock
155
+ - LICENSE
154
156
  - Rakefile
155
157
  - Readme.md
156
158
  - bin/beautify
@@ -164,7 +166,8 @@ files:
164
166
  - lib/github_analyze/organization.rb
165
167
  - lib/github_analyze/version.rb
166
168
  homepage: https://github.com/georgedrummond/github_analyze
167
- licenses: []
169
+ licenses:
170
+ - MIT
168
171
  metadata: {}
169
172
  post_install_message:
170
173
  rdoc_options: []