pulley 0.0.1 → 0.0.2
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.md +1 -0
- data/bin/pulley +9 -2
- data/lib/pulley.rb +17 -0
- data/pulley.gemspec +2 -2
- metadata +4 -4
data/README.md
CHANGED
data/bin/pulley
CHANGED
@@ -6,7 +6,14 @@ credentials = Pulley::Credentials.load
|
|
6
6
|
if credentials.empty?
|
7
7
|
abort "Set your credentials. See README at https://github.com/xtoddx/pulley"
|
8
8
|
end
|
9
|
-
|
10
9
|
client = Pulley::Github.new(credentials[:username], credentials[:password],
|
11
10
|
credentials[:repository])
|
12
|
-
|
11
|
+
|
12
|
+
if ARGV.delete('--publish')
|
13
|
+
require 'json'
|
14
|
+
text = STDIN.read
|
15
|
+
requests = JSON.parse(text)
|
16
|
+
Pulley::Publisher.new(client).publish_updates(requests)
|
17
|
+
else
|
18
|
+
Pulley::CLI.display_pull_requests(client.pull_requests)
|
19
|
+
end
|
data/lib/pulley.rb
CHANGED
@@ -45,6 +45,10 @@ module Pulley
|
|
45
45
|
def pull_requests
|
46
46
|
@connection.pull_requests(@repo)
|
47
47
|
end
|
48
|
+
|
49
|
+
def update_pull_request number, title, body
|
50
|
+
@connection.update_pull_request(@repo, number, title, body)
|
51
|
+
end
|
48
52
|
end
|
49
53
|
|
50
54
|
class CLI
|
@@ -69,4 +73,17 @@ module Pulley
|
|
69
73
|
end
|
70
74
|
end
|
71
75
|
|
76
|
+
class Publisher
|
77
|
+
def initialize client
|
78
|
+
@client = client
|
79
|
+
end
|
80
|
+
|
81
|
+
def publish_updates reqs
|
82
|
+
reqs.each do |req|
|
83
|
+
next unless req['modified']
|
84
|
+
@client.update_pull_request(req['number'], req['title'], req['body'])
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
72
89
|
end
|
data/pulley.gemspec
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'pulley'
|
3
|
-
s.version = '0.0.
|
3
|
+
s.version = '0.0.2'
|
4
4
|
s.date = '2012-12-11'
|
5
5
|
|
6
6
|
s.summary = 'A CLI tool for working with Github Pull Requests'
|
7
|
-
s.description = 'Pulley will turn pull requests into a json stream on STDOUT for piping through other programs, it can be piped back in with the --
|
7
|
+
s.description = 'Pulley will turn pull requests into a json stream on STDOUT for piping through other programs, it can be piped back in with the --publish flag to persist changes to github.'
|
8
8
|
|
9
9
|
s.authors = ['Todd Willey (xtoddx)']
|
10
10
|
s.email = 'xtoddx@gmail.com'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pulley
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-12-11 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: octokit
|
16
|
-
requirement: &
|
16
|
+
requirement: &70215689950920 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,9 +21,9 @@ dependencies:
|
|
21
21
|
version: 1.19.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70215689950920
|
25
25
|
description: Pulley will turn pull requests into a json stream on STDOUT for piping
|
26
|
-
through other programs, it can be piped back in with the --
|
26
|
+
through other programs, it can be piped back in with the --publish flag to persist
|
27
27
|
changes to github.
|
28
28
|
email: xtoddx@gmail.com
|
29
29
|
executables:
|