gawky 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +34 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +53 -0
- data/LICENSE.txt +22 -0
- data/README.md +31 -0
- data/Rakefile +2 -0
- data/bin/gawky +7 -0
- data/gawky.gemspec +22 -0
- data/lib/gawky/runner.rb +32 -0
- data/lib/gawky/status.rb +19 -0
- data/lib/gawky/version.rb +3 -0
- data/lib/gawky.rb +19 -0
- data/sample.json +4 -0
- metadata +86 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: a00d0407e9f712e6ee16fd9801c22badb56aedfc
|
4
|
+
data.tar.gz: 1f940bf6bbd245e723b41e1e0a1b14c9ff9be963
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f58abcc7e66061869dff79168a8f5fe33b6066dd2227e5bf0d27f78b517e377f6e8797a087b82a80c6e4ea32f87d70da04d88c8226dbbe07fea052fa3eb23205
|
7
|
+
data.tar.gz: 2ac3333f46c0e5c6b3c71aa252ba639c58034830d78686b74f3712231efd3063c442cdf43c03f94d09ee6614831a8f646767c791fbbf19fe39f2238cbe84bee4
|
data/.gitignore
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
/.config
|
4
|
+
/coverage/
|
5
|
+
/InstalledFiles
|
6
|
+
/pkg/
|
7
|
+
/spec/reports/
|
8
|
+
/test/tmp/
|
9
|
+
/test/version_tmp/
|
10
|
+
/tmp/
|
11
|
+
|
12
|
+
## Specific to RubyMotion:
|
13
|
+
.dat*
|
14
|
+
.repl_history
|
15
|
+
build/
|
16
|
+
|
17
|
+
## Documentation cache and generated files:
|
18
|
+
/.yardoc/
|
19
|
+
/_yardoc/
|
20
|
+
/doc/
|
21
|
+
/rdoc/
|
22
|
+
|
23
|
+
## Environment normalisation:
|
24
|
+
/.bundle/
|
25
|
+
/lib/bundler/man/
|
26
|
+
|
27
|
+
# for a library or gem, you might want to ignore these files since the code is
|
28
|
+
# intended to run in multiple environments; otherwise, check them in:
|
29
|
+
# Gemfile.lock
|
30
|
+
# .ruby-version
|
31
|
+
# .ruby-gemset
|
32
|
+
|
33
|
+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
|
34
|
+
.rvmrc
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
gawky (0.0.1)
|
5
|
+
|
6
|
+
GEM
|
7
|
+
remote: https://rubygems.org/
|
8
|
+
specs:
|
9
|
+
addressable (2.3.6)
|
10
|
+
descendants_tracker (0.0.4)
|
11
|
+
thread_safe (~> 0.3, >= 0.3.1)
|
12
|
+
faraday (0.9.0)
|
13
|
+
multipart-post (>= 1.2, < 3)
|
14
|
+
github_api (0.11.3)
|
15
|
+
addressable (~> 2.3)
|
16
|
+
descendants_tracker (~> 0.0.1)
|
17
|
+
faraday (~> 0.8, < 0.10)
|
18
|
+
hashie (>= 1.2)
|
19
|
+
multi_json (>= 1.7.5, < 2.0)
|
20
|
+
nokogiri (~> 1.6.0)
|
21
|
+
oauth2
|
22
|
+
hashie (3.2.0)
|
23
|
+
json (1.8.1)
|
24
|
+
jwt (1.0.0)
|
25
|
+
mini_portile (0.6.0)
|
26
|
+
multi_json (1.10.1)
|
27
|
+
multi_xml (0.5.5)
|
28
|
+
multipart-post (2.0.0)
|
29
|
+
nokogiri (1.6.2.1)
|
30
|
+
mini_portile (= 0.6.0)
|
31
|
+
oauth2 (1.0.0)
|
32
|
+
faraday (>= 0.8, < 0.10)
|
33
|
+
jwt (~> 1.0)
|
34
|
+
multi_json (~> 1.3)
|
35
|
+
multi_xml (~> 0.5)
|
36
|
+
rack (~> 1.2)
|
37
|
+
rack (1.5.2)
|
38
|
+
rake (10.3.2)
|
39
|
+
term-ansicolor (1.3.0)
|
40
|
+
tins (~> 1.0)
|
41
|
+
thread_safe (0.3.4)
|
42
|
+
tins (1.3.0)
|
43
|
+
|
44
|
+
PLATFORMS
|
45
|
+
ruby
|
46
|
+
|
47
|
+
DEPENDENCIES
|
48
|
+
bundler (~> 1.6)
|
49
|
+
gawky!
|
50
|
+
github_api (~> 0.11.3)
|
51
|
+
json (~> 1.8.1)
|
52
|
+
rake
|
53
|
+
term-ansicolor (~> 1.3.0)
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Bruno Oliveira
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# Gawky
|
2
|
+
|
3
|
+
A tiny and simple console tool for pull requests
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Clone the repository
|
8
|
+
|
9
|
+
And then execute:
|
10
|
+
|
11
|
+
$ bundle install
|
12
|
+
|
13
|
+
Or install it yourself as:
|
14
|
+
|
15
|
+
$ gem install --local gawky.gemspec
|
16
|
+
|
17
|
+
Rename the sample.json file to gawky.json and copy to your HOME directory
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
$ bin/gawky or bin/gawky [organization name]
|
22
|
+
|
23
|
+
## Contributing
|
24
|
+
|
25
|
+
1. Fork it ( https://github.com/[my-github-username]/gawky/fork )
|
26
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
+
3. Add unit tests, because yeah it's missing
|
28
|
+
4. Commit your changes (`git commit -am 'Add some feature'`)
|
29
|
+
5. Push to the branch (`git push origin my-new-feature`)
|
30
|
+
6. Create a new Pull Request
|
31
|
+
|
data/Rakefile
ADDED
data/bin/gawky
ADDED
data/gawky.gemspec
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'gawky/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "gawky"
|
8
|
+
spec.version = Gawky::VERSION
|
9
|
+
spec.authors = ["Bruno Oliveira"]
|
10
|
+
spec.email = ["bruno@abstractj.org"]
|
11
|
+
spec.summary = %q{A tiny and simple console tool for pull requests}
|
12
|
+
spec.homepage = "https://github.com/abstractj/gawky"
|
13
|
+
spec.license = "MIT"
|
14
|
+
|
15
|
+
spec.files = `git ls-files -z`.split("\x0")
|
16
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
17
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
|
+
spec.require_paths = ["lib"]
|
19
|
+
|
20
|
+
spec.add_development_dependency "bundler", "~> 1.6"
|
21
|
+
spec.add_development_dependency "rake"
|
22
|
+
end
|
data/lib/gawky/runner.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
module Gawky
|
2
|
+
class Runner
|
3
|
+
|
4
|
+
def initialize
|
5
|
+
@date_now = Date.today
|
6
|
+
end
|
7
|
+
|
8
|
+
def run
|
9
|
+
issues = Gawky.github.issues.list(:org => ARGV[0],
|
10
|
+
:filter => 'all',
|
11
|
+
:auto_pagination => true,
|
12
|
+
:sort => 'created')
|
13
|
+
issues.each do |issue|
|
14
|
+
if issue['pull_request']
|
15
|
+
date = DateTime.parse(issue.created_at)
|
16
|
+
if elapsed_time(date) > Gawky.max_elapsed_days
|
17
|
+
puts Status.new(date, issue).warning
|
18
|
+
else
|
19
|
+
puts Status.new(date, issue).green
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def elapsed_time(date)
|
28
|
+
(@date_now - date).to_i
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
data/lib/gawky/status.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'term/ansicolor'
|
2
|
+
|
3
|
+
class Status
|
4
|
+
|
5
|
+
def initialize(date, issue)
|
6
|
+
@@date = date.strftime('%e %b %Y %H:%M %p')
|
7
|
+
@@login = issue.user.login
|
8
|
+
@@title = issue.title
|
9
|
+
@@url = issue.html_url
|
10
|
+
end
|
11
|
+
|
12
|
+
def warning
|
13
|
+
"\e[31m#{@@date}\e[0m - \e[34m#{@@login}\e[0m - \e[33m#{@@title}\e[0m - \e[34m#{@@url}\e[0m"
|
14
|
+
end
|
15
|
+
|
16
|
+
def green
|
17
|
+
"\e[32m#{@@date}\e[0m - \e[34m#{@@login}\e[0m - \e[33m#{@@title}\e[0m - \e[34m#{@@url}\e[0m"
|
18
|
+
end
|
19
|
+
end
|
data/lib/gawky.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'gawky/version'
|
2
|
+
require 'gawky/runner'
|
3
|
+
require 'gawky/status'
|
4
|
+
require 'github_api'
|
5
|
+
require 'json'
|
6
|
+
|
7
|
+
module Gawky
|
8
|
+
|
9
|
+
@@configuration = JSON.load(IO.read(ENV['HOME'] + '/.gawky.json'))
|
10
|
+
|
11
|
+
def self.github
|
12
|
+
Github.new oauth_token: @@configuration['token']
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.max_elapsed_days
|
16
|
+
@@configuration['maxElapsedDays']
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
data/sample.json
ADDED
metadata
ADDED
@@ -0,0 +1,86 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: gawky
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Bruno Oliveira
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-07-18 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.6'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.6'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description:
|
42
|
+
email:
|
43
|
+
- bruno@abstractj.org
|
44
|
+
executables:
|
45
|
+
- gawky
|
46
|
+
extensions: []
|
47
|
+
extra_rdoc_files: []
|
48
|
+
files:
|
49
|
+
- .gitignore
|
50
|
+
- Gemfile
|
51
|
+
- Gemfile.lock
|
52
|
+
- LICENSE.txt
|
53
|
+
- README.md
|
54
|
+
- Rakefile
|
55
|
+
- bin/gawky
|
56
|
+
- gawky.gemspec
|
57
|
+
- lib/gawky.rb
|
58
|
+
- lib/gawky/runner.rb
|
59
|
+
- lib/gawky/status.rb
|
60
|
+
- lib/gawky/version.rb
|
61
|
+
- sample.json
|
62
|
+
homepage: https://github.com/abstractj/gawky
|
63
|
+
licenses:
|
64
|
+
- MIT
|
65
|
+
metadata: {}
|
66
|
+
post_install_message:
|
67
|
+
rdoc_options: []
|
68
|
+
require_paths:
|
69
|
+
- lib
|
70
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - '>='
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
75
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
76
|
+
requirements:
|
77
|
+
- - '>='
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: '0'
|
80
|
+
requirements: []
|
81
|
+
rubyforge_project:
|
82
|
+
rubygems_version: 2.1.11
|
83
|
+
signing_key:
|
84
|
+
specification_version: 4
|
85
|
+
summary: A tiny and simple console tool for pull requests
|
86
|
+
test_files: []
|