octokit_issue_export 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +24 -5
- data/lib/octokit/client/issue_export.rb +3 -2
- data/lib/octokit_issue_export/client.rb +15 -0
- data/lib/octokit_issue_export/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72b012262c5b545b506799659c3364c4f20f7516
|
4
|
+
data.tar.gz: 683ea6417a2594ed61ef15c9cf5b2dc31b78b771
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e66431cbb16aa2b698caedbf94a3e4fc9605bd4416eb680b464d9293259706f592cb65e95e749fbaff29a31de4001759a25b14a9573ebcb2aef2ec506a006b3
|
7
|
+
data.tar.gz: 0f2c34eba4a54a4b0c7fb7c13715ac77a8da67214a83575be6959e438c8f32ee15e43b49817d8d29f72f69fbb702c73c8a779d06103afb3d6eb01a7793a06632
|
data/README.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
Octokit IssueExport
|
2
|
+
===================
|
3
|
+
|
4
|
+
[![Gem Version](https://badge.fury.io/rb/octokit_issue_export.png)][gem]
|
5
|
+
[gem]: https://rubygems.org/gems/octokit_issue_export
|
3
6
|
|
4
7
|
Export issues from projects on GitHub
|
5
8
|
|
@@ -21,15 +24,31 @@ Or install it yourself as:
|
|
21
24
|
Usage
|
22
25
|
-----
|
23
26
|
|
27
|
+
```ruby
|
28
|
+
[1] 2.0.0(main)> require 'octokit_issue_export'
|
29
|
+
=> true
|
30
|
+
[2] 2.0.0(main)> Octokit.export_org_issues('rails')
|
31
|
+
[rails/rails]
|
32
|
+
- #12673, state: open, comments: 0, title: "Fix Timed thread-safety. Fixes #12069"
|
33
|
+
- #12672, state: open, comments: 0, title: "unescapeHTML crashes with certain *.html_safe inputs"
|
34
|
+
- #12671, state: open, comments: 4, title: "Rails 4.0.1.rc1: undefined method `set_name_cache' for #<Module:...> (NoMethodError)"
|
35
|
+
- #12670, state: open, comments: 1, title: "Optimize none? and one? relation query methods to use LIMIT 1 and COUNT."
|
36
|
+
- #12667, state: open, comments: 1, title: "Fix Guide HTML validation"
|
37
|
+
...
|
38
|
+
# => ./rails/rails/12673.json
|
39
|
+
# => ./rails/rails/12672.json
|
40
|
+
# ...
|
24
41
|
```
|
25
|
-
|
42
|
+
|
43
|
+
when includes private repository
|
44
|
+
|
45
|
+
```ruby
|
26
46
|
Octokit.configure do |c|
|
27
47
|
c.login = 'defunkt'
|
28
48
|
c.password = 'c0d3b4ssssss!'
|
29
49
|
end
|
30
50
|
|
31
|
-
|
32
|
-
Octokit.export_org_issues('rails')
|
51
|
+
Octokit.export_org_issues('github')
|
33
52
|
```
|
34
53
|
|
35
54
|
Contributing
|
@@ -4,18 +4,19 @@ module Octokit
|
|
4
4
|
def export_issues(username = nil)
|
5
5
|
username = login if username.nil?
|
6
6
|
repos(username).each { |repo| export_issues_by_repo(repo) }
|
7
|
+
Time.now
|
7
8
|
end
|
8
9
|
|
9
10
|
def export_organization_issues(organization)
|
10
11
|
org_repos(organization).each { |repo| export_issues_by_repo(repo) }
|
12
|
+
Time.now
|
11
13
|
end
|
12
14
|
alias :export_org_issues :export_organization_issues
|
13
15
|
|
14
16
|
def export_issues_by_repository(repo)
|
15
|
-
self._dir_for_export = File.join(%w(.) + repo.full_name.split('/'))
|
16
|
-
|
17
17
|
puts "[#{repo.full_name}]"
|
18
18
|
if repo(repo.full_name).has_issues?
|
19
|
+
self._dir_for_export = File.join(%w(.) + repo.full_name.split('/'))
|
19
20
|
_export_issues_by_repository(repo.full_name)
|
20
21
|
else
|
21
22
|
puts "- project without issues"
|
@@ -3,5 +3,20 @@ require 'octokit/client/issue_export'
|
|
3
3
|
module Octokit
|
4
4
|
class Client
|
5
5
|
include Octokit::Client::IssueExport
|
6
|
+
alias :original_request :request
|
7
|
+
|
8
|
+
def _request_stopper
|
9
|
+
return if last_response.nil?
|
10
|
+
return unless Octokit.rate_limit.remaining.zero?
|
11
|
+
|
12
|
+
minutes = (rate_limit.resets_in + 5)/60
|
13
|
+
puts "=> Rate limit! Please wait #{minutes} minutes(#{rate_limit.resets_at})..."
|
14
|
+
sleep minutes
|
15
|
+
end
|
16
|
+
|
17
|
+
def request(method, path, data, options = {})
|
18
|
+
_request_stopper
|
19
|
+
original_request(method, path, data, options = {})
|
20
|
+
end
|
6
21
|
end
|
7
22
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: octokit_issue_export
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- linyows
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-10-
|
11
|
+
date: 2013-10-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: octokit
|