my_timeline-github 0.0.2 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.markdown +5 -0
- data/app/scrapers/my_timeline/github/fork_event_builder.rb +15 -9
- data/app/scrapers/my_timeline/github/pull_request_event_builder.rb +20 -12
- data/lib/my_timeline/github/engine.rb +1 -2
- data/lib/my_timeline/github/version.rb +1 -1
- data/my_timeline-github.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 181521b70e1f562f7fa401a58369f5c2718e7020
|
4
|
+
data.tar.gz: e147aca2b3a1682fe3243532e7dd694919c2a9a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5affa4a61418c5511d01fcfe5663f9aca81bb4b9f9af354e7bce0dc696eb7b6285c67e63c54f8a68dfa7ce1cdf5bfca5cb6038f2b132d4c82fc5c0acd12516a
|
7
|
+
data.tar.gz: ed19824ba501615e572796614b80ad3814fa4f9c69b94fcdf05dcf63909f24a6b157d978a297fca2daad6421190205d4a80f0afd21dd2e0d83adff90a4c3f3d8
|
data/CHANGELOG.markdown
CHANGED
@@ -5,7 +5,18 @@ module MyTimeline
|
|
5
5
|
def build_event
|
6
6
|
return false if already_exists_in_db?
|
7
7
|
|
8
|
-
event =
|
8
|
+
event.linkable = fork_event
|
9
|
+
event.user = user if MyTimeline.user_class
|
10
|
+
event.save
|
11
|
+
|
12
|
+
fork_event.event = event
|
13
|
+
fork_event.save
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def event
|
19
|
+
@event ||= MyTimeline::Event.create(
|
9
20
|
happened_on: github_event.created_at,
|
10
21
|
original_id: github_event.id,
|
11
22
|
external_link: "https://www.github.com/#{user.settings(:github).user_name}/#{github_event.repo.name}",
|
@@ -14,19 +25,14 @@ module MyTimeline
|
|
14
25
|
public: 1,
|
15
26
|
description: "Forked #{link_user_repo(github_event.repo.name)}"
|
16
27
|
)
|
28
|
+
end
|
17
29
|
|
18
|
-
|
30
|
+
def fork_event
|
31
|
+
@fork_event ||= MyTimeline::Github::ForkEvent.new(
|
19
32
|
happened_on: github_event.created_at,
|
20
33
|
original_id: github_event.id,
|
21
34
|
repo: github_event.repo.name
|
22
35
|
)
|
23
|
-
|
24
|
-
event.linkable = fork_event
|
25
|
-
event.user = user if MyTimeline.user_class
|
26
|
-
event.save
|
27
|
-
|
28
|
-
fork_event.event = event
|
29
|
-
fork_event.save
|
30
36
|
end
|
31
37
|
end
|
32
38
|
end
|
@@ -5,8 +5,19 @@ module MyTimeline
|
|
5
5
|
def build_event
|
6
6
|
return false if already_exists_in_db?
|
7
7
|
|
8
|
-
event =
|
9
|
-
|
8
|
+
event.linkable = pull_request_event
|
9
|
+
event.user = user if MyTimeline.user_class
|
10
|
+
event.save
|
11
|
+
|
12
|
+
pull_request_event.event = event
|
13
|
+
pull_request_event.save
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def event
|
19
|
+
@event ||= MyTimeline::Event.create(
|
20
|
+
happened_on: happened_on,
|
10
21
|
original_id: github_event.id,
|
11
22
|
external_link: github_event.payload.pull_request.rels[:html].href,
|
12
23
|
icon_name: "github.png",
|
@@ -14,9 +25,11 @@ module MyTimeline
|
|
14
25
|
public: 1,
|
15
26
|
description: "#{github_event.payload.action.capitalize} Pull Request #{link_pr} on #{link_user_repo(github_event.repo.name)}: #{github_event.payload.pull_request.title}"
|
16
27
|
)
|
28
|
+
end
|
17
29
|
|
18
|
-
|
19
|
-
|
30
|
+
def pull_request_event
|
31
|
+
@pull_request_event ||= MyTimeline::Github::PullRequestEvent.new(
|
32
|
+
happened_on: happened_on,
|
20
33
|
title: github_event.payload.pull_request.title,
|
21
34
|
body: github_event.payload.pull_request.body,
|
22
35
|
url: github_event.payload.pull_request.rels[:html].href,
|
@@ -26,16 +39,11 @@ module MyTimeline
|
|
26
39
|
changed_files: github_event.payload.pull_request.changed_files,
|
27
40
|
repo: github_event.repo.name
|
28
41
|
)
|
29
|
-
|
30
|
-
event.linkable = pull_request_event
|
31
|
-
event.user = user if MyTimeline.user_class
|
32
|
-
event.save
|
33
|
-
|
34
|
-
pull_request_event.event = event
|
35
|
-
pull_request_event.save
|
36
42
|
end
|
37
43
|
|
38
|
-
|
44
|
+
def happened_on
|
45
|
+
github_event.created_at
|
46
|
+
end
|
39
47
|
|
40
48
|
def link_pr
|
41
49
|
"<a href=#{github_event.payload.pull_request.rels[:html].href}>##{github_event.payload.number}</a>"
|
@@ -14,8 +14,7 @@ module MyTimeline
|
|
14
14
|
end
|
15
15
|
|
16
16
|
config.after_initialize do |app|
|
17
|
-
MyTimeline.
|
18
|
-
MyTimeline.register_plugin :github
|
17
|
+
MyTimeline.register_plugin :github, defaults: {user_token: nil}
|
19
18
|
end
|
20
19
|
|
21
20
|
rake_tasks do
|
data/my_timeline-github.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: my_timeline-github
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Aiken
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-01-
|
11
|
+
date: 2014-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: my_timeline
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.0
|
19
|
+
version: 0.1.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.0
|
26
|
+
version: 0.1.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: octokit
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|