revue 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/revue.rb +5 -5
- metadata +1 -1
data/lib/revue.rb
CHANGED
@@ -7,7 +7,7 @@ URL = "#{PROTOCOL}://revue.io"
|
|
7
7
|
PATH = "/api/v1"
|
8
8
|
|
9
9
|
opts = Trollop::options do
|
10
|
-
version "revue 1.0.
|
10
|
+
version "revue 1.0.1 (c) 2013 Matthew Williams"
|
11
11
|
banner <<-EOS
|
12
12
|
revue is a tool for creating code reviews from a diff file.
|
13
13
|
|
@@ -18,15 +18,15 @@ revue <diff_file>
|
|
18
18
|
where [options] are:
|
19
19
|
EOS
|
20
20
|
|
21
|
-
opt :url, "Use an alternative revue instance, e.g. a local installation", short
|
22
|
-
opt :verbose, "Make the program more talkative", short
|
23
|
-
opt :version, "Print version and exit", short
|
21
|
+
opt :url, "Use an alternative revue instance, e.g. a local installation", :short => "-u", :default => URL
|
22
|
+
opt :verbose, "Make the program more talkative", :short => "-v"
|
23
|
+
opt :version, "Print version and exit", :short => "-V"
|
24
24
|
end
|
25
25
|
|
26
26
|
RestClient.proxy = ENV["#{PROTOCOL}_proxy"] if ENV["#{PROTOCOL}_proxy"]
|
27
27
|
RestClient.log = STDOUT if opts[:verbose]
|
28
28
|
begin
|
29
|
-
response = RestClient.post "#{opts[:url]}/#{PATH}", { 'content' => ARGF.read }.to_json, content_type
|
29
|
+
response = RestClient.post "#{opts[:url]}/#{PATH}", { 'content' => ARGF.read }.to_json, :content_type => :json, :accept => :json
|
30
30
|
puts JSON.parse(response)['url']
|
31
31
|
rescue => e
|
32
32
|
STDERR.puts JSON.parse(e.response)["errors"]
|