vanity-source 0.13 → 0.14

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/CHANGELOG CHANGED
@@ -1,3 +1,9 @@
1
+ 2010-09-07 v0.14 RubyGems and Github identities
2
+
3
+ RubyGems releases now identify RubyGems as the source of the activity.
4
+
5
+ Github source includes github login name as identity.
6
+
1
7
  2010-08-31 v0.13 Github data source merges related commits
2
8
 
3
9
  Now it does.
@@ -32,7 +32,7 @@ module Vanity
32
32
  #
33
33
  # In particular, #setup must set specific values for each collector:
34
34
  # * metric.name -- The name of the metric, e.g. Twitter source might pick the
35
- # name "Twitter mentions of @vanitydash".
35
+ # name "Twitter mentions of @dash_fu".
36
36
  # * metric.columns -- Specifies the columns (at least one) that make up this
37
37
  # metric. The value if an array where each item describes a single column,
38
38
  # see below for more details.
@@ -37,7 +37,7 @@ module Vanity
37
37
  context.update json.slice(*%w{description url homepage})
38
38
  block.call :set=>{ :forks=>json["forks"], :watchers=>json["watchers"] }
39
39
  else
40
- logger.error "Backtweets: #{response.code} #{response.message}"
40
+ logger.error "Github: #{response.code} #{response.message}"
41
41
  error = true
42
42
  end
43
43
 
@@ -65,7 +65,7 @@ module Vanity
65
65
  merged.reverse.each do |commits|
66
66
  first = commits.first
67
67
  committer = first["committer"]
