hubba 0.4.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{HISTORY.md → CHANGELOG.md} +0 -0
- data/Manifest.txt +4 -5
- data/README.md +20 -20
- data/Rakefile +4 -4
- data/lib/hubba.rb +30 -12
- data/lib/hubba/client.rb +47 -21
- data/lib/hubba/config.rb +51 -0
- data/lib/hubba/github.rb +60 -51
- data/lib/hubba/reports.rb +249 -0
- data/lib/hubba/reposet.rb +170 -0
- data/lib/hubba/stats.rb +104 -33
- data/lib/hubba/version.rb +2 -4
- data/test/helper.rb +0 -2
- data/test/stats/jekyll~minima.json +8 -4
- data/test/test_config.rb +10 -2
- data/test/test_stats.rb +44 -5
- data/test/test_stats_tmp.rb +8 -7
- metadata +22 -17
- data/lib/hubba/cache.rb +0 -62
- data/test/cache/users~geraldb~orgs.json +0 -46
- data/test/cache/users~geraldb~repos.json +0 -263
- data/test/test_cache.rb +0 -45
data/test/test_cache.rb
DELETED
@@ -1,45 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
###
|
4
|
-
# to run use
|
5
|
-
# ruby -I ./lib -I ./test test/test_cache.rb
|
6
|
-
|
7
|
-
|
8
|
-
require 'helper'
|
9
|
-
|
10
|
-
|
11
|
-
class TestCache < MiniTest::Test
|
12
|
-
|
13
|
-
def setup
|
14
|
-
@cache = Hubba::Cache.new( "#{Hubba.root}/test/cache" )
|
15
|
-
end
|
16
|
-
|
17
|
-
def test_basename
|
18
|
-
mappings = [['/users/geraldb', 'users~geraldb'],
|
19
|
-
['/users/geraldb/repos', 'users~geraldb~repos'],
|
20
|
-
['/users/geraldb/repos?per_page=100', 'users~geraldb~repos'],
|
21
|
-
['/users/geraldb/orgs', 'users~geraldb~orgs'],
|
22
|
-
['/users/geraldb/orgs?per_page=100', 'users~geraldb~orgs'],
|
23
|
-
['/orgs/wikiscript/repos', 'orgs~wikiscript~repos'],
|
24
|
-
['/orgs/planetjekyll/repos', 'orgs~planetjekyll~repos'],
|
25
|
-
['/orgs/vienna-rb/repos', 'orgs~vienna-rb~repos']]
|
26
|
-
|
27
|
-
mappings.each do |mapping|
|
28
|
-
assert_equal mapping[1], @cache.request_uri_to_basename( mapping[0] )
|
29
|
-
end
|
30
|
-
end # method test_basename
|
31
|
-
|
32
|
-
def test_cache
|
33
|
-
orgs = @cache.get( '/users/geraldb/orgs' )
|
34
|
-
assert_equal 4, orgs.size
|
35
|
-
|
36
|
-
repos = @cache.get( '/users/geraldb/repos' )
|
37
|
-
assert_equal 3, repos.size
|
38
|
-
end # method test_cache
|
39
|
-
|
40
|
-
def test_cache_miss
|
41
|
-
assert_nil @cache.get( '/test/hello' )
|
42
|
-
assert_nil @cache.get( '/test/hola' )
|
43
|
-
end # method test_cache_miss
|
44
|
-
|
45
|
-
end # class TestCache
|