cuiabout 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +40 -12
- data/cuiabout.gemspec +2 -2
- data/lib/cuiabout.rb +33 -0
- data/lib/cuiabout/helper.rb +0 -0
- data/lib/cuiabout/version.rb +1 -1
- metadata +5 -4
data/README.md
CHANGED
@@ -6,37 +6,65 @@ CLI for cui-about.me (http://github.com/naoty/cui-aboutme)
|
|
6
6
|
|
7
7
|
Add this line to your application's Gemfile:
|
8
8
|
|
9
|
-
|
9
|
+
```ruby
|
10
|
+
gem 'cuiabout'
|
11
|
+
```
|
10
12
|
|
11
13
|
And then execute:
|
12
14
|
|
13
|
-
|
15
|
+
```sh
|
16
|
+
$ bundle
|
17
|
+
```
|
14
18
|
|
15
19
|
Or install it yourself as:
|
16
20
|
|
17
|
-
|
21
|
+
```sh
|
22
|
+
$ gem install cuiabout
|
23
|
+
```
|
18
24
|
|
19
25
|
## Usage
|
20
26
|
|
21
27
|
Print how to use this gem.
|
22
28
|
|
23
|
-
|
29
|
+
```sh
|
30
|
+
$ cuiabout help
|
24
31
|
|
25
|
-
|
32
|
+
Usage: cuiabout ACTION
|
26
33
|
|
27
|
-
|
28
|
-
|
29
|
-
|
34
|
+
cuiabout [username] # Prints user's profile
|
35
|
+
cuiabout show [username] # Prints user's profile
|
36
|
+
cuiabout list # Prints all user names
|
37
|
+
```
|
30
38
|
|
31
39
|
Print all user names.
|
32
40
|
|
33
|
-
|
34
|
-
|
35
|
-
|
41
|
+
```sh
|
42
|
+
$ cuiabout list
|
43
|
+
naoty
|
44
|
+
soplana
|
45
|
+
```
|
36
46
|
|
37
47
|
Print a specific user's profile.
|
38
48
|
|
39
|
-
|
49
|
+
```sh
|
50
|
+
$ cuiabout naoty
|
51
|
+
```
|
52
|
+
|
53
|
+
Signup with your name, password, and any other information.
|
54
|
+
|
55
|
+
```sh
|
56
|
+
$ cuiabout signup naoty email=naoty.k@gmail.com github=http://github.com/naoty
|
57
|
+
password:
|
58
|
+
Success!
|
59
|
+
```
|
60
|
+
|
61
|
+
Update your profile.
|
62
|
+
|
63
|
+
```sh
|
64
|
+
$ cuiabout update naoty blog=http://naoty.hatenablog.com location=Tokyo
|
65
|
+
password:
|
66
|
+
Success!
|
67
|
+
```
|
40
68
|
|
41
69
|
## Contributing
|
42
70
|
|
data/cuiabout.gemspec
CHANGED
@@ -4,9 +4,9 @@ require File.expand_path('../lib/cuiabout/version', __FILE__)
|
|
4
4
|
Gem::Specification.new do |gem|
|
5
5
|
gem.authors = ["naoty"]
|
6
6
|
gem.email = ["naoty.k@gmail.com"]
|
7
|
-
gem.description = %q{
|
7
|
+
gem.description = %q{CLI for cui-about.me (http://cui-about.me)}
|
8
8
|
gem.summary = %q{CLI for cui-about.me}
|
9
|
-
gem.homepage = ""
|
9
|
+
gem.homepage = "http://github.com/naoty/cuiabout"
|
10
10
|
|
11
11
|
gem.files = `git ls-files`.split($\)
|
12
12
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
data/lib/cuiabout.rb
CHANGED
@@ -35,6 +35,30 @@ Usage: cuiabout ACTION
|
|
35
35
|
system "curl #{ROOT_PATH}/#{name}"
|
36
36
|
end
|
37
37
|
|
38
|
+
def signup *args
|
39
|
+
abort 'ERROR: Please specify your name' if args.empty?
|
40
|
+
|
41
|
+
name = args.shift
|
42
|
+
password = ask_password
|
43
|
+
data = "name=#{name}&password=#{password}"
|
44
|
+
args.each do |arg|
|
45
|
+
data += "&#{arg}"
|
46
|
+
end
|
47
|
+
system "curl -X POST -d '#{data}' #{ROOT_PATH}/signup"
|
48
|
+
end
|
49
|
+
|
50
|
+
def update *args
|
51
|
+
abort 'ERROR: Please specify your name' if args.empty?
|
52
|
+
|
53
|
+
name = args.shift
|
54
|
+
password = ask_password
|
55
|
+
data = "password=#{password}"
|
56
|
+
args.each do |arg|
|
57
|
+
data += "&#{arg}"
|
58
|
+
end
|
59
|
+
system "curl -X PUT -d '#{data}' #{ROOT_PATH}/#{name}"
|
60
|
+
end
|
61
|
+
|
38
62
|
def method_missing method_or_name, *args
|
39
63
|
if listed? method_or_name
|
40
64
|
show method_or_name
|
@@ -50,6 +74,15 @@ Usage: cuiabout ACTION
|
|
50
74
|
names.split($/).include?(name.to_s)
|
51
75
|
end
|
52
76
|
|
77
|
+
def ask_password
|
78
|
+
print 'password: '
|
79
|
+
system 'stty -echo'
|
80
|
+
password = $stdin.gets.chop
|
81
|
+
system 'stty echo'
|
82
|
+
print "\n"
|
83
|
+
return password
|
84
|
+
end
|
85
|
+
|
53
86
|
end
|
54
87
|
|
55
88
|
end
|
File without changes
|
data/lib/cuiabout/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cuiabout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,9 +9,9 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-08-
|
12
|
+
date: 2012-08-12 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
|
-
description:
|
14
|
+
description: CLI for cui-about.me (http://cui-about.me)
|
15
15
|
email:
|
16
16
|
- naoty.k@gmail.com
|
17
17
|
executables:
|
@@ -27,8 +27,9 @@ files:
|
|
27
27
|
- bin/cuiabout
|
28
28
|
- cuiabout.gemspec
|
29
29
|
- lib/cuiabout.rb
|
30
|
+
- lib/cuiabout/helper.rb
|
30
31
|
- lib/cuiabout/version.rb
|
31
|
-
homepage:
|
32
|
+
homepage: http://github.com/naoty/cuiabout
|
32
33
|
licenses: []
|
33
34
|
post_install_message:
|
34
35
|
rdoc_options: []
|