stratify-github 0.1

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.
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ *.gem
2
+ .bundle
3
+ pkg/*
4
+
data/.rvmrc ADDED
@@ -0,0 +1 @@
1
+ rvm use ruby-1.9.3-p125@stratify
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in stratify-github.gemspec
4
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,96 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ stratify-github (0.1)
5
+ actionpack (~> 3.2.0)
6
+ railties (~> 3.2.0)
7
+ rinku (~> 1.0.0)
8
+ stratify-base (~> 0.1.4)
9
+
10
+ GEM
11
+ remote: http://rubygems.org/
12
+ specs:
13
+ actionpack (3.2.7)
14
+ activemodel (= 3.2.7)
15
+ activesupport (= 3.2.7)
16
+ builder (~> 3.0.0)
17
+ erubis (~> 2.7.0)
18
+ journey (~> 1.0.4)
19
+ rack (~> 1.4.0)
20
+ rack-cache (~> 1.2)
21
+ rack-test (~> 0.6.1)
22
+ sprockets (~> 2.1.3)
23
+ activemodel (3.2.7)
24
+ activesupport (= 3.2.7)
25
+ builder (~> 3.0.0)
26
+ activesupport (3.2.7)
27
+ i18n (~> 0.6)
28
+ multi_json (~> 1.0)
29
+ bson (1.6.4)
30
+ bson_ext (1.6.4)
31
+ bson (~> 1.6.4)
32
+ builder (3.0.0)
33
+ database_cleaner (0.7.2)
34
+ diff-lcs (1.1.3)
35
+ erubis (2.7.0)
36
+ fakeweb (1.3.0)
37
+ hike (1.2.1)
38
+ i18n (0.6.0)
39
+ journey (1.0.4)
40
+ json (1.7.4)
41
+ mongo (1.6.2)
42
+ bson (~> 1.6.2)
43
+ mongoid (2.4.12)
44
+ activemodel (~> 3.1)
45
+ mongo (<= 1.6.2)
46
+ tzinfo (~> 0.3.22)
47
+ multi_json (1.3.6)
48
+ rack (1.4.1)
49
+ rack-cache (1.2)
50
+ rack (>= 0.4)
51
+ rack-ssl (1.3.2)
52
+ rack
53
+ rack-test (0.6.1)
54
+ rack (>= 1.0)
55
+ railties (3.2.7)
56
+ actionpack (= 3.2.7)
57
+ activesupport (= 3.2.7)
58
+ rack-ssl (~> 1.3.2)
59
+ rake (>= 0.8.7)
60
+ rdoc (~> 3.4)
61
+ thor (>= 0.14.6, < 2.0)
62
+ rake (0.9.2.2)
63
+ rdoc (3.12)
64
+ json (~> 1.4)
65
+ rinku (1.0.0)
66
+ rspec (2.9.0)
67
+ rspec-core (~> 2.9.0)
68
+ rspec-expectations (~> 2.9.0)
69
+ rspec-mocks (~> 2.9.0)
70
+ rspec-core (2.9.0)
71
+ rspec-expectations (2.9.1)
72
+ diff-lcs (~> 1.1.3)
73
+ rspec-mocks (2.9.0)
74
+ sprockets (2.1.3)
75
+ hike (~> 1.2)
76
+ rack (~> 1.0)
77
+ tilt (~> 1.1, != 1.3.0)
78
+ stratify-base (0.1.4)
79
+ bson_ext (~> 1.6.0)
80
+ mongoid (~> 2.4.0)
81
+ tilt (~> 1.3.2)
82
+ thor (0.15.4)
83
+ tilt (1.3.3)
84
+ tzinfo (0.3.33)
85
+ vcr (1.10.3)
86
+
87
+ PLATFORMS
88
+ ruby
89
+
90
+ DEPENDENCIES
91
+ database_cleaner (~> 0.7.2)
92
+ fakeweb (~> 1.3.0)
93
+ rake (~> 0.9.2)
94
+ rspec (~> 2.9.0)
95
+ stratify-github!
96
+ vcr (~> 1.10.0)
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2012 Daemian Mack (http://daemianmack.com)
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ 'Software'), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,21 @@
1
+ # stratify-github
2
+
3
+ ## Dependencies
4
+
5
+ Stratify is developed and tested with the following dependencies.
6
+
7
+ * Ruby 1.9.3 (See `.rvmrc` for the specific version.)
8
+ * MongoDB 2.0
9
+
10
+ ## Development
11
+
12
+ To get set up for development on stratify-github, clone the repo, and ...
13
+
14
+ cd stratify/stratify-github
15
+ gem install bundler
16
+ bundle
17
+ rake
18
+
19
+ ## License
20
+
21
+ Copyright 2012 Daemian Mack ([daemianmack.com](http://daemianmack.com)). Released under the MIT license. See the LICENSE file for further details.
data/Rakefile ADDED
@@ -0,0 +1,10 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
3
+
4
+ require 'rspec/core'
5
+ require 'rspec/core/rake_task'
6
+ RSpec::Core::RakeTask.new(:spec) do |spec|
7
+ spec.pattern = FileList['spec/**/*_spec.rb']
8
+ end
9
+
10
+ task :default => :spec
@@ -0,0 +1,6 @@
1
+ require 'stratify-base'
2
+
3
+ require 'stratify-github/activity'
4
+ require 'stratify-github/collector'
5
+ require 'stratify-github/engine'
6
+ require 'stratify-github/version'
@@ -0,0 +1,40 @@
1
+ require 'stratify-github/presenter'
2
+ require 'stratify-github/translation'
3
+
4
+ module Stratify
5
+ module GitHub
6
+ class Activity < Stratify::Activity
7
+ extend Stratify::GitHub::Translation
8
+
9
+ field :checksum
10
+ field :url
11
+ field :actor
12
+ field :repository
13
+ field :action # 'created', 'deleted', etc.
14
+ field :ref # The human/ref name for a branch, tag, etc.
15
+ field :ref_type # 'branch', 'repo', 'tag'...
16
+ field :thing # The acted-upon item. ('target' is reserved by mongoid.)
17
+ field :payload # A text snippet of the comment, gists, etc.
18
+ field :event_type
19
+
20
+ natural_key :checksum
21
+
22
+ validates_presence_of :checksum, :url, :actor, :event_type
23
+
24
+ def permalink
25
+ url
26
+ end
27
+
28
+ # Let the values of this object's fields inform its checksum.
29
+ def to_str
30
+ fields.collect do |field, body|
31
+ send(field) if body.type == Object
32
+ end.compact.sort.join(' ')
33
+ end
34
+
35
+ def to_html
36
+ Stratify::GitHub::Presenter.new(self).to_html
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,23 @@
1
+ require 'open-uri'
2
+
3
+ module Stratify
4
+ module GitHub
5
+ class Collector < Stratify::Collector
6
+ source "GitHub"
7
+
8
+ configuration_fields :username => {:type => :string}
9
+
10
+ def activities
11
+ activities_from_api.map do |activity_in_api_format|
12
+ Stratify::GitHub::Activity.from_api_hash(activity_in_api_format)
13
+ end
14
+ end
15
+
16
+ private
17
+
18
+ def activities_from_api
19
+ JSON.parse open("https://github.com/#{username}.json").read
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,9 @@
1
+ require 'rails'
2
+
3
+ module Stratify
4
+ module GitHub
5
+ class Engine < Rails::Engine
6
+ engine_name :stratify_github
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,222 @@
1
+ module Stratify
2
+ module GitHub
3
+ class Event
4
+ extend ActionView::Helpers
5
+
6
+ def self.trunc(text, length=140)
7
+ truncate(text, :length => length)
8
+ end
9
+
10
+
11
+ class CommitCommentEvent
12
+ def self.make(activity, api_hash)
13
+ activity.repository = api_hash['url'].split('/')[0..4].join('/')
14
+ activity
15
+ end
16
+ def self.text(activity)
17
+ "#{activity.actor} commented on a commit to #{activity.repository}"
18
+ end
19
+ end
20
+
21
+ class CreateEvent
22
+ def self.make(activity, api_hash)
23
+ activity.ref = api_hash['payload']['ref']
24
+ activity.ref_type = api_hash['payload']['ref_type']
25
+ # This is terrible.
26
+ if activity.ref_type == 'repository'
27
+ activity.repository = api_hash['url']
28
+ else
29
+ activity.repository = api_hash['url'].split('/')[0..-3].join('/')
30
+ end
31
+ activity
32
+ end
33
+ def self.text(activity)
34
+ # ref is populated if ref_type is not 'repository'.
35
+ ref = activity.ref ? "#{activity.ref} on" : ''
36
+ "#{activity.actor} created #{activity.ref_type} #{ref} #{activity.repository}"
37
+ end
38
+ end
39
+
40
+ class DeleteEvent
41
+ def self.make(activity, api_hash)
42
+ activity.ref = api_hash['payload']['ref']
43
+ activity.ref_type = api_hash['payload']['ref_type']
44
+ activity.repository = api_hash['repository']['url']
45
+ activity
46
+ end
47
+ def self.text(activity)
48
+ "#{activity.actor} deleted #{activity.ref_type} #{activity.ref} from #{activity.repository}"
49
+ end
50
+ end
51
+
52
+ # Unused? Unseen in the wild.
53
+ # class DownloadEvent
54
+ # def make(activity, api_hash)
55
+ # activity
56
+ # end
57
+ # def text(activity)
58
+ # "A download occurred!"
59
+ # end
60
+ # end
61
+
62
+ class FollowEvent
63
+ def self.make(activity, api_hash)
64
+ activity.thing = api_hash['payload']['target']['login']
65
+ activity
66
+ end
67
+ def self.text(activity)
68
+ "#{activity.actor} followed #{activity.thing}"
69
+ end
70
+ end
71
+
72
+ class ForkEvent
73
+ def self.make(activity, api_hash)
74
+ activity.thing = api_hash['repository']['url']
75
+ activity
76
+ end
77
+ def self.text(activity)
78
+ "#{activity.actor} forked #{activity.thing}"
79
+ end
80
+ end
81
+
82
+ # Unused? Unseen in the wild.
83
+ # class ForkApplyEvent
84
+ # def self.make(activity, api_hash)
85
+ # activity.thing = api_hash['head']
86
+ # activity
87
+ # end
88
+ # def self.text(activity)
89
+ # "#{activity.actor} applied a patch in the Fork Queue to #{activity.head}"
90
+ # end
91
+ # end
92
+
93
+ class GistEvent
94
+ def self.make(activity, api_hash)
95
+ activity.action = api_hash['payload']['action']
96
+ activity.payload = api_hash['payload']['desc']
97
+ activity
98
+ end
99
+ def self.text(activity)
100
+ "#{activity.actor} #{activity.action}d a gist: #{activity.payload}"
101
+ end
102
+ end
103
+
104
+ class GollumEvent
105
+ def self.make(activity, api_hash)
106
+ # TODO Handle more than one page per event, assuming that happens.
107
+ activity.action = api_hash['payload']['pages'][0]['action']
108
+ activity.repository = api_hash['repository']['url']
109
+ activity.thing = api_hash['payload']['pages'][0]['page_name']
110
+ activity
111
+ end
112
+ def self.text(activity)
113
+ "#{activity.actor} #{activity.action} wiki page #{activity.thing} on #{activity.repository}"
114
+ end
115
+ end
116
+
117
+ class IssueCommentEvent
118
+ def self.make(activity, api_hash)
119
+ activity.repository = api_hash['repository']['url']
120
+ activity
121
+ end
122
+ def self.text(activity)
123
+ "#{activity.actor} commented on an issue on #{activity.repository}"
124
+ end
125
+ end
126
+
127
+ class IssuesEvent
128
+ def self.make(activity, api_hash)
129
+ activity.action = api_hash['payload']['action']
130
+ activity.repository = api_hash['url']
131
+ activity
132
+ end
133
+ def self.text(activity)
134
+ "#{activity.actor} #{activity.action} an issue on #{activity.repository}"
135
+ end
136
+ end
137
+
138
+ class MemberEvent
139
+ def self.make(activity, api_hash)
140
+ activity.action = api_hash['payload']['action']
141
+ activity.repository = api_hash['url']
142
+ activity.thing = api_hash['payload']['member']['login']
143
+ activity
144
+ end
145
+ def self.text(activity)
146
+ "#{activity.actor} #{activity.action} #{activity.thing} as a collaborator to #{activity.repository}"
147
+ end
148
+ end
149
+
150
+ class PublicEvent
151
+ def self.make(activity, api_hash)
152
+ activity.action = "publicized"
153
+ activity.repository = api_hash['repository']['url']
154
+ activity
155
+ end
156
+ def self.text(activity)
157
+ "#{activity.actor} opened #{activity.repository} to the public"
158
+ end
159
+ end
160
+
161
+ class PullRequestEvent < Event
162
+ def self.make(activity, api_hash)
163
+ activity.payload = api_hash['payload']['pull_request']['body'] || api_hash['payload']['pull_request']['title']
164
+ activity.repository = api_hash['repository']['url']
165
+ activity
166
+ end
167
+ def self.text(activity)
168
+ payload = trunc(activity.payload)
169
+ "#{activity.actor} made a pull request on #{activity.repository} -- #{payload}"
170
+ end
171
+ end
172
+
173
+ class PullRequestReviewCommentEvent < Event
174
+ def self.make(activity, api_hash)
175
+ activity.payload = api_hash['payload']['comment']['body']
176
+ activity.repository = api_hash['repository']['url']
177
+ activity
178
+ end
179
+ def self.text(activity)
180
+ payload = trunc(activity.payload)
181
+ "#{activity.actor} commented on a pull request on #{activity.repository} -- #{payload}"
182
+ end
183
+ end
184
+
185
+ class PushEvent < Event
186
+ def self.make(activity, api_hash)
187
+ activity.action = "pushed"
188
+ activity.ref = api_hash['payload']['ref']
189
+ activity.repository = api_hash['repository']['url']
190
+ activity.payload = api_hash['payload']['shas'][0][2]
191
+ activity
192
+ end
193
+ def self.text(activity)
194
+ payload = truncate(activity.payload, :length => 140)
195
+ "#{activity.actor} pushed to #{activity.ref} on #{activity.repository} -- #{payload}"
196
+ end
197
+ end
198
+
199
+ # Untested.
200
+ # class TeamAddEvent
201
+ # def self.make(activity, api_hash)
202
+ # activity.ref = api_hash['ref']
203
+ # activity.thing = api_hash['repository']['url']
204
+ # activity
205
+ # end
206
+ # def self.text(activity)
207
+ # "#{activity.actor} added team member #{activity.ref} to #{activity.thing}"
208
+ # end
209
+ # end
210
+
211
+ class WatchEvent
212
+ def self.make(activity, api_hash)
213
+ activity
214
+ end
215
+ def self.text(activity)
216
+ "#{activity.actor} started watching #{activity.url}"
217
+ end
218
+ end
219
+
220
+ end
221
+ end
222
+ end
@@ -0,0 +1,30 @@
1
+ require 'action_view'
2
+ require 'rinku'
3
+
4
+ module Stratify
5
+ module GitHub
6
+ class Presenter
7
+ include ActionView::Helpers::UrlHelper
8
+
9
+ def initialize(activity)
10
+ @activity = activity
11
+ end
12
+
13
+ def text
14
+ clazz = Stratify::GitHub::Event.const_get(@activity.event_type)
15
+ return clazz.text(@activity)
16
+ end
17
+
18
+ def to_html
19
+ linkify_urls(text)
20
+ end
21
+
22
+ private
23
+
24
+ def linkify_urls(text)
25
+ Rinku.auto_link(text)
26
+ end
27
+
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,29 @@
1
+ require 'stratify-github/events'
2
+ require 'digest/md5'
3
+
4
+ class GitHubApiError < StandardError; end
5
+
6
+ module Stratify
7
+ module GitHub
8
+ module Translation
9
+
10
+ def from_api_hash(api_hash)
11
+ activity = Stratify::GitHub::Activity.new
12
+
13
+ activity.event_type = api_hash['type']
14
+ activity.url = api_hash['url']
15
+ activity.actor = api_hash['actor']
16
+ activity.created_at = Time.now()
17
+ activity.checksum = Digest::MD5.hexdigest(activity)
18
+
19
+ begin
20
+ clazz = Stratify::GitHub::Event.const_get(activity.event_type)
21
+ rescue NameError
22
+ raise GitHubApiError, "GitHub API passed unknown type #{activity.event_type}"
23
+ end
24
+
25
+ activity = clazz.make(activity, api_hash)
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,5 @@
1
+ module Stratify
2
+ module GitHub
3
+ VERSION = "0.1"
4
+ end
5
+ end
data/spec/mongoid.yml ADDED
@@ -0,0 +1,3 @@
1
+ persist_in_safe_mode: true
2
+ host: localhost
3
+ database: stratify_github_test
@@ -0,0 +1,39 @@
1
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
3
+ require 'rspec'
4
+ require 'stratify-github'
5
+
6
+ # Requires supporting files with custom matchers and macros, etc,
7
+ # in ./support/ and its subdirectories.
8
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
9
+
10
+ require 'database_cleaner'
11
+
12
+ RSpec.configure do |config|
13
+ config.color_enabled = true
14
+ config.formatter = :progress
15
+
16
+ # Configure RSpec to run focused specs, and also respect the alias 'fit' for focused specs
17
+ config.filter_run :focused => true
18
+ config.run_all_when_everything_filtered = true
19
+ config.alias_example_to :fit, :focused => true
20
+
21
+ config.extend VCR::RSpec::Macros
22
+
23
+ # Configure RSpec to truncate the database before any spec tagged with ":database => true"
24
+ DatabaseCleaner.strategy = :truncation
25
+ DatabaseCleaner.orm = "mongoid"
26
+ config.before(:each, :database => true) do
27
+ DatabaseCleaner.clean
28
+ end
29
+
30
+ config.before(:suite) do
31
+ initialize_mongoid_configuration
32
+ end
33
+ end
34
+
35
+ def initialize_mongoid_configuration
36
+ mongoid_config = YAML::load_file(File.join(File.dirname(__FILE__), "mongoid.yml"))
37
+ Mongoid.from_hash(mongoid_config)
38
+ end
39
+
@@ -0,0 +1,216 @@
1
+ require 'spec_helper'
2
+ require 'digest/md5'
3
+
4
+ D = {'actor' => 'daemianmack', 'url' => 'http://example.com/'}
5
+
6
+ def DM(hsh)
7
+ D.merge(hsh)
8
+ end
9
+
10
+ describe Stratify::GitHub::Activity do
11
+
12
+ context 'save-time requirements' do
13
+ it 'checksums properly' do
14
+ fields = {
15
+ 'action' => nil,
16
+ 'actor' => 'bender',
17
+ 'url' => 'http://example.com/',
18
+ 'type' => 'WatchEvent'}
19
+ checksum = Digest::MD5.hexdigest(fields.values.compact.sort.join(' '))
20
+ activity = Stratify::GitHub::Activity.from_api_hash(fields)
21
+ activity.checksum.should == checksum
22
+ end
23
+ end
24
+
25
+ context 'translation' do
26
+ it 'raises an error when the API passes an unknown event type' do
27
+ fields = {'type' => 'BendEvent'}
28
+ lambda {Stratify::GitHub::Activity.from_api_hash(fields)}.should raise_error(GitHubApiError)
29
+ end
30
+
31
+ it 'produces correct fields for a branch CreateEvent' do
32
+ data = DM({'type' => 'CreateEvent',
33
+ 'url' => 'https://github.com/daemianmack/fake_ruby_project/compare/new',
34
+ 'payload' => {
35
+ 'ref' => 'new',
36
+ 'ref_type' => 'branch'}})
37
+ event = Stratify::GitHub::Activity.from_api_hash(data)
38
+ event.event_type.should == 'CreateEvent'
39
+ event.ref.should == 'new'
40
+ event.ref_type.should == 'branch'
41
+ event.repository.should == 'https://github.com/daemianmack/fake_ruby_project'
42
+ end
43
+
44
+ it 'produces correct fields for a repo CreateEvent' do
45
+ data = DM({'type' => 'CreateEvent',
46
+ 'url' => 'https://github.com/daemianmack/fake_ruby_project',
47
+ 'payload' => {
48
+ 'ref' => nil,
49
+ 'ref_type' => 'repository'}})
50
+ event = Stratify::GitHub::Activity.from_api_hash(data)
51
+ event.event_type.should == 'CreateEvent'
52
+ event.ref.should == nil
53
+ event.ref_type.should == 'repository'
54
+ event.repository.should == 'https://github.com/daemianmack/fake_ruby_project'
55
+ end
56
+
57
+ it 'produces correct fields for a CommitCommentEvent' do
58
+ data = DM({'type' => 'CommitCommentEvent',
59
+ 'url' => 'https://github.com/daemianmack/fake_ruby_project/compare/master'})
60
+ event = Stratify::GitHub::Activity.from_api_hash(data)
61
+ event.event_type.should == 'CommitCommentEvent'
62
+ event.repository.should == 'https://github.com/daemianmack/fake_ruby_project'
63
+ end
64
+
65
+ it 'produces correct fields for a DeleteEvent' do
66
+ data = DM({'type' => 'DeleteEvent',
67
+ 'payload' => {
68
+ 'ref' => 'expendable',
69
+ 'ref_type' => 'branch'},
70
+ 'repository' => {
71
+ 'url' => 'https://github.com/daemianmack/fake_ruby_project'}})
72
+ event = Stratify::GitHub::Activity.from_api_hash(data)
73
+ event.event_type.should == 'DeleteEvent'
74
+ event.ref.should == 'expendable'
75
+ event.ref_type.should == 'branch'
76
+ event.repository.should == 'https://github.com/daemianmack/fake_ruby_project'
77
+ end
78
+
79
+ it 'produces correct fields for a FollowEvent' do
80
+ data = DM({'type' => 'FollowEvent',
81
+ 'payload' => {
82
+ 'target' => {
83
+ 'login' => 'defunkt'}}})
84
+ event = Stratify::GitHub::Activity.from_api_hash(data)
85
+ event.event_type.should == 'FollowEvent'
86
+ event.thing.should == 'defunkt'
87
+ end
88
+
89
+ it 'produces correct fields for a ForkEvent' do
90
+ data = DM({'type' => 'ForkEvent',
91
+ 'repository' => {
92
+ 'url' => 'https://github.com/jasonrudolph/stratify'}})
93
+ event = Stratify::GitHub::Activity.from_api_hash(data)
94
+ event.event_type.should == 'ForkEvent'
95
+ event.thing.should == 'https://github.com/jasonrudolph/stratify'
96
+ end
97
+
98
+ it 'produces correct fields for a GistEvent' do
99
+ data = DM({'type' => 'GistEvent',
100
+ 'payload' => {
101
+ 'action' => 'fork',
102
+ 'desc' => 'using ActiveSupport::Concerns to extend Rails'}})
103
+ event = Stratify::GitHub::Activity.from_api_hash(data)
104
+ event.action.should == 'fork'
105
+ event.event_type.should == 'GistEvent'
106
+ event.payload.should == 'using ActiveSupport::Concerns to extend Rails'
107
+ end
108
+
109
+ it 'produces correct fields for a GollumEvent' do
110
+ data = DM({'type' => 'GollumEvent',
111
+ 'payload' => {
112
+ 'pages' => [{
113
+ 'action' => 'created',
114
+ 'page_name' => 'Contributing'}]},
115
+ 'repository' => {
116
+ 'url' => 'https://github.com/daemianmack/cronviz'}})
117
+ event = Stratify::GitHub::Activity.from_api_hash(data)
118
+ event.action.should == 'created'
119
+ event.event_type.should == 'GollumEvent'
120
+ event.repository.should == 'https://github.com/daemianmack/cronviz'
121
+ event.thing.should == 'Contributing'
122
+ end
123
+
124
+ it 'produces correct fields for a IssueCommentEvent' do
125
+ data = DM({'type' => 'IssueCommentEvent',
126
+ 'repository' => {
127
+ 'url' => 'https://github.com/daemianmack/cronviz'}})
128
+ event = Stratify::GitHub::Activity.from_api_hash(data)
129
+ event.event_type.should == 'IssueCommentEvent'
130
+ event.repository.should == 'https://github.com/daemianmack/cronviz'
131
+ end
132
+
133
+ it 'produces correct fields for a IssuesEvent' do
134
+ data = DM({'type' => 'IssuesEvent',
135
+ 'payload' => {
136
+ 'action' => 'created'},
137
+ 'url' => 'https://github.com/daemianmack/cronviz'})
138
+ event = Stratify::GitHub::Activity.from_api_hash(data)
139
+ event.action.should == 'created'
140
+ event.event_type.should == 'IssuesEvent'
141
+ event.repository.should == 'https://github.com/daemianmack/cronviz'
142
+ end
143
+
144
+ it 'produces correct fields for a MemberEvent' do
145
+ data = DM({'type' => 'MemberEvent',
146
+ 'payload' => {
147
+ 'action' => 'added',
148
+ 'member' => {
149
+ 'login' => 'bender'}},
150
+ 'url' => 'https://github.com/daemianmack/cronviz'})
151
+ event = Stratify::GitHub::Activity.from_api_hash(data)
152
+ event.action.should == 'added'
153
+ event.event_type.should == 'MemberEvent'
154
+ event.repository.should == 'https://github.com/daemianmack/cronviz'
155
+ event.thing.should == 'bender'
156
+ end
157
+
158
+ it 'produces correct fields for a PublicEvent' do
159
+ data = DM({'type' => 'PublicEvent',
160
+ 'repository' => {
161
+ 'url' => 'https://github.com/daemianmack/cronviz'}})
162
+ event = Stratify::GitHub::Activity.from_api_hash(data)
163
+ event.action.should == 'publicized'
164
+ event.event_type.should == 'PublicEvent'
165
+ event.repository.should == 'https://github.com/daemianmack/cronviz'
166
+ end
167
+
168
+ it 'produces correct fields for a PullRequestEvent' do
169
+ data = DM({'type' => 'PullRequestEvent',
170
+ 'payload' => {
171
+ 'pull_request' => {
172
+ 'title' => 'Allow time to flow in reverse'}},
173
+ 'repository' => {
174
+ 'url' => 'https://github.com/daemianmack/cronviz'}})
175
+ event = Stratify::GitHub::Activity.from_api_hash(data)
176
+ event.event_type.should == 'PullRequestEvent'
177
+ event.payload.should == 'Allow time to flow in reverse'
178
+ event.repository.should == 'https://github.com/daemianmack/cronviz'
179
+ end
180
+
181
+ it 'produces correct fields for a PullRequestReviewCommentEvent' do
182
+ data = DM({'type' => 'PullRequestReviewCommentEvent',
183
+ 'payload' => {
184
+ 'comment' => {
185
+ 'body' => 'Please remove all semicolons from this JavaScript.'}},
186
+ 'repository' => {
187
+ 'url' => 'https://github.com/daemianmack/cronviz'}})
188
+ event = Stratify::GitHub::Activity.from_api_hash(data)
189
+ event.event_type.should == 'PullRequestReviewCommentEvent'
190
+ event.payload.should == 'Please remove all semicolons from this JavaScript.'
191
+ event.repository.should == 'https://github.com/daemianmack/cronviz'
192
+ end
193
+
194
+ it 'produces correct fields for a PushEvent' do
195
+ data = DM({'type' => 'PushEvent',
196
+ 'payload' => {
197
+ 'ref' => 'refs/head/master',
198
+ 'shas' => [[nil, nil, 'Fix all the things']]},
199
+ 'repository' => {
200
+ 'url' => 'https://github.com/daemianmack/cronviz'}})
201
+ event = Stratify::GitHub::Activity.from_api_hash(data)
202
+ event.action.should == 'pushed'
203
+ event.event_type.should == 'PushEvent'
204
+ event.ref.should == 'refs/head/master'
205
+ event.repository.should == 'https://github.com/daemianmack/cronviz'
206
+ event.payload.should == 'Fix all the things'
207
+ end
208
+
209
+ it 'produces correct fields for a WatchEvent' do
210
+ data = DM({'type' => 'WatchEvent'})
211
+ event = Stratify::GitHub::Activity.from_api_hash(data)
212
+ event.event_type.should == 'WatchEvent'
213
+ end
214
+ end
215
+
216
+ end
@@ -0,0 +1,16 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'stratify-github' do
4
+ use_vcr_cassette 'github'
5
+
6
+ it 'collects and stores events from GitHub', :database => true do
7
+ collector = Stratify::GitHub::Collector.create!(:username => 'daemianmack')
8
+ collector.run
9
+
10
+ Stratify::GitHub::Activity.where(
11
+ :actor => 'daemianmack',
12
+ :event_type => 'ForkEvent',
13
+ :url => 'https://github.com/daemianmack/stratify'
14
+ ).should exist
15
+ end
16
+ end
@@ -0,0 +1,15 @@
1
+ require 'spec_helper'
2
+
3
+ describe Stratify::GitHub::Presenter do
4
+ describe '#to_html' do
5
+ it 'wraps a GitHub repo URL with a link' do
6
+ data = {
7
+ 'type' => 'WatchEvent',
8
+ 'url' => 'https://github.com/daemianmack/cronviz'}
9
+ activity = Stratify::GitHub::Activity.from_api_hash(data)
10
+ presenter = Stratify::GitHub::Presenter.new(activity)
11
+ presenter.to_html.should match '<a href="https://github.com/daemianmack/cronviz">https://github.com/daemianmack/cronviz</a>'
12
+ end
13
+ end
14
+
15
+ end
@@ -0,0 +1,7 @@
1
+ require 'vcr'
2
+
3
+ VCR.config do |c|
4
+ c.cassette_library_dir = 'vcr_cassettes'
5
+ c.stub_with :fakeweb
6
+ c.default_cassette_options = { :record => :once }
7
+ end
@@ -0,0 +1,32 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "stratify-github/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "stratify-github"
7
+ s.version = Stratify::GitHub::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["Daemian Mack"]
10
+ s.email = ["daemianmack@gmail.com"]
11
+ s.homepage = "http://github.com/jasonrudolph/stratify/"
12
+ s.summary = "GitHub plugin for Stratify"
13
+ s.description = s.summary
14
+
15
+ s.rubyforge_project = "stratify-github"
16
+
17
+ s.files = `git ls-files`.split("\n")
18
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
+ s.require_paths = ["lib"]
21
+
22
+ s.add_runtime_dependency "actionpack", "~> 3.2.0"
23
+ s.add_runtime_dependency "railties", "~> 3.2.0"
24
+ s.add_runtime_dependency "rinku", "~> 1.0.0"
25
+ s.add_runtime_dependency "stratify-base", "~> 0.1.4"
26
+
27
+ s.add_development_dependency "database_cleaner", "~> 0.7.2"
28
+ s.add_development_dependency "fakeweb", "~> 1.3.0"
29
+ s.add_development_dependency "rake", "~> 0.9.2"
30
+ s.add_development_dependency "rspec", "~> 2.9.0"
31
+ s.add_development_dependency "vcr", "~> 1.10.0"
32
+ end
@@ -0,0 +1,139 @@
1
+ ---
2
+ - !ruby/struct:VCR::HTTPInteraction
3
+ request: !ruby/struct:VCR::Request
4
+ method: :get
5
+ uri: https://github.com:443/daemianmack.json
6
+ body:
7
+ headers:
8
+ response: !ruby/struct:VCR::Response
9
+ status: !ruby/struct:VCR::ResponseStatus
10
+ code: 200
11
+ message: OK
12
+ headers:
13
+ server:
14
+ - nginx/1.0.13
15
+ date:
16
+ - Sun, 05 Aug 2012 02:31:32 GMT
17
+ content-type:
18
+ - application/json; charset=utf-8
19
+ connection:
20
+ - keep-alive
21
+ status:
22
+ - 200 OK
23
+ strict-transport-security:
24
+ - max-age=2592000
25
+ etag:
26
+ - ! '"bcae5ff1ca8d06bfca58637cb8b01453"'
27
+ x-runtime:
28
+ - '61'
29
+ x-frame-options:
30
+ - deny
31
+ content-length:
32
+ - '28789'
33
+ cache-control:
34
+ - private, max-age=0, must-revalidate
35
+ body: ! '[{"actor_attributes":{"blog":"daemianmack.com","location":"Raleigh,
36
+ NC","gravatar_id":"dc2592b56f80dafd7ba86f4ccef552c1","email":"daemianmack@gmail.com","type":"User","company":"","login":"daemianmack","name":"Daemian
37
+ Mack"},"repository":{"owner":"daemianmack","created_at":"2012-08-04T17:04:37-07:00","has_downloads":true,"stargazers":1,"has_wiki":true,"watchers":1,"fork":false,"size":92,"has_issues":true,"pushed_at":"2012-08-04T17:08:09-07:00","name":"fake_ruby_project","url":"https://github.com/daemianmack/fake_ruby_project","forks":0,"language":"Ruby","description":"","private":false,"open_issues":0},"url":"https://github.com/daemianmack/fake_ruby_project/wiki/Home","created_at":"2012-08-04T17:59:39-07:00","type":"GollumEvent","payload":{"pages":[{"page_name":"Home","action":"edited","html_url":"https://github.com/daemianmack/fake_ruby_project/wiki/Home","summary":null,"sha":"858555e9f85f76040c3a6e4e25b80a90c6cbb41b","title":"Home"}]},"actor":"daemianmack","public":true},{"actor_attributes":{"blog":"daemianmack.com","location":"Raleigh,
38
+ NC","gravatar_id":"dc2592b56f80dafd7ba86f4ccef552c1","email":"daemianmack@gmail.com","type":"User","company":"","login":"daemianmack","name":"Daemian
39
+ Mack"},"repository":{"owner":"daemianmack","created_at":"2012-08-04T17:04:37-07:00","has_downloads":true,"stargazers":1,"has_wiki":true,"watchers":1,"fork":false,"size":92,"has_issues":true,"pushed_at":"2012-08-04T17:08:09-07:00","name":"fake_ruby_project","url":"https://github.com/daemianmack/fake_ruby_project","forks":0,"language":"Ruby","description":"","private":false,"open_issues":0},"url":"https://github.com/daemianmack/fake_ruby_project/wiki/Home","created_at":"2012-08-04T17:50:09-07:00","type":"GollumEvent","payload":{"pages":[{"page_name":"Home","action":"created","html_url":"https://github.com/daemianmack/fake_ruby_project/wiki/Home","summary":null,"sha":"35ccd25e8992a942077488074bd6ca7d33dc55f6","title":"Home"}]},"actor":"daemianmack","public":true},{"actor_attributes":{"blog":"daemianmack.com","location":"Raleigh,
40
+ NC","gravatar_id":"dc2592b56f80dafd7ba86f4ccef552c1","email":"daemianmack@gmail.com","type":"User","company":"","login":"daemianmack","name":"Daemian
41
+ Mack"},"repository":{"owner":"daemianmack","created_at":"2012-08-04T17:04:37-07:00","has_downloads":true,"stargazers":1,"has_wiki":true,"watchers":1,"fork":false,"size":92,"has_issues":true,"pushed_at":"2012-08-04T17:08:09-07:00","name":"fake_ruby_project","url":"https://github.com/daemianmack/fake_ruby_project","forks":0,"language":"Ruby","description":"","private":false,"open_issues":0},"url":"https://github.com/daemianmack/fake_ruby_project/compare/new","created_at":"2012-08-04T17:08:09-07:00","type":"CreateEvent","payload":{"ref_type":"branch","description":"","master_branch":"master","ref":"new"},"actor":"daemianmack","public":true},{"actor_attributes":{"blog":"daemianmack.com","location":"Raleigh,
42
+ NC","gravatar_id":"dc2592b56f80dafd7ba86f4ccef552c1","email":"daemianmack@gmail.com","type":"User","company":"","login":"daemianmack","name":"Daemian
43
+ Mack"},"repository":{"owner":"daemianmack","created_at":"2012-08-04T17:04:37-07:00","has_downloads":true,"stargazers":1,"has_wiki":true,"watchers":1,"fork":false,"size":92,"has_issues":true,"pushed_at":"2012-08-04T17:08:09-07:00","name":"fake_ruby_project","url":"https://github.com/daemianmack/fake_ruby_project","forks":0,"language":"Ruby","description":"","private":false,"open_issues":0},"url":"https://github.com/daemianmack/fake_ruby_project/compare/master","created_at":"2012-08-04T17:06:02-07:00","type":"CreateEvent","payload":{"ref_type":"branch","description":"","master_branch":"master","ref":"master"},"actor":"daemianmack","public":true},{"actor_attributes":{"blog":"daemianmack.com","location":"Raleigh,
44
+ NC","gravatar_id":"dc2592b56f80dafd7ba86f4ccef552c1","email":"daemianmack@gmail.com","type":"User","company":"","login":"daemianmack","name":"Daemian
45
+ Mack"},"repository":{"owner":"daemianmack","created_at":"2012-08-04T17:04:37-07:00","has_downloads":true,"stargazers":1,"has_wiki":true,"watchers":1,"fork":false,"size":92,"has_issues":true,"pushed_at":"2012-08-04T17:08:09-07:00","name":"fake_ruby_project","url":"https://github.com/daemianmack/fake_ruby_project","forks":0,"language":"Ruby","description":"","private":false,"open_issues":0},"url":"https://github.com/daemianmack/fake_ruby_project","created_at":"2012-08-04T17:04:37-07:00","type":"CreateEvent","payload":{"ref_type":"repository","description":"","master_branch":"master","ref":null},"actor":"daemianmack","public":true},{"actor_attributes":{"blog":"daemianmack.com","location":"Raleigh,
46
+ NC","gravatar_id":"dc2592b56f80dafd7ba86f4ccef552c1","email":"daemianmack@gmail.com","type":"User","company":"","login":"daemianmack","name":"Daemian
47
+ Mack"},"url":"https://github.com/daemianmack/fake_ruby_project","created_at":"2012-08-04T16:58:45-07:00","type":"MemberEvent","payload":{"action":"added","member":{"gravatar_id":"777892eb38d2e6a4eb915d558068c971","url":"https://api.github.com/users/chrispatterson","avatar_url":"https://secure.gravatar.com/avatar/777892eb38d2e6a4eb915d558068c971?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":24543,"login":"chrispatterson"}},"actor":"daemianmack","public":true},{"actor_attributes":{"blog":"daemianmack.com","location":"Raleigh,
48
+ NC","gravatar_id":"dc2592b56f80dafd7ba86f4ccef552c1","email":"daemianmack@gmail.com","type":"User","company":"","login":"daemianmack","name":"Daemian
49
+ Mack"},"repository":{"owner":"daemianmack","created_at":"2012-06-20T06:16:26-07:00","has_downloads":true,"stargazers":1,"homepage":"","has_wiki":true,"watchers":1,"fork":true,"size":132,"has_issues":false,"pushed_at":"2012-04-03T04:31:08-07:00","name":"cronviz","url":"https://github.com/daemianmack/cronviz","forks":0,"language":"Ruby","description":"A
50
+ crontab visualizer","private":false,"open_issues":0},"url":"https://github.com/daemianmack/cronviz","created_at":"2012-08-04T16:51:00-07:00","type":"MemberEvent","payload":{"action":"added","member":{"gravatar_id":"8a630bbe398902117b85afab5d524e18","url":"https://api.github.com/users/ploats","avatar_url":"https://secure.gravatar.com/avatar/8a630bbe398902117b85afab5d524e18?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":229847,"login":"ploats"}},"actor":"daemianmack","public":true},{"actor_attributes":{"blog":"daemianmack.com","location":"Raleigh,
51
+ NC","gravatar_id":"dc2592b56f80dafd7ba86f4ccef552c1","email":"daemianmack@gmail.com","type":"User","company":"","login":"daemianmack","name":"Daemian
52
+ Mack"},"repository":{"owner":"jasonrudolph","created_at":"2011-04-17T08:36:10-07:00","has_downloads":true,"stargazers":13,"homepage":"","has_wiki":true,"watchers":13,"fork":false,"size":124,"has_issues":true,"pushed_at":"2012-05-04T14:41:42-07:00","name":"stratify","url":"https://github.com/jasonrudolph/stratify","forks":2,"language":"Ruby","description":"Rails
53
+ + MongoDB app for building a consolidated timeline of your data from disparate
54
+ sources (e.g., Twitter, Foursquare, etc.)","private":false,"open_issues":0},"url":"https://github.com/daemianmack/stratify","created_at":"2012-08-03T07:18:47-07:00","type":"ForkEvent","payload":{},"actor":"daemianmack","public":true},{"actor_attributes":{"blog":"daemianmack.com","location":"Raleigh,
55
+ NC","gravatar_id":"dc2592b56f80dafd7ba86f4ccef552c1","email":"daemianmack@gmail.com","type":"User","company":"","login":"daemianmack","name":"Daemian
56
+ Mack"},"repository":{"owner":"daemianmack","created_at":"2009-07-18T09:50:15-07:00","has_downloads":true,"stargazers":3,"homepage":"","has_wiki":true,"watchers":3,"fork":false,"size":1612,"has_issues":true,"pushed_at":"2012-07-24T13:09:46-07:00","name":"dotfiles","url":"https://github.com/daemianmack/dotfiles","forks":1,"language":"Python","description":"Some
57
+ of the best files start with a dot.","private":false,"open_issues":0},"url":"https://github.com/daemianmack/dotfiles/compare/4db0fcd2fd...ab5f28ec6b","created_at":"2012-07-24T13:09:47-07:00","type":"PushEvent","payload":{"head":"ab5f28ec6b087c9983ec2f20784d033c23243b95","size":1,"shas":[["ab5f28ec6b087c9983ec2f20784d033c23243b95","dmack@rpath.com","-f,
58
+ not -z, to check for virtualenvwrapper.sh existance.","Daemian Mack",true]],"ref":"refs/heads/master"},"actor":"daemianmack","public":true},{"actor_attributes":{"blog":"daemianmack.com","location":"Raleigh,
59
+ NC","gravatar_id":"dc2592b56f80dafd7ba86f4ccef552c1","email":"daemianmack@gmail.com","type":"User","company":"","login":"daemianmack","name":"Daemian
60
+ Mack"},"repository":{"owner":"daemianmack","created_at":"2009-07-18T09:50:15-07:00","has_downloads":true,"stargazers":3,"homepage":"","has_wiki":true,"watchers":3,"fork":false,"size":1612,"has_issues":true,"pushed_at":"2012-07-24T13:09:46-07:00","name":"dotfiles","url":"https://github.com/daemianmack/dotfiles","forks":1,"language":"Python","description":"Some
61
+ of the best files start with a dot.","private":false,"open_issues":0},"url":"https://github.com/daemianmack/dotfiles/compare/b48d7923ef...4db0fcd2fd","created_at":"2012-07-24T13:06:11-07:00","type":"PushEvent","payload":{"head":"4db0fcd2fdd9724cfd259aaa07398f571bf92308","size":2,"shas":[["bce81a55d4dcd540531ae45b18cb0fc1992fc6bd","dmack@rpath.com","Snip
62
+ outmoded aliases.","Daemian Mack",true],["4db0fcd2fdd9724cfd259aaa07398f571bf92308","dmack@rpath.com","Snip
63
+ outmoded exports.","Daemian Mack",true]],"ref":"refs/heads/master"},"actor":"daemianmack","public":true},{"actor_attributes":{"blog":"daemianmack.com","location":"Raleigh,
64
+ NC","gravatar_id":"dc2592b56f80dafd7ba86f4ccef552c1","email":"daemianmack@gmail.com","type":"User","company":"","login":"daemianmack","name":"Daemian
65
+ Mack"},"repository":{"owner":"daemianmack","created_at":"2009-07-18T09:50:15-07:00","has_downloads":true,"stargazers":3,"homepage":"","has_wiki":true,"watchers":3,"fork":false,"size":1612,"has_issues":true,"pushed_at":"2012-07-24T13:09:46-07:00","name":"dotfiles","url":"https://github.com/daemianmack/dotfiles","forks":1,"language":"Python","description":"Some
66
+ of the best files start with a dot.","private":false,"open_issues":0},"url":"https://github.com/daemianmack/dotfiles/compare/65b58a4dc7...b48d7923ef","created_at":"2012-07-24T13:01:25-07:00","type":"PushEvent","payload":{"head":"b48d7923ef667336bfc0081f256d418066c125b9","size":2,"shas":[["e486721f4fdd44cfc4bab9ff38b7c4eaf3e3a517","dmack@rpath.com","Trivial.","Daemian
67
+ Mack",true],["b48d7923ef667336bfc0081f256d418066c125b9","dmack@rpath.com","Snip
68
+ hacky checkout-last-git-branch maneuver in favor of native one.","Daemian Mack",true]],"ref":"refs/heads/master"},"actor":"daemianmack","public":true},{"actor_attributes":{"blog":"daemianmack.com","location":"Raleigh,
69
+ NC","gravatar_id":"dc2592b56f80dafd7ba86f4ccef552c1","email":"daemianmack@gmail.com","type":"User","company":"","login":"daemianmack","name":"Daemian
70
+ Mack"},"repository":{"owner":"daemianmack","created_at":"2009-07-18T09:50:15-07:00","has_downloads":true,"stargazers":3,"homepage":"","has_wiki":true,"watchers":3,"fork":false,"size":1612,"has_issues":true,"pushed_at":"2012-07-24T13:09:46-07:00","name":"dotfiles","url":"https://github.com/daemianmack/dotfiles","forks":1,"language":"Python","description":"Some
71
+ of the best files start with a dot.","private":false,"open_issues":0},"url":"https://github.com/daemianmack/dotfiles/compare/2a932c7f4e...65b58a4dc7","created_at":"2012-07-24T12:56:05-07:00","type":"PushEvent","payload":{"head":"65b58a4dc7bd5012240b0f756720a56fe9167996","size":1,"shas":[["65b58a4dc7bd5012240b0f756720a56fe9167996","dmack@rpath.com","Finally
72
+ conditionalize virtualenvwrapper loading.","Daemian Mack",true]],"ref":"refs/heads/master"},"actor":"daemianmack","public":true},{"actor_attributes":{"blog":"daemianmack.com","location":"Raleigh,
73
+ NC","gravatar_id":"dc2592b56f80dafd7ba86f4ccef552c1","email":"daemianmack@gmail.com","type":"User","company":"","login":"daemianmack","name":"Daemian
74
+ Mack"},"url":"https://github.com/daemianmack/fake_ruby_project/compare/master","created_at":"2012-07-22T14:56:45-07:00","type":"CreateEvent","payload":{"ref_type":"branch","description":"Fake!","master_branch":"master","ref":"master"},"actor":"daemianmack","public":true},{"actor_attributes":{"blog":"daemianmack.com","location":"Raleigh,
75
+ NC","gravatar_id":"dc2592b56f80dafd7ba86f4ccef552c1","email":"daemianmack@gmail.com","type":"User","company":"","login":"daemianmack","name":"Daemian
76
+ Mack"},"url":"https://github.com/daemianmack/fake_ruby_project","created_at":"2012-07-22T14:55:45-07:00","type":"CreateEvent","payload":{"ref_type":"repository","description":"Fake!","master_branch":"master","ref":null},"actor":"daemianmack","public":true},{"actor_attributes":{"blog":"daemianmack.com","location":"Raleigh,
77
+ NC","gravatar_id":"dc2592b56f80dafd7ba86f4ccef552c1","email":"daemianmack@gmail.com","type":"User","company":"","login":"daemianmack","name":"Daemian
78
+ Mack"},"repository":{"owner":"daemianmack","created_at":"2009-07-18T09:50:15-07:00","has_downloads":true,"stargazers":3,"homepage":"","has_wiki":true,"watchers":3,"fork":false,"size":1612,"has_issues":true,"pushed_at":"2012-07-24T13:09:46-07:00","name":"dotfiles","url":"https://github.com/daemianmack/dotfiles","forks":1,"language":"Python","description":"Some
79
+ of the best files start with a dot.","private":false,"open_issues":0},"url":"https://github.com/daemianmack/dotfiles/compare/ed8e8a0e29...2a932c7f4e","created_at":"2012-07-21T05:15:20-07:00","type":"PushEvent","payload":{"head":"2a932c7f4ea29d0db8239e168b09bf92f0320c3f","size":1,"shas":[["2a932c7f4ea29d0db8239e168b09bf92f0320c3f","daemianmack@gmail.com","Out
80
+ out damned RVM.","Daemian Mack",true]],"ref":"refs/heads/master"},"actor":"daemianmack","public":true},{"actor_attributes":{"blog":"daemianmack.com","location":"Raleigh,
81
+ NC","gravatar_id":"dc2592b56f80dafd7ba86f4ccef552c1","email":"daemianmack@gmail.com","type":"User","company":"","login":"daemianmack","name":"Daemian
82
+ Mack"},"url":"https://gist.github.com/3151794","created_at":"2012-07-20T09:44:24-07:00","type":"GistEvent","payload":{"action":"fork","url":"https://gist.github.com/3151794","id":3151794,"desc":"using
83
+ ActiveSupport::Concerns to extend Rails","name":"gist: 3151794"},"actor":"daemianmack","public":true},{"actor_attributes":{"blog":"daemianmack.com","location":"Raleigh,
84
+ NC","gravatar_id":"dc2592b56f80dafd7ba86f4ccef552c1","email":"daemianmack@gmail.com","type":"User","company":"","login":"daemianmack","name":"Daemian
85
+ Mack"},"repository":{"owner":"daemianmack","created_at":"2009-07-19T13:31:35-07:00","has_downloads":true,"stargazers":3,"homepage":"","has_wiki":true,"watchers":3,"fork":true,"size":176,"has_issues":false,"pushed_at":"2012-07-19T12:32:57-07:00","name":"emacs-starter-kit","url":"https://github.com/daemianmack/emacs-starter-kit","forks":1,"language":"Emacs
86
+ Lisp","description":"All the code you need to get started, with an emphasis
87
+ on dynamic languages.","private":false,"open_issues":0},"url":"https://github.com/daemianmack/emacs-starter-kit/compare/dfb1659467...4002d614d5","created_at":"2012-07-19T12:32:58-07:00","type":"PushEvent","payload":{"head":"4002d614d5be0ee86f8a08a756562a64b0ce1984","size":1,"shas":[["4002d614d5be0ee86f8a08a756562a64b0ce1984","daemianmack@gmail.com","Having
88
+ added workgroups, let''s actually add workgroups.el now.","Daemian Mack",true]],"ref":"refs/heads/master"},"actor":"daemianmack","public":true},{"actor_attributes":{"blog":"daemianmack.com","location":"Raleigh,
89
+ NC","gravatar_id":"dc2592b56f80dafd7ba86f4ccef552c1","email":"daemianmack@gmail.com","type":"User","company":"","login":"daemianmack","name":"Daemian
90
+ Mack"},"repository":{"owner":"daemianmack","created_at":"2009-07-19T13:31:35-07:00","has_downloads":true,"stargazers":3,"homepage":"","has_wiki":true,"watchers":3,"fork":true,"size":176,"has_issues":false,"pushed_at":"2012-07-19T12:32:57-07:00","name":"emacs-starter-kit","url":"https://github.com/daemianmack/emacs-starter-kit","forks":1,"language":"Emacs
91
+ Lisp","description":"All the code you need to get started, with an emphasis
92
+ on dynamic languages.","private":false,"open_issues":0},"url":"https://github.com/daemianmack/emacs-starter-kit/compare/06f9612297...dfb1659467","created_at":"2012-07-18T09:03:40-07:00","type":"PushEvent","payload":{"head":"dfb16594671acf04f5b6cba31e1b5f84831b3c26","size":2,"shas":[["e78db11e998f5f51ba3d719d86197808a1df6ab8","dmack@rpath.com","Re-enable
93
+ smooth scrolling, omgggg.","Daemian Mack",true],["dfb16594671acf04f5b6cba31e1b5f84831b3c26","dmack@rpath.com","Add
94
+ vi-style % for paren-jumping brace-matching.","Daemian Mack",true]],"ref":"refs/heads/master"},"actor":"daemianmack","public":true},{"actor_attributes":{"blog":"daemianmack.com","location":"Raleigh,
95
+ NC","gravatar_id":"dc2592b56f80dafd7ba86f4ccef552c1","email":"daemianmack@gmail.com","type":"User","company":"","login":"daemianmack","name":"Daemian
96
+ Mack"},"repository":{"owner":"daemianmack","created_at":"2012-07-08T17:42:30-07:00","has_downloads":true,"stargazers":1,"homepage":"","has_wiki":true,"watchers":1,"fork":false,"size":136,"has_issues":true,"pushed_at":"2012-07-08T19:15:17-07:00","name":"clj-cronviz","url":"https://github.com/daemianmack/clj-cronviz","forks":1,"language":"Clojure","description":"A
97
+ Clojure port of the Ruby crontab visualizer I wrote for Federated Media.","private":false,"open_issues":0},"url":"https://github.com/daemianmack/clj-cronviz","created_at":"2012-07-08T19:16:38-07:00","type":"PublicEvent","actor":"daemianmack","public":true},{"actor_attributes":{"blog":"daemianmack.com","location":"Raleigh,
98
+ NC","gravatar_id":"dc2592b56f80dafd7ba86f4ccef552c1","email":"daemianmack@gmail.com","type":"User","company":"","login":"daemianmack","name":"Daemian
99
+ Mack"},"url":"https://gist.github.com/3070981","created_at":"2012-07-08T06:42:13-07:00","type":"GistEvent","payload":{"action":"fork","url":"https://gist.github.com/3070981","id":3070981,"desc":"Clojure
100
+ ns syntax cheat-sheet","name":"gist: 3070981"},"actor":"daemianmack","public":true},{"actor_attributes":{"blog":"daemianmack.com","location":"Raleigh,
101
+ NC","gravatar_id":"dc2592b56f80dafd7ba86f4ccef552c1","email":"daemianmack@gmail.com","type":"User","company":"","login":"daemianmack","name":"Daemian
102
+ Mack"},"repository":{"owner":"sjl","created_at":"2012-07-07T14:56:34-07:00","has_downloads":true,"stargazers":82,"homepage":"http://stevelosh.com/blog/2012/07/caves-of-clojure-01/","has_wiki":true,"watchers":82,"fork":false,"size":184,"has_issues":true,"pushed_at":"2012-08-01T18:13:48-07:00","name":"caves","url":"https://github.com/sjl/caves","forks":6,"language":"Clojure","description":"The
103
+ code for my Caves of Clojure series of blog posts.","private":false,"open_issues":1},"url":"https://github.com/sjl/caves","created_at":"2012-07-07T16:57:34-07:00","type":"WatchEvent","payload":{"action":"started"},"actor":"daemianmack","public":true},{"actor_attributes":{"blog":"daemianmack.com","location":"Raleigh,
104
+ NC","gravatar_id":"dc2592b56f80dafd7ba86f4ccef552c1","email":"daemianmack@gmail.com","type":"User","company":"","login":"daemianmack","name":"Daemian
105
+ Mack"},"url":"https://github.com/rkh","created_at":"2012-07-03T06:40:33-07:00","type":"FollowEvent","payload":{"target":{"repos":128,"gravatar_id":"5c2b452f6eea4a6d84c105ebd971d2a4","followers":532,"id":30442,"login":"rkh"}},"actor":"daemianmack","public":true},{"actor_attributes":{"blog":"daemianmack.com","location":"Raleigh,
106
+ NC","gravatar_id":"dc2592b56f80dafd7ba86f4ccef552c1","email":"daemianmack@gmail.com","type":"User","company":"","login":"daemianmack","name":"Daemian
107
+ Mack"},"repository":{"owner":"gcatlin","created_at":"2012-07-01T08:27:02-07:00","has_downloads":true,"stargazers":1,"homepage":"","has_wiki":true,"watchers":1,"fork":true,"size":192,"has_issues":false,"pushed_at":"2012-07-31T17:21:37-07:00","name":"home","url":"https://github.com/gcatlin/home","forks":0,"language":"Perl","description":"My
108
+ dotfiles and stuff","private":false,"open_issues":0},"url":"https://github.com/gcatlin/home/commit/82913d98890f91966998280aa627ebe5e96f63ec#Library/KeyBindings/DefaultKeyBinding.dict-P57","created_at":"2012-07-03T06:10:21-07:00","type":"CommitCommentEvent","payload":{"commit":"82913d98890f91966998280aa627ebe5e96f63ec","comment_id":1532901},"actor":"daemianmack","public":true},{"actor_attributes":{"blog":"daemianmack.com","location":"Raleigh,
109
+ NC","gravatar_id":"dc2592b56f80dafd7ba86f4ccef552c1","email":"daemianmack@gmail.com","type":"User","company":"","login":"daemianmack","name":"Daemian
110
+ Mack"},"repository":{"owner":"daemianmack","created_at":"2009-07-18T09:50:15-07:00","has_downloads":true,"stargazers":3,"homepage":"","has_wiki":true,"watchers":3,"fork":false,"size":1612,"has_issues":true,"pushed_at":"2012-07-24T13:09:46-07:00","name":"dotfiles","url":"https://github.com/daemianmack/dotfiles","forks":1,"language":"Python","description":"Some
111
+ of the best files start with a dot.","private":false,"open_issues":0},"url":"https://github.com/daemianmack/dotfiles/compare/4a0199b356...ed8e8a0e29","created_at":"2012-07-02T06:59:47-07:00","type":"PushEvent","payload":{"head":"ed8e8a0e291caf7dd06d5fb32982cc405f505ac1","size":1,"shas":[["ed8e8a0e291caf7dd06d5fb32982cc405f505ac1","dmack@rpath.com","Add
112
+ eval of rbenv init to bottom of .bash_profile so reboots stop confusing me when
113
+ gems ''disappear''.","Daemian Mack",true]],"ref":"refs/heads/master"},"actor":"daemianmack","public":true},{"actor_attributes":{"blog":"daemianmack.com","location":"Raleigh,
114
+ NC","gravatar_id":"dc2592b56f80dafd7ba86f4ccef552c1","email":"daemianmack@gmail.com","type":"User","company":"","login":"daemianmack","name":"Daemian
115
+ Mack"},"repository":{"owner":"daemianmack","created_at":"2009-07-19T13:31:35-07:00","has_downloads":true,"stargazers":3,"homepage":"","has_wiki":true,"watchers":3,"fork":true,"size":176,"has_issues":false,"pushed_at":"2012-07-19T12:32:57-07:00","name":"emacs-starter-kit","url":"https://github.com/daemianmack/emacs-starter-kit","forks":1,"language":"Emacs
116
+ Lisp","description":"All the code you need to get started, with an emphasis
117
+ on dynamic languages.","private":false,"open_issues":0},"url":"https://github.com/daemianmack/emacs-starter-kit/compare/0c9952faf2...06f9612297","created_at":"2012-07-02T02:50:26-07:00","type":"PushEvent","payload":{"head":"06f9612297a8ab445e9e56247920c1a4e33e9e04","size":1,"shas":[["06f9612297a8ab445e9e56247920c1a4e33e9e04","daemianmack@gmail.com","Add
118
+ workgroups.el","Daemian Mack",true]],"ref":"refs/heads/master"},"actor":"daemianmack","public":true},{"actor_attributes":{"blog":"daemianmack.com","location":"Raleigh,
119
+ NC","gravatar_id":"dc2592b56f80dafd7ba86f4ccef552c1","email":"daemianmack@gmail.com","type":"User","company":"","login":"daemianmack","name":"Daemian
120
+ Mack"},"repository":{"owner":"tlh","created_at":"2010-07-23T07:25:08-07:00","has_downloads":true,"stargazers":80,"homepage":"","has_wiki":true,"watchers":80,"fork":false,"size":188,"has_issues":true,"pushed_at":"2011-10-10T11:47:40-07:00","name":"workgroups.el","url":"https://github.com/tlh/workgroups.el","forks":13,"language":"Emacs
121
+ Lisp","description":"workgroups for windows -- sexy window management for emacs","private":false,"open_issues":19},"url":"https://github.com/daemianmack/workgroups.el","created_at":"2012-07-01T03:53:17-07:00","type":"ForkEvent","payload":{},"actor":"daemianmack","public":true},{"actor_attributes":{"blog":"daemianmack.com","location":"Raleigh,
122
+ NC","gravatar_id":"dc2592b56f80dafd7ba86f4ccef552c1","email":"daemianmack@gmail.com","type":"User","company":"","login":"daemianmack","name":"Daemian
123
+ Mack"},"repository":{"owner":"daemianmack","created_at":"2009-07-19T13:31:35-07:00","has_downloads":true,"stargazers":3,"homepage":"","has_wiki":true,"watchers":3,"fork":true,"size":176,"has_issues":false,"pushed_at":"2012-07-19T12:32:57-07:00","name":"emacs-starter-kit","url":"https://github.com/daemianmack/emacs-starter-kit","forks":1,"language":"Emacs
124
+ Lisp","description":"All the code you need to get started, with an emphasis
125
+ on dynamic languages.","private":false,"open_issues":0},"url":"https://github.com/daemianmack/emacs-starter-kit/compare/216cc3c328...0c9952faf2","created_at":"2012-06-28T05:22:05-07:00","type":"PushEvent","payload":{"head":"0c9952faf27b68f77f52c358fbda791352fc4a80","size":12,"shas":[["dc4b4e6ab7ade1776c890d73588947a5fd36d707","dmack@rpath.com","Add
126
+ expand-region and mark-multiple.","Daemian Mack",true],["a73e56b417f7711453cf07fad9227722a557da90","dmack@rpath.com","Add
127
+ monky business.","Daemian Mack",true],["0056ef83c6958098ff5190419c89c37bd181a3ac","dmack@rpath.com","Add
128
+ desktop-mode improvements.","Daemian Mack",true],["4d69f9900147ae1e8773b7d8dbac80c625294b47","dmack@rpath.com","mode-line
129
+ cleanup.","Daemian Mack",true],["0b4eca1cb465069dc906ce2738cef447ce4c64ac","dmack@rpath.com","places
130
+ config.","Daemian Mack",true],["2e935a6a13d1a121f011fcd92c43bdf64e7b602d","dmack@rpath.com","Display
131
+ ido results vertically, rather than horizontally","Daemian Mack",true],["0395b2ae3e670b12eb78cedc496daf5cd3dce24a","dmack@rpath.com","Remove
132
+ outmoded logging from rpdb2 yas snippet.","Daemian Mack",true],["3cef08bf4ba2b25c20edf40c1c26926a8555f134","dmack@rpath.com","Various
133
+ custom.el effluvia.","Daemian Mack",true],["31d94270e20b93cdb214af6fb640eb2b6d736849","dmack@rpath.com","Tweak
134
+ monky-diff-none face.","Daemian Mack",true],["fa13f35531ed1abf36710354ac9a4f2c37bf7462","dmack@rpath.com","uniquify-separator","Daemian
135
+ Mack",true],["b45b58b12f7c7c11be8fd5a21aa2694bf7f8a3c8","dmack@rpath.com","Add
136
+ bf-pretty-print-xml-region function.","Daemian Mack",true],["0c9952faf27b68f77f52c358fbda791352fc4a80","dmack@rpath.com","Add
137
+ vc-hg-annotate-command to make vc''s annotations on hg files a\nlittle more
138
+ helpful.","Daemian Mack",true]],"ref":"refs/heads/master"},"actor":"daemianmack","public":true}]'
139
+ http_version: '1.1'
metadata ADDED
@@ -0,0 +1,214 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: stratify-github
3
+ version: !ruby/object:Gem::Version
4
+ version: '0.1'
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Daemian Mack
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-08-05 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: actionpack
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 3.2.0
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: 3.2.0
30
+ - !ruby/object:Gem::Dependency
31
+ name: railties
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ version: 3.2.0
38
+ type: :runtime
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: 3.2.0
46
+ - !ruby/object:Gem::Dependency
47
+ name: rinku
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ~>
52
+ - !ruby/object:Gem::Version
53
+ version: 1.0.0
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 1.0.0
62
+ - !ruby/object:Gem::Dependency
63
+ name: stratify-base
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ~>
68
+ - !ruby/object:Gem::Version
69
+ version: 0.1.4
70
+ type: :runtime
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: 0.1.4
78
+ - !ruby/object:Gem::Dependency
79
+ name: database_cleaner
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ~>
84
+ - !ruby/object:Gem::Version
85
+ version: 0.7.2
86
+ type: :development
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ~>
92
+ - !ruby/object:Gem::Version
93
+ version: 0.7.2
94
+ - !ruby/object:Gem::Dependency
95
+ name: fakeweb
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ~>
100
+ - !ruby/object:Gem::Version
101
+ version: 1.3.0
102
+ type: :development
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ~>
108
+ - !ruby/object:Gem::Version
109
+ version: 1.3.0
110
+ - !ruby/object:Gem::Dependency
111
+ name: rake
112
+ requirement: !ruby/object:Gem::Requirement
113
+ none: false
114
+ requirements:
115
+ - - ~>
116
+ - !ruby/object:Gem::Version
117
+ version: 0.9.2
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ~>
124
+ - !ruby/object:Gem::Version
125
+ version: 0.9.2
126
+ - !ruby/object:Gem::Dependency
127
+ name: rspec
128
+ requirement: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ~>
132
+ - !ruby/object:Gem::Version
133
+ version: 2.9.0
134
+ type: :development
135
+ prerelease: false
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ~>
140
+ - !ruby/object:Gem::Version
141
+ version: 2.9.0
142
+ - !ruby/object:Gem::Dependency
143
+ name: vcr
144
+ requirement: !ruby/object:Gem::Requirement
145
+ none: false
146
+ requirements:
147
+ - - ~>
148
+ - !ruby/object:Gem::Version
149
+ version: 1.10.0
150
+ type: :development
151
+ prerelease: false
152
+ version_requirements: !ruby/object:Gem::Requirement
153
+ none: false
154
+ requirements:
155
+ - - ~>
156
+ - !ruby/object:Gem::Version
157
+ version: 1.10.0
158
+ description: GitHub plugin for Stratify
159
+ email:
160
+ - daemianmack@gmail.com
161
+ executables: []
162
+ extensions: []
163
+ extra_rdoc_files: []
164
+ files:
165
+ - .gitignore
166
+ - .rvmrc
167
+ - Gemfile
168
+ - Gemfile.lock
169
+ - LICENSE
170
+ - README.md
171
+ - Rakefile
172
+ - app/assets/images/github-icon-16.png
173
+ - app/assets/images/github-icon-24.png
174
+ - lib/stratify-github.rb
175
+ - lib/stratify-github/activity.rb
176
+ - lib/stratify-github/collector.rb
177
+ - lib/stratify-github/engine.rb
178
+ - lib/stratify-github/events.rb
179
+ - lib/stratify-github/presenter.rb
180
+ - lib/stratify-github/translation.rb
181
+ - lib/stratify-github/version.rb
182
+ - spec/mongoid.yml
183
+ - spec/spec_helper.rb
184
+ - spec/stratify-github/activity_spec.rb
185
+ - spec/stratify-github/integration_spec.rb
186
+ - spec/stratify-github/presenter_spec.rb
187
+ - spec/support/vcr_setup.rb
188
+ - stratify-github.gemspec
189
+ - vcr_cassettes/github.yml
190
+ homepage: http://github.com/jasonrudolph/stratify/
191
+ licenses: []
192
+ post_install_message:
193
+ rdoc_options: []
194
+ require_paths:
195
+ - lib
196
+ required_ruby_version: !ruby/object:Gem::Requirement
197
+ none: false
198
+ requirements:
199
+ - - ! '>='
200
+ - !ruby/object:Gem::Version
201
+ version: '0'
202
+ required_rubygems_version: !ruby/object:Gem::Requirement
203
+ none: false
204
+ requirements:
205
+ - - ! '>='
206
+ - !ruby/object:Gem::Version
207
+ version: '0'
208
+ requirements: []
209
+ rubyforge_project: stratify-github
210
+ rubygems_version: 1.8.23
211
+ signing_key:
212
+ specification_version: 3
213
+ summary: GitHub plugin for Stratify
214
+ test_files: []