gitwrap 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/gitwrap/base_connection.rb +1 -1
- data/lib/gitwrap/data_creator.rb +1 -1
- data/lib/gitwrap/orgs.rb +24 -19
- data/lib/gitwrap/repos.rb +28 -23
- data/lib/gitwrap/users.rb +21 -16
- data/lib/gitwrap/version.rb +1 -1
- data/lib/gitwrap.rb +0 -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: 1e996179963fd4497d2afe9e14aac0f590e058be
|
4
|
+
data.tar.gz: d7f8573235a4d709b862bca821c0aad3c36ef2ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc7dc08a63cbb8b1a7091651f6981cc52a2f6332b2872e6c5b0365bf4af8ff900d77ad1ad1d732ddcd96772d92b2d826cc07f07fcf3a9f8855289dd837f3ed74
|
7
|
+
data.tar.gz: 2e0d191948ae7c9c413ca437b4a2ca791c7ae8cada54a2793d3804530b2a15a907b8d70ad47979b583d2bd49632e09615a785240af8095f261599350b672e6e3
|
data/README.md
CHANGED
@@ -22,7 +22,7 @@ Or install it yourself as:
|
|
22
22
|
|
23
23
|
After installing the gem just include it in your gemfile and off you go!
|
24
24
|
|
25
|
-
The
|
25
|
+
The objects are generated automatically. They have a base url to connect to and retrieve data via the DataCreator module, which parses and returns corresponding obejcts to the method calls.
|
26
26
|
|
27
27
|
Each object method is listed here:
|
28
28
|
|
data/lib/gitwrap/data_creator.rb
CHANGED
data/lib/gitwrap/orgs.rb
CHANGED
@@ -1,24 +1,29 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
$current_org = 0
|
1
|
+
$: << 'lib'
|
2
|
+
require 'gitwrap/base_connection.rb'
|
4
3
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
@location = hash["location"]
|
10
|
-
@public_repos = hash["public_repos"]
|
11
|
-
@followers = hash["followers"]
|
12
|
-
@members = hash["members"]
|
13
|
-
end
|
4
|
+
module Gitwrap
|
5
|
+
class Org < GithubConnection
|
6
|
+
attr_accessor :name, :site, :location, :public_repos, :followers, :members, :id
|
7
|
+
$current_org = 0
|
14
8
|
|
15
|
-
|
16
|
-
|
17
|
-
|
9
|
+
def initialize(hash)
|
10
|
+
@id = hash["id"]
|
11
|
+
@name = hash["login"]
|
12
|
+
@site = hash["blog"]
|
13
|
+
@location = hash["location"]
|
14
|
+
@public_repos = hash["public_repos"]
|
15
|
+
@followers = hash["followers"]
|
16
|
+
@members = hash["members"]
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.fetch_single_org(organization)
|
20
|
+
org = Org.new({}).create_org("#{BASE_URL}orgs/#{organization}")
|
21
|
+
end
|
18
22
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
+
def self.fetch_all_orgs
|
24
|
+
orgs = Org.new({}).create_many_orgs("#{BASE_URL}organizations?since=#{$current_org}")
|
25
|
+
$current_org += orgs.length-1
|
26
|
+
orgs
|
27
|
+
end
|
23
28
|
end
|
24
29
|
end
|
data/lib/gitwrap/repos.rb
CHANGED
@@ -1,30 +1,35 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
$current_repo = 0
|
1
|
+
$: << 'lib'
|
2
|
+
require 'gitwrap/base_connection.rb'
|
4
3
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
@language = hash["language"]
|
10
|
-
@stars = hash["stargazers_count"]
|
11
|
-
end
|
4
|
+
module Gitwrap
|
5
|
+
class Repo < GithubConnection
|
6
|
+
attr_accessor :name, :url, :forks_count, :language, :stars
|
7
|
+
$current_repo = 0
|
12
8
|
|
13
|
-
|
14
|
-
|
15
|
-
|
9
|
+
def initialize(hash)
|
10
|
+
@name = hash["name"]
|
11
|
+
@url = hash["url"]
|
12
|
+
@forks = hash["forks_count"]
|
13
|
+
@language = hash["language"]
|
14
|
+
@stars = hash["stargazers_count"]
|
15
|
+
end
|
16
16
|
|
17
|
-
|
18
|
-
|
19
|
-
|
17
|
+
def self.fetch_user_repos(username)
|
18
|
+
repo = Repo.new({}).create_user_repos("#{BASE_URL}users/#{username}/repos")
|
19
|
+
end
|
20
20
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
21
|
+
def self.fetch_org_repos(org)
|
22
|
+
repos = Repo.new({}).create_org_repos("#{BASE_URL}orgs/#{org}/repos")
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.fetch_all_repos
|
26
|
+
repos = Repo.new({}).create_many_repos("#{BASE_URL}repositories")
|
27
|
+
$current_repo += repos.length-1
|
28
|
+
repos
|
29
|
+
end
|
26
30
|
|
27
|
-
|
28
|
-
|
31
|
+
def self.fetch_single_repo(username, repo)
|
32
|
+
repo = Repo.new({}).create_single_repo("#{BASE_URL}repos/#{username}/#{repo}")
|
33
|
+
end
|
29
34
|
end
|
30
35
|
end
|
data/lib/gitwrap/users.rb
CHANGED
@@ -1,21 +1,26 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
$current_id = 0
|
1
|
+
$: << 'lib'
|
2
|
+
require 'gitwrap/base_connection.rb'
|
4
3
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
@username = hash['login']
|
10
|
-
end
|
4
|
+
module Gitwrap
|
5
|
+
class User < GithubConnection
|
6
|
+
attr_accessor :name, :location, :email, :username
|
7
|
+
$current_id = 0
|
11
8
|
|
12
|
-
|
13
|
-
|
14
|
-
|
9
|
+
def initialize(hash)
|
10
|
+
@name = hash['name']
|
11
|
+
@location = hash['location']
|
12
|
+
@email = hash['email']
|
13
|
+
@username = hash['login']
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.fetch_single_user(username)
|
17
|
+
user = User.new({}).create_user("#{BASE_URL}users/#{username}")
|
18
|
+
end
|
15
19
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
+
def self.fetch_all_users
|
21
|
+
$all_users = User.new({}).create_many_users("#{BASE_URL}users?since=#{$current_id}")
|
22
|
+
$current_id += $all_users.length-1
|
23
|
+
$all_users
|
24
|
+
end
|
20
25
|
end
|
21
26
|
end
|
data/lib/gitwrap/version.rb
CHANGED
data/lib/gitwrap.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitwrap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- oscarmarcelo95
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|