Permalink
Browse files

crazy changes to make github happy

  • Loading branch information...
2 parents e103fb0 + 60a92fe commit 901f0b8a234ff5acf92504b356250d1f54f43273 @WardCunningham committed Apr 12, 2012
Showing with 56 additions and 36 deletions.
  1. +0 −1 client/client.js
  2. +56 −35 server/sinatra/server.rb
View
1 client/client.js
@@ -1030,7 +1030,6 @@ require.define("/lib/fetch.coffee", function (require, module, exports, __dirnam
}
site = localContext.shift();
resource = site === 'origin' ? (site = null, slug) : "remote/" + site + "/" + slug;
- wiki.log('fetch', resource);
return $.ajax({
type: 'GET',
dataType: 'json',
View
91 server/sinatra/server.rb
@@ -225,41 +225,62 @@ def oops status, message
JSON.pretty_generate(page)
end
- get '/global-changes.json' do
- content_type 'application/json'
- cross_origin
- bins = Hash.new {|hash, key| hash[key] = Array.new}
- Dir.chdir(File.join(self.class.data_root, "farm")) do
- Dir.glob("*") do |site|
- Dir.chdir(File.join(site,'pages')) do
- count = 100
- Dir.glob("*").collect do |slug|
- dt = Time.now - File.new(slug).mtime
- break if (count -= 1) <= 0
- slug = "#{site}/#{slug}"
- bins[(dt/=60)<1?'Minute':(dt/=60)<1?'Hour':(dt/=24)<1?'Day':(dt/=7)<1?'Week':(dt/=4)<1?'Month':(dt/=3)<1?'Season':(dt/=4)<1?'Year':'Forever']<<slug
- end
- end
- end
- end
- story = []
- ['Minute', 'Hour', 'Day', 'Week'].each do |key|
- next unless bins[key].length>0
- story << {'type' => 'paragraph', 'text' => "<h3>Within a #{key}</h3>", 'id' => RandomId.generate}
- bins[key].each do |remote|
- (site,slug) = remote.split '/'
- farm = Page.new
- farm.directory = File.join(self.class.data_root, "farm/#{site}")
- farm.default_directory = File.join APP_ROOT, "default-data", "pages"
- page = farm.get(slug)
- next if page['story'].length == 0
- site = "#{site}#{request.port==80 ? '' : ':'+request.port.to_s}"
- story << {'type' => 'federatedWiki', 'site' => site, 'slug' => slug, 'title' => page['title'], 'text' => "", 'id' => RandomId.generate}
- end
- end
- page = {'title' => 'Recent Changes', 'story' => story}
- JSON.pretty_generate(page)
- end
+# get '/global-changes.json' do
+# content_type 'application/json'
+# cross_origin
+# bins = Hash.new {|hash, key| hash[key] = Array.new}
+# Dir.chdir(File.join(self.class.data_root, "farm")) do
+# <<<<<<< HEAD
+# Dir.glob("*") do |site|
+# Dir.chdir(File.join(site,'pages')) do
+# count = 100
+# Dir.glob("*").collect do |slug|
+# dt = Time.now - File.new(slug).mtime
+# break if (count -= 1) <= 0
+# slug = "#{site}/#{slug}"
+# bins[(dt/=60)<1?'Minute':(dt/=60)<1?'Hour':(dt/=24)<1?'Day':(dt/=7)<1?'Week':(dt/=4)<1?'Month':(dt/=3)<1?'Season':(dt/=4)<1?'Year':'Forever']<<slug
+# end
+# end
+# end
+# end
+# =======
+# Dir.glob("*") do |site|
+# Dir.chdir(File.join(site,'pages')) do
+# count = 100
+# Dir.glob("*").collect do |slug|
+# dt = Time.now - File.new(slug).mtime
+# break if (count -= 1) <= 0
+# slug = "#{site}/#{slug}"
+# bins[(dt/=60)<1?'Minute':(dt/=60)<1?'Hour':(dt/=24)<1?'Day':(dt/=7)<1?'Week':(dt/=4)<1?'Month':(dt/=3)<1?'Season':(dt/=4)<1?'Year':'Forever']<<slug
+# end
+# end
+# end
+# end
+# >>>>>>> origin/models
+# story = []
+# ['Minute', 'Hour', 'Day', 'Week'].each do |key|
+# next unless bins[key].length>0
+# story << {'type' => 'paragraph', 'text' => "<h3>Within a #{key}</h3>", 'id' => RandomId.generate}
+# bins[key].each do |remote|
+# <<<<<<< HEAD
+# (site,slug) = remote.split '/'
+# =======
+# tuple = remote.split '/'
+# site = tuple[0]
+# slug = tuple[1]
+# >>>>>>> origin/models
+# farm = Page.new
+# farm.directory = File.join(self.class.data_root, "farm/#{site}")
+# farm.default_directory = File.join APP_ROOT, "default-data", "pages"
+# page = farm.get(slug)
+# next if page['story'].length == 0
+# site = "#{site}#{request.port==80 ? '' : ':'+request.port.to_s}"
+# story << {'type' => 'federatedWiki', 'site' => site, 'slug' => slug, 'title' => page['title'], 'text' => "", 'id' => RandomId.generate}
+# end
+# end
+# page = {'title' => 'Recent Changes', 'story' => story}
+# JSON.pretty_generate(page)
+# end
get %r{^/([a-z0-9-]+)\.json$} do |name|
content_type 'application/json'

0 comments on commit 901f0b8

Please sign in to comment.