neo4apis-github 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 92947a29e07d365b4377e3d53d5e9df577f21180
4
+ data.tar.gz: c9d8f4f18e8d13407cd52f9f56513d86a5c4d80f
5
+ SHA512:
6
+ metadata.gz: 547480c3123bbcabc8cc7064c68146fcda3a0306e003769e2f7d6869a3b207385126700b4f250fdecbcc5ef8cb758ce6fc97daee8952984aafbb127c48d8722d
7
+ data.tar.gz: 1e311edf979ed4aea71c97277cd97d5f7b75c2a892a7264e40405d8230a0dd538f6ad9b8087e41df609dae91d45c5ed170a33c0f242d86c19c8838ccda0dec45
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ group :development do
6
+ gem 'pry'
7
+ end
8
+
9
+ group :test do
10
+ gem 'rspec'
11
+ end
12
+
@@ -0,0 +1,21 @@
1
+
2
+ neo4apis-github is a ruby gem for making importing data from github to neo4j easy
3
+
4
+ This adapter supports objects created from the `github` gem.
5
+
6
+ ```ruby
7
+
8
+ require 'github_api'
9
+ github_client = Github.new(oauth_token: token)
10
+
11
+ require 'neo4apis/github'
12
+ neo4japis_github = Neo4Apis::Github.new(Neo4j::Session.open)
13
+
14
+ neo4japis_github.batch do
15
+ github_client.issues.list.each do |issue|
16
+ import :Issue, issue
17
+ end
18
+ end
19
+
20
+ ```
21
+
@@ -0,0 +1,4 @@
1
+ require 'neo4apis'
2
+
3
+ require 'neo4apis/github'
4
+
@@ -0,0 +1,68 @@
1
+ require 'neo4apis'
2
+
3
+ module Neo4Apis
4
+ class Github < Base
5
+ prefix :Github
6
+
7
+ uuid :Repository, :id
8
+ uuid :User, :id
9
+ uuid :Issue, :id
10
+
11
+ importer :Repository do |repository|
12
+ owner_node = import :User, repository.owner
13
+
14
+ node = add_node :Repository, {
15
+ id: repository.id,
16
+ name: repository.name,
17
+ full_name: repository.full_name,
18
+ html_url: repository.html_url,
19
+ description: repository.description,
20
+ fork: repository.fork,
21
+
22
+ stargazers_count: repository.stargazers_count,
23
+ watchers_count: repository.watchers_count,
24
+ language: repository.language,
25
+ forks: repository.forks
26
+ }
27
+
28
+ add_relationship(:has_owner, node, owner_node)
29
+
30
+ node
31
+ end
32
+
33
+ importer :Issue do |issue|
34
+ user_node = import :User, issue.user
35
+ assignee_node = import :User, issue.assignee
36
+ repository_node = import :Repository, issue.repository
37
+
38
+ node = add_node :Issue, {
39
+ id: issue.id,
40
+ number: issue.number,
41
+ title: issue.title,
42
+ body: issue.body,
43
+ html_url: issue.html_url,
44
+ comments: issue.comments,
45
+ created_at: issue.created_at,
46
+ updated_at: issue.updated_at,
47
+ closed_at: issue.closed_at,
48
+ }
49
+
50
+ add_relationship(:from_repository, node, repository_node)
51
+ add_relationship(:has_user, node, user_node)
52
+ add_relationship(:has_assignee, node, assignee_node)
53
+
54
+ node
55
+ end
56
+
57
+ importer :User do |user|
58
+ add_node :User, {
59
+ id: user.id,
60
+ login: user.login,
61
+ html_url: user.html_url,
62
+ site_admin: user.site_admin
63
+ }
64
+ end
65
+
66
+ end
67
+ end
68
+
@@ -0,0 +1,24 @@
1
+ lib = File.expand_path('../lib/', __FILE__)
2
+ $:.unshift lib unless $:.include?(lib)
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = "neo4apis-github"
6
+ s.version = '0.0.3'
7
+ s.required_ruby_version = ">= 1.9.1"
8
+
9
+ s.authors = "Brian Underwood"
10
+ s.email = 'public@brian-underwood.codes'
11
+ s.homepage = "https://github.com/neo4jrb/neo4apis-github/"
12
+ s.summary = "An ruby gem to import github data to neo4j"
13
+ s.license = 'MIT'
14
+ s.description = <<-EOF
15
+ A ruby gem using neo4apis to make importing github data to neo4j easy
16
+ EOF
17
+
18
+ s.require_path = 'lib'
19
+ s.files = Dir.glob("{bin,lib,config}/**/*") + %w(README.md Gemfile neo4apis-github.gemspec)
20
+
21
+ s.add_dependency('neo4apis', "~> 0.0.1")
22
+ s.add_dependency('github_api', "~> 0.12.2")
23
+
24
+ end
metadata ADDED
@@ -0,0 +1,78 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: neo4apis-github
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3
5
+ platform: ruby
6
+ authors:
7
+ - Brian Underwood
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-10-31 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: neo4apis
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.0.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.0.1
27
+ - !ruby/object:Gem::Dependency
28
+ name: github_api
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 0.12.2
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 0.12.2
41
+ description: |
42
+ A ruby gem using neo4apis to make importing github data to neo4j easy
43
+ email: public@brian-underwood.codes
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - Gemfile
49
+ - README.md
50
+ - lib/neo4apis-github.rb
51
+ - lib/neo4apis/github.rb
52
+ - neo4apis-github.gemspec
53
+ homepage: https://github.com/neo4jrb/neo4apis-github/
54
+ licenses:
55
+ - MIT
56
+ metadata: {}
57
+ post_install_message:
58
+ rdoc_options: []
59
+ require_paths:
60
+ - lib
61
+ required_ruby_version: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: 1.9.1
66
+ required_rubygems_version: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ requirements: []
72
+ rubyforge_project:
73
+ rubygems_version: 2.2.2
74
+ signing_key:
75
+ specification_version: 4
76
+ summary: An ruby gem to import github data to neo4j
77
+ test_files: []
78
+ has_rdoc: