hexabat 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +8 -6
- data/hexabat.gemspec +3 -1
- data/lib/hexabat/client.rb +1 -1
- data/lib/hexabat/version.rb +1 -1
- data/spec/hexabat/client_spec.rb +6 -0
- metadata +35 -9
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Hexabat [![Build Status](https://secure.travis-ci.org/
|
1
|
+
# Hexabat [![Build Status](https://secure.travis-ci.org/path11/hexabat.png?branch=master)](http://travis-ci.org/path11/hexabat) [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/path11/hexabat)
|
2
2
|
|
3
3
|
**Hexabat is a Github issues importer tool for Ruby.**
|
4
4
|
|
@@ -26,14 +26,14 @@ time. You will need to query page by page and get open and closed issues
|
|
26
26
|
separately.
|
27
27
|
|
28
28
|
Also, if you want to find out the total number of issues, there is no easy way
|
29
|
-
of doing it. You can
|
29
|
+
of doing it. You can find out the amount of open issues through the
|
30
30
|
[repositories API](http://developer.github.com/v3/repos/#get)
|
31
31
|
but, where are the closed ones?
|
32
32
|
|
33
33
|
|
34
34
|
## Features
|
35
35
|
|
36
|
-
Hexabat tackles those two problems by providing
|
36
|
+
Hexabat tackles those two problems by providing an easy way of importing
|
37
37
|
the issues of a Github repository:
|
38
38
|
|
39
39
|
```ruby
|
@@ -56,14 +56,17 @@ That means that Hexabat will allow you to:
|
|
56
56
|
|
57
57
|
* **Find out the total number of issues** (both open and closed) of the repository.
|
58
58
|
* **Do something with the data of every issue in the repository** (i.e. store it in a database).
|
59
|
-
|
59
|
+
You can check the JSON returned by github on the
|
60
|
+
[github api documentation](http://developer.github.com/v3/issues/#list-issues-for-a-repository).
|
61
|
+
The only thing Hexabat does is parsing this JSON and yield the issues to the
|
62
|
+
callback one by one.
|
63
|
+
* **Handle importing errors properly** (i.e. store the error reason in a database).
|
60
64
|
|
61
65
|
You don't need set every single callback if you don't want to. You can setup only one
|
62
66
|
callback if that's what you need. We also provide a default `errback` that will
|
63
67
|
print to `STDERR` a message with the failure (pretty similar to the example above).
|
64
68
|
|
65
69
|
|
66
|
-
|
67
70
|
###Authentication
|
68
71
|
|
69
72
|
If you are importing a public repository's issues you don't need to authenticate:
|
@@ -97,7 +100,6 @@ end
|
|
97
100
|
|
98
101
|
Hexabat will start the event loop for you if you call it outside a running one.
|
99
102
|
|
100
|
-
|
101
103
|
### Does Hexabat stop the event loop?
|
102
104
|
|
103
105
|
No it doesn't. Given that Hexabat doesn't know the work you are going to do
|
data/hexabat.gemspec
CHANGED
@@ -6,7 +6,7 @@ Gem::Specification.new do |gem|
|
|
6
6
|
gem.email = %w{alberto@path11.com ecomba@path11.com javier@path11.com sebastian@path11.com}
|
7
7
|
gem.description = %q{A Github issues importing tool}
|
8
8
|
gem.summary = %q{Importing all the issues of a Github repository is a complex task: the Github API does not provide an easy way of doing it. Hexabat will help you with that. It will allow you to find out the total number of issues (counting both open and closed ones) and to perform an action with each one of them.}
|
9
|
-
gem.homepage = ""
|
9
|
+
gem.homepage = "http://github.com/path11/hexabat"
|
10
10
|
|
11
11
|
gem.files = `git ls-files`.split($\)
|
12
12
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
@@ -23,4 +23,6 @@ Gem::Specification.new do |gem|
|
|
23
23
|
gem.add_development_dependency 'rake'
|
24
24
|
gem.add_development_dependency 'rspec'
|
25
25
|
gem.add_development_dependency 'webmock'
|
26
|
+
gem.add_development_dependency 'simplecov'
|
27
|
+
gem.add_development_dependency 'yard'
|
26
28
|
end
|
data/lib/hexabat/client.rb
CHANGED
@@ -30,7 +30,7 @@ module Hexabat
|
|
30
30
|
def on(event_callback)
|
31
31
|
event = event_callback.keys.first
|
32
32
|
raise_unknown_event_error event unless known? event
|
33
|
-
callbacks.merge! event_callback
|
33
|
+
callbacks.merge! event_callback unless event_callback[event].nil?
|
34
34
|
end
|
35
35
|
|
36
36
|
def known_events
|
data/lib/hexabat/version.rb
CHANGED
data/spec/hexabat/client_spec.rb
CHANGED
@@ -19,6 +19,12 @@ describe Hexabat::Client do
|
|
19
19
|
expect { subject.on unknown_event: a_callback}.to raise_error ArgumentError
|
20
20
|
end
|
21
21
|
|
22
|
+
it 'ignores attemts to set a callback to nil' do
|
23
|
+
subject.callbacks[:error].should_not be nil
|
24
|
+
subject.on error: nil
|
25
|
+
subject.callbacks[:error].should_not be nil
|
26
|
+
end
|
27
|
+
|
22
28
|
it 'starts Event Machine if it is not running' do
|
23
29
|
EM.stub(:reactor_running?).and_return(false)
|
24
30
|
EM.should_receive(:run)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hexabat
|
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:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-10-
|
12
|
+
date: 2012-10-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: eventmachine
|
@@ -123,6 +123,38 @@ dependencies:
|
|
123
123
|
- - ! '>='
|
124
124
|
- !ruby/object:Gem::Version
|
125
125
|
version: '0'
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: simplecov
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
130
|
+
requirements:
|
131
|
+
- - ! '>='
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
134
|
+
type: :development
|
135
|
+
prerelease: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
138
|
+
requirements:
|
139
|
+
- - ! '>='
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '0'
|
142
|
+
- !ruby/object:Gem::Dependency
|
143
|
+
name: yard
|
144
|
+
requirement: !ruby/object:Gem::Requirement
|
145
|
+
none: false
|
146
|
+
requirements:
|
147
|
+
- - ! '>='
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: '0'
|
150
|
+
type: :development
|
151
|
+
prerelease: false
|
152
|
+
version_requirements: !ruby/object:Gem::Requirement
|
153
|
+
none: false
|
154
|
+
requirements:
|
155
|
+
- - ! '>='
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
version: '0'
|
126
158
|
description: A Github issues importing tool
|
127
159
|
email:
|
128
160
|
- alberto@path11.com
|
@@ -162,7 +194,7 @@ files:
|
|
162
194
|
- spec/hexabat/page_request_buider_spec.rb
|
163
195
|
- spec/hexabat/page_response_processor_spec.rb
|
164
196
|
- spec/hexabat_spec.rb
|
165
|
-
homepage:
|
197
|
+
homepage: http://github.com/path11/hexabat
|
166
198
|
licenses: []
|
167
199
|
post_install_message:
|
168
200
|
rdoc_options: []
|
@@ -174,18 +206,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
174
206
|
- - ! '>='
|
175
207
|
- !ruby/object:Gem::Version
|
176
208
|
version: '0'
|
177
|
-
segments:
|
178
|
-
- 0
|
179
|
-
hash: 2707408037992863866
|
180
209
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
181
210
|
none: false
|
182
211
|
requirements:
|
183
212
|
- - ! '>='
|
184
213
|
- !ruby/object:Gem::Version
|
185
214
|
version: '0'
|
186
|
-
segments:
|
187
|
-
- 0
|
188
|
-
hash: 2707408037992863866
|
189
215
|
requirements: []
|
190
216
|
rubyforge_project:
|
191
217
|
rubygems_version: 1.8.24
|