neo4apis-github 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 50c493af7ce019e95f72822c3778e60c614b06fd
4
- data.tar.gz: 0416e9593c5aee224fb8eeeaafae23a2890c1536
3
+ metadata.gz: 774300728dd1f077c28e03d0a8e6a1e8bca049b1
4
+ data.tar.gz: 6126f205ac27fced87b2180fd7b6bb60fa31774a
5
5
  SHA512:
6
- metadata.gz: 86b5683c6383a39f676cb228413a1129ae3ecaefb3582a1b55a6a1e1554df43e40252c14e5d85905d064043ba2df87277ed50720ef3661ca44915a594d561c97
7
- data.tar.gz: 619a538dfa58a8e8ea176f4ea7b0c097258fa4ae825a2d1545a5048ba41e3a0d59cf0bd860a76e646ec1d15c36268a3ce4b97a3336ad2bcfb88ecf104a020e18
6
+ metadata.gz: d81101e1fe724e1a3a6b5d08cc948da26d6c0012352ba838e71a7c26eb07843bc5104bc7257ae8310cee0fc7f636a117357426f09c37f0955ce46644a5113378
7
+ data.tar.gz: 38c8559351c256bf6abdc50ce088957eed2a582d4cd1af5b4268f8031664865d95d5e9b07f6ea2d84115c0e38968d593388ce7ad67aa5e32274f4edecacbda3e
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  neo4apis-github is a ruby gem for making importing data from github to neo4j easy
3
3
 
4
- This adapter supports objects created from the `github` gem.
4
+ This adapter supports objects created from the `github_api` gem.
5
5
 
6
6
  ```ruby
7
7
 
@@ -24,4 +24,4 @@ end
24
24
 
25
25
  ```
26
26
 
27
- Current supports importing of User, Issue, and Repository
27
+ Currently supports importing of User, Issue, Repository, Comment, and Commit entities
@@ -2,17 +2,22 @@ require 'neo4apis'
2
2
 
3
3
  module Neo4Apis
4
4
  class Github < Base
5
- prefix :Github
5
+ common_label :GitHub
6
6
 
7
7
  uuid :Repository, :id
8
8
  uuid :User, :id
9
9
  uuid :Issue, :id
10
+ uuid :Comment, :id
11
+ uuid :Commit, :sha
10
12
 
11
13
  importer :Repository do |repository|
12
14
  owner_node = import :User, repository.owner
13
15
 
14
- node = add_node :Repository, repository, [:id, :name, :full_name, :html_url, :description, :fork,
15
- :stargazers_count, :watchers_count, :language, :forks]
16
+ node = add_node :Repository, repository, [:id, :name, :full_name, :html_url, :description,# :fork,
17
+ :stargazers_count, :watchers_count, :language, :forks,
18
+ :git_url, :ssh_url, :clone_url, :svn_url, :homepage,
19
+ :size, :forks_count, :mirror_url,
20
+ :created_at, :updated_at, :pushed_at]
16
21
 
17
22
  add_relationship(:has_owner, node, owner_node)
18
23
 
@@ -21,21 +26,51 @@ module Neo4Apis
21
26
 
22
27
  importer :Issue do |issue|
23
28
  user_node = import :User, issue.user
24
- assignee_node = import :User, issue.assignee
25
- repository_node = import :Repository, issue.repository
29
+ assignee_node = import :User, issue.assignee if issue.assignee
26
30
 
27
31
  node = add_node :Issue, issue, [:id, :number, :title, :body, :html_url, :comments,
28
32
  :created_at, :updated_at, :closed_at]
29
33
 
30
- add_relationship(:from_repository, node, repository_node)
31
34
  add_relationship(:has_user, node, user_node)
32
- add_relationship(:has_assignee, node, assignee_node)
35
+ add_relationship(:has_assignee, node, assignee_node) if assignee_node
36
+
37
+ node
38
+ end
39
+
40
+ importer :Comment do |comment|
41
+ user_node = import :User, comment.user
42
+
43
+ node = add_node :Comment, comment, [:id, :html_url, :body,
44
+ :position, :line, :path, :commit_id,
45
+ :created_at, :updated_at]
46
+
47
+ add_relationship(:made_comment, user_node, node)
48
+
49
+ node
50
+ end
51
+
52
+ importer :Commit do |commit|
53
+ author_node = import :User, commit.author if commit.author
54
+ committer_node = import :User, commit.committer if commit.committer
55
+
56
+ node = add_node(:Commit, commit, [:sha, :html_url]) do |props|
57
+ props.commit_author_date = commit.commit.author.date
58
+ props.commit_committer_date = commit.commit.committer.date
59
+
60
+ props.commit_message = commit.commit.message
61
+
62
+ props.stats = commit.stats.to_json
63
+ end
64
+
65
+
66
+ add_relationship(:authored, node, author_node) if author_node
67
+ add_relationship(:committed, node, committer_node) if committer_node
33
68
 
34
69
  node
35
70
  end
36
71
 
37
72
  importer :User do |user|
38
- add_node :User, user, [:id, :login, :html_url, :site_admin]
73
+ add_node :User, user, [:id, :login, :avatar_url, :gravatar_id, :type, :html_url, :site_admin]
39
74
  end
40
75
 
41
76
  end
@@ -3,7 +3,7 @@ $:.unshift lib unless $:.include?(lib)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "neo4apis-github"
6
- s.version = '0.1.0'
6
+ s.version = '0.2.0'
7
7
  s.required_ruby_version = ">= 1.9.1"
8
8
 
9
9
  s.authors = "Brian Underwood"
@@ -18,7 +18,7 @@ A ruby gem using neo4apis to make importing github data to neo4j easy
18
18
  s.require_path = 'lib'
19
19
  s.files = Dir.glob("{bin,lib,config}/**/*") + %w(README.md Gemfile neo4apis-github.gemspec)
20
20
 
21
- s.add_dependency('neo4apis', "~> 0.2.0")
21
+ s.add_dependency('neo4apis', "~> 0.6.0")
22
22
  s.add_dependency('github_api', "~> 0.12.2")
23
23
 
24
24
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neo4apis-github
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Underwood
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-02 00:00:00.000000000 Z
11
+ date: 2015-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: neo4apis
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.2.0
19
+ version: 0.6.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.2.0
26
+ version: 0.6.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: github_api
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -70,7 +70,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
70
70
  version: '0'
71
71
  requirements: []
72
72
  rubyforge_project:
73
- rubygems_version: 2.2.2
73
+ rubygems_version: 2.4.3
74
74
  signing_key:
75
75
  specification_version: 4
76
76
  summary: An ruby gem to import github data to neo4j