cuiabout 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.
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE +22 -0
- data/README.md +47 -0
- data/Rakefile +2 -0
- data/bin/cuiabout +4 -0
- data/cuiabout.gemspec +17 -0
- data/lib/cuiabout.rb +56 -0
- data/lib/cuiabout/version.rb +3 -0
- metadata +55 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 naoty
|
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,47 @@
|
|
1
|
+
# Cuiabout
|
2
|
+
|
3
|
+
CLI for cui-about.me (http://github.com/naoty/cui-aboutme)
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'cuiabout'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install cuiabout
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
Print how to use this gem.
|
22
|
+
|
23
|
+
$ cuiabout help
|
24
|
+
|
25
|
+
Usage: cuiabout ACTION
|
26
|
+
|
27
|
+
cuiabout [username] # Prints user's profile
|
28
|
+
cuiabout show [username] # Prints user's profile
|
29
|
+
cuiabout list # Prints all user names
|
30
|
+
|
31
|
+
Print all user names.
|
32
|
+
|
33
|
+
$ cuiabout list
|
34
|
+
naoty
|
35
|
+
soplana
|
36
|
+
|
37
|
+
Print a specific user's profile.
|
38
|
+
|
39
|
+
$ cuiabout naoty
|
40
|
+
|
41
|
+
## Contributing
|
42
|
+
|
43
|
+
1. Fork it
|
44
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
45
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
46
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
47
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
data/bin/cuiabout
ADDED
data/cuiabout.gemspec
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/cuiabout/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.authors = ["naoty"]
|
6
|
+
gem.email = ["naoty.k@gmail.com"]
|
7
|
+
gem.description = %q{This gem helps to download hackers' profiles, and upload your profile.}
|
8
|
+
gem.summary = %q{CLI for cui-about.me}
|
9
|
+
gem.homepage = ""
|
10
|
+
|
11
|
+
gem.files = `git ls-files`.split($\)
|
12
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
13
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
14
|
+
gem.name = "cuiabout"
|
15
|
+
gem.require_paths = ["lib"]
|
16
|
+
gem.version = Cuiabout::VERSION
|
17
|
+
end
|
data/lib/cuiabout.rb
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
require "cuiabout/version"
|
2
|
+
|
3
|
+
module Cuiabout
|
4
|
+
class CLI
|
5
|
+
|
6
|
+
ROOT_PATH = 'http://cui-about.me'
|
7
|
+
|
8
|
+
class << self
|
9
|
+
|
10
|
+
def run *args
|
11
|
+
command = args.shift || 'usage'
|
12
|
+
send(command, *args)
|
13
|
+
end
|
14
|
+
|
15
|
+
def usage *args
|
16
|
+
puts %(
|
17
|
+
Usage: cuiabout ACTION
|
18
|
+
|
19
|
+
cuiabout [username] # Prints user's profile
|
20
|
+
cuiabout show [username] # Prints user's profile
|
21
|
+
cuiabout list # Prints all user names
|
22
|
+
)
|
23
|
+
end
|
24
|
+
alias :help :usage
|
25
|
+
alias :me :usage
|
26
|
+
|
27
|
+
def list *args
|
28
|
+
system "curl #{ROOT_PATH}/users"
|
29
|
+
end
|
30
|
+
|
31
|
+
def show *args
|
32
|
+
abort "ERROR: Please specify user's name" if args.empty?
|
33
|
+
|
34
|
+
name = args.shift
|
35
|
+
system "curl #{ROOT_PATH}/#{name}"
|
36
|
+
end
|
37
|
+
|
38
|
+
def method_missing method_or_name, *args
|
39
|
+
if listed? method_or_name
|
40
|
+
show method_or_name
|
41
|
+
else
|
42
|
+
abort 'ERROR: Unknown command'
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
private
|
47
|
+
|
48
|
+
def listed? name
|
49
|
+
names = `curl --silent #{ROOT_PATH}/users`
|
50
|
+
names.split($/).include?(name.to_s)
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
54
|
+
|
55
|
+
end
|
56
|
+
end
|
metadata
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: cuiabout
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- naoty
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-08-11 00:00:00.000000000 Z
|
13
|
+
dependencies: []
|
14
|
+
description: This gem helps to download hackers' profiles, and upload your profile.
|
15
|
+
email:
|
16
|
+
- naoty.k@gmail.com
|
17
|
+
executables:
|
18
|
+
- cuiabout
|
19
|
+
extensions: []
|
20
|
+
extra_rdoc_files: []
|
21
|
+
files:
|
22
|
+
- .gitignore
|
23
|
+
- Gemfile
|
24
|
+
- LICENSE
|
25
|
+
- README.md
|
26
|
+
- Rakefile
|
27
|
+
- bin/cuiabout
|
28
|
+
- cuiabout.gemspec
|
29
|
+
- lib/cuiabout.rb
|
30
|
+
- lib/cuiabout/version.rb
|
31
|
+
homepage: ''
|
32
|
+
licenses: []
|
33
|
+
post_install_message:
|
34
|
+
rdoc_options: []
|
35
|
+
require_paths:
|
36
|
+
- lib
|
37
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
38
|
+
none: false
|
39
|
+
requirements:
|
40
|
+
- - ! '>='
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '0'
|
43
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
44
|
+
none: false
|
45
|
+
requirements:
|
46
|
+
- - ! '>='
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0'
|
49
|
+
requirements: []
|
50
|
+
rubyforge_project:
|
51
|
+
rubygems_version: 1.8.23
|
52
|
+
signing_key:
|
53
|
+
specification_version: 3
|
54
|
+
summary: CLI for cui-about.me
|
55
|
+
test_files: []
|