68
- person = { :fullname=>committer["name"], :identities=>%W{github.com:#{committer["name"]}}, :email=>committer["email"] }
68
+ person = { :fullname=>committer["name"], :identities=>%W{github.com:#{committer["login"]}}, :email=>committer["email"] }
69
69
  messages = commits.map { |commit| %{<blockquote><a href="#{commit["url"]}">#{commit["id"][0,7]}</a> #{h commit["message"].strip.split(/[\n\r]/).first[0,50]}</blockquote>} }
70
70
  html = %{pushed to #{h context["branch"]} at <a href="http://github.com/#{context["repo"]}">#{h context["repo"]}</a>:\n#{messages.join("\n")}}
71
71
  block.call :activity=>{ :uid=>first["id"], :html=>html, :url=>first["url"], :tags=>%w{push},
@@ -80,7 +80,7 @@ module Vanity
80
80
  merge("timestamp"=>Time.parse(last_commit["committed_date"]).utc)
81
81
  end
82
82
  else
83
- logger.error "Backtweets: #{response.code} #{response.message}"
83
+ logger.error "Github: #{response.code} #{response.message}"
84
84
  error = true
85
85
  end
86
86
 
@@ -34,8 +34,9 @@ module Vanity
34
34
  current, latest = Gem::Version.new(context["version"]), Gem::Version.new(json["version"])
35
35
  if latest > current
36
36
  html = "released <a href=\"http://rubygems.org/gems/#{gem_name}/versions/#{latest}\">#{gem_name} version #{latest}</a>."
37
+ person = { :fullname=>"RubyGems", :identities=>"url:http://rubygems.org/", :photo_url=>"http://dash-fu.com/images/sources/ruby.png" }
37
38
  yield :activity=>{ :uid=>"#{gem_name}-#{latest}", :url=>"http://rubygems.org/gems/#{gem_name}",
38
- :html=>html, :tags=>%w{release} }
39
+ :html=>html, :tags=>%w{release}, :person=>person }
39
40
  end
40
41
  end
41
42
  context["version"] = json["version"]
@@ -163,6 +163,10 @@ test Vanity::Source::Github do
163
163
  should "capture email" do
164
164
  assert_equal "assaf@labnotes.org", subject.email
165
165
  end
166
+
167
+ should "capture identity" do
168
+ assert_contains subject.identities, "github.com:assaf"
169
+ end
166
170
  end
167
171
 
168
172
  context "commit message" do
@@ -1,6 +1,7 @@
1
1
  class Person
2
2
 
3
3
  def initialize(args = {})
4
+ args[:identities] = Array.wrap(args[:identities])
4
5
  args.each do |name, value|
5
6
  send "#{name}=", value
6
7
  end
@@ -113,8 +113,25 @@ released <a href=\"http://rubygems.org/gems/vanity/versions/2.1.0\">vanity versi
113
113
  end
114
114
 
115
115
  should "be valid" do
116
+ subject.validate
116
117
  assert subject.valid?
117
118
  end
119
+
120
+ context "person" do
121
+ subject { activity.person }
122
+
123
+ should "be named Ruby Gems" do
124
+ assert_equal "RubyGems", subject.fullname
125
+ end
126
+
127
+ should "have URL as identity" do
128
+ assert_contains subject.identities, "url:http://rubygems.org/"
129
+ end
130
+
131
+ should "use the Ruby Gem as photo" do
132
+ assert_equal "http://dash-fu.com/images/sources/ruby.png", subject.photo_url
133
+ end
134
+ end
118
135
  end
119
136
  end
120
137
  end
@@ -730,3 +730,81 @@ Backtweets: 200
730
730
  Backtweets: 500
731
731
  RubyGems: 200
732
732
  RubyGems: 500
733
+ Backtweets: 500
734
+ Backtweets: 200
735
+ Backtweets: 200
736
+ Backtweets: 500
737
+ RubyGems: 200
738
+ RubyGems: 500
739
+ Backtweets: 500
740
+ Backtweets: 200
741
+ Backtweets: 200
742
+ Backtweets: 500
743
+ RubyGems: 200
744
+ RubyGems: 500
745
+ Backtweets: 500
746
+ Backtweets: 200
747
+ Backtweets: 200
748
+ Backtweets: 500
749
+ RubyGems: 200
750
+ RubyGems: 500
751
+ Backtweets: 500
752
+ Backtweets: 200
753
+ Backtweets: 200
754
+ Backtweets: 500
755
+ RubyGems: 200
756
+ RubyGems: 500
757
+ Backtweets: 500
758
+ Backtweets: 200
759
+ Backtweets: 200
760
+ Backtweets: 500
761
+ RubyGems: 200
762
+ RubyGems: 500
763
+ Backtweets: 500
764
+ Backtweets: 200
765
+ Backtweets: 200
766
+ Backtweets: 500
767
+ RubyGems: 200
768
+ RubyGems: 500
769
+ Backtweets: 500
770
+ Backtweets: 200
771
+ Backtweets: 200
772
+ Backtweets: 500
773
+ RubyGems: 200
774
+ RubyGems: 500
775
+ Backtweets: 500
776
+ Backtweets: 200
777
+ Backtweets: 200
778
+ Backtweets: 500
779
+ RubyGems: 200
780
+ RubyGems: 500
781
+ Backtweets: 500
782
+ Backtweets: 200
783
+ Backtweets: 200
784
+ Backtweets: 500
785
+ RubyGems: 200
786
+ RubyGems: 500
787
+ Backtweets: 500
788
+ Backtweets: 200
789
+ Backtweets: 200
790
+ Backtweets: 500
791
+ RubyGems: 200
792
+ RubyGems: 500
793
+ Backtweets: 500
794
+ Backtweets: 200
795
+ Backtweets: 200
796
+ Backtweets: 500
797
+ RubyGems: 200
798
+ RubyGems: 500
799
+ Backtweets: 500
800
+ Backtweets: 200
801
+ Backtweets: 200
802
+ Backtweets: 500
803
+ RubyGems: 200
804
+ RubyGems: 500
805
+ Backtweets: 500
806
+ Backtweets: 200
807
+ Github: 200
808
+ Github: 500
809
+ RubyGems: 200
810
+ RubyGems: 500
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "vanity-source"
3
- spec.version = "0.13"
3
+ spec.version = "0.14"
4
4
  spec.author = "Assaf Arkin"
5
5
  spec.email = "assaf@labnotes.org"
6
6
  spec.homepage = "http://vanitydash.com"
metadata CHANGED
@@ -4,8 +4,8 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 13
8
- version: "0.13"
7
+ - 14
8
+ version: "0.14"
9
9
  platform: ruby
10
10
  authors:
11
11
  - Assaf Arkin
@@ -13,7 +13,7 @@ autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
15
 
16
- date: 2010-08-31 00:00:00 -07:00
16
+ date: 2010-09-07 00:00:00 -07:00
17
17
  default_executable:
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
@@ -128,7 +128,7 @@ licenses: []
128
128
  post_install_message:
129
129
  rdoc_options:
130
130
  - --title
131
- - Vanity::Source 0.13
131
+ - Vanity::Source 0.14
132
132
  - --main
133
133
  - README.rdoc
134
134
  - --webcvs