brio 0.0.3 → 0.0.4
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/README.rdoc +29 -3
- data/bin/brio +8 -8
- data/lib/brio/format/pretty.rb +12 -5
- data/lib/brio/resources/post.rb +1 -1
- data/lib/brio/version.rb +1 -1
- metadata +9 -3
data/README.rdoc
CHANGED
@@ -2,13 +2,28 @@
|
|
2
2
|
|
3
3
|
brio is a command line application for interfacing with appdotnet social network.
|
4
4
|
|
5
|
-
==
|
6
|
-
You have to make sure that you have ruby installed
|
5
|
+
== Installation
|
6
|
+
You have to make sure that you have ruby installed, <b>version 1.9.2, 1.9.3 (the latest stable)</b>
|
7
|
+
|
8
|
+
Note! For now it was tested only with RUby versions 1.9.2 and 1.9.3. It does not work on 1.8.7.
|
7
9
|
|
8
10
|
Once you've verified that Ruby is installed:
|
9
11
|
|
10
12
|
gem install brio
|
11
13
|
|
14
|
+
== Troubleshooting
|
15
|
+
|
16
|
+
==== I am getting SSL errors, help!
|
17
|
+
If you are getting a similar message to this:
|
18
|
+
|
19
|
+
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed on error;
|
20
|
+
|
21
|
+
you will need to install some openssl packages:
|
22
|
+
|
23
|
+
$ rvm pkg install openssl
|
24
|
+
$ rvm reinstall 1.9.3 --with-openssl-dir=$rvm_path/usr
|
25
|
+
|
26
|
+
|
12
27
|
== Authorization
|
13
28
|
brio needs to be authorized with appdotnet to run. To proceed, type the following command at the prompt and follow the instructions:
|
14
29
|
|
@@ -112,8 +127,19 @@ List posts created by *username*
|
|
112
127
|
List posts created by me (the current authenticated user).
|
113
128
|
|
114
129
|
brio list posts -c15
|
115
|
-
List my last 15 posts.
|
130
|
+
List my last 15 posts.
|
131
|
+
|
132
|
+
== Screenshots
|
133
|
+
|
134
|
+
img:images/brio-help.png
|
135
|
+
|
136
|
+
img:images/brio-stream.png
|
137
|
+
|
138
|
+
img:images/brio-whois.png
|
139
|
+
|
116
140
|
|
117
141
|
== Copyright
|
118
142
|
See LICENSE[https://github.com/klaut/brio/blob/master/LICENSE.txt] for details.
|
119
143
|
|
144
|
+
:include:brio.rdoc
|
145
|
+
|
data/bin/brio
CHANGED
@@ -57,7 +57,7 @@ command :authorize do |c|
|
|
57
57
|
Launchy.open client.oauth_url
|
58
58
|
token = ask "Enter your oauth token:"
|
59
59
|
|
60
|
-
client.config['token'] = token
|
60
|
+
client.config['token'] = token.to_s
|
61
61
|
say "<%= color('Authorization successful.', :green) %>"
|
62
62
|
else
|
63
63
|
say "<%= color('You already authorized with app.net', :red) %>"
|
@@ -101,7 +101,7 @@ command :post do |c|
|
|
101
101
|
end
|
102
102
|
help_now!('message is required') if message.empty?
|
103
103
|
post = client.create_post text: message
|
104
|
-
say "<%= color(
|
104
|
+
say "<%= color(\"#{post.text}\", :red) %>" if post.is_a? Brio::Resources::NullResource
|
105
105
|
end
|
106
106
|
|
107
107
|
c.desc 'Reply to a post'
|
@@ -116,7 +116,7 @@ command :post do |c|
|
|
116
116
|
end
|
117
117
|
help_now!('postID and message are both required') if message.empty?
|
118
118
|
post = client.create_post reply_to: args[0], text: message
|
119
|
-
say "<%= color(
|
119
|
+
say "<%= color(\"#{post.text}\", :red) %>" if post.is_a? Brio::Resources::NullResource
|
120
120
|
end
|
121
121
|
end
|
122
122
|
|
@@ -126,7 +126,7 @@ command :post do |c|
|
|
126
126
|
delete.action do |global_options,options,args|
|
127
127
|
help_now!('postID is required') if args.empty?
|
128
128
|
post = client.delete_post args[0]
|
129
|
-
say "<%= color(
|
129
|
+
say "<%= color(\"#{post.text}\", :red) %>" if post.is_a? Brio::Resources::NullResource
|
130
130
|
end
|
131
131
|
end
|
132
132
|
|
@@ -143,7 +143,7 @@ command :post do |c|
|
|
143
143
|
else
|
144
144
|
post = client.create_post_repost args[0]
|
145
145
|
end
|
146
|
-
say "<%= color(
|
146
|
+
say "<%= color(\"#{post.text}\", :red) %>" if post.is_a? Brio::Resources::NullResource
|
147
147
|
end
|
148
148
|
end
|
149
149
|
|
@@ -157,7 +157,7 @@ command :post do |c|
|
|
157
157
|
else
|
158
158
|
post = client.create_post_star args[0]
|
159
159
|
end
|
160
|
-
say "<%= color(
|
160
|
+
say "<%= color(\"#{post.text}\", :red) %>" if post.is_a? Brio::Resources::NullResource
|
161
161
|
end
|
162
162
|
end
|
163
163
|
|
@@ -185,7 +185,7 @@ command :follow do |c|
|
|
185
185
|
help_now!('username is required') if args.empty?
|
186
186
|
exit_now!('username must start with @') if !args.empty? and !args[0].start_with?('@')
|
187
187
|
user = client.create_user_follow args[0]
|
188
|
-
say "<%= color(
|
188
|
+
say "<%= color(\"#{user.text}\", :red) %>" if user.is_a? Brio::Resources::NullResource
|
189
189
|
end
|
190
190
|
end
|
191
191
|
|
@@ -196,7 +196,7 @@ command :unfollow do |c|
|
|
196
196
|
help_now!('username is required') if args.empty?
|
197
197
|
exit_now!('username must start with @') if !args.empty? and !args[0].start_with?('@')
|
198
198
|
user = client.delete_user_follow args[0]
|
199
|
-
say "<%= color(
|
199
|
+
say "<%= color(\"#{user.text}\", :red) %>" if user.is_a? Brio::Resources::NullResource
|
200
200
|
end
|
201
201
|
end
|
202
202
|
|
data/lib/brio/format/pretty.rb
CHANGED
@@ -6,6 +6,8 @@
|
|
6
6
|
class Pretty
|
7
7
|
attr_accessor :wrap
|
8
8
|
|
9
|
+
WRAP_SIZE = 110
|
10
|
+
|
9
11
|
HighLine.color_scheme = HighLine::ColorScheme.new do |cs|
|
10
12
|
cs[:username] = [ :red ]
|
11
13
|
cs[:end_line] = [ :yellow] #:rgb_aaaaaa
|
@@ -24,13 +26,13 @@
|
|
24
26
|
end
|
25
27
|
|
26
28
|
def print_post( post )
|
27
|
-
say "<%= color(\"
|
29
|
+
say "<%= color(\"@#{post.user.username}\", :username) %>"
|
28
30
|
if post.text
|
29
31
|
say "." * @wrap
|
30
32
|
say "#{post.text.strip}"
|
31
33
|
say "." * @wrap
|
32
34
|
end
|
33
|
-
say "<%= color('<id: #{post.id} | #{pretty_format_time(post.created_at)}#{reply_status post}> <replies #{post.num_replies}>', :end_line) %>"
|
35
|
+
say "<%= color('<id: #{post.id} | #{pretty_format_time(post.created_at)}#{reply_status post}> <replies #{post.num_replies} | stars #{post.num_stars} | reposts #{post.num_reposts}>', :end_line) %>"
|
34
36
|
say "\n"
|
35
37
|
end
|
36
38
|
|
@@ -53,10 +55,10 @@
|
|
53
55
|
end
|
54
56
|
|
55
57
|
def set_wrap
|
56
|
-
if $terminal.output_cols <
|
58
|
+
if $terminal.output_cols < WRAP_SIZE
|
57
59
|
@wrap = $terminal.output_cols
|
58
60
|
else
|
59
|
-
@wrap =
|
61
|
+
@wrap = WRAP_SIZE
|
60
62
|
end
|
61
63
|
$terminal.wrap_at = @wrap
|
62
64
|
end
|
@@ -66,9 +68,14 @@
|
|
66
68
|
end
|
67
69
|
|
68
70
|
def reply_status( post )
|
71
|
+
msg = ""
|
69
72
|
if post.reply_to
|
70
|
-
" | in reply to: #{post.reply_to}"
|
73
|
+
msg << " | in reply to: #{post.reply_to}"
|
74
|
+
end
|
75
|
+
if post.repost_of
|
76
|
+
msg << " | repost of: #{post.repost_of.id}"
|
71
77
|
end
|
78
|
+
msg
|
72
79
|
end
|
73
80
|
|
74
81
|
private
|
data/lib/brio/resources/post.rb
CHANGED
data/lib/brio/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: brio
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-02-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -276,15 +276,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
276
276
|
- - ! '>='
|
277
277
|
- !ruby/object:Gem::Version
|
278
278
|
version: '0'
|
279
|
+
segments:
|
280
|
+
- 0
|
281
|
+
hash: -4202813074843204447
|
279
282
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
280
283
|
none: false
|
281
284
|
requirements:
|
282
285
|
- - ! '>='
|
283
286
|
- !ruby/object:Gem::Version
|
284
287
|
version: '0'
|
288
|
+
segments:
|
289
|
+
- 0
|
290
|
+
hash: -4202813074843204447
|
285
291
|
requirements: []
|
286
292
|
rubyforge_project:
|
287
|
-
rubygems_version: 1.8.
|
293
|
+
rubygems_version: 1.8.25
|
288
294
|
signing_key:
|
289
295
|
specification_version: 3
|
290
296
|
summary: CLI for app.net
|