barkeep-client 0.1.5 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +5 -1
- data/README.md +1 -1
- data/barkeep_client.gemspec +1 -0
- data/lib/barkeep/commit.rb +16 -16
- data/lib/barkeep/configuration.rb +4 -0
- data/lib/barkeep/unapproved.rb +2 -3
- data/lib/barkeep/version.rb +1 -1
- data/lib/barkeep/view.rb +1 -1
- metadata +17 -7
- data/CHANGES.markdown +0 -15
data/Gemfile.lock
CHANGED
@@ -1,14 +1,18 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
barkeep-client (0.
|
4
|
+
barkeep-client (0.1.6)
|
5
5
|
dedent (~> 0.0.2)
|
6
|
+
rest-client
|
6
7
|
trollop (~> 1.16.2)
|
7
8
|
|
8
9
|
GEM
|
9
10
|
remote: http://rubygems.org/
|
10
11
|
specs:
|
11
12
|
dedent (0.0.2)
|
13
|
+
mime-types (1.17.2)
|
14
|
+
rest-client (1.6.7)
|
15
|
+
mime-types (>= 1.16)
|
12
16
|
trollop (1.16.2)
|
13
17
|
|
14
18
|
PLATFORMS
|
data/README.md
CHANGED
data/barkeep_client.gemspec
CHANGED
data/lib/barkeep/commit.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require "rubygems"
|
2
2
|
require "trollop"
|
3
3
|
require "dedent"
|
4
|
-
require "
|
4
|
+
require "rest_client"
|
5
5
|
require "json"
|
6
6
|
|
7
7
|
require "barkeep/constants"
|
@@ -29,7 +29,7 @@ module BarkeepClient
|
|
29
29
|
end
|
30
30
|
|
31
31
|
begin
|
32
|
-
result = BarkeepClient.commits(configuration, repo, [sha])[
|
32
|
+
result = BarkeepClient.commits(configuration, repo, [sha]).values[0]
|
33
33
|
rescue RuntimeError => e
|
34
34
|
puts e.message
|
35
35
|
exit 1
|
@@ -55,21 +55,21 @@ module BarkeepClient
|
|
55
55
|
end
|
56
56
|
|
57
57
|
# Core method for calling Barkeep's commit API call.
|
58
|
-
|
59
|
-
def self.commits(configuration, repo, shas)
|
58
|
+
def self.commits(configuration, repo, shas, fields = [])
|
60
59
|
result = {}
|
61
|
-
shas.
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
60
|
+
params = { :shas => shas.join(",") }
|
61
|
+
params[:fields] = fields.join(",") unless fields.empty?
|
62
|
+
begin
|
63
|
+
response = RestClient.post "http://#{configuration["barkeep_server"]}/api/commits/#{repo}", params
|
64
|
+
rescue SocketError
|
65
|
+
raise "Cannot connect to the Barkeep server at http:#{configuration["barkeep_server"]}."
|
66
|
+
end
|
67
|
+
if response.code != 200
|
68
|
+
error = JSON.parse(response.body)["message"] rescue nil
|
69
|
+
raise error ? "Error: #{error}" : "Unspecified server error."
|
70
|
+
end
|
71
|
+
commits = JSON.parse(response.body)
|
72
|
+
commits.each do |sha, info|
|
73
73
|
commit_data = {}
|
74
74
|
info.each do |key, value|
|
75
75
|
next if value.nil?
|
data/lib/barkeep/unapproved.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
require "rubygems"
|
2
2
|
require "trollop"
|
3
3
|
require "dedent"
|
4
|
-
require "net/http"
|
5
4
|
require "json"
|
6
5
|
|
7
6
|
require "barkeep/constants"
|
@@ -41,7 +40,7 @@ module BarkeepClient
|
|
41
40
|
if commits.empty?
|
42
41
|
puts "No commits in range."
|
43
42
|
exit 0
|
44
|
-
elsif commits.size >
|
43
|
+
elsif commits.size > 1000
|
45
44
|
puts "Warning: #{commits.size} commits in range. Lookup could be very slow. Proceed? [yN]"
|
46
45
|
unless STDIN.gets.downcase.strip =~ /^y(es)?/
|
47
46
|
puts "Aborting."
|
@@ -50,7 +49,7 @@ module BarkeepClient
|
|
50
49
|
end
|
51
50
|
|
52
51
|
begin
|
53
|
-
commit_data = BarkeepClient.commits(configuration, repo, commits)
|
52
|
+
commit_data = BarkeepClient.commits(configuration, repo, commits, ["approved"])
|
54
53
|
rescue RuntimeError => e
|
55
54
|
puts e.message
|
56
55
|
exit 1
|
data/lib/barkeep/version.rb
CHANGED
data/lib/barkeep/view.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: barkeep-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-05-21 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: trollop
|
16
|
-
requirement: &
|
16
|
+
requirement: &23208580 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 1.16.2
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *23208580
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: dedent
|
27
|
-
requirement: &
|
27
|
+
requirement: &23201960 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,7 +32,18 @@ dependencies:
|
|
32
32
|
version: 0.0.2
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *23201960
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: rest-client
|
38
|
+
requirement: &23198240 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
44
|
+
type: :runtime
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *23198240
|
36
47
|
description: A command-line client for Barkeep's REST API.
|
37
48
|
email:
|
38
49
|
- caleb@ooyala.com
|
@@ -43,7 +54,6 @@ extra_rdoc_files: []
|
|
43
54
|
files:
|
44
55
|
- .gitignore
|
45
56
|
- .rbenv-version
|
46
|
-
- CHANGES.markdown
|
47
57
|
- Gemfile
|
48
58
|
- Gemfile.lock
|
49
59
|
- README.md
|
data/CHANGES.markdown
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
Barkeep Client Changes
|
2
|
-
======================
|
3
|
-
|
4
|
-
This file summarizes changes between barkeep-client gem versions.
|
5
|
-
|
6
|
-
0.1.1
|
7
|
-
-----
|
8
|
-
|
9
|
-
* Make it easier to pass in arbitrary arguments to `git log` from the `unapproved` command using `--`.
|
10
|
-
|
11
|
-
|
12
|
-
0.1.0
|
13
|
-
-----
|
14
|
-
|
15
|
-
Initial version, including `commit` and `unapproved` commands.
|