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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a84e4da89b2ae2a5e470f91003d7c8034a085d0d
4
- data.tar.gz: 87b5bbf68d73b5ed2d1be1ed7a0f09f6717f45e0
3
+ metadata.gz: 1e996179963fd4497d2afe9e14aac0f590e058be
4
+ data.tar.gz: d7f8573235a4d709b862bca821c0aad3c36ef2ac
5
5
  SHA512:
6
- metadata.gz: e57875f16bbffccda55ff3b0c220a41341e5c5fde5a2f29d0f2fa317f259e4b6bbece88e7cd8927bee48d9243559b5d35359ce6246bbfa2b2be8228caa5fd533
7
- data.tar.gz: dc34267fe3d242b728e9802a9665d30a4be8f01fd84304246f0cc17a21df230221e2208b6b4bb251cbc79a16d749697c42b88fadd238aa376062ddb5287e0cef
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 obejcts 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.
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
 
@@ -1,7 +1,7 @@
1
1
  $: << 'lib'
2
- require 'gitwrap/data_creator'
3
2
  require 'json'
4
3
  require 'open-uri'
4
+ require 'gitwrap/data_creator'
5
5
 
6
6
  class GithubConnection
7
7
  include DataCreator
@@ -46,6 +46,6 @@ module DataCreator
46
46
 
47
47
  def create_single_repo(url)
48
48
  Repo.new(parse_data(url))
49
- end
49
+ endn
50
50
 
51
51
  end
data/lib/gitwrap/orgs.rb CHANGED
@@ -1,24 +1,29 @@
1
- class Org < GithubConnection
2
- attr_accessor :name, :site, :location, :public_repos, :followers, :members, :id
3
- $current_org = 0
1
+ $: << 'lib'
2
+ require 'gitwrap/base_connection.rb'
4
3
 
5
- def initialize(hash)
6
- @id = hash["id"]
7
- @name = hash["login"]
8
- @site = hash["blog"]
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
- def self.fetch_single_org(organization)
16
- org = Org.new({}).create_org("#{BASE_URL}orgs/#{organization}")
17
- end
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
- def self.fetch_all_orgs
20
- orgs = Org.new({}).create_many_orgs("#{BASE_URL}organizations?since=#{$current_org}")
21
- $current_org += orgs.length-1
22
- orgs
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
- class Repo < GithubConnection
2
- attr_accessor :name, :url, :forks_count, :language, :stars
3
- $current_repo = 0
1
+ $: << 'lib'
2
+ require 'gitwrap/base_connection.rb'
4
3
 
5
- def initialize(hash)
6
- @name = hash["name"]
7
- @url = hash["url"]
8
- @forks = hash["forks_count"]
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
- def self.fetch_user_repos(username)
14
- repo = Repo.new({}).create_user_repos("#{BASE_URL}users/#{username}/repos")
15
- end
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
- def self.fetch_org_repos(org)
18
- repos = Repo.new({}).create_org_repos("#{BASE_URL}orgs/#{org}/repos")
19
- end
17
+ def self.fetch_user_repos(username)
18
+ repo = Repo.new({}).create_user_repos("#{BASE_URL}users/#{username}/repos")
19
+ end
20
20
 
21
- def self.fetch_all_repos
22
- repos = Repo.new({}).create_many_repos("#{BASE_URL}repositories")
23
- $current_repo += repos.length-1
24
- repos
25
- end
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
- def self.fetch_single_repo(username, repo)
28
- repo = Repo.new({}).create_single_repo("#{BASE_URL}repos/#{username}/#{repo}")
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
- class User < GithubConnection
2
- attr_accessor :name, :location, :email, :username
3
- $current_id = 0
1
+ $: << 'lib'
2
+ require 'gitwrap/base_connection.rb'
4
3
 
5
- def initialize(hash)
6
- @name = hash['name']
7
- @location = hash['location']
8
- @email = hash['email']
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
- def self.fetch_single_user(username)
13
- user = User.new({}).create_user("#{BASE_URL}users/#{username}")
14
- end
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
- def self.fetch_all_users
17
- $all_users = User.new({}).create_many_users("#{BASE_URL}users?since=#{$current_id}")
18
- $current_id += $all_users.length-1
19
- $all_users
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
@@ -1,3 +1,3 @@
1
1
  module Gitwrap
2
- VERSION = "0.7.0"
2
+ VERSION = "0.8.0"
3
3
  end
data/lib/gitwrap.rb CHANGED
@@ -1,4 +1,3 @@
1
1
  require "gitwrap/version"
2
- require "gitwrap/dependencies"
3
2
  module Gitwrap
4
3
  end
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.7.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-17 00:00:00.000000000 Z
11
+ date: 2015-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler