my_timeline-github 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.markdown +6 -0
- data/README.markdown +24 -26
- data/app/models/my_timeline/github/fork_event.rb +1 -1
- data/app/models/my_timeline/github/pull_request_event.rb +10 -0
- data/app/scrapers/my_timeline/github/github_scraper.rb +1 -1
- data/app/scrapers/my_timeline/github/pull_request_event_builder.rb +45 -0
- data/config/routes.rb +2 -2
- data/db/migrate/{20131222224040_create_github_fork_events.rb → create_github_fork_events.rb} +0 -0
- data/db/migrate/create_github_pull_request_events.rb +19 -0
- data/lib/my_timeline/github/railties/github_tasks.rake +18 -8
- data/lib/my_timeline/github/version.rb +1 -1
- data/my_timeline-github.gemspec +1 -1
- metadata +10 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 459fd302a5a573cadc74fbea8fcd6b679b29b76c
|
4
|
+
data.tar.gz: b83b3a73a416886141031e6ad3b78bea71c6ddf0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df601e08ac424cfc4f45f6a5d36e9d8abcc393edbb368788ea0523705d83d5292f160ba730a30118e365dd0fa6fb576f41bb81359220aa2caed0b0b284754288
|
7
|
+
data.tar.gz: a85e4ccc67be66a9f51107816e5833c3fa20adfc91006f0a6b1134fb8f55cc75ce052af07304a2e994bcd8b2796ed9ac1e9012edb552f3913b62485d6169c3f9
|
data/CHANGELOG.markdown
ADDED
data/README.markdown
CHANGED
@@ -1,14 +1,12 @@
|
|
1
|
-
[![Code Climate](https://codeclimate.com/github/JustinAiken/my_timeline-github.png)](https://codeclimate.com/github/JustinAiken/my_timeline-github)
|
2
|
-
|
3
|
-
# My Timeline - Github Plugin
|
1
|
+
# My Timeline - Github Plugin [![Code Climate](https://codeclimate.com/github/JustinAiken/my_timeline-github.png)](https://codeclimate.com/github/JustinAiken/my_timeline-github)
|
4
2
|
#### Github Integration with My Timeline
|
5
3
|
|
6
|
-
|
4
|
+
## Requirements:
|
7
5
|
|
8
6
|
- [My Timeline](https://github.com/JustinAiken/my_timeline)
|
9
7
|
- [Octokit](https://github.com/octokit/octokit.rb) gem
|
10
8
|
|
11
|
-
|
9
|
+
## Usage:
|
12
10
|
|
13
11
|
1. Add this gem to your Gemfile:
|
14
12
|
`gem 'my_timeline-github'` and `bundle install`
|
@@ -29,30 +27,30 @@ end
|
|
29
27
|
|
30
28
|
```
|
31
29
|
|
32
|
-
|
30
|
+
## Current State
|
33
31
|
|
34
32
|
Github provides a wide variety of user activities. This plugin will eventually include them all, but they'll be coming one at a time...
|
35
33
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
34
|
+
`[ ]` [CommitCommentEvent](http://developer.github.com/v3/activity/events/types/#commitcommentevent) <br>
|
35
|
+
`[ ]` [CreateEvent](http://developer.github.com/v3/activity/events/types/#createevent) <br>
|
36
|
+
`[ ]` [DeleteEvent](http://developer.github.com/v3/activity/events/types/#deleteevent) <br>
|
37
|
+
`[ ]` [DownloadEvent](http://developer.github.com/v3/activity/events/types/#downloadevent) <br>
|
38
|
+
`[ ]` [FollowEvent](http://developer.github.com/v3/activity/events/types/#followevent) <br>
|
39
|
+
`[x]` [ForkEvent](http://developer.github.com/v3/activity/events/types/#forkevent) <br>
|
40
|
+
`[ ]` [ForkApplyEvent](http://developer.github.com/v3/activity/events/types/#forkapplyevent) <br>
|
41
|
+
`[ ]` [GistEvent](http://developer.github.com/v3/activity/events/types/#gistevent) <br>
|
42
|
+
`[ ]` [GollumEvent](http://developer.github.com/v3/activity/events/types/#gollumevent) <br>
|
43
|
+
`[ ]` [IssueCommentEvent](http://developer.github.com/v3/activity/events/types/#issuecommentevent) <br>
|
44
|
+
`[ ]` [IssuesEvent](http://developer.github.com/v3/activity/events/types/#issuesevent) <br>
|
45
|
+
`[ ]` [MemberEvent](http://developer.github.com/v3/activity/events/types/#memberevent) <br>
|
46
|
+
`[ ]` [PublicEvent](http://developer.github.com/v3/activity/events/types/#publicevent) <br>
|
47
|
+
`[X]` [PullRequestEvent](http://developer.github.com/v3/activity/events/types/#pullrequestevent) <br>
|
48
|
+
`[ ]` [PullRequestReviewCommentEvent](http://developer.github.com/v3/activity/events/types/#pullrequestreviewcommentevent) <br>
|
49
|
+
`[ ]` [PushEvent](http://developer.github.com/v3/activity/events/types/#pushevent) <br>
|
50
|
+
`[ ]` [ReleaseEvent](http://developer.github.com/v3/activity/events/types/#releaseevent) <br>
|
51
|
+
`[ ]` [StatusEvent](http://developer.github.com/v3/activity/events/types/#statusevent) <br>
|
52
|
+
`[ ]` [TeamAddEvent](http://developer.github.com/v3/activity/events/types/#teamaddevent) <br>
|
53
|
+
`[ ]` [WatchEvent](http://developer.github.com/v3/activity/events/types/#watchevent)
|
56
54
|
|
57
55
|
## Credits
|
58
56
|
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module MyTimeline
|
2
|
+
module Github
|
3
|
+
class PullRequestEventBuilder < GithubBuilder
|
4
|
+
|
5
|
+
def build_event
|
6
|
+
return false if already_exists_in_db?
|
7
|
+
|
8
|
+
event = MyTimeline::Event.create(
|
9
|
+
happened_on: github_event.created_at,
|
10
|
+
original_id: github_event.id,
|
11
|
+
external_link: github_event.payload.pull_request.rels[:html].href,
|
12
|
+
icon_name: "github.png",
|
13
|
+
importance: 5,
|
14
|
+
public: 1,
|
15
|
+
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
|
+
)
|
17
|
+
|
18
|
+
pull_request_event = MyTimeline::Github::PullRequestEvent.new(
|
19
|
+
happened_on: github_event.created_at,
|
20
|
+
title: github_event.payload.pull_request.title,
|
21
|
+
body: github_event.payload.pull_request.body,
|
22
|
+
url: github_event.payload.pull_request.rels[:html].href,
|
23
|
+
commits: github_event.payload.pull_request.commits,
|
24
|
+
additions: github_event.payload.pull_request.additions,
|
25
|
+
deletions: github_event.payload.pull_request.deletions,
|
26
|
+
changed_files: github_event.payload.pull_request.changed_files,
|
27
|
+
repo: github_event.repo.name
|
28
|
+
)
|
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
|
+
end
|
37
|
+
|
38
|
+
private
|
39
|
+
|
40
|
+
def link_pr
|
41
|
+
"<a href=#{github_event.payload.pull_request.rels[:html].href}>##{github_event.payload.number}</a>"
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
data/config/routes.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
MyTimeline::Engine.routes.draw do
|
2
|
-
|
3
|
-
post
|
2
|
+
get 'github/scrape' => 'github#scrape', as: "github_scrape"
|
3
|
+
post 'github/new' => 'github#new', as: "new_github"
|
4
4
|
resources :github
|
5
5
|
end
|
data/db/migrate/{20131222224040_create_github_fork_events.rb → create_github_fork_events.rb}
RENAMED
File without changes
|
@@ -0,0 +1,19 @@
|
|
1
|
+
class CreateGithubPullRequestEvents < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :my_timeline_github_pull_request_events do |t|
|
4
|
+
t.datetime :happened_on
|
5
|
+
|
6
|
+
t.text :title
|
7
|
+
t.text :body
|
8
|
+
t.string :url
|
9
|
+
t.integer :commits
|
10
|
+
t.integer :additions
|
11
|
+
t.integer :deletions
|
12
|
+
t.integer :changed_files
|
13
|
+
t.string :repo
|
14
|
+
|
15
|
+
t.references :event
|
16
|
+
t.timestamps
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -1,13 +1,23 @@
|
|
1
|
-
namespace "my_timeline-
|
1
|
+
namespace "my_timeline-github" do
|
2
|
+
|
3
|
+
def already_copied?(migration_file)
|
4
|
+
`ls db/migrate/*#{migration_file}.my_timeline.rb` != ""
|
5
|
+
end
|
6
|
+
|
7
|
+
def copy_migration(migration_file)
|
8
|
+
return if already_copied? migration_file
|
9
|
+
timestamp = Time.now.strftime("%Y%m%d%H%M%S")
|
10
|
+
source = File.expand_path "../../../../db/migrate/#{migration_file}.rb", File.dirname(__FILE__)
|
11
|
+
dest = File.expand_path "db/migrate/#{timestamp}_#{migration_file}.my_timeline.rb"
|
12
|
+
puts "cp #{source} #{dest}"
|
13
|
+
`cp #{source} #{dest}`
|
14
|
+
end
|
15
|
+
|
2
16
|
namespace :install do
|
3
|
-
desc "Copy migrations from my_timeline-
|
17
|
+
desc "Copy migrations from my_timeline-github to application"
|
4
18
|
task :migrations do
|
5
|
-
|
6
|
-
|
7
|
-
source = File.expand_path "../../../../db/migrate//db/migrate/20131222224040_create_github_fork_events.rb", File.dirname(__FILE__)
|
8
|
-
dest = File.expand_path "db/migrate/#{timestamp}_create_github_fork_events.my_timeline.rb"
|
9
|
-
puts "cp #{source} #{dest}"
|
10
|
-
`cp #{source} #{dest}`
|
19
|
+
copy_migration "create_github_fork_events"
|
20
|
+
copy_migration "create_github_pull_request_events"
|
11
21
|
end
|
12
22
|
end
|
13
23
|
end
|
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.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Aiken
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-01-10 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:
|
19
|
+
version: 0.0.4
|
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:
|
26
|
+
version: 0.0.4
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: octokit
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -46,18 +46,22 @@ extensions: []
|
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
48
|
- .gitignore
|
49
|
+
- CHANGELOG.markdown
|
49
50
|
- Gemfile
|
50
51
|
- LICENSE
|
51
52
|
- README.markdown
|
52
53
|
- app/assets/images/my_timeline/icons/github.png
|
53
54
|
- app/controllers/my_timeline/github_controller.rb
|
54
55
|
- app/models/my_timeline/github/fork_event.rb
|
56
|
+
- app/models/my_timeline/github/pull_request_event.rb
|
55
57
|
- app/scrapers/my_timeline/github/fork_event_builder.rb
|
56
58
|
- app/scrapers/my_timeline/github/github_builder.rb
|
57
59
|
- app/scrapers/my_timeline/github/github_scraper.rb
|
60
|
+
- app/scrapers/my_timeline/github/pull_request_event_builder.rb
|
58
61
|
- app/views/my_timeline/github/_control_panel.html.erb
|
59
62
|
- config/routes.rb
|
60
|
-
- db/migrate/
|
63
|
+
- db/migrate/create_github_fork_events.rb
|
64
|
+
- db/migrate/create_github_pull_request_events.rb
|
61
65
|
- lib/my_timeline-github.rb
|
62
66
|
- lib/my_timeline/github/engine.rb
|
63
67
|
- lib/my_timeline/github/railties/github_tasks.rake
|
@@ -83,9 +87,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
83
87
|
version: '0'
|
84
88
|
requirements: []
|
85
89
|
rubyforge_project:
|
86
|
-
rubygems_version: 2.0.
|
90
|
+
rubygems_version: 2.0.3
|
87
91
|
signing_key:
|
88
92
|
specification_version: 4
|
89
93
|
summary: Github plugin for MyTimeline
|
90
94
|
test_files: []
|
91
|
-
has_rdoc:
|