otr 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/LICENSE +0 -4
  2. data/README.rdoc +8 -10
  3. data/lib/otr.rb +11 -3
  4. metadata +4 -4
data/LICENSE CHANGED
@@ -11,10 +11,6 @@ are permitted provided that the following conditions are met:
11
11
  notice, this list of conditions and the following disclaimer in the
12
12
  documentation and/or other materials provided with the distribution.
13
13
 
14
- 3. Neither the name of OTR nor the names of its
15
- contributors may be used to endorse or promote products derived from
16
- this software without specific prior written permission.
17
-
18
14
  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19
15
  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20
16
  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
data/README.rdoc CHANGED
@@ -10,14 +10,12 @@ app and command-line gem.
10
10
 
11
11
  === Sinatra
12
12
 
13
- The Sinatra app is hosted on Heroku at
14
- {otr.jupo.org}[http://otr.jupo.org]. Add your username to the path to
15
- get your feed. For example my GitHub and Bitbucket username is
16
- +stephenmcd+ so my feed is available at {otr.jupo.org/stephenmcd}[
17
- http://otr.jupo.org/stephenmcd]. If you have different usernames
18
- between GitHub and Bitbucket, you can use the URL
19
- {otr.jupo.org/github_username/bitbucket_username
20
- }[http://otr.jupo.org/github_username/bitbucket_username]
13
+ The Sinatra app is hosted on Heroku at {otr.jupo.org}[http://otr.jupo.org].
14
+ Add your username to the path to get your feed. For example my GitHub and
15
+ Bitbucket username is +stephenmcd+ so my feed is available at
16
+ {otr.jupo.org/stephenmcd}[http://otr.jupo.org/stephenmcd]. If you have
17
+ different usernames between GitHub and Bitbucket, you can use the URL
18
+ {otr.jupo.org/github_username/bitbucket_username}[http://otr.jupo.org/github_username/bitbucket_username]
21
19
  to provide them separately. Note that feeds are cached for about 24
22
20
  hours.
23
21
 
@@ -92,10 +90,10 @@ You can also use +otr+ in your own Ruby code:
92
90
  require 'rubygems'
93
91
  require 'otr'
94
92
 
95
- = With a combined username:
93
+ # With a combined username:
96
94
  options = {:username => "stephenmcd"}
97
95
 
98
- = Or with differing usernames:
96
+ # Or with differing usernames:
99
97
  options = {:github_username => "alice", :bitbucket_username => "bob"}
100
98
 
101
99
  json = OTR.get(options).to_json
data/lib/otr.rb CHANGED
@@ -5,7 +5,7 @@ require "json"
5
5
  require "rest_client"
6
6
 
7
7
  module OTR
8
- VERSION = "0.1.0"
8
+ VERSION = "0.1.1"
9
9
 
10
10
  def self.get_bb(username)
11
11
  repos = {}
@@ -28,8 +28,16 @@ module OTR
28
28
  end
29
29
 
30
30
  def self.get_gh(username)
31
- url = "http://github.com/api/v1/json/#{username}"
32
- JSON.parse(RestClient.get(url))["user"]["repositories"]
31
+ page = 0
32
+ all_repos = []
33
+ while true
34
+ page += 1
35
+ url = "https://api.github.com/users/#{username}/repos?page=#{page}"
36
+ repos = JSON.parse(RestClient.get(url))
37
+ break if repos.count == 0
38
+ all_repos += repos
39
+ end
40
+ all_repos
33
41
  end
34
42
 
35
43
  def self.get(options)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: otr
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Stephen McDonald
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-12-31 00:00:00 Z
18
+ date: 2012-06-14 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: rest-client