hubhumans 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/.rvmrc +2 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +59 -0
- data/Rakefile +1 -0
- data/bin/hubhumans +16 -0
- data/hubhumans.gemspec +22 -0
- data/lib/hubhumans/version.rb +3 -0
- data/lib/hubhumans.rb +32 -0
- metadata +75 -0
data/.gitignore
ADDED
data/.rvmrc
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Matthew Rothenberg
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
# HubHuman
|
2
|
+
|
3
|
+
Automatically create a `humans.txt` file based upon public members of a GitHub organization.
|
4
|
+
|
5
|
+
## Wut?
|
6
|
+
|
7
|
+
GitHub.com has a [shiny humans.txt](http://github.com/humans.txt) on their site which is [autogenerated from the organization team list](http://www.quora.com/GitHub/Does-GitHub-keep-its-complete-employee-list-in-the-sites-humans-txt-file/answer/Zach-Holman). This is an nice way to keep the file up to date, so here's a quick hack to do so.
|
8
|
+
|
9
|
+
## Installation
|
10
|
+
|
11
|
+
Add this line to your application's Gemfile:
|
12
|
+
|
13
|
+
gem 'hubhumans'
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install hubhumans
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
Just pass the GitHub organization name. For example, the following commmand:
|
26
|
+
|
27
|
+
hubhumans flickr
|
28
|
+
|
29
|
+
Would produce the following output:
|
30
|
+
|
31
|
+
/* TEAM */
|
32
|
+
|
33
|
+
Daniel Bogan (waferbaby)
|
34
|
+
Site: http://usesthis.com/
|
35
|
+
Location: San Francisco, California
|
36
|
+
|
37
|
+
Eric Gelinas (standardpixel)
|
38
|
+
Site: blog.standardpixel.com
|
39
|
+
Location: San Francisco, California
|
40
|
+
|
41
|
+
Stephen Woods (saw)
|
42
|
+
Site: stephenwoods.net
|
43
|
+
Location: 94110
|
44
|
+
|
45
|
+
[...]
|
46
|
+
|
47
|
+
You may want to set up a cron task to periodically do the following to keep yours up to date:
|
48
|
+
|
49
|
+
hubhumans myorgname > /path/to/www/humans.txt
|
50
|
+
|
51
|
+
Easy!
|
52
|
+
|
53
|
+
## Contributing
|
54
|
+
|
55
|
+
1. Fork it
|
56
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
57
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
58
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
59
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/bin/hubhumans
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
begin
|
4
|
+
require 'hubhumans'
|
5
|
+
rescue LoadError
|
6
|
+
require 'rubygems'
|
7
|
+
require 'hubhumans'
|
8
|
+
end
|
9
|
+
include Hubhumans
|
10
|
+
|
11
|
+
def bail
|
12
|
+
abort "usage: #{File.basename(__FILE__)} [organization_name]"
|
13
|
+
end
|
14
|
+
|
15
|
+
bail if ARGV[0].nil?
|
16
|
+
puts Humanifier.new.render_for_org(ARGV[0])
|
data/hubhumans.gemspec
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'hubhumans/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |gem|
|
7
|
+
gem.name = "hubhumans"
|
8
|
+
gem.version = Hubhumans::VERSION
|
9
|
+
gem.authors = ["Matthew Rothenberg"]
|
10
|
+
gem.email = ["mrothenberg@gmail.com"]
|
11
|
+
gem.description = %q{Automatically create a `humans.txt` file based upon public members of a GitHub organization.}
|
12
|
+
gem.summary = %q{Automatically create a `humans.txt` file based upon public members of a GitHub organization.}
|
13
|
+
gem.homepage = "http://github.com/mroth/hubhumans"
|
14
|
+
gem.licenses = ['MIT']
|
15
|
+
|
16
|
+
gem.files = `git ls-files`.split($/)
|
17
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
18
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
19
|
+
gem.require_paths = ["lib"]
|
20
|
+
|
21
|
+
gem.add_runtime_dependency "octokit", "~> 1.23.0"
|
22
|
+
end
|
data/lib/hubhumans.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
require "hubhumans/version"
|
2
|
+
require "octokit"
|
3
|
+
|
4
|
+
module Hubhumans
|
5
|
+
|
6
|
+
class Humanifier
|
7
|
+
|
8
|
+
def initialize
|
9
|
+
@client = Octokit::Client.new(:auto_traversal => true)
|
10
|
+
end
|
11
|
+
|
12
|
+
def render_for_org(org_name)
|
13
|
+
gh_org = @client.organization_members(org_name)
|
14
|
+
output = "/* TEAM */\n"
|
15
|
+
gh_org.each do |member|
|
16
|
+
output << self.render_user(member.login)
|
17
|
+
end
|
18
|
+
output
|
19
|
+
end
|
20
|
+
|
21
|
+
def render_user(login)
|
22
|
+
user = @client.user(login)
|
23
|
+
output = ""
|
24
|
+
output << " #{user.name} (#{user.login})\n"
|
25
|
+
output << " Site: #{user.blog}\n" unless user.blog.nil?
|
26
|
+
output << " Location: #{user.location}\n" unless user.location.nil?
|
27
|
+
output + "\n"
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
metadata
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: hubhumans
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Matthew Rothenberg
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-02-18 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: octokit
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 1.23.0
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 1.23.0
|
30
|
+
description: Automatically create a `humans.txt` file based upon public members of
|
31
|
+
a GitHub organization.
|
32
|
+
email:
|
33
|
+
- mrothenberg@gmail.com
|
34
|
+
executables:
|
35
|
+
- hubhumans
|
36
|
+
extensions: []
|
37
|
+
extra_rdoc_files: []
|
38
|
+
files:
|
39
|
+
- .gitignore
|
40
|
+
- .rvmrc
|
41
|
+
- Gemfile
|
42
|
+
- LICENSE.txt
|
43
|
+
- README.md
|
44
|
+
- Rakefile
|
45
|
+
- bin/hubhumans
|
46
|
+
- hubhumans.gemspec
|
47
|
+
- lib/hubhumans.rb
|
48
|
+
- lib/hubhumans/version.rb
|
49
|
+
homepage: http://github.com/mroth/hubhumans
|
50
|
+
licenses:
|
51
|
+
- MIT
|
52
|
+
post_install_message:
|
53
|
+
rdoc_options: []
|
54
|
+
require_paths:
|
55
|
+
- lib
|
56
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
63
|
+
none: false
|
64
|
+
requirements:
|
65
|
+
- - ! '>='
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
68
|
+
requirements: []
|
69
|
+
rubyforge_project:
|
70
|
+
rubygems_version: 1.8.25
|
71
|
+
signing_key:
|
72
|
+
specification_version: 3
|
73
|
+
summary: Automatically create a `humans.txt` file based upon public members of a GitHub
|
74
|
+
organization.
|
75
|
+
test_files: []
|