toolmantim-bananajour 2.1.3 → 2.1.4
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/Readme.md +9 -1
- data/lib/bananajour/bonjour/advertiser.rb +5 -3
- data/lib/bananajour/bonjour/repository.rb +3 -3
- data/lib/bananajour/commands.rb +0 -8
- data/lib/bananajour/grit_extensions.rb +0 -2
- data/lib/bananajour/helpers.rb +2 -0
- data/lib/bananajour/repository.rb +6 -5
- data/lib/bananajour/version.rb +1 -1
- data/lib/bananajour.rb +1 -0
- data/sinatra/views/home.haml +4 -5
- metadata +2 -2
data/Readme.md
CHANGED
@@ -7,6 +7,8 @@ Unlike Gitjour, the repositories you're serving are not your working git reposit
|
|
7
7
|
|
8
8
|
Bananajour is the baby of [Tim Lucas](http://toolmantim.com/) with much railscamp hackage by [Nathan de Vries](http://github.com/atnan), [Lachlan Hardy](http://github.com/lachlanhardy), [Josh Bassett](http://github.com/nullobject), [Myles Byrne](http://github.com/quackingduck), [Ben Hoskings](http://github.com/benhoskings), [Brett Goulder](http://github.com/brettgo1), [Tony Issakov](https://github.com/tissak), and [Mark Bennett](http://github.com/MarkBennett). The rad logo was by [Carla Hackett](http://carlahackettdesign.com/).
|
9
9
|
|
10
|
+

|
11
|
+
|
10
12
|
Installation and usage
|
11
13
|
----------------------
|
12
14
|
|
@@ -36,10 +38,16 @@ Fire up [http://localhost:9331/](http://localhost:9331/) to check it out.
|
|
36
38
|
If somebody starts sharing a Bananajour repository with the same name on the
|
37
39
|
network, it'll automatically show up in the network thanks to the wonder that is Bonjour.
|
38
40
|
|
41
|
+
For a list of all the commands:
|
42
|
+
|
43
|
+
bananajour help
|
44
|
+
|
39
45
|
Official repository and support
|
40
46
|
-------------------------------
|
41
47
|
|
42
|
-
[
|
48
|
+
The official repo and support issues/tickets live at [github.com/toolmantim/bananajour](http://github.com/toolmantim/bananajour).
|
49
|
+
|
50
|
+
Feature and support discussions live at [groups.google.com/group/bananajour](http://groups.google.com/group/bananajour).
|
43
51
|
|
44
52
|
Developing
|
45
53
|
----------
|
@@ -8,12 +8,13 @@ class Bananajour::Bonjour::Advertiser
|
|
8
8
|
end
|
9
9
|
private
|
10
10
|
def register_app
|
11
|
-
|
11
|
+
STDOUT.puts "Registering #{Bananajour.web_uri}"
|
12
12
|
tr = DNSSD::TextRecord.new
|
13
13
|
tr["name"] = Bananajour.config.name
|
14
14
|
tr["email"] = Bananajour.config.email
|
15
15
|
tr["uri"] = Bananajour.web_uri
|
16
16
|
tr["gravatar"] = Bananajour.gravatar
|
17
|
+
tr["version"] = Bananajour::VERSION
|
17
18
|
DNSSD.register("#{Bananajour.config.name}'s bananajour", "_http._tcp,_bananajour", nil, Bananajour.web_port, tr) {}
|
18
19
|
end
|
19
20
|
def register_repos
|
@@ -25,7 +26,7 @@ class Bananajour::Bonjour::Advertiser
|
|
25
26
|
end
|
26
27
|
def stop_old_services
|
27
28
|
old_services.each do |old_service|
|
28
|
-
|
29
|
+
STDOUT.puts "Unregistering #{old_service.repository.uri}"
|
29
30
|
old_service.stop
|
30
31
|
@services.delete(old_service)
|
31
32
|
end
|
@@ -35,7 +36,7 @@ class Bananajour::Bonjour::Advertiser
|
|
35
36
|
end
|
36
37
|
def register_new_repositories
|
37
38
|
new_repositories.each do |new_repo|
|
38
|
-
|
39
|
+
STDOUT.puts "Registering #{new_repo.uri}"
|
39
40
|
tr = DNSSD::TextRecord.new
|
40
41
|
tr["name"] = new_repo.name
|
41
42
|
tr["uri"] = new_repo.uri
|
@@ -43,6 +44,7 @@ class Bananajour::Bonjour::Advertiser
|
|
43
44
|
tr["bjour-email"] = Bananajour.config.email
|
44
45
|
tr["bjour-uri"] = Bananajour.web_uri
|
45
46
|
tr["bjour-gravatar"] = Bananajour.gravatar
|
47
|
+
tr["bjour-version"] = Bananajour::VERSION
|
46
48
|
service = DNSSD.register(new_repo.name, "_git._tcp,_bananajour", nil, 9418, tr) {}
|
47
49
|
service.class.instance_eval { attr_accessor(:repository) }
|
48
50
|
service.repository = new_repo
|
@@ -6,8 +6,8 @@ class Bananajour::Bonjour::Repository
|
|
6
6
|
@name, @uri, @person = name, uri, person
|
7
7
|
end
|
8
8
|
|
9
|
-
def
|
10
|
-
Bananajour::Repository.
|
9
|
+
def html_id
|
10
|
+
Bananajour::Repository.html_id(name)
|
11
11
|
end
|
12
12
|
|
13
13
|
def ==(other)
|
@@ -23,7 +23,7 @@ class Bananajour::Bonjour::Repository
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def web_uri
|
26
|
-
"#{person.uri}##{
|
26
|
+
"#{person.uri}##{html_id}"
|
27
27
|
end
|
28
28
|
|
29
29
|
def to_hash
|
data/lib/bananajour/commands.rb
CHANGED
@@ -13,9 +13,6 @@ module Bananajour::Commands
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def serve_web!
|
16
|
-
if repositories.empty?
|
17
|
-
STDERR.puts "Warning: you don't have any bananajour repositories. Use: bananajour init"
|
18
|
-
end
|
19
16
|
fork { exec "/usr/bin/env ruby #{File.dirname(__FILE__)}/../../sinatra/app.rb -p #{web_port} -e production" }
|
20
17
|
puts "* Started " + web_uri.foreground(:yellow)
|
21
18
|
end
|
@@ -25,11 +22,6 @@ module Bananajour::Commands
|
|
25
22
|
puts "* Started " + "#{git_uri}".foreground(:yellow)
|
26
23
|
end
|
27
24
|
|
28
|
-
def serve_git!
|
29
|
-
fork { exec "git daemon --base-path=#{repositories_path} --export-all" }
|
30
|
-
puts "* Started " + "#{git_uri}".foreground(:yellow)
|
31
|
-
end
|
32
|
-
|
33
25
|
def advertise!
|
34
26
|
fork { Bananajour::Bonjour::Advertiser.new.go! }
|
35
27
|
end
|
data/lib/bananajour/helpers.rb
CHANGED
@@ -5,7 +5,7 @@ module Bananajour
|
|
5
5
|
def self.for_name(name)
|
6
6
|
new(Bananajour.repositories_path.join(name + ".git"))
|
7
7
|
end
|
8
|
-
def self.
|
8
|
+
def self.html_id(name)
|
9
9
|
name.gsub(/[^A-Za-z-]+/, '').downcase
|
10
10
|
end
|
11
11
|
def initialize(path)
|
@@ -25,8 +25,8 @@ module Bananajour
|
|
25
25
|
def name
|
26
26
|
dirname.sub(".git",'')
|
27
27
|
end
|
28
|
-
def
|
29
|
-
self.class.
|
28
|
+
def html_id
|
29
|
+
self.class.html_id(name)
|
30
30
|
end
|
31
31
|
def dirname
|
32
32
|
path.split.last.to_s
|
@@ -38,7 +38,7 @@ module Bananajour
|
|
38
38
|
Bananajour.git_uri + dirname
|
39
39
|
end
|
40
40
|
def web_uri
|
41
|
-
Bananajour.web_uri + "#" +
|
41
|
+
Bananajour.web_uri + "#" + html_id
|
42
42
|
end
|
43
43
|
def grit_repo
|
44
44
|
@grit_repo ||= Grit::Repo.new(path)
|
@@ -68,7 +68,8 @@ module Bananajour
|
|
68
68
|
heads = grit_repo.heads
|
69
69
|
{
|
70
70
|
"name" => name,
|
71
|
-
"html_friendly_name" =>
|
71
|
+
"html_friendly_name" => html_id, # TODO: Deprecate in v3. Renamed to html_id since 2.1.4
|
72
|
+
"html_id" => html_id,
|
72
73
|
"uri" => uri,
|
73
74
|
"heads" => heads.map {|h| h.name},
|
74
75
|
"recent_commits" => recent_commits.collect do |c|
|
data/lib/bananajour/version.rb
CHANGED
data/lib/bananajour.rb
CHANGED
data/sinatra/views/home.haml
CHANGED
@@ -204,10 +204,9 @@
|
|
204
204
|
:border-color #980
|
205
205
|
|
206
206
|
- for repository in @my_repositories
|
207
|
-
- repository_id = repository.html_friendly_name
|
208
207
|
- heads = repository.grit_repo.heads
|
209
208
|
|
210
|
-
.repository{:id =>
|
209
|
+
.repository{:id => repository.html_id, 'data-name' => repository.name}
|
211
210
|
|
212
211
|
- if repository.readme_file && !local?
|
213
212
|
%p.readme
|
@@ -227,7 +226,7 @@
|
|
227
226
|
%li
|
228
227
|
%img.gravatar{:src => commit.author.gravatar_uri}
|
229
228
|
%p.message
|
230
|
-
%a{:href => "/#{repository.
|
229
|
+
%a{:href => "/#{URI.escape(repository.name)}/#{commit.id}"}&= commit.short_message
|
231
230
|
%span.meta
|
232
231
|
- if head = heads.find {|h| h.commit == commit}
|
233
232
|
\-
|
@@ -240,7 +239,7 @@
|
|
240
239
|
%ul.network
|
241
240
|
- for repo in @repository_browser.repositories_similar_to(repository)
|
242
241
|
%li.loading{'data-json-uri' => repo.json_uri}
|
243
|
-
%a.name{:href => "#{repo.person.uri}##{repo.
|
242
|
+
%a.name{:href => "#{repo.person.uri}##{repo.html_id}"}= repo.person.name
|
244
243
|
|
245
244
|
- if local?
|
246
245
|
:javascript
|
@@ -267,7 +266,7 @@
|
|
267
266
|
$(data.recent_commits).each(function(i) {
|
268
267
|
var commit = this;
|
269
268
|
var message = $("<p class='message'/>").html(
|
270
|
-
$("<a/>").attr("href", data.bananajour.uri + data.
|
269
|
+
$("<a/>").attr("href", data.bananajour.uri + encodeURIComponent(data.name) + "/" + commit.id).text(commit.message)
|
271
270
|
).appendTo(repoLi).append(
|
272
271
|
$("<span class='meta'/>")
|
273
272
|
.append($("<em class='branch'/>").text(commit.head && (" - " + commit.head)))
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: toolmantim-bananajour
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Lucas
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-06-
|
12
|
+
date: 2009-06-12 00:00:00 -07:00
|
13
13
|
default_executable: bananajour
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|