From c6f5b4ed161e5b6feb9acdc907dc287fc807f0cb Mon Sep 17 00:00:00 2001 From: Michael Fellinger Date: Thu, 16 Sep 2010 14:41:33 +0900 Subject: [PATCH 001/155] Basic 1.9.2 port --- Gemfile | 1 - app/models/profile.rb | 2 +- app/models/user.rb | 10 +++++----- config/application.rb | 2 +- config/environment.rb | 2 +- config/environments/development.rb | 2 +- config/initializers/socket.rb | 2 +- script/rails | 2 +- 8 files changed, 11 insertions(+), 12 deletions(-) diff --git a/Gemfile b/Gemfile index 77627808d..193cc0eb7 100644 --- a/Gemfile +++ b/Gemfile @@ -54,7 +54,6 @@ end group :development do gem 'nifty-generators' - gem 'ruby-debug' end group :deployment do diff --git a/app/models/profile.rb b/app/models/profile.rb index f03843226..23744711d 100644 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -5,7 +5,7 @@ class Profile include MongoMapper::EmbeddedDocument - require 'lib/diaspora/webhooks' + require_relative '../../lib/diaspora/webhooks' include Diaspora::Webhooks include ROXML diff --git a/app/models/user.rb b/app/models/user.rb index d09f55ea2..d35dfb3df 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -3,9 +3,9 @@ # the COPYRIGHT file. -require 'lib/diaspora/user/friending.rb' -require 'lib/diaspora/user/querying.rb' -require 'lib/salmon/salmon' +require_relative '../../lib/diaspora/user/friending.rb' +require_relative '../../lib/diaspora/user/querying.rb' +require_relative '../../lib/salmon/salmon' class User include MongoMapper::Document @@ -295,11 +295,11 @@ class User aspect(:name => "Family") aspect(:name => "Work") end - + def self.create(opts ={}) puts opts.inspect end - + def terse_url terse = self.url.gsub(/(https?:|www\.)\/\//, '') terse = terse.chop! if terse[-1, 1] == '/' diff --git a/config/application.rb b/config/application.rb index ef8a567a5..441afd82d 100644 --- a/config/application.rb +++ b/config/application.rb @@ -13,7 +13,7 @@ require "active_resource/railtie" # you've limited to :test, :development, or :production. Bundler.require(:default, Rails.env) if defined?(Bundler) -require 'lib/mongo_mapper/bson_id' +require_relative '../lib/mongo_mapper/bson_id' module Diaspora class Application < Rails::Application # Settings in config/environments/* take precedence over those specified here. diff --git a/config/environment.rb b/config/environment.rb index dc11087dd..2548cdb9b 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -5,7 +5,7 @@ # Load the rails application -require File.expand_path('../application', __FILE__) +require_relative 'application' Haml::Template.options[:format] = :html5 # Initialize the rails application Diaspora::Application.initialize! diff --git a/config/environments/development.rb b/config/environments/development.rb index 66a0ef31a..e3987d6df 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -3,7 +3,7 @@ # the COPYRIGHT file. -require 'lib/mongo_mapper/clear_dev_memory' +require_relative '../../lib/mongo_mapper/clear_dev_memory' Diaspora::Application.configure do # Settings specified here will take precedence over those in config/environment.rb diff --git a/config/initializers/socket.rb b/config/initializers/socket.rb index 1fd09fd93..f4b6d2e4a 100644 --- a/config/initializers/socket.rb +++ b/config/initializers/socket.rb @@ -5,7 +5,7 @@ require 'em-websocket' require 'eventmachine' -require "lib/diaspora/websocket" +require_relative "../../lib/diaspora/websocket" EM.next_tick { Diaspora::WebSocket.initialize_channels diff --git a/script/rails b/script/rails index f138a34a4..f8da2cffd 100755 --- a/script/rails +++ b/script/rails @@ -1,4 +1,4 @@ -#!/usr/bin/env ruby1.8 +#!/usr/bin/env ruby # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. APP_PATH = File.expand_path('../../config/application', __FILE__) From ba058a39a8c857f9a7496cfc6fd6f17865e40e02 Mon Sep 17 00:00:00 2001 From: Michael Fellinger Date: Thu, 16 Sep 2010 14:50:30 +0900 Subject: [PATCH 002/155] Replace require_relative with compatible version --- Gemfile.lock | 8 -------- app/models/profile.rb | 2 +- app/models/user.rb | 6 +++--- config/application.rb | 2 +- config/environment.rb | 2 +- config/environments/development.rb | 2 +- config/initializers/socket.rb | 2 +- 7 files changed, 8 insertions(+), 16 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 007810850..4002245ca 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -107,7 +107,6 @@ GEM net-sftp (>= 2.0.0) net-ssh (>= 2.0.14) net-ssh-gateway (>= 1.0.0) - columnize (0.3.1) crack (0.1.8) daemons (1.1.0) database_cleaner (0.5.2) @@ -127,7 +126,6 @@ GEM highline (1.6.1) i18n (0.4.1) json (1.4.6) - linecache (0.43) lsof (0.3.0) mail (2.2.6.1) activesupport (>= 2.3.6) @@ -190,11 +188,6 @@ GEM rspec-rails (2.0.0.beta.17) rspec (>= 2.0.0.beta.14) webrat (>= 0.7.0) - ruby-debug (0.10.3) - columnize (>= 0.1) - ruby-debug-base (~> 0.10.3.0) - ruby-debug-base (0.10.3) - linecache (>= 0.3) saucelabs-adapter (0.8.12) lsof (>= 0.3.0) net-ssh (>= 2.0.12) @@ -253,7 +246,6 @@ DEPENDENCIES roxml! rspec (>= 2.0.0.beta.17) rspec-rails (= 2.0.0.beta.17) - ruby-debug saucelabs-adapter (= 0.8.12) selenium-rc sprinkle! diff --git a/app/models/profile.rb b/app/models/profile.rb index 23744711d..2bb54028a 100644 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -5,7 +5,7 @@ class Profile include MongoMapper::EmbeddedDocument - require_relative '../../lib/diaspora/webhooks' + require File.expand_path('../../../lib/diaspora/webhooks', __FILE__) include Diaspora::Webhooks include ROXML diff --git a/app/models/user.rb b/app/models/user.rb index d35dfb3df..8e7fb1373 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -3,9 +3,9 @@ # the COPYRIGHT file. -require_relative '../../lib/diaspora/user/friending.rb' -require_relative '../../lib/diaspora/user/querying.rb' -require_relative '../../lib/salmon/salmon' +require File.expand_path('../../../lib/diaspora/user/friending', __FILE__) +require File.expand_path('../../../lib/diaspora/user/querying', __FILE__) +require File.expand_path('../../../lib/salmon/salmon', __FILE__) class User include MongoMapper::Document diff --git a/config/application.rb b/config/application.rb index 441afd82d..7cfa694b2 100644 --- a/config/application.rb +++ b/config/application.rb @@ -13,7 +13,7 @@ require "active_resource/railtie" # you've limited to :test, :development, or :production. Bundler.require(:default, Rails.env) if defined?(Bundler) -require_relative '../lib/mongo_mapper/bson_id' +require File.expand_path('../../lib/mongo_mapper/bson_id', __FILE__) module Diaspora class Application < Rails::Application # Settings in config/environments/* take precedence over those specified here. diff --git a/config/environment.rb b/config/environment.rb index 2548cdb9b..dc11087dd 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -5,7 +5,7 @@ # Load the rails application -require_relative 'application' +require File.expand_path('../application', __FILE__) Haml::Template.options[:format] = :html5 # Initialize the rails application Diaspora::Application.initialize! diff --git a/config/environments/development.rb b/config/environments/development.rb index e3987d6df..713cba8c8 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -3,7 +3,7 @@ # the COPYRIGHT file. -require_relative '../../lib/mongo_mapper/clear_dev_memory' +require File.expand_path('../../../lib/mongo_mapper/clear_dev_memory', __FILE__) Diaspora::Application.configure do # Settings specified here will take precedence over those in config/environment.rb diff --git a/config/initializers/socket.rb b/config/initializers/socket.rb index f4b6d2e4a..bbeee1443 100644 --- a/config/initializers/socket.rb +++ b/config/initializers/socket.rb @@ -5,7 +5,7 @@ require 'em-websocket' require 'eventmachine' -require_relative "../../lib/diaspora/websocket" +require File.expand_path("../../../lib/diaspora/websocket", __FILE__) EM.next_tick { Diaspora::WebSocket.initialize_channels From 35c9922c612c03191b7906c5a06610faea88c3f9 Mon Sep 17 00:00:00 2001 From: Michael Fellinger Date: Thu, 16 Sep 2010 15:24:26 +0900 Subject: [PATCH 003/155] And fix some more requires --- app/controllers/publics_controller.rb | 2 +- app/models/person.rb | 2 +- app/models/post.rb | 2 +- app/models/request.rb | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/publics_controller.rb b/app/controllers/publics_controller.rb index 07cf63dc8..cd3812fe7 100644 --- a/app/controllers/publics_controller.rb +++ b/app/controllers/publics_controller.rb @@ -4,7 +4,7 @@ class PublicsController < ApplicationController - require 'lib/diaspora/parser' + require File.expand_path('../../../lib/diaspora/parser', __FILE__) include Diaspora::Parser layout false diff --git a/app/models/person.rb b/app/models/person.rb index 121fdde56..daf182832 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -3,7 +3,7 @@ # the COPYRIGHT file. -require 'lib/hcard' +require File.expand_path('../../../lib/hcard', __FILE__) class Person include MongoMapper::Document diff --git a/app/models/post.rb b/app/models/post.rb index e2dd53d3d..7e20354af 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -4,7 +4,7 @@ class Post - require 'lib/encryptable' + require File.expand_path('../../../lib/encryptable', __FILE__) include MongoMapper::Document include ApplicationHelper include ROXML diff --git a/app/models/request.rb b/app/models/request.rb index da62edd93..7082515cf 100644 --- a/app/models/request.rb +++ b/app/models/request.rb @@ -4,7 +4,7 @@ class Request - require 'lib/diaspora/webhooks' + require File.expand_path('../../../lib/diaspora/webhooks', __FILE__) include MongoMapper::Document include Diaspora::Webhooks include ROXML From ef2e393ac8a898610b80c0fba4842bc1f7bee5fc Mon Sep 17 00:00:00 2001 From: Michael Nutt Date: Thu, 16 Sep 2010 02:32:16 -0400 Subject: [PATCH 004/155] Add bin directory to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 89b33da60..bf8a0e240 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ gpg/diaspora-production/*.gpg gpg/*/random_seed public/uploads/* .rvmrc +/bin From 46a83324ab63b67fa3f85fcefa705aef9ab1b77b Mon Sep 17 00:00:00 2001 From: Michael Nutt Date: Thu, 16 Sep 2010 02:34:11 -0400 Subject: [PATCH 005/155] Warn if can't attach to websocket port --- config/initializers/socket.rb | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/config/initializers/socket.rb b/config/initializers/socket.rb index 1fd09fd93..a806e2553 100644 --- a/config/initializers/socket.rb +++ b/config/initializers/socket.rb @@ -9,18 +9,26 @@ require "lib/diaspora/websocket" EM.next_tick { Diaspora::WebSocket.initialize_channels - EventMachine::WebSocket.start( - :host => "0.0.0.0", - :port => APP_CONFIG[:socket_port], - :debug =>APP_CONFIG[:socket_debug]) do |ws| - ws.onopen { + begin + EventMachine::WebSocket.start( + :host => "0.0.0.0", + :port => APP_CONFIG[:socket_port], + :debug =>APP_CONFIG[:socket_debug]) do |ws| + ws.onopen { - sid = Diaspora::WebSocket.subscribe(ws.request['Path'].gsub('/',''), ws) + sid = Diaspora::WebSocket.subscribe(ws.request['Path'].gsub('/',''), ws) - ws.onmessage { |msg| SocketsController.new.incoming(msg) } + ws.onmessage { |msg| SocketsController.new.incoming(msg) } - ws.onclose { Diaspora::WebSocket.unsubscribe(ws.request['Path'].gsub('/',''), sid) } - } + ws.onclose { Diaspora::WebSocket.unsubscribe(ws.request['Path'].gsub('/',''), sid) } + } + end + rescue RuntimeError => e + if e.message =~ /no acceptor/ + raise RuntimeError, "Could not listen on port #{APP_CONFIG[:socket_port]}, perhaps another process is already using it?" + else + raise + end end } From aa6b2425638ccbf2884df53f2674b69833d73d0a Mon Sep 17 00:00:00 2001 From: Michael Nutt Date: Thu, 16 Sep 2010 03:07:39 -0400 Subject: [PATCH 006/155] websocket js should honor app socket port configuration --- app/views/js/_websocket_js.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/js/_websocket_js.haml b/app/views/js/_websocket_js.haml index 483621625..33af68cce 100644 --- a/app/views/js/_websocket_js.haml +++ b/app/views/js/_websocket_js.haml @@ -9,7 +9,7 @@ $(document).ready(function(){ function debug(str){ $("#debug").append("

" + str); }; - ws = new WebSocket("ws://#{request.host}:8080/#{CGI::escape(current_user.id.to_s)}"); + ws = new WebSocket("ws://#{request.host}:#{APP_CONFIG[:socket_port]}/#{CGI::escape(current_user.id.to_s)}"); //Attach onmessage to websocket ws.onmessage = function(evt) { From 4d8c83adaddea210483cbb6378af1c9386d09761 Mon Sep 17 00:00:00 2001 From: Guido Serra aka Zeph Date: Thu, 16 Sep 2010 23:56:47 +0200 Subject: [PATCH 007/155] issue #9 on github: missing OsX/MongoDB info --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 89ea0ae19..e25a764d1 100644 --- a/README.md +++ b/README.md @@ -184,6 +184,8 @@ If you installed the Ubuntu package, MongoDB should already be running (if not, If you installed the Fedora package, MongoDB will need to be started via `service mongodb start`. If you installed the binary manually, run `sudo mongod` from where mongo is installed to start mongo. +If you installed the OsX package through "brew", MongoDB will need to be started via `sudo launchctl load org.mongodb.mongod.plist`. (before you have to go to /Library/LaunchDaemons and add a symlink to /usr/local/Cellar/mongodb/1.6.2-x86_64/org.mongodb.mongod.plist) + Diaspora will not run unless mongo is running. Mongo will not run by default, and will need to be started every time you wish to use or run the test suite for Diaspora. ### Run the app server From 4ce2505a6578288b8d3d9b8f93eb7bf52c67b5a2 Mon Sep 17 00:00:00 2001 From: Guido Serra aka Zeph Date: Fri, 17 Sep 2010 00:24:30 +0200 Subject: [PATCH 008/155] wrong! fullpath required --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e25a764d1..c12f989bf 100644 --- a/README.md +++ b/README.md @@ -184,7 +184,7 @@ If you installed the Ubuntu package, MongoDB should already be running (if not, If you installed the Fedora package, MongoDB will need to be started via `service mongodb start`. If you installed the binary manually, run `sudo mongod` from where mongo is installed to start mongo. -If you installed the OsX package through "brew", MongoDB will need to be started via `sudo launchctl load org.mongodb.mongod.plist`. (before you have to go to /Library/LaunchDaemons and add a symlink to /usr/local/Cellar/mongodb/1.6.2-x86_64/org.mongodb.mongod.plist) +If you installed the OsX package through "brew", MongoDB will need to be started via `sudo launchctl load /Library/LaunchDaemons/org.mongodb.mongod.plist`. (before you have to go to /Library/LaunchDaemons and add a symlink to /usr/local/Cellar/mongodb/1.6.2-x86_64/org.mongodb.mongod.plist) Diaspora will not run unless mongo is running. Mongo will not run by default, and will need to be started every time you wish to use or run the test suite for Diaspora. From 45b6ff53f176f46f8d768773cbe93fc2f6c93dca Mon Sep 17 00:00:00 2001 From: Aria Stewart Date: Sat, 18 Sep 2010 16:35:48 -0600 Subject: [PATCH 009/155] Ruby 1.9 fixes --- app/controllers/photos_controller.rb | 4 ++-- app/models/photo.rb | 2 +- config.ru | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index cefc8f5d6..4065ff34c 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -21,9 +21,9 @@ class PhotosController < ApplicationController # get file content type att_content_type = (request.content_type.to_s == "") ? "application/octet-stream" : request.content_type.to_s # create temporal file - file = Tempfile.new(file_name) + file = Tempfile.new(file_name, {encoding: 'BINARY'}) # put data into this file from raw post request - file.print request.raw_post + file.print request.raw_post.force_encoding('BINARY') # create several required methods for this temporal file Tempfile.send(:define_method, "content_type") {return att_content_type} diff --git a/app/models/photo.rb b/app/models/photo.rb index 8792911f3..92b02d36d 100644 --- a/app/models/photo.rb +++ b/app/models/photo.rb @@ -22,7 +22,7 @@ class Photo < Post timestamps! validates_presence_of :album - validates_true_for :album_id, :logic => lambda {self.validate_album_person} + validates_true_for(:album_id, :logic => Proc.new { self.validate_album_person }) before_destroy :ensure_user_picture diff --git a/config.ru b/config.ru index cb12bcfa2..ed9da1085 100644 --- a/config.ru +++ b/config.ru @@ -6,6 +6,7 @@ # This file is used by Rack-based servers to start the application. +$LOAD_PATH << '.' require ::File.expand_path('../config/environment', __FILE__) #use Rack::FiberPool #require 'lib/chrome_frame' From cc982b4841372175b262537fb73929ea78e0e6a6 Mon Sep 17 00:00:00 2001 From: Guido Serra aka Zeph Date: Sun, 19 Sep 2010 19:58:36 +0200 Subject: [PATCH 010/155] draft of italian localization --- config/locales/devise.it.yml | 43 ++++++++++++++++++++++++++++++++++++ config/locales/it.yml | 14 ++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 config/locales/devise.it.yml create mode 100644 config/locales/it.yml diff --git a/config/locales/devise.it.yml b/config/locales/devise.it.yml new file mode 100644 index 000000000..d1105b15a --- /dev/null +++ b/config/locales/devise.it.yml @@ -0,0 +1,43 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. +# +# 1st DRAFT of the italian translation +# 09/2010 Guido Serra aka Zeph + +it: + errors: + messages: + not_found: "non trovato" + already_confirmed: "era già stato confermato" + not_locked: "non era protetto" + + devise: + failure: + unauthenticated: 'Devi identificarti o registrarti prima di poter continuare.' + unconfirmed: 'Devi confermare il tuo account prima di continuare.' + locked: 'Il tuo account è protetto.' + invalid: 'Email o password errata.' + invalid_token: 'Token identificativo non valido.' + timeout: 'Sessione scaduta, riautenticati per poter continuare.' + inactive: 'Il tuo account non è stato ancora attivato.' + sessions: + signed_in: 'Autenticato correttamente.' + signed_out: 'Uscito correttamente.' + passwords: + send_instructions: 'Riceverai, a breve, una mail con le istruzioni per proseguire.' + updated: 'La tua parola chiave è stata cambiata correttamente, sei autenticato.' + confirmations: + send_instructions: 'Riceverai una email con le istruzioni, per confermare la tua utenza, in pochi minuti.' + confirmed: 'Accesso confermato correttamente, sei ora collegato.' + registrations: + signed_up: 'Registrazione andata a buon fine. Se abilitata, riceverai un email di conferma.' + updated: 'Dati aggiornati correttamente.' + destroyed: 'Utenza rimossa, speriamo di rivederti presto.' + unlocks: + send_instructions: 'Riceverai una email con le istruzioni per sbloccare la tua utenza.' + unlocked: 'Utenza sbloccata, sei collegato.' + mailer: + confirmation_instructions: 'Istruzioni di conferma di un utenza' + reset_password_instructions: 'Istruzioni per reinizializzare la parola chiave' + unlock_instructions: 'Istruzioni per sbloccare un utenza' diff --git a/config/locales/it.yml b/config/locales/it.yml new file mode 100644 index 000000000..cf5f023d2 --- /dev/null +++ b/config/locales/it.yml @@ -0,0 +1,14 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +# Sample localization file for English. Add more files in this directory for other locales. +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + +# +# 1st DRAFT of the italian translation +# 09/2010 Guido Serra aka Zeph + +it: + hello: "Ciao Mondo!" From 3599161a4a3881b150160a9167ce4590f15ac2de Mon Sep 17 00:00:00 2001 From: Guido Serra aka Zeph Date: Sun, 19 Sep 2010 22:33:02 +0200 Subject: [PATCH 011/155] osx files --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 89b33da60..bbd4cefb8 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ gpg/diaspora-production/*.gpg gpg/*/random_seed public/uploads/* .rvmrc +.DS_Store From 9571ade89c652e4b5357d3a0ef01fb9a2ac7ac52 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 21 Sep 2010 12:29:39 -0700 Subject: [PATCH 012/155] basic setup --- Gemfile | 1 + Gemfile.lock | 4 ++++ app/controllers/services_controller.rb | 25 +++++++++++++++++++++ app/controllers/users_controller.rb | 3 +++ app/views/users/edit.html.haml | 8 +++++++ config/environment.rb | 9 +++++++- config/fb_config.yml | 4 ++++ config/routes.rb | 31 +++++++++++++------------- 8 files changed, 69 insertions(+), 16 deletions(-) create mode 100644 app/controllers/services_controller.rb create mode 100644 config/fb_config.yml diff --git a/Gemfile b/Gemfile index cc92bec3d..18cfef692 100644 --- a/Gemfile +++ b/Gemfile @@ -21,6 +21,7 @@ gem 'will_paginate', '3.0.pre2' gem 'roxml', :git => 'git://github.com/Empact/roxml.git' gem 'addressable', :require => 'addressable/uri' gem 'json' +gem 'mini_fb' #Standards gem 'pubsubhubbub' diff --git a/Gemfile.lock b/Gemfile.lock index dd181b320..68cf44272 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -142,6 +142,9 @@ GEM mime-types treetop (>= 1.4.5) mime-types (1.16) + mini_fb (1.1.3) + hashie + rest-client mini_magick (2.1) subexec (~> 0.0.4) mocha (0.9.8) @@ -252,6 +255,7 @@ DEPENDENCIES jnunemaker-validatable (= 1.8.4)! json magent! + mini_fb mini_magick mocha mongo_mapper (= 0.8.4)! diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb new file mode 100644 index 000000000..567a1d144 --- /dev/null +++ b/app/controllers/services_controller.rb @@ -0,0 +1,25 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +class ServicesController < ApplicationController + + def create + puts 'services/create' + p params + + code = params['code'] # Facebooks verification string + if code + access_token_hash = MiniFB.oauth_access_token(FB_APP_ID, HOST + "services/create", FB_SECRET, code) + p access_token_hash + @access_token = access_token_hash["access_token"] + + # TODO: This is where you'd want to store the token in your database + # but for now, we'll just keep it in the cookie so we don't need a database + cookies[:access_token] = @access_token + flash[:success] = "Authentication successful." + end + redirect_to edit_user_url current_user + end +end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index dbb69d1a2..76ed944dd 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -13,6 +13,9 @@ class UsersController < ApplicationController @person = @user.person @profile = @user.profile @photos = Photo.find_all_by_person_id(@person.id).paginate :page => params[:page], :order => 'created_at DESC' + + @fb_access_url = MiniFB.oauth_url(FB_APP_ID, HOST + "services/create", + :scope=>MiniFB.scopes.join(",")) end def update diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index fd94b2a42..330ad7f48 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -53,6 +53,14 @@ = p.label :last_name = p.text_field :last_name, :value => @profile.last_name + %br + %br + + %h3 Connect with Facebook + + %p + = link_to "Login to Facebook", @fb_access_url + #submit_block = link_to "Cancel", root_path or diff --git a/config/environment.rb b/config/environment.rb index 385a96651..7bf59851a 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -8,7 +8,14 @@ require File.expand_path('../application', __FILE__) Haml::Template.options[:format] = :html5 Haml::Template.options[:escape_html] = true + +# Load facebook connection application credentials +fb_config = YAML::load(File.open(File.expand_path("./config/fb_config.yml"))) +FB_API_KEY = fb_config['fb_api_key'] +FB_SECRET = fb_config['fb_secret'] +FB_APP_ID = fb_config['fb_app_id'] +HOST = fb_config['host'] + # Initialize the rails application Diaspora::Application.initialize! - diff --git a/config/fb_config.yml b/config/fb_config.yml new file mode 100644 index 000000000..7b69791e5 --- /dev/null +++ b/config/fb_config.yml @@ -0,0 +1,4 @@ +fb_api_key: {dcf4e90df086cf6d3e531b31e043ff32} +fb_secret: {36917c2878d658b8c575952b6a78e3c3} +fb_app_id: {120373411325347} +host: http://localhost:3000/ diff --git a/config/routes.rb b/config/routes.rb index ae757499c..016a89bcb 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -5,32 +5,33 @@ Diaspora::Application.routes.draw do - resources :people, :only => [:index, :show, :destroy] - resources :users, :except => [:create, :new, :show] - resources :status_messages, :only => [:create, :destroy, :show] - resources :comments, :except => [:index] - resources :requests, :except => [:edit, :update] - resources :photos, :except => [:index] + resources :people, :only => [:index, :show, :destroy] + resources :users, :except => [:create, :new, :show] + resources :status_messages, :only => [:create, :destroy, :show] + resources :comments, :except => [:index] + resources :requests, :except => [:edit, :update] + resources :photos, :except => [:index] resources :albums match 'aspects/move_friends', :to => 'aspects#move_friends', :as => 'move_friends' - match 'aspects/move_friend', :to => 'aspects#move_friend', :as => 'move_friend' - match 'aspects/manage', :to => 'aspects#manage' - resources :aspects, :except => [:edit] + match 'aspects/move_friend', :to => 'aspects#move_friend', :as => 'move_friend' + match 'aspects/manage', :to => 'aspects#manage' + resources :aspects, :except => [:edit] + match 'services/create', :to => "services#create" - match 'warzombie', :to => "dev_utilities#warzombie" - match 'zombiefriends', :to => "dev_utilities#zombiefriends" - match 'zombiefriendaccept', :to => "dev_utilities#zombiefriendaccept" - match 'set_backer_number', :to => "dev_utilities#set_backer_number" - match 'set_profile_photo', :to => "dev_utilities#set_profile_photo" + match 'warzombie', :to => "dev_utilities#warzombie" + match 'zombiefriends', :to => "dev_utilities#zombiefriends" + match 'zombiefriendaccept', :to => "dev_utilities#zombiefriendaccept" + match 'set_backer_number', :to => "dev_utilities#set_backer_number" + match 'set_profile_photo', :to => "dev_utilities#set_profile_photo" #routes for devise, not really sure you will need to mess with this in the future, lets put default, #non mutable stuff in anohter file devise_for :users, :controllers => {:registrations => "registrations"} match 'login', :to => 'devise/sessions#new', :as => "new_user_session" match 'logout', :to => 'devise/sessions#destroy', :as => "destroy_user_session" - match 'signup', :to => 'registrations#new', :as => "new_user_registration" + match 'signup', :to => 'registrations#new', :as => "new_user_registration" match 'get_to_the_choppa', :to => redirect("/signup") #public routes From fcc681df71f7876a609b105e06fa72d173e5999b Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 22 Sep 2010 16:32:52 -0700 Subject: [PATCH 013/155] DG IZ moved to be APP_CONFIG for host --- app/controllers/services_controller.rb | 2 +- app/controllers/users_controller.rb | 2 +- app/views/shared/_aspect_nav.haml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb index 567a1d144..b254b0a63 100644 --- a/app/controllers/services_controller.rb +++ b/app/controllers/services_controller.rb @@ -11,7 +11,7 @@ class ServicesController < ApplicationController code = params['code'] # Facebooks verification string if code - access_token_hash = MiniFB.oauth_access_token(FB_APP_ID, HOST + "services/create", FB_SECRET, code) + access_token_hash = MiniFB.oauth_access_token(FB_APP_ID, APP_CONFIG[:pod_url] + "services/create", FB_SECRET, code) p access_token_hash @access_token = access_token_hash["access_token"] diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 76ed944dd..c425729b2 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -14,7 +14,7 @@ class UsersController < ApplicationController @profile = @user.profile @photos = Photo.find_all_by_person_id(@person.id).paginate :page => params[:page], :order => 'created_at DESC' - @fb_access_url = MiniFB.oauth_url(FB_APP_ID, HOST + "services/create", + @fb_access_url = MiniFB.oauth_url(FB_APP_ID, APP_CONFIG[:pod_url] + "services/create", :scope=>MiniFB.scopes.join(",")) end diff --git a/app/views/shared/_aspect_nav.haml b/app/views/shared/_aspect_nav.haml index dbca3bbef..55da1bcdf 100644 --- a/app/views/shared/_aspect_nav.haml +++ b/app/views/shared/_aspect_nav.haml @@ -8,11 +8,11 @@ - for aspect in @aspects %li{:class => ("selected" if current_aspect?(aspect))} = link_for_aspect aspect - - %ul{ :style => "position:absolute;right:0;bottom:0.01em;"} %li{:class => ("selected" if @aspect == :all)} = link_to "All Aspects", root_url + %ul{ :style => "position:absolute;right:0;bottom:0.01em;"} + %li{ :style => "margin-right:0;", :class => ("selected" if @aspect == :manage)} = link_to ( (@request_count == 0)? "Manage Aspects" : "Manage Aspects (#{@request_count})"), {:controller => :aspects, :action => :manage}, :class => "edit_aspect_button", :class => new_request(@request_count), :title => "Manage your Aspects" From 53c0aff23db50d39cd814704a2eabfc64f5592fe Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 22 Sep 2010 16:34:42 -0700 Subject: [PATCH 014/155] deploy from the right branch --- config/deploy_config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/deploy_config.yml b/config/deploy_config.yml index c653b6565..f724ec383 100644 --- a/config/deploy_config.yml +++ b/config/deploy_config.yml @@ -8,7 +8,7 @@ cross_server: deploy_to: '/usr/local/app/diaspora' user: 'root' repo: 'git@github.com:diaspora/diaspora.git' - branch: 'master' + branch: 'fb' default_env: 'development' servers: tom: From 159d72c04c1d1f3c1cc6fc69f2e32b1c3eb5080d Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 22 Sep 2010 16:56:39 -0700 Subject: [PATCH 015/155] DG IZ; logged in as? --- app/controllers/application_controller.rb | 6 ++++++ app/views/users/edit.html.haml | 14 +++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index f0ca5bfc8..0060a8989 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -9,6 +9,7 @@ class ApplicationController < ActionController::Base before_filter :set_friends_and_status, :except => [:create, :update] before_filter :count_requests + before_filter :fb_user_info layout :layout_by_resource @@ -37,4 +38,9 @@ class ApplicationController < ActionController::Base @request_count = Request.for_user(current_user).size if current_user end + def fb_user_info + @access_token = cookies[:access_token] + @logged_in = @access_token.present? + end + end diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index ddbc9c10a..bfb4e92e1 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -56,10 +56,18 @@ %br %br - %h3 Connect with Facebook - %p - = link_to "Login to Facebook", @fb_access_url + %h2 Services + + %h3 Facebook + + - if @logged_in + Logged in to facebook as + - @response_hash = MiniFB.get(@access_token, @id, :type => "user") + = @response_hash[:user][:name] + %p + = link_to "Login to Facebook", @fb_access_url + #submit_block = link_to "Cancel", root_path From 26478403e2efeb2906510ea74509e2870cc3e06e Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 22 Sep 2010 17:14:58 -0700 Subject: [PATCH 016/155] DG IZ; connecting/disconnecting from fb --- app/controllers/application_controller.rb | 2 +- app/controllers/services_controller.rb | 11 +++++++++-- app/views/users/edit.html.haml | 15 ++++++++------- config/routes.rb | 1 + 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 0060a8989..2fecb4f90 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -39,7 +39,7 @@ class ApplicationController < ActionController::Base end def fb_user_info - @access_token = cookies[:access_token] + @access_token = session[:access_token] @logged_in = @access_token.present? end diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb index b254b0a63..ab654e739 100644 --- a/app/controllers/services_controller.rb +++ b/app/controllers/services_controller.rb @@ -16,10 +16,17 @@ class ServicesController < ApplicationController @access_token = access_token_hash["access_token"] # TODO: This is where you'd want to store the token in your database - # but for now, we'll just keep it in the cookie so we don't need a database - cookies[:access_token] = @access_token + # but for now, we'll just keep it in the session so we don't need a database + session[:access_token] = @access_token flash[:success] = "Authentication successful." end redirect_to edit_user_url current_user end + + def destroy + session[:access_token] = nil + session[:user_id] = nil + redirect_to edit_user_url current_url + end + end diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index bfb4e92e1..924b0f72f 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -60,13 +60,14 @@ %h2 Services %h3 Facebook - - - if @logged_in - Logged in to facebook as - - @response_hash = MiniFB.get(@access_token, @id, :type => "user") - = @response_hash[:user][:name] - %p - = link_to "Login to Facebook", @fb_access_url + %p + - if @logged_in + Connected to facebook as + - @response_hash = MiniFB.get(@access_token, 'me') + = @response_hash[:name] + = link_to "Disconnect from Facebook", services_destroy_path + - else + = link_to "Connect to Facebook", @fb_access_url #submit_block diff --git a/config/routes.rb b/config/routes.rb index 016a89bcb..57e58e9aa 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -19,6 +19,7 @@ Diaspora::Application.routes.draw do resources :aspects, :except => [:edit] match 'services/create', :to => "services#create" + match 'services/destroy', :to => "services#destroy" match 'warzombie', :to => "dev_utilities#warzombie" match 'zombiefriends', :to => "dev_utilities#zombiefriends" From aef3c8d7bbeea1980845ad61a091b73cb2992e8f Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 22 Sep 2010 17:16:16 -0700 Subject: [PATCH 017/155] indent, whoops --- app/views/users/edit.html.haml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index 924b0f72f..1973d9a25 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -59,15 +59,15 @@ %h2 Services - %h3 Facebook - %p - - if @logged_in - Connected to facebook as - - @response_hash = MiniFB.get(@access_token, 'me') - = @response_hash[:name] - = link_to "Disconnect from Facebook", services_destroy_path - - else - = link_to "Connect to Facebook", @fb_access_url + %h3 Facebook + %p + - if @logged_in + Connected to facebook as + - @response_hash = MiniFB.get(@access_token, 'me') + = @response_hash[:name] + = link_to "Disconnect from Facebook", services_destroy_path + - else + = link_to "Connect to Facebook", @fb_access_url #submit_block From ddbde60e8cf715ca25071bc2e3ad06d20686b363 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 22 Sep 2010 17:17:24 -0700 Subject: [PATCH 018/155] another indent... --- app/views/users/edit.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index 1973d9a25..56a537c98 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -60,7 +60,7 @@ %h2 Services %h3 Facebook - %p + %p - if @logged_in Connected to facebook as - @response_hash = MiniFB.get(@access_token, 'me') From ae58120deb8071092994a048c3e010a31014cd34 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 22 Sep 2010 17:18:46 -0700 Subject: [PATCH 019/155] another typo... --- app/controllers/services_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb index ab654e739..e13820b5a 100644 --- a/app/controllers/services_controller.rb +++ b/app/controllers/services_controller.rb @@ -26,7 +26,7 @@ class ServicesController < ApplicationController def destroy session[:access_token] = nil session[:user_id] = nil - redirect_to edit_user_url current_url + redirect_to edit_user_url current_user end end From bc70ebdb950836d0e1d1bd661516ac749d2243a1 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 22 Sep 2010 17:33:57 -0700 Subject: [PATCH 020/155] DG IZ; quick form in user edit --- app/controllers/services_controller.rb | 8 ++++++++ app/views/users/edit.html.haml | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb index e13820b5a..d6a7db8a7 100644 --- a/app/controllers/services_controller.rb +++ b/app/controllers/services_controller.rb @@ -29,4 +29,12 @@ class ServicesController < ApplicationController redirect_to edit_user_url current_user end + def fb_post + id = 'me' + type = 'feed' + + @res = MiniFB.post(@access_token, id, :type=>type, :metadata=>true, :params=>params) + redirect_to user_edit_url current_user + end + end diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index 56a537c98..5f8e1e4f6 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -65,6 +65,12 @@ Connected to facebook as - @response_hash = MiniFB.get(@access_token, 'me') = @response_hash[:name] + + + - form_tag :controller => "services", :action => "fb_post" + = text_area_tag "message" + = submit_tag "send it off" + = link_to "Disconnect from Facebook", services_destroy_path - else = link_to "Connect to Facebook", @fb_access_url From 0c2480c9be3b4369ab30df8c16cbcf225ccb94fc Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 22 Sep 2010 17:34:57 -0700 Subject: [PATCH 021/155] DG IZ; quick form in user edit --- config/routes.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/routes.rb b/config/routes.rb index 57e58e9aa..269622156 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -20,6 +20,7 @@ Diaspora::Application.routes.draw do match 'services/create', :to => "services#create" match 'services/destroy', :to => "services#destroy" + match 'services/fb_post', :to => "services#fb_post" match 'warzombie', :to => "dev_utilities#warzombie" match 'zombiefriends', :to => "dev_utilities#zombiefriends" From fc0350e4e13e8934a987b4310a1b489babe836b4 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 22 Sep 2010 17:49:11 -0700 Subject: [PATCH 022/155] DG IZ; user can post a status update from user edit page to facebook. --- app/controllers/services_controller.rb | 2 +- app/views/users/edit.html.haml | 38 ++++++++++++++------------ 2 files changed, 22 insertions(+), 18 deletions(-) diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb index d6a7db8a7..373eb100e 100644 --- a/app/controllers/services_controller.rb +++ b/app/controllers/services_controller.rb @@ -34,7 +34,7 @@ class ServicesController < ApplicationController type = 'feed' @res = MiniFB.post(@access_token, id, :type=>type, :metadata=>true, :params=>params) - redirect_to user_edit_url current_user + redirect_to edit_user_url current_user end end diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index 5f8e1e4f6..1c345559e 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -57,29 +57,33 @@ %br - %h2 Services - - %h3 Facebook - %p - - if @logged_in - Connected to facebook as - - @response_hash = MiniFB.get(@access_token, 'me') - = @response_hash[:name] - - - - form_tag :controller => "services", :action => "fb_post" - = text_area_tag "message" - = submit_tag "send it off" - - = link_to "Disconnect from Facebook", services_destroy_path - - else - = link_to "Connect to Facebook", @fb_access_url #submit_block = link_to "Cancel", root_path or = f.submit "Update Profile" + + + +%h2 Services + +%h3 Facebook +%p + - if @logged_in + Connected to facebook as + - @response_hash = MiniFB.get(@access_token, 'me') + = @response_hash[:name] + + + - form_tag :controller => "services", :action => "fb_post" do + = text_area_tag "message" + = submit_tag "send it off" + + = link_to "Disconnect from Facebook", services_destroy_path + - else + = link_to "Connect to Facebook", @fb_access_url + - end #content_bottom .back From 7303212784c865cf1aaea8257c13cdd1bf30e239 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Wed, 22 Sep 2010 17:50:47 -0700 Subject: [PATCH 023/155] DG IZ; haml typo --- app/views/users/edit.html.haml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index 1c345559e..fb9de28be 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -75,15 +75,13 @@ - @response_hash = MiniFB.get(@access_token, 'me') = @response_hash[:name] - - - form_tag :controller => "services", :action => "fb_post" do + - form_tag "/services/fb_post" do = text_area_tag "message" = submit_tag "send it off" = link_to "Disconnect from Facebook", services_destroy_path - else = link_to "Connect to Facebook", @fb_access_url - - end #content_bottom .back From c889fcb5926fcf00d28db78595603681570ac8a0 Mon Sep 17 00:00:00 2001 From: Guido Serra aka Zeph Date: Thu, 23 Sep 2010 20:55:57 +0200 Subject: [PATCH 024/155] merge a culo --- config/locales/it.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/config/locales/it.yml b/config/locales/it.yml index 44f8a8033..4cce93d73 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -3,20 +3,8 @@ # the COPYRIGHT file. -<<<<<<< HEAD -# Sample localization file for English. Add more files in this directory for other locales. -# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. - -# -# 1st DRAFT of the italian translation -# 09/2010 Guido Serra aka Zeph - -it: - hello: "Ciao Mondo!" -======= # Sample localization file for Italian. Add more files in this directory for other locales. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. it: hello: "Ciao Mondo" ->>>>>>> af91eb51b4ff8d001bbdceba4b4e9e45db498190 From 48c212c1ab8e1e46a026bf07cbb102203ff32020 Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 23 Sep 2010 12:18:26 -0700 Subject: [PATCH 025/155] made a public view, copied the fb publisher there --- app/controllers/aspects_controller.rb | 10 ++++++++++ app/views/shared/_aspect_nav.haml | 2 ++ config/fb_config.yml | 2 +- config/routes.rb | 1 + 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index 779ce0f6f..9112792c1 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -45,6 +45,16 @@ class AspectsController < ApplicationController respond_with @aspect end + def public + @fb_access_url = MiniFB.oauth_url(FB_APP_ID, APP_CONFIG[:pod_url] + "services/create", + :scope=>MiniFB.scopes.join(",")) + + @posts = current_user.visible_posts(:by_members_of => :all).paginate :page => params[:page], :per_page => 15, :order => 'created_at DESC' + @aspect = :all + + respond_with @aspect + end + def manage @aspect = :manage @remote_requests = Request.for_user(current_user).all diff --git a/app/views/shared/_aspect_nav.haml b/app/views/shared/_aspect_nav.haml index 55da1bcdf..ebfd2b57d 100644 --- a/app/views/shared/_aspect_nav.haml +++ b/app/views/shared/_aspect_nav.haml @@ -12,6 +12,8 @@ = link_to "All Aspects", root_url %ul{ :style => "position:absolute;right:0;bottom:0.01em;"} + %li{:class => ("selected" if @aspect == :all)} + = link_to "Public", aspects_public_path %li{ :style => "margin-right:0;", :class => ("selected" if @aspect == :manage)} = link_to ( (@request_count == 0)? "Manage Aspects" : "Manage Aspects (#{@request_count})"), {:controller => :aspects, :action => :manage}, :class => "edit_aspect_button", :class => new_request(@request_count), :title => "Manage your Aspects" diff --git a/config/fb_config.yml b/config/fb_config.yml index 7b69791e5..4c3309fac 100644 --- a/config/fb_config.yml +++ b/config/fb_config.yml @@ -1,4 +1,4 @@ fb_api_key: {dcf4e90df086cf6d3e531b31e043ff32} -fb_secret: {36917c2878d658b8c575952b6a78e3c3} +fb_secret: {7fe864834726f8a5e65bc93928b99a53} fb_app_id: {120373411325347} host: http://localhost:3000/ diff --git a/config/routes.rb b/config/routes.rb index 269622156..112ff5768 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -16,6 +16,7 @@ Diaspora::Application.routes.draw do match 'aspects/move_friends', :to => 'aspects#move_friends', :as => 'move_friends' match 'aspects/move_friend', :to => 'aspects#move_friend', :as => 'move_friend' match 'aspects/manage', :to => 'aspects#manage' + match 'aspects/public', :to => 'aspects#public' resources :aspects, :except => [:edit] match 'services/create', :to => "services#create" From 5857838a0a6ece7f42da2df6264c4d334e8e5c6a Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 23 Sep 2010 12:29:00 -0700 Subject: [PATCH 026/155] adding the new files --- app/views/aspects/public.html.haml | 35 ++++++++++++++++++++++++++++++ config/deploy_config.yml | 2 +- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 app/views/aspects/public.html.haml diff --git a/app/views/aspects/public.html.haml b/app/views/aspects/public.html.haml new file mode 100644 index 000000000..add02f490 --- /dev/null +++ b/app/views/aspects/public.html.haml @@ -0,0 +1,35 @@ +-# Copyright (c) 2010, Diaspora Inc. This file is +-# licensed under the Affero General Public License version 3. See +-# the COPYRIGHT file. + + +- content_for :page_title do + = link_to "photos", albums_path(:aspect => @aspect) + +- content_for :left_pane do + = render "shared/aspect_friends" + +- content_for :publish do + = render "shared/publisher", :aspect_ids => :public + +%h3 Facebook +%p + - if @logged_in + Connected to facebook as + - @response_hash = MiniFB.get(@access_token, 'me') + = @response_hash[:name] + + - form_tag "/services/fb_post" do + = text_area_tag "message" + = submit_tag "send it off" + + = link_to "Disconnect from Facebook", services_destroy_path + - else + = link_to "Connect to Facebook", @fb_access_url + +%ul#stream + - for post in @posts + = render type_partial(post), :post => post unless post.class == Album +#pagination + = will_paginate @posts + diff --git a/config/deploy_config.yml b/config/deploy_config.yml index f724ec383..fcecaa6b1 100644 --- a/config/deploy_config.yml +++ b/config/deploy_config.yml @@ -7,7 +7,7 @@ cross_server: deploy_to: '/usr/local/app/diaspora' user: 'root' - repo: 'git@github.com:diaspora/diaspora.git' + repo: 'git://github.com/diaspora/diaspora.git' branch: 'fb' default_env: 'development' servers: From f0999628ae651309c2d4b9a6b0b895fd7e7e9c09 Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 23 Sep 2010 14:43:08 -0700 Subject: [PATCH 027/155] trying to get friends from fb --- app/views/users/edit.html.haml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index fb9de28be..bbd84ec92 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -75,10 +75,12 @@ - @response_hash = MiniFB.get(@access_token, 'me') = @response_hash[:name] + - @fb_friends = MiniFB.get(@access_token, 'me', :type => "friends") + = @fb_friends.inspect + - form_tag "/services/fb_post" do = text_area_tag "message" = submit_tag "send it off" - = link_to "Disconnect from Facebook", services_destroy_path - else = link_to "Connect to Facebook", @fb_access_url From 19c3a5ce4b32b9183d593ea92a25a536a9cdd2e2 Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 23 Sep 2010 15:07:07 -0700 Subject: [PATCH 028/155] fetching friend data --- app/views/users/edit.html.haml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index bbd84ec92..3045a2ad2 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -76,7 +76,8 @@ = @response_hash[:name] - @fb_friends = MiniFB.get(@access_token, 'me', :type => "friends") - = @fb_friends.inspect + - @fb_friends[:data] do |friend| + = MiniFB.get(@access_token, friend[:id]).inspect - form_tag "/services/fb_post" do = text_area_tag "message" From 1fdbc637d173a5a473339686dbd79008874d5044 Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 23 Sep 2010 15:18:29 -0700 Subject: [PATCH 029/155] trying profile pictures on remote --- app/views/users/edit.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index 3045a2ad2..7d6d0d552 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -76,8 +76,8 @@ = @response_hash[:name] - @fb_friends = MiniFB.get(@access_token, 'me', :type => "friends") - - @fb_friends[:data] do |friend| - = MiniFB.get(@access_token, friend[:id]).inspect + - @fb_friends[:data].each do |friend| + = image_tag( "http://graph.facebook.com/#{friend[:id]}/picture" - form_tag "/services/fb_post" do = text_area_tag "message" From fc2cf4fde64a39694bd7b8d3c1a23ed6ba4b2d28 Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 23 Sep 2010 15:21:15 -0700 Subject: [PATCH 030/155] typo --- app/views/users/edit.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index 7d6d0d552..e4789e361 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -77,7 +77,7 @@ - @fb_friends = MiniFB.get(@access_token, 'me', :type => "friends") - @fb_friends[:data].each do |friend| - = image_tag( "http://graph.facebook.com/#{friend[:id]}/picture" + = image_tag( "http://graph.facebook.com/#{friend[:id]}/picture" ) - form_tag "/services/fb_post" do = text_area_tag "message" From be10681945160fb60d4ab644d5fc7f8503d174f5 Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 23 Sep 2010 16:06:55 -0700 Subject: [PATCH 031/155] IZ tying the publisher to fb in public aspect --- app/controllers/status_messages_controller.rb | 10 ++++++++++ app/views/aspects/public.html.haml | 5 ++++- app/views/shared/_aspect_nav.haml | 2 +- app/views/shared/_publisher.haml | 8 +++++++- 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/app/controllers/status_messages_controller.rb b/app/controllers/status_messages_controller.rb index 5a8efbe06..5dc1cbce0 100644 --- a/app/controllers/status_messages_controller.rb +++ b/app/controllers/status_messages_controller.rb @@ -13,6 +13,16 @@ class StatusMessagesController < ApplicationController params[:status_message][:to] = params[:aspect_ids] data = clean_hash params[:status_message] + + if @logged_in && params[:status_message][:to] == :public + id = 'me' + type = 'feed' + + @res = MiniFB.post(@access_token, id, :type=>type, + :metadata=>true, :params=>{:message => params[:status_message][:message]}) + + params[:status_message][:to] == :all + end @status_message = current_user.post(:status_message, data) respond_with @status_message diff --git a/app/views/aspects/public.html.haml b/app/views/aspects/public.html.haml index add02f490..e8872cfb7 100644 --- a/app/views/aspects/public.html.haml +++ b/app/views/aspects/public.html.haml @@ -10,7 +10,10 @@ = render "shared/aspect_friends" - content_for :publish do - = render "shared/publisher", :aspect_ids => :public + - if @logged_in + = render "shared/publisher", :aspect_ids => :public + - else + = render "shared/publisher", :aspect_ids => :all %h3 Facebook %p diff --git a/app/views/shared/_aspect_nav.haml b/app/views/shared/_aspect_nav.haml index ebfd2b57d..1d49ef049 100644 --- a/app/views/shared/_aspect_nav.haml +++ b/app/views/shared/_aspect_nav.haml @@ -12,7 +12,7 @@ = link_to "All Aspects", root_url %ul{ :style => "position:absolute;right:0;bottom:0.01em;"} - %li{:class => ("selected" if @aspect == :all)} + %li{:class => ("selected" if @aspect == :public)} = link_to "Public", aspects_public_path %li{ :style => "margin-right:0;", :class => ("selected" if @aspect == :manage)} diff --git a/app/views/shared/_publisher.haml b/app/views/shared/_publisher.haml index 130f136a9..a84b39052 100644 --- a/app/views/shared/_publisher.haml +++ b/app/views/shared/_publisher.haml @@ -16,7 +16,13 @@ going to... - for aspect in @aspects %li - = check_box_tag("aspect_ids[]", aspect.id, @aspect == :all || current_aspect?(aspect) ) + = check_box_tag("aspect_ids[]", aspect.id, @aspect == :public || @aspect == :all || current_aspect?(aspect) ) = aspect.name = f.submit "Share" + + - if @logged_in + - @response_hash = MiniFB.get(@access_token, 'me') + = "going to Facebook as #{@response_hash[:name]}" + + From 4d2bd52310f1dbd49a47f7f5906ae16f3cdfb905 Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 23 Sep 2010 16:41:05 -0700 Subject: [PATCH 032/155] public aspect param on statusMessage create and in the partial --- app/controllers/status_messages_controller.rb | 5 ++--- app/views/shared/_publisher.haml | 3 ++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/status_messages_controller.rb b/app/controllers/status_messages_controller.rb index 5dc1cbce0..e970fb2bb 100644 --- a/app/controllers/status_messages_controller.rb +++ b/app/controllers/status_messages_controller.rb @@ -14,14 +14,12 @@ class StatusMessagesController < ApplicationController data = clean_hash params[:status_message] - if @logged_in && params[:status_message][:to] == :public + if @logged_in && params[:status_message][:public] == true id = 'me' type = 'feed' @res = MiniFB.post(@access_token, id, :type=>type, :metadata=>true, :params=>{:message => params[:status_message][:message]}) - - params[:status_message][:to] == :all end @status_message = current_user.post(:status_message, data) @@ -44,6 +42,7 @@ class StatusMessagesController < ApplicationController return { :message => params[:message], :to => params[:to] + :public => params[:public] } end end diff --git a/app/views/shared/_publisher.haml b/app/views/shared/_publisher.haml index a84b39052..ae61300f3 100644 --- a/app/views/shared/_publisher.haml +++ b/app/views/shared/_publisher.haml @@ -11,12 +11,13 @@ %p %label{:for => "status_message_message"} Message = f.text_area :message, :rows => 2, :value => params[:prefill] + = f.hidden_field( :public, :value => (params[:action] == 'public') ) %ul.aspect_selector{ :style => "display:none;"} going to... - for aspect in @aspects %li - = check_box_tag("aspect_ids[]", aspect.id, @aspect == :public || @aspect == :all || current_aspect?(aspect) ) + = check_box_tag("aspect_ids[]", aspect.id, (params[:action] == 'public') || @aspect == :all || current_aspect?(aspect) ) = aspect.name = f.submit "Share" From d7833c66b24ea5a157ab3331acb8995fb2621f30 Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 23 Sep 2010 16:48:58 -0700 Subject: [PATCH 033/155] typo --- app/controllers/status_messages_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/status_messages_controller.rb b/app/controllers/status_messages_controller.rb index e970fb2bb..8611b3804 100644 --- a/app/controllers/status_messages_controller.rb +++ b/app/controllers/status_messages_controller.rb @@ -41,7 +41,7 @@ class StatusMessagesController < ApplicationController def clean_hash(params) return { :message => params[:message], - :to => params[:to] + :to => params[:to], :public => params[:public] } end From 107fb58917979d76f29fd7b7e2e29258b5831ed0 Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 23 Sep 2010 17:04:27 -0700 Subject: [PATCH 034/155] added a logger statement --- app/controllers/status_messages_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/status_messages_controller.rb b/app/controllers/status_messages_controller.rb index 8611b3804..28ce83ecd 100644 --- a/app/controllers/status_messages_controller.rb +++ b/app/controllers/status_messages_controller.rb @@ -17,7 +17,8 @@ class StatusMessagesController < ApplicationController if @logged_in && params[:status_message][:public] == true id = 'me' type = 'feed' - + + Rails.logger.info("Sending a message: #{params[:status_message][:message]} to Facebook") @res = MiniFB.post(@access_token, id, :type=>type, :metadata=>true, :params=>{:message => params[:status_message][:message]}) end From 0d71a1896c8b41a8ff76d632b2e225be27f09ae7 Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 23 Sep 2010 17:11:42 -0700 Subject: [PATCH 035/155] posting to FB from public now works --- app/controllers/status_messages_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/status_messages_controller.rb b/app/controllers/status_messages_controller.rb index 28ce83ecd..98ae19b82 100644 --- a/app/controllers/status_messages_controller.rb +++ b/app/controllers/status_messages_controller.rb @@ -14,7 +14,7 @@ class StatusMessagesController < ApplicationController data = clean_hash params[:status_message] - if @logged_in && params[:status_message][:public] == true + if @logged_in && params[:status_message][:public] == 'true' id = 'me' type = 'feed' From 75e1ddf9d28ec19d41b03dce3e844bafc776ff6b Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 23 Sep 2010 17:17:18 -0700 Subject: [PATCH 036/155] saying going to FB in public aspect --- app/views/shared/_publisher.haml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/views/shared/_publisher.haml b/app/views/shared/_publisher.haml index ae61300f3..fdacfccb4 100644 --- a/app/views/shared/_publisher.haml +++ b/app/views/shared/_publisher.haml @@ -11,6 +11,7 @@ %p %label{:for => "status_message_message"} Message = f.text_area :message, :rows => 2, :value => params[:prefill] + = "going to Facebook as #{MiniFB.get(@access_token, 'me')[:name]}" if @logged_in = f.hidden_field( :public, :value => (params[:action] == 'public') ) %ul.aspect_selector{ :style => "display:none;"} @@ -22,8 +23,3 @@ = f.submit "Share" - - if @logged_in - - @response_hash = MiniFB.get(@access_token, 'me') - = "going to Facebook as #{@response_hash[:name]}" - - From 11dc2253111af29ae6644a54e1c7aec7ec53a5c7 Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 23 Sep 2010 17:19:43 -0700 Subject: [PATCH 037/155] removed the old publish box --- app/views/aspects/public.html.haml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/app/views/aspects/public.html.haml b/app/views/aspects/public.html.haml index e8872cfb7..def45bc7c 100644 --- a/app/views/aspects/public.html.haml +++ b/app/views/aspects/public.html.haml @@ -15,21 +15,6 @@ - else = render "shared/publisher", :aspect_ids => :all -%h3 Facebook -%p - - if @logged_in - Connected to facebook as - - @response_hash = MiniFB.get(@access_token, 'me') - = @response_hash[:name] - - - form_tag "/services/fb_post" do - = text_area_tag "message" - = submit_tag "send it off" - - = link_to "Disconnect from Facebook", services_destroy_path - - else - = link_to "Connect to Facebook", @fb_access_url - %ul#stream - for post in @posts = render type_partial(post), :post => post unless post.class == Album From 796f198d8c717d5211708a13a8e304e45000942e Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 23 Sep 2010 17:20:55 -0700 Subject: [PATCH 038/155] notification only on user page --- app/views/shared/_publisher.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/shared/_publisher.haml b/app/views/shared/_publisher.haml index fdacfccb4..4714b1f1f 100644 --- a/app/views/shared/_publisher.haml +++ b/app/views/shared/_publisher.haml @@ -11,7 +11,7 @@ %p %label{:for => "status_message_message"} Message = f.text_area :message, :rows => 2, :value => params[:prefill] - = "going to Facebook as #{MiniFB.get(@access_token, 'me')[:name]}" if @logged_in + = "going to Facebook as #{MiniFB.get(@access_token, 'me')[:name]}" if @logged_in && (params[:action] == 'public') = f.hidden_field( :public, :value => (params[:action] == 'public') ) %ul.aspect_selector{ :style => "display:none;"} From eaea26e58d7781c79d7ea962b491cfd4aeb06445 Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 23 Sep 2010 19:33:33 -0700 Subject: [PATCH 039/155] the public aspect is now set in application controller --- app/controllers/application_controller.rb | 4 +++- app/controllers/aspects_controller.rb | 1 - app/views/shared/_aspect_friends.haml | 2 +- app/views/shared/_publisher.haml | 5 +++-- app/views/shared/_sub_header.haml | 2 ++ 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 2fecb4f90..1cbdc7c39 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -23,7 +23,9 @@ class ApplicationController < ActionController::Base def set_friends_and_status if current_user - if params[:aspect] == nil || params[:aspect] == 'all' + if params[:action] == 'public' + @aspect = :public + elsif params[:aspect] == nil || params[:aspect] == 'all' @aspect = :all else @aspect = current_user.aspect_by_id( params[:aspect]) diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index 9112792c1..f05edfe6e 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -50,7 +50,6 @@ class AspectsController < ApplicationController :scope=>MiniFB.scopes.join(",")) @posts = current_user.visible_posts(:by_members_of => :all).paginate :page => params[:page], :per_page => 15, :order => 'created_at DESC' - @aspect = :all respond_with @aspect end diff --git a/app/views/shared/_aspect_friends.haml b/app/views/shared/_aspect_friends.haml index 6ab286a81..f4aa811b1 100644 --- a/app/views/shared/_aspect_friends.haml +++ b/app/views/shared/_aspect_friends.haml @@ -8,7 +8,7 @@ - for friend in @friends = person_image_link(friend) - -unless @aspect == :all + -unless (@aspect == :all) || (@aspect == :public) = link_to (image_tag('add_friend_button.png', :height => "50px", :width => "50px")), "#add_request_pane", :id => 'add_request_button' .yo{:style => 'display:none'} diff --git a/app/views/shared/_publisher.haml b/app/views/shared/_publisher.haml index 4714b1f1f..54f14c27a 100644 --- a/app/views/shared/_publisher.haml +++ b/app/views/shared/_publisher.haml @@ -5,20 +5,21 @@ #publisher = owner_image_tag + = @aspect = form_for StatusMessage.new, :remote => true do |f| = f.error_messages %p %label{:for => "status_message_message"} Message = f.text_area :message, :rows => 2, :value => params[:prefill] - = "going to Facebook as #{MiniFB.get(@access_token, 'me')[:name]}" if @logged_in && (params[:action] == 'public') + = "going to Facebook as #{MiniFB.get(@access_token, 'me')[:name]}" if @logged_in && @aspect == :public = f.hidden_field( :public, :value => (params[:action] == 'public') ) %ul.aspect_selector{ :style => "display:none;"} going to... - for aspect in @aspects %li - = check_box_tag("aspect_ids[]", aspect.id, (params[:action] == 'public') || @aspect == :all || current_aspect?(aspect) ) + = check_box_tag("aspect_ids[]", aspect.id, @aspect == :public || @aspect == :all || current_aspect?(aspect) ) = aspect.name = f.submit "Share" diff --git a/app/views/shared/_sub_header.haml b/app/views/shared/_sub_header.haml index 4e0e2aca4..c8b2bd5e9 100644 --- a/app/views/shared/_sub_header.haml +++ b/app/views/shared/_sub_header.haml @@ -10,6 +10,8 @@ = link_to "All Aspects", root_path - elsif @aspect == :manage = "Manage Aspects" + - elsif @aspect == :public + = "Public" - else = link_to @aspect.name, @aspect From 265753b5fecedd83c8432b952169024cebe7d501 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Thu, 23 Sep 2010 20:13:07 -0700 Subject: [PATCH 040/155] user edit is now divided into real sections --- app/views/layouts/application.html.haml | 2 +- app/views/users/_profile.haml | 59 ++++++++++++++ app/views/users/_services.haml | 28 +++++++ app/views/users/edit.html.haml | 98 +++++------------------- public/stylesheets/application.css | 22 +++--- public/stylesheets/sass/application.sass | 31 +++++--- 6 files changed, 140 insertions(+), 100 deletions(-) create mode 100644 app/views/users/_profile.haml create mode 100644 app/views/users/_services.haml diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 4a3ec2dbb..4226ef139 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -50,7 +50,7 @@ = text_field_tag 'q' %li= link_to current_user.real_name, current_user.person - %li= link_to "edit profile", edit_user_path(current_user) + %li= link_to "settings", edit_user_path(current_user) %li= link_to "logout", destroy_user_session_path = render "shared/aspect_nav" diff --git a/app/views/users/_profile.haml b/app/views/users/_profile.haml new file mode 100644 index 000000000..e1da95649 --- /dev/null +++ b/app/views/users/_profile.haml @@ -0,0 +1,59 @@ +-# Copyright (c) 2010, Diaspora Inc. This file is +-# licensed under the Affero General Public License version 3. See +-# the COPYRIGHT file. + + +%h2 Profile + += form_for @user do |f| + = f.error_messages + + = f.fields_for :profile do |p| + + %h3 Picture + %div#image_picker + = p.hidden_field :image_url, :value => (@profile.image_url if @profile.image_url), :id => 'image_url_field' + + - unless @photos.nil? || @photos.empty? + - for photo in @photos + - if @profile.image_url && @profile.image_url.include?(photo.url(:thumb_medium)) + %div.small_photo{:id => photo.url(:thumb_medium), :class=>'selected'} + = check_box_tag 'checked_photo', true, true + = link_to image_tag(photo.url(:thumb_medium)), "#" + - else + %div.small_photo{:id => photo.url(:thumb_medium)} + = check_box_tag 'checked_photo' + = link_to image_tag(photo.url(:thumb_medium)), "#" + + - else + You don't have any photos! Go to the + = link_to "albums", albums_path(:aspect => 'all') + page to upload some. + + =will_paginate @photos + + %br + + %h3 Info + + %p + %b + DIASPORA USERNAME: + = @user.diaspora_handle + + %p + = p.label :first_name + = p.text_field :first_name, :value => @profile.first_name + %p + = p.label :last_name + = p.text_field :last_name, :value => @profile.last_name + + #submit_block + = link_to "Cancel", root_path + or + = f.submit "Update Profile" + +#content_bottom + .back + = link_to "⇧ home", root_path + diff --git a/app/views/users/_services.haml b/app/views/users/_services.haml new file mode 100644 index 000000000..c6e31939a --- /dev/null +++ b/app/views/users/_services.haml @@ -0,0 +1,28 @@ +-# Copyright (c) 2010, Diaspora Inc. This file is +-# licensed under the Affero General Public License version 3. See +-# the COPYRIGHT file. + + +%h2 Services + +%h3 Facebook +%p + - if @logged_in + Connected to facebook as + - @response_hash = MiniFB.get(@access_token, 'me') + = @response_hash[:name] + + - @fb_friends = MiniFB.get(@access_token, 'me', :type => "friends") + - @fb_friends[:data].each do |friend| + = image_tag( "http://graph.facebook.com/#{friend[:id]}/picture" ) + + - form_tag "/services/fb_post" do + = text_area_tag "message" + = submit_tag "send it off" + = link_to "Disconnect from Facebook", services_destroy_path + - else + = link_to "Connect to Facebook", @fb_access_url + + #content_bottom + .back + = link_to "⇧ home", root_path diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index e4789e361..b4ef0226c 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -3,89 +3,29 @@ -# the COPYRIGHT file. +:javascript + $("#settings_nav li > a").click( function() { + var target = "#"+$(this).attr('class'); + if( !$(target).is(":visible") ) { + $(".settings_pane").fadeOut(200, function() { + $(target).delay(200).fadeIn(200); + }); + } + }); + + - content_for :publish do %h1 - Editing profile + Settings - content_for :left_pane do - \. - -= form_for @user do |f| - = f.error_messages - - = f.fields_for :profile do |p| - - %h3 Picture - %div#image_picker - = p.hidden_field :image_url, :value => (@profile.image_url if @profile.image_url), :id => 'image_url_field' - - - unless @photos.nil? || @photos.empty? - - for photo in @photos - - if @profile.image_url && @profile.image_url.include?(photo.url(:thumb_medium)) - %div.small_photo{:id => photo.url(:thumb_medium), :class=>'selected'} - = check_box_tag 'checked_photo', true, true - = link_to image_tag(photo.url(:thumb_medium)), "#" - - else - %div.small_photo{:id => photo.url(:thumb_medium)} - = check_box_tag 'checked_photo' - = link_to image_tag(photo.url(:thumb_medium)), "#" - - - else - You don't have any photos! Go to the - = link_to "albums", albums_path(:aspect => 'all') - page to upload some. - - =will_paginate @photos - - %br - - %h3 Info - - %p - %b - DIASPORA USERNAME: - = @user.diaspora_handle - - %p - = p.label :first_name - = p.text_field :first_name, :value => @profile.first_name - %p - = p.label :last_name - = p.text_field :last_name, :value => @profile.last_name - - %br - %br + %ul#settings_nav + %li=link_to 'Profile', '#', :class => 'profile' + %li=link_to 'Services', '#', :class => 'services' +#profile.settings_pane{:style=>"display:block;"} + = render 'users/profile' +#services.settings_pane + = render 'users/services' - - #submit_block - = link_to "Cancel", root_path - or - = f.submit "Update Profile" - - - -%h2 Services - -%h3 Facebook -%p - - if @logged_in - Connected to facebook as - - @response_hash = MiniFB.get(@access_token, 'me') - = @response_hash[:name] - - - @fb_friends = MiniFB.get(@access_token, 'me', :type => "friends") - - @fb_friends[:data].each do |friend| - = image_tag( "http://graph.facebook.com/#{friend[:id]}/picture" ) - - - form_tag "/services/fb_post" do - = text_area_tag "message" - = submit_tag "send it off" - = link_to "Disconnect from Facebook", services_destroy_path - - else - = link_to "Connect to Facebook", @fb_access_url - -#content_bottom - .back - = link_to "⇧ home", root_path diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 82bbd8b6d..4c83aa0c2 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -659,15 +659,19 @@ h1.big_text { -moz-box-shadow: 0 2px 4px #333333; opacity: 0.9; } -#notification_badge { - position: fixed; - bottom: 0; - margin-left: 854px; } - #notification_badge a { - background-color: #eeeeee; - border: 1px solid #cccccc; - border-bottom: none; - padding: 3px 10px; } +ul#settings_nav { + list-style: none; + padding: 0; + marign: 0; + font-size: larger; } + ul#settings_nav > li a { + display: block; + height: 100%; + border-bottom: 1px solid #eeeeee; + padding: 5px 0; } + +.settings_pane { + display: none; } #fancybox-close:hover { background-color: transparent; } diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 7c77a0b79..890ef7708 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -839,21 +839,30 @@ h1.big_text :-moz-box-shadow 0 2px 4px #333 :opacity 0.9 -#notification_badge - :position fixed - :bottom 0 - :margin - :left 854px +ul#settings_nav + :list + :style none + :padding 0 + :marign 0 - a - :background - :color #eee + :font + :size larger - :border 1px solid #ccc - :bottom none + > li + + a + :display block + :height 100% + :border + :bottom 1px solid #eee + :padding 5px 0 + + +.settings_pane + :display none - :padding 3px 10px #fancybox-close:hover :background :color transparent + From a594c9a34f16173468c815537d0fe96e915af6c7 Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 23 Sep 2010 20:19:02 -0700 Subject: [PATCH 041/155] friends in the public bucket --- app/views/shared/_aspect_friends.haml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/views/shared/_aspect_friends.haml b/app/views/shared/_aspect_friends.haml index f4aa811b1..10a0da317 100644 --- a/app/views/shared/_aspect_friends.haml +++ b/app/views/shared/_aspect_friends.haml @@ -7,7 +7,11 @@ = owner_image_link - for friend in @friends = person_image_link(friend) - + - if @logged_in && (@aspect == :public) + Facebook Friends + - @fb_friends = MiniFB.get(@access_token, 'me', :type => "friends") + - @fb_friends[:data].each do |friend| + = image_tag( "http://graph.facebook.com/#{friend[:id]}/picture" ) -unless (@aspect == :all) || (@aspect == :public) = link_to (image_tag('add_friend_button.png', :height => "50px", :width => "50px")), "#add_request_pane", :id => 'add_request_button' From a6c1ff8ce236ac03581169483c73eec21370e017 Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 23 Sep 2010 20:21:17 -0700 Subject: [PATCH 042/155] fixed the deploy scripts --- db/seeds/backer.rb | 4 ++-- db/seeds/tom.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/db/seeds/backer.rb b/db/seeds/backer.rb index 20fe90fdf..12e6236f8 100644 --- a/db/seeds/backer.rb +++ b/db/seeds/backer.rb @@ -44,8 +44,8 @@ end def set_app_config username current_config = YAML.load(File.read(Rails.root.join('config', 'app_config.yml.example'))) current_config[Rails.env.to_s] ||= {} - current_config[Rails.env.to_s]['pod_url'] = "#{username}.joindiaspora.com" - current_config['default']['pod_url'] = "#{username}.joindiaspora.com" + current_config[Rails.env.to_s]['pod_url'] = "http://#{username}.joindiaspora.com/" + current_config['default']['pod_url'] = "http://#{username}.joindiaspora.com/" file = File.new(Rails.root.join('..','..','shared','app_config.yml'),'w') file.write(current_config.to_yaml) file.close diff --git a/db/seeds/tom.rb b/db/seeds/tom.rb index cc3000d0b..1eaa5b236 100644 --- a/db/seeds/tom.rb +++ b/db/seeds/tom.rb @@ -9,8 +9,8 @@ require 'config/environment' def set_app_config username current_config = YAML.load(File.read(Rails.root.join('config', 'app_config.yml.example'))) current_config[Rails.env.to_s] ||= {} - current_config[Rails.env.to_s]['pod_url'] = "#{username}.joindiaspora.com" - current_config['default']['pod_url'] = "#{username}.joindiaspora.com" + current_config[Rails.env.to_s]['pod_url'] = "http://#{username}.joindiaspora.com/" + current_config['default']['pod_url'] = "http://#{username}.joindiaspora.com/" file = File.new(Rails.root.join('..','..','shared','app_config.yml'),'w') file.write(current_config.to_yaml) file.close From 4f17eb4e02c13783de1efc8ac99bd57957c9de4e Mon Sep 17 00:00:00 2001 From: danielvincent Date: Thu, 23 Sep 2010 20:33:34 -0700 Subject: [PATCH 043/155] stray aspect name removed from publisher --- app/views/shared/_publisher.haml | 1 - 1 file changed, 1 deletion(-) diff --git a/app/views/shared/_publisher.haml b/app/views/shared/_publisher.haml index 54f14c27a..a137ccdeb 100644 --- a/app/views/shared/_publisher.haml +++ b/app/views/shared/_publisher.haml @@ -5,7 +5,6 @@ #publisher = owner_image_tag - = @aspect = form_for StatusMessage.new, :remote => true do |f| = f.error_messages From deea03bf82e14fe8e4d01f9ca5bc81ae50f3a6b3 Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 23 Sep 2010 20:38:39 -0700 Subject: [PATCH 044/155] deploy restart after db:reset since we need the new app_config.yml --- config/deploy.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/deploy.rb b/config/deploy.rb index 2f8065134..869328533 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -150,6 +150,7 @@ namespace :db do purge backer_seed tom_seed + deploy::restart end From b9bff760542328dc0fd3dfb9ebee529abfdcbb53 Mon Sep 17 00:00:00 2001 From: Raphael Date: Fri, 24 Sep 2010 09:49:42 -0700 Subject: [PATCH 045/155] Initial 1.9.2, specs fail (possibly validatable), need to pull in aredridel photo fixes --- Gemfile | 1 - Gemfile.lock | 2 -- app/models/user.rb | 15 --------------- 3 files changed, 18 deletions(-) diff --git a/Gemfile b/Gemfile index 2b3cd008c..2155262cb 100644 --- a/Gemfile +++ b/Gemfile @@ -47,7 +47,6 @@ group :test do gem 'rspec-rails', '2.0.0.beta.17' gem 'mocha' gem 'webrat', '0.7.2.beta.1' - gem 'redgreen' gem 'autotest' gem 'database_cleaner' gem 'saucelabs-adapter', '= 0.8.12' diff --git a/Gemfile.lock b/Gemfile.lock index ecee78c77..4a0be2e30 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -180,7 +180,6 @@ GEM rake (>= 0.8.4) thor (~> 0.14.0) rake (0.8.7) - redgreen (1.2.2) rest-client (1.6.1) mime-types (>= 1.16) rspec (2.0.0.beta.22) @@ -252,7 +251,6 @@ DEPENDENCIES pubsubhubbub rails (= 3.0.0) redfinger! - redgreen roxml! rspec (>= 2.0.0.beta.17) rspec-rails (= 2.0.0.beta.17) diff --git a/app/models/user.rb b/app/models/user.rb index c1aebfd53..c6957ff6d 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - require File.expand_path('../../../lib/diaspora/user/friending', __FILE__) require File.expand_path('../../../lib/diaspora/user/querying', __FILE__) require File.expand_path('../../../lib/diaspora/user/receiving', __FILE__) @@ -258,20 +257,6 @@ class User aspect(:name => "Family") aspect(:name => "Work") end -<<<<<<< HEAD - - def self.create(opts ={}) - puts opts.inspect - end - - def terse_url - terse = self.url.gsub(/(https?:|www\.)\/\//, '') - terse = terse.chop! if terse[-1, 1] == '/' - terse - end -======= - ->>>>>>> master def diaspora_handle "#{self.username}@#{APP_CONFIG[:terse_pod_url]}" From 82b99decbbed20896b9d049cf96fa378c76699fe Mon Sep 17 00:00:00 2001 From: ilya Date: Fri, 24 Sep 2010 10:45:27 -0700 Subject: [PATCH 046/155] putting the token in the warden session --- app/controllers/application_controller.rb | 2 +- app/controllers/services_controller.rb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 1cbdc7c39..2bf2bf174 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -41,7 +41,7 @@ class ApplicationController < ActionController::Base end def fb_user_info - @access_token = session[:access_token] + @access_token = env['warden'].session[:access_token] @logged_in = @access_token.present? end diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb index 373eb100e..b39538d96 100644 --- a/app/controllers/services_controller.rb +++ b/app/controllers/services_controller.rb @@ -17,15 +17,15 @@ class ServicesController < ApplicationController # TODO: This is where you'd want to store the token in your database # but for now, we'll just keep it in the session so we don't need a database - session[:access_token] = @access_token + env['warden'].session[:access_token] = @access_token flash[:success] = "Authentication successful." end redirect_to edit_user_url current_user end def destroy - session[:access_token] = nil - session[:user_id] = nil + env['warden'].session[:access_token] = nil + env['warden'].session[:user_id] = nil redirect_to edit_user_url current_user end From 40120bb441a733d566e83fb35d5bc76a61e25c6d Mon Sep 17 00:00:00 2001 From: Raphael Date: Fri, 24 Sep 2010 11:15:39 -0700 Subject: [PATCH 047/155] Moving to activemodel validations --- Gemfile | 3 +-- Gemfile.lock | 17 +++++------------ app/models/photo.rb | 16 ++++++++++------ 3 files changed, 16 insertions(+), 20 deletions(-) diff --git a/Gemfile b/Gemfile index 2155262cb..cf863eb43 100644 --- a/Gemfile +++ b/Gemfile @@ -8,8 +8,7 @@ gem 'bundler', '1.0.0' gem 'devise', :git => 'http://github.com/BadMinus/devise.git' #Mongo -gem 'mongo_mapper', '0.8.4', :git => 'http://github.com/jnunemaker/mongomapper.git' -gem 'jnunemaker-validatable', '1.8.4', :git => 'http://github.com/jnunemaker/validatable.git' +gem 'mongo_mapper', :branch => 'rails3', :git => 'http://github.com/jnunemaker/mongomapper.git' gem 'bson_ext', '1.0.7' gem 'bson', '1.0.7' diff --git a/Gemfile.lock b/Gemfile.lock index 4a0be2e30..ac66e59c1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -57,20 +57,14 @@ GIT GIT remote: http://github.com/jnunemaker/mongomapper.git - revision: 931dab779011aa7acf60c1a4c7ad19e1ba838345 + revision: b0eac421ef5b3bee782e15d391eca372a189d414 + branch: rails3 specs: mongo_mapper (0.8.4) - activesupport (>= 2.3.4) - jnunemaker-validatable (~> 1.8.4) + activemodel (~> 3.0.0) + activesupport (~> 3.0.0) plucky (~> 0.3.5) -GIT - remote: http://github.com/jnunemaker/validatable.git - revision: 8d7c3ce14133760e748a0e34b99dfe6ec4d69153 - specs: - jnunemaker-validatable (1.8.4) - activesupport (>= 2.3.4) - GEM remote: http://rubygems.org/ specs: @@ -241,12 +235,11 @@ DEPENDENCIES em-websocket factory_girl_rails haml - jnunemaker-validatable (= 1.8.4)! json magent! mini_magick mocha - mongo_mapper (= 0.8.4)! + mongo_mapper! nifty-generators pubsubhubbub rails (= 3.0.0) diff --git a/app/models/photo.rb b/app/models/photo.rb index 8792911f3..fbab51ea5 100644 --- a/app/models/photo.rb +++ b/app/models/photo.rb @@ -2,7 +2,13 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - +class PhotoAlbumValidator < ActiveModel::Validator + def validate(document) + unless document.album.person_id == document.person_id + document.errors[:base] << "You post photos to that album" + end + end +end class Photo < Post require 'carrierwave/orm/mongomapper' include MongoMapper::Document @@ -22,7 +28,7 @@ class Photo < Post timestamps! validates_presence_of :album - validates_true_for :album_id, :logic => lambda {self.validate_album_person} + validates_with PhotoAlbumValidator before_destroy :ensure_user_picture @@ -36,10 +42,6 @@ class Photo < Post photo end - def validate_album_person - album.person_id == person_id - end - def remote_photo image.url.nil? ? (remote_photo_path + '/' + remote_photo_name) : image.url end @@ -70,3 +72,5 @@ class Photo < Post {:thumb_url => url(:thumb_medium), :id => id, :album_id => album_id} end end + + From 19199dabfe2a21a5f4e8a6a02624febd02d74d8c Mon Sep 17 00:00:00 2001 From: Raphael Date: Fri, 24 Sep 2010 11:49:30 -0700 Subject: [PATCH 048/155] fix spec_helper for 1.9.2 --- spec/lib/diaspora_parser_spec.rb | 3 ++- spec/misc_spec.rb | 21 +++++++++++++++++++++ spec/models/aspect_spec.rb | 10 +++++----- spec/spec_helper.rb | 5 +++++ 4 files changed, 33 insertions(+), 6 deletions(-) diff --git a/spec/lib/diaspora_parser_spec.rb b/spec/lib/diaspora_parser_spec.rb index cdd1063ab..3f4e20b1e 100644 --- a/spec/lib/diaspora_parser_spec.rb +++ b/spec/lib/diaspora_parser_spec.rb @@ -103,7 +103,7 @@ describe Diaspora::Parser do it "should activate the Person if I initiated a request to that url" do request = @user.send_friend_request_to( @user2.person, @aspect) - + @user.reload request.reverse_for @user2 xml = request.to_diaspora_xml @@ -125,6 +125,7 @@ describe Diaspora::Parser do it 'should process retraction for a person' do person_count = Person.all.count request = @user.send_friend_request_to( @user2.person, @aspect) + @user.reload request.reverse_for @user2 xml = request.to_diaspora_xml diff --git a/spec/misc_spec.rb b/spec/misc_spec.rb index 14f1d4c3e..d03300211 100644 --- a/spec/misc_spec.rb +++ b/spec/misc_spec.rb @@ -34,4 +34,25 @@ describe 'making sure the spec runner works' do end end + describe '#friend_users' do + before do + @user1 = Factory.create(:user) + @aspect1 = @user1.aspect(:name => "losers") + @user2 = Factory.create(:user) + @aspect2 = @user2.aspect(:name => "bruisers") + friend_users(@user1, @aspect1, @user2, @aspect2) + @user1.reload + @aspect1.reload + @user2.reload + @aspect2.reload + end + + it 'makes the first user friends with the second' do + @aspect1.people.include?(@user2.person).should be_true + end + + it 'makes the second user friends with the first' do + @aspect2.people.include?(@user1.person).should be_true + end + end end diff --git a/spec/models/aspect_spec.rb b/spec/models/aspect_spec.rb index 5931970cf..ea5afc7cf 100644 --- a/spec/models/aspect_spec.rb +++ b/spec/models/aspect_spec.rb @@ -20,7 +20,7 @@ describe Aspect do aspect.name.should == "losers" end - it 'should be able to have people' do + it 'should be creatable with people' do aspect = @user.aspect(:name => 'losers', :people => [@friend, @friend_2]) aspect.people.size.should == 2 end @@ -156,16 +156,16 @@ describe Aspect do @user.receive message.to_diaspora_xml @aspect.reload - @aspect.posts.count.should be 1 - @aspect3.posts.count.should be 0 + @aspect.posts.count.should == 1 + @aspect3.posts.count.should == 0 @user.reload @user.move_friend(:friend_id => @user2.person.id, :from => @aspect.id, :to => @aspect3.id) @aspect.reload @aspect3.reload - @aspect3.posts.count.should be 1 - @aspect.posts.count.should be 0 + @aspect3.posts.count.should == 1 + @aspect.posts.count.should == 0 end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 3fdac9810..ef5db93c2 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -82,7 +82,12 @@ end def friend_users(user1, aspect1, user2, aspect2) request = user1.send_friend_request_to(user2.person, aspect1) reversed_request = user2.accept_friend_request( request.id, aspect2.id) + user1.reload user1.receive reversed_request.to_diaspora_xml + user1.reload + aspect1.reload + user2.reload + aspect2.reload end def stub_success(address = 'abc@example.com') From 5c32cbaee8583ae9d651c7c72c58d4c426bac44e Mon Sep 17 00:00:00 2001 From: Raphael Date: Fri, 24 Sep 2010 14:40:30 -0700 Subject: [PATCH 049/155] Fix requires in rake task --- lib/tasks/db.rake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/tasks/db.rake b/lib/tasks/db.rake index c0d289cda..9c438ddb1 100644 --- a/lib/tasks/db.rake +++ b/lib/tasks/db.rake @@ -9,17 +9,17 @@ namespace :db do namespace :seed do task :tom do puts "Seeding the database for #{Rails.env}..." - require 'db/seeds/tom' + require File.dirname(__FILE__) + '/../../db/seeds/tom' end task :dev do puts "Seeding the database for #{Rails.env}..." - require 'db/seeds/dev' + require File.dirname(__FILE__) + '/../../db/seeds/dev' end task :backer do puts "Seeding the database for #{Rails.env}..." - require 'db/seeds/backer' + require File.dirname(__FILE__) + '/../../db/seeds/backer' create end @@ -27,7 +27,7 @@ namespace :db do desc 'Delete the collections in the current RAILS_ENV database' task :purge do - require 'config/environment' + require File.dirname(__FILE__) + '/../../config/environment' puts "Purging the database for #{Rails.env}..." @@ -57,7 +57,7 @@ namespace :db do task :fix_diaspora_handle do puts "fixing the people in this seed" - require 'config/environment' + require File.dirname(__FILE__) + '/../../config/environment' Person.where(:url => 'example.org').all.each{|person| if person.owner person.url = APP_CONFIG[:pod_url] From bb5867855695a8ad9dd69c6856f721129a00cbc9 Mon Sep 17 00:00:00 2001 From: ilya Date: Fri, 24 Sep 2010 14:41:31 -0700 Subject: [PATCH 050/155] added a fb_status model & parser method --- app/models/fb_status.rb | 30 +++++++++++++ spec/factories.rb | 8 ++++ spec/fixtures/fb_status | 79 +++++++++++++++++++++++++++++++++++ spec/models/fb_status_spec.rb | 44 +++++++++++++++++++ 4 files changed, 161 insertions(+) create mode 100644 app/models/fb_status.rb create mode 100644 spec/fixtures/fb_status create mode 100644 spec/models/fb_status_spec.rb diff --git a/app/models/fb_status.rb b/app/models/fb_status.rb new file mode 100644 index 000000000..d1a57ef9a --- /dev/null +++ b/app/models/fb_status.rb @@ -0,0 +1,30 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +class FbStatus + include MongoMapper::Document + + key :graph_id, String + key :author_id, String + key :author_name, String + key :message, String + key :updated_time, DateTime + + timestamps! + + validates_presence_of :graph_id,:author_id,:author_name,:message,:updated_time + + def self.from_api(json) + hash = JSON.parse(json) + self.create( + :graph_id => hash['id'], + :author_id => hash['from']['id'] + :author_name => hash['from']['name'], + :message => hash['message'] + :updated_time => Time.parse(hash['updated_time'] + end + +end + diff --git a/spec/factories.rb b/spec/factories.rb index 21a7ad110..0b00ed3d5 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -69,3 +69,11 @@ Factory.define :photo do |p| end Factory.define(:comment) {} + +Factory.define :fb_status do |s| + s.graph_id "367501354973" + s.author_name "Bret Taylor" + s.author_id "220439" + s.message "Pigs run from our house in fear. Tonight, I am wrapping the pork tenderloin in bacon and putting pancetta in the corn." + s.updated_time Time.parse "2010-03-06T02:57:48+0000" +end diff --git a/spec/fixtures/fb_status b/spec/fixtures/fb_status new file mode 100644 index 000000000..5602e8343 --- /dev/null +++ b/spec/fixtures/fb_status @@ -0,0 +1,79 @@ +{ + "id": "367501354973", + "from": { + "name": "Bret Taylor", + "id": "220439" + }, + "message": "Pigs run from our house in fear. Tonight, I am wrapping the pork tenderloin in bacon and putting pancetta in the corn.", + "updated_time": "2010-03-06T02:57:48+0000", + "likes": { + "data": [ + { + "id": "29906278", + "name": "Ross Miller" + } + ] + }, + "comments": { + "data": [ + { + "id": "367501354973_12216733", + "from": { + "name": "Doug Edwards", + "id": "628675309" + }, + "message": "Make sure you don't, as they say, go whole hog...\nhttp://www.youtube.com/watch?v=U4wTFuaV8VQ", + "created_time": "2010-03-06T03:24:46+0000" + }, + { + "id": "367501354973_12249673", + "from": { + "name": "Tom Taylor", + "id": "1249191863" + }, + "message": "Are you and Karen gonna, as they say, pig out?", + "created_time": "2010-03-06T21:05:21+0000" + }, + { + "id": "367501354973_12249857", + "from": { + "name": "Sheila Taylor", + "id": "1315606682" + }, + "message": "how did it turn out? Sounds nummy!\n", + "created_time": "2010-03-06T21:10:30+0000" + }, + { + "id": "367501354973_12250973", + "from": { + "name": "Bret Taylor", + "id": "220439" + }, + "message": "Mom: turned out well. Sauce was good as well: pan sauce with mustard, balsamic, onion, and maple syrup. Surprisingly good in the end, and not too sweet, which was my concern. ", + "created_time": "2010-03-06T21:44:53+0000" + }, + { + "id": "367501354973_12251276", + "from": { + "name": "Sheila Taylor", + "id": "1315606682" + }, + "message": "Sounds delicious! I probably would have skipped the maple syrup, but I am not married to a Canadian :)\n\nSheila Taylor\n(925) 818-7795\nP.O. Box 938\nGlen Ellen, CA 95442\nwww.winecountrytrekking.com", + "created_time": "2010-03-06T21:55:12+0000" + }, + { + "id": "367501354973_12264435", + "from": { + "name": "Amelia Ann Arapoff", + "id": "1580390378" + }, + "message": "Bacon is always in our refrigerator, in case of need, somehow there is always need.", + "created_time": "2010-03-07T05:11:52+0000" + } + ], + "paging": { + "previous": "https://graph.facebook.com/367501354973/comments?access_token=2227470867%7C2.wNlupL2HPsOtrlYFBF56NA__.3600.1285354800-100001548997697%7C8lZ_pdgNDvSHYS4o1OkqhdQu6mA&limit=25&since=2010-03-07T05%3A11%3A52%2B0000", + "next": "https://graph.facebook.com/367501354973/comments?access_token=2227470867%7C2.wNlupL2HPsOtrlYFBF56NA__.3600.1285354800-100001548997697%7C8lZ_pdgNDvSHYS4o1OkqhdQu6mA&limit=25&until=2010-03-06T03%3A24%3A45%2B0000" + } + } +} \ No newline at end of file diff --git a/spec/models/fb_status_spec.rb b/spec/models/fb_status_spec.rb new file mode 100644 index 000000000..a74506512 --- /dev/null +++ b/spec/models/fb_status_spec.rb @@ -0,0 +1,44 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + + +require File.dirname(__FILE__) + '/../spec_helper' +require 'json' + +describe FbStatus do + + let(:fb_status) { Factory.create :fb_status } + + it 'is valid' do + fb_status.should be_valid + end + + describe '#from_api' do + let(:json_string) {File.open(File.dirname(__FILE__) + '/../fixtures/fb_status').read} + let!(:json_object) { JSON.parse(json_string) } + let!(:status_from_json) {FbStatus.from_api(json_string)} + + it 'has graph_id' do + status_from_json.graph_id.should == json_object['id'] + end + + it 'has author_id' do + status_from_json.graph_id.should == json_object['from']['id'] + end + + it 'has author_name' do + status_from_json.graph_id.should == json_object['from']['name'] + end + + it 'has message' do + status_from_json.message.should == json_object['message'] + end + + it 'has author_name' do + status_from_json.updated_time.should == Time.parse(json_object['updated_time']) + end + end + +end From 1f62f910e34b5a9e0e036ba13213c5dae39724b6 Mon Sep 17 00:00:00 2001 From: Raphael Date: Fri, 24 Sep 2010 14:43:23 -0700 Subject: [PATCH 051/155] fix requires in db seeds --- db/seeds.rb | 2 +- db/seeds/backer.rb | 4 ++-- db/seeds/dev.rb | 2 +- db/seeds/tom.rb | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/db/seeds.rb b/db/seeds.rb index 29a5191f4..a21966266 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -12,5 +12,5 @@ # cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }]) # Mayor.create(:name => 'Daley', :city => citie -require 'config/environment' +require File.dirname(__FILE__) + '/../../config/environment' diff --git a/db/seeds/backer.rb b/db/seeds/backer.rb index 20fe90fdf..b80fd794b 100644 --- a/db/seeds/backer.rb +++ b/db/seeds/backer.rb @@ -12,7 +12,7 @@ # cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }]) # Mayor.create(:name => 'Daley', :city => citie -require 'config/environment' +require File.dirname(__FILE__) + '/../../config/environment' def create @@ -25,7 +25,7 @@ def create #set pod url username = backer_info[backer_number]['username'].gsub(/ /,'').downcase set_app_config username - require 'config/initializers/_load_app_config.rb' + require File.dirname(__FILE__) + '/../../config/initializers/_load_app_config.rb' # Create seed user user = User.instantiate!(:email => "#{username}@#{username}.joindiaspora.com", diff --git a/db/seeds/dev.rb b/db/seeds/dev.rb index e2d8a5495..dcbca72aa 100644 --- a/db/seeds/dev.rb +++ b/db/seeds/dev.rb @@ -4,7 +4,7 @@ -require 'config/environment' +require File.dirname(__FILE__) + '/../../config/environment' def set_app_config username current_config = YAML.load(File.read(Rails.root.join('config', 'app_config.yml.example'))) diff --git a/db/seeds/tom.rb b/db/seeds/tom.rb index cc3000d0b..468667485 100644 --- a/db/seeds/tom.rb +++ b/db/seeds/tom.rb @@ -4,7 +4,7 @@ -require 'config/environment' +require File.dirname(__FILE__) + '/../../config/environment' def set_app_config username current_config = YAML.load(File.read(Rails.root.join('config', 'app_config.yml.example'))) From ae7c869bc35893e60bbb236442343252dde70173 Mon Sep 17 00:00:00 2001 From: Raphael Date: Fri, 24 Sep 2010 15:01:36 -0700 Subject: [PATCH 052/155] Add specs for album controller failure --- spec/controllers/albums_controller_spec.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/spec/controllers/albums_controller_spec.rb b/spec/controllers/albums_controller_spec.rb index 67b7d9a78..e8ea44479 100644 --- a/spec/controllers/albums_controller_spec.rb +++ b/spec/controllers/albums_controller_spec.rb @@ -20,4 +20,14 @@ describe AlbumsController do @album.reload.name.should eql("new_name") end + describe '#create' do + it 'all aspects' do + params = {"album" => {"name" => "Sunsets","to" => "all"}} + post :create, params + end + it 'one aspect' do + params = {"album" => {"name" => "Sunsets","to" => @aspect.id.to_s}} + post :create, params + end + end end From ac9854596f4c3fdaa286391612464e0585ea612c Mon Sep 17 00:00:00 2001 From: ilya Date: Fri, 24 Sep 2010 15:04:31 -0700 Subject: [PATCH 053/155] fb_status partial rendered in public --- app/models/fb_status.rb | 3 ++- app/views/aspects/public.html.haml | 5 +++++ app/views/fb_status/_fb_status.html.haml | 13 +++++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 app/views/fb_status/_fb_status.html.haml diff --git a/app/models/fb_status.rb b/app/models/fb_status.rb index d1a57ef9a..367549c1b 100644 --- a/app/models/fb_status.rb +++ b/app/models/fb_status.rb @@ -18,7 +18,8 @@ class FbStatus def self.from_api(json) hash = JSON.parse(json) - self.create( + #just keeping them in memory for now + self.new( :graph_id => hash['id'], :author_id => hash['from']['id'] :author_name => hash['from']['name'], diff --git a/app/views/aspects/public.html.haml b/app/views/aspects/public.html.haml index def45bc7c..b760c9215 100644 --- a/app/views/aspects/public.html.haml +++ b/app/views/aspects/public.html.haml @@ -18,6 +18,11 @@ %ul#stream - for post in @posts = render type_partial(post), :post => post unless post.class == Album + - if @logged_in + - MiniFB.get(@access_token, 'me', :type => "feed").each do |item| + - if item['type'] == 'status' + = render "fb_status", :post => FbStatus.from_api() + #pagination = will_paginate @posts diff --git a/app/views/fb_status/_fb_status.html.haml b/app/views/fb_status/_fb_status.html.haml new file mode 100644 index 000000000..30ec62652 --- /dev/null +++ b/app/views/fb_status/_fb_status.html.haml @@ -0,0 +1,13 @@ +-# Copyright (c) 2010, Diaspora Inc. This file is +-# licensed under the Affero General Public License version 3. See +-# the COPYRIGHT file. + + +%li.message{:id => post.id, :class => ("mine" if current_user.owns?(post))} + + = image_tag( "http://graph.facebook.com/#{post.author_id}/picture" ) + + .content + %span.from + = post.author_name + = post.message From c7757a302cf30395b200ca979f3bedf6094dd9b5 Mon Sep 17 00:00:00 2001 From: ilya Date: Fri, 24 Sep 2010 15:06:48 -0700 Subject: [PATCH 054/155] typo --- app/views/aspects/public.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/aspects/public.html.haml b/app/views/aspects/public.html.haml index b760c9215..e6500e648 100644 --- a/app/views/aspects/public.html.haml +++ b/app/views/aspects/public.html.haml @@ -21,7 +21,7 @@ - if @logged_in - MiniFB.get(@access_token, 'me', :type => "feed").each do |item| - if item['type'] == 'status' - = render "fb_status", :post => FbStatus.from_api() + = render "fb_status", :post => FbStatus.from_api(item) #pagination = will_paginate @posts From 004e659ee1d9a814ffeb5f05186da2592e4189ea Mon Sep 17 00:00:00 2001 From: Raphael Date: Fri, 24 Sep 2010 15:10:49 -0700 Subject: [PATCH 055/155] fix album posting --- app/models/user.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index c6957ff6d..272f404bc 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -128,14 +128,18 @@ class User end def validate_aspect_permissions(aspect_ids) - aspect_ids = [aspect_ids.to_s] if aspect_ids.is_a? BSON::ObjectId + if aspect_ids == "all" + return aspect_ids + end + + aspect_ids = [aspect_ids.to_s] unless aspect_ids.is_a? Array if aspect_ids.nil? || aspect_ids.empty? raise ArgumentError.new("You must post to someone.") end aspect_ids.each do |aspect_id| - unless aspect_id == "all" || self.aspects.find(aspect_id) + unless self.aspects.find(aspect_id) raise ArgumentError.new("Cannot post to an aspect you do not own.") end end From 999d2292257e323aa478be78a2bdd57c5d8d9f75 Mon Sep 17 00:00:00 2001 From: Raphael Date: Fri, 24 Sep 2010 15:18:30 -0700 Subject: [PATCH 056/155] Post photos in either 1.8.7 or 1.9.2 --- app/controllers/photos_controller.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index d66706626..0866751d0 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -19,9 +19,15 @@ class PhotosController < ApplicationController # get file content type att_content_type = (request.content_type.to_s == "") ? "application/octet-stream" : request.content_type.to_s # create temporal file - file = Tempfile.new(file_name, {:encoding => 'BINARY'}) + begin + file = Tempfile.new(file_name, {:encoding => 'BINARY'}) + file.print request.raw_post.force_encoding('BINARY') + rescue RuntimeError => e + raise e unless e.message.include?('cannot generate tempfile') + file = Tempfile.new(file_name) # Ruby 1.8 compatibility + file.print request.raw_post + end # put data into this file from raw post request - file.print request.raw_post.force_encoding('BINARY') # create several required methods for this temporal file Tempfile.send(:define_method, "content_type") {return att_content_type} From 8323e7dcb21189ad5aa010dea2c28df141110e58 Mon Sep 17 00:00:00 2001 From: Daniele Di Sarli Date: Sat, 25 Sep 2010 01:21:52 +0800 Subject: [PATCH 057/155] Added Italian translation --- config/locales/diaspora/it.yml | 197 ++++++++++++++++++++++++++++++++- 1 file changed, 196 insertions(+), 1 deletion(-) diff --git a/config/locales/diaspora/it.yml b/config/locales/diaspora/it.yml index 4cce93d73..9ef8c0f7c 100644 --- a/config/locales/diaspora/it.yml +++ b/config/locales/diaspora/it.yml @@ -7,4 +7,199 @@ # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. it: - hello: "Ciao Mondo" + hello: "Ciao mondo" + application: + helper: + unknown_person: "persona sconosciuta" + new_requests: "nuove richieste" + dashboards: + helper: + home: "home" + error_messages: + helper: + invalid_fields: "Campi non validi" + correct_the_following_errors_and_try_again: "Correggi i seguenti errori e riprova." + people: + helper: + results_for: " risultati per %{params}" + people_on_pod_are_aware_of: " people on pod are aware of" + layouts: + application: + edit_profile: "modifica profilo" + logout: "disconnetti" + shared: + aspect_nav: + all_aspects: "Tutti gli Aspetti" + manage: "Gestisci" + manage_your_aspects: "Gestisci i tuoi Aspetti" + sub_header: + all_aspects: "Tutti gli Aspetti" + manage_aspects: "Gestisci Aspetti" + publisher: + share: "Condividi" + aspect_friends: + add_friends: "aggiungi amici" + albums: + album: + you: "tu" + new_album: + create: "crea" + add_a_new_album: "Aggiungi un nuovo album" + show: + edit_album: "Modifica album" + albums: "album" + updated: "aggiornato" + by: "da" + edit: + editing: "Modifica" + updated: "aggiornato" + are_you_sure: "Sei sicuro?" + delete_album: "Elimina album" + cancel: "Annulla" + index: + home: "home" + new_album: "Nuovo album" + create: + success: "Hai creato un album chiamato %{name}." + update: + success: "L'album %{name} è stato modificato." + failure: "Modifica dell'album %{name} fallita." + destroy: + success: "L'album %{name} è stato eliminato." + helper: + friends_albums: "Album degli amici" + your_albums: "I tuoi album" + aspects: + index: + photos: "foto" + show: + photos: "foto" + manage: + add_a_new_aspect: "Aggiungi un nuovo aspetto" + add_a_new_friend: "Aggiungi un nuovo amico" + show: "Mostra" + update_aspects: "Aggiorna Aspetti" + requests: "Richieste" + ignore_remove: "Ignora/Rimuovi" + new_aspect: + add_a_new_aspect: "Aggiungi un nuovo aspetto" + create: "Crea" + create: + success: "Clicca sul segno "più" nella parte sinistra per dire a Diaspora chi può vedere il tuo nuovo aspetto." + destroy: + success: "%{name} è stato rimosso con successo." + update: + success: "Il tuo aspetto, %{name}, è stato modificato con successo." + move_friends: + failure: "Modifica dell'aspetto fallita per l'amico %{real_name}." + success: "Aspetti modificati con successo." + move_friend: + failure: "non ha funzionato %{inspect}" + success: "Adesso stai mostrando al tuo amico un aspetto differente di te stesso." + helper: + remove: "rimuovi" + aspect_not_empty: "Aspetto non vuoto" + users: + edit: + cancel: "Annulla" + update_profile: "Aggiorna profilo" + home: "Home" + diaspora_username: "NOME UTENTE DIASPORA" + info: "Info" + picture: "Immagine" + editing_profile: "Modifica del profilo" + albums: "Album" + you_dont_have_any_photos: "Non hai nessuna foto! Vai alla pagina" + page_to_upload_some: "per caricarne qualcuna." + comments: + comment: + ago: "fa" + new_comment: + comment: "Commento" + photos: + show: + prev: "indietro" + full_size: "dimensione intera" + next: "avanti" + edit_photo: "Modifica foto" + delete_photo: "Elimina foto" + are_you_sure: "Sei sicuro?" + comments: "commenti" + edit: + editing: "Modifica" + are_you_sure: "Sei sicuro?" + delete_photo: "Elimina foto" + photo: + show_comments: "mostra commenti" + posted_a_new_photo_to: "ha caricato una nuova foto in" + new: + new_photo: "Nuova foto" + back_to_list: "Torna all'elenco" + post_it: "inseriscila!" + create: + runtime_error: "Caricamento della foto fallito. Sei sicuro che la tua cintura di sicurezza è allacciata?" + integrity_error: "Caricamento della foto fallito. Sei sicuro che era un'immagine?" + type_error: "Caricamento della foto fallito. Sei sicuro di aver aggiunto un'immagine?" + update: + notice: "Foto aggiornata con successo." + error: "Modifica della foto fallita." + destroy: + notice: "Foto eliminata." + registrations: + new: + sign_up: "Iscriviti" + create: + success: "Ti sei unito a Diaspora!" + status_messages: + new_status_message: + tell_me_something_good: "dimmi qualcosa di buono" + oh_yeah: "oh si!" + status_message: + show_comments: "mostra commenti" + delete: "Elimina" + are_you_sure: "Sei sicuro?" + show: + status_message: "Messaggio di stato" + comments: "commenti" + are_you_sure: "Sei sicuro?" + destroy: "Distruggi" + view_all: "Vedi tutto" + message: "Messaggio" + owner: "Proprietario" + helper: + no_message_to_display: "Nessun messaggio da visualizzare." + people: + person: + add_friend: "aggiungi amico" + pending_request: "richiesta in sospeso" + index: + add_friend: "aggiungi amico" + real_name: "nome reale" + diaspora_handle: "diaspora handle" + thats_you: "sei tu!" + friend_request_pending: "richiesta d'amicizia in sospeso" + you_have_a_friend_request_from_this_person: "hai una richiesta d'amicizia da questa persona" + new: + new_person: "Nuova persona" + back_to_list: "Torna all'elenco" + show: + last_seen: "ultima visualizzazione: %{how_long_ago}" + friends_since: "amici da: %{how_long_ago}" + save: "salva" + are_you_sure: "Sei sicuro?" + remove_friend: "rimuovi amico" + requests: + new_request: + add_a_new_friend_to: "Aggiungi un amico a" + enter_a_diaspora_username: "Inserisci un nome utente Diaspora:" + your_diaspora_username_is: "Il tuo nome utente Diaspora è: %{diaspora_handle}" + friends_username: "nome utente dell'amico" + destroy: + success: "Adesso siete amici." + error: "Seleziona un aspetto!" + ignore: "Ignora richiesta di amicizia." + create: + error: "Nessun seed Diaspora trovato con questa email!" + already_friends: "Sei già amico con %{destination_url}!" + success: "Una richiesta di amicizia è stata inviata a %{destination_url}." + horribly_wrong: "Qualcosa è andato orribilmente storto." From d66eedaf0046eff40603c696d6af13977117a5b5 Mon Sep 17 00:00:00 2001 From: hemanth Date: Fri, 17 Sep 2010 21:57:02 +0800 Subject: [PATCH 058/155] Fixed a major issue with sudo user check\! --- ubuntu-setup.bash | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ubuntu-setup.bash b/ubuntu-setup.bash index 67b602abe..24f4af871 100644 --- a/ubuntu-setup.bash +++ b/ubuntu-setup.bash @@ -8,7 +8,8 @@ shopt -s extglob # Check if the user has sudo privileges. -[[ $( id -u) ]] && echo "$(whoami) has no sudo permissions on this machine" && exit 1 +sudo -v >/dev/null 2>&1 || { echo $(whoami) has no sudo privileges ; exit 1; } + # Install build tools echo "Installing build tools.." From 1add029421f701f2704525c20d726f72347f5d09 Mon Sep 17 00:00:00 2001 From: hemanth Date: Fri, 17 Sep 2010 23:48:06 +0800 Subject: [PATCH 059/155] Check for wget added --- ubuntu-setup.bash | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ubuntu-setup.bash b/ubuntu-setup.bash index 24f4af871..f9e7d9ff8 100644 --- a/ubuntu-setup.bash +++ b/ubuntu-setup.bash @@ -11,6 +11,9 @@ shopt -s extglob sudo -v >/dev/null 2>&1 || { echo $(whoami) has no sudo privileges ; exit 1; } +# Check if wget is installed +test wget || echo "Installing wget.." && sudo apt-get install wget && echo "Installed wget.." + # Install build tools echo "Installing build tools.." sudo apt-get -y --no-install-recommends install build-essential libxslt1.1 libxslt1-dev libxml2 From d4ad943699e76489f7efd8059c2d8e5b80cad95a Mon Sep 17 00:00:00 2001 From: hemanth Date: Sat, 18 Sep 2010 01:43:15 +0800 Subject: [PATCH 060/155] Check on universe repository, if enabled or not. --- ubuntu-setup.bash | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ubuntu-setup.bash b/ubuntu-setup.bash index f9e7d9ff8..50a2f4ff7 100644 --- a/ubuntu-setup.bash +++ b/ubuntu-setup.bash @@ -10,6 +10,8 @@ shopt -s extglob # Check if the user has sudo privileges. sudo -v >/dev/null 2>&1 || { echo $(whoami) has no sudo privileges ; exit 1; } +# Check if universal repository is enabled +grep -i universe /etc/apt/sources.list >> /dev/null || echo "Please enable universe repository" && exit 1 # Check if wget is installed test wget || echo "Installing wget.." && sudo apt-get install wget && echo "Installed wget.." From 5682cf59ab71ac215062f8f38f092dd10495b922 Mon Sep 17 00:00:00 2001 From: hemanth Date: Sat, 18 Sep 2010 02:28:13 +0800 Subject: [PATCH 061/155] Added a check on if the user has already cloned and also a set -e to exit immediately if a command exits with a non-zero status. --- ubuntu-setup.bash | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ubuntu-setup.bash b/ubuntu-setup.bash index 50a2f4ff7..bb62088a9 100644 --- a/ubuntu-setup.bash +++ b/ubuntu-setup.bash @@ -2,7 +2,9 @@ # Author : hemanth.hm@gmail.com # Site : www.h3manth.com # This script helps to setup diaspora. -# + +# Exit immediately if a command exits with a non-zero status. +set -e # Set extented globbing shopt -s extglob @@ -82,9 +84,11 @@ echo "Installed blunder.." # Take a clone of Diaspora ( -echo "Clone diaspora source.." -git clone http://github.com/diaspora/diaspora.git + +# Check if the user is already in a cloned source if not clone the source +[[ $( basename $PWD ) == "diaspora" ]] && echo "Already in diaspora directory" || git clone http://github.com/diaspora/diaspora.git ; cd diaspora echo "Cloned the source.." + # Install extra gems cd diaspora echo "Installing more gems.." From dc0fc1f4451c9a7472df5b32b6086fd86b56e8ec Mon Sep 17 00:00:00 2001 From: hemanth Date: Sat, 18 Sep 2010 02:38:13 +0800 Subject: [PATCH 062/155] set -e removed as the rules change from one Bash version to another, as Bash attempts to track the extremely slippery POSIX definition of this "feature". When a SubShell is involved, it gets worse still -- the behavior changes depending on whether Bash is invoked in POSIX mode. --- ubuntu-setup.bash | 3 --- 1 file changed, 3 deletions(-) diff --git a/ubuntu-setup.bash b/ubuntu-setup.bash index bb62088a9..65231d9d0 100644 --- a/ubuntu-setup.bash +++ b/ubuntu-setup.bash @@ -3,9 +3,6 @@ # Site : www.h3manth.com # This script helps to setup diaspora. -# Exit immediately if a command exits with a non-zero status. -set -e - # Set extented globbing shopt -s extglob From 585cc7a480ef4327afc500c1883554f7f6356add Mon Sep 17 00:00:00 2001 From: hemanth Date: Sat, 18 Sep 2010 04:49:08 +0800 Subject: [PATCH 063/155] Check if universal repository is enabled or not. --- ubuntu-setup.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ubuntu-setup.bash b/ubuntu-setup.bash index 65231d9d0..a969d0fe3 100644 --- a/ubuntu-setup.bash +++ b/ubuntu-setup.bash @@ -10,7 +10,7 @@ shopt -s extglob sudo -v >/dev/null 2>&1 || { echo $(whoami) has no sudo privileges ; exit 1; } # Check if universal repository is enabled -grep -i universe /etc/apt/sources.list >> /dev/null || echo "Please enable universe repository" && exit 1 +grep -i universe /etc/apt/sources.list > /dev/null || { echo "Please enable universe repository" ; exit 1 ; } # Check if wget is installed test wget || echo "Installing wget.." && sudo apt-get install wget && echo "Installed wget.." From 043dadf0ea53208b7d32fabfaa8a4e61b8680c6c Mon Sep 17 00:00:00 2001 From: Daniel Thomas Date: Mon, 20 Sep 2010 04:10:29 +0800 Subject: [PATCH 064/155] Update copyright information on ubuntu-setup.bash Adding Diaspora Inc. copyright and reference to the AGPL and noting that Mackenzie Morgan (maco) and I have made contributions to the file. Signed-off-by: Daniel Thomas --- ubuntu-setup.bash | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ubuntu-setup.bash b/ubuntu-setup.bash index a969d0fe3..f9d4ff9fb 100644 --- a/ubuntu-setup.bash +++ b/ubuntu-setup.bash @@ -1,7 +1,13 @@ #!/bin/bash # Author : hemanth.hm@gmail.com # Site : www.h3manth.com +# Contributions from: Mackenzie Morgan (maco) and Daniel Thomas (drt24) # This script helps to setup diaspora. +# +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + # Set extented globbing shopt -s extglob From 8a30a287afa9bbe81a41ee488c1957f8b8d8ae87 Mon Sep 17 00:00:00 2001 From: Daniel Thomas Date: Mon, 20 Sep 2010 04:30:31 +0800 Subject: [PATCH 065/155] Make ubuntu-setup.bash executable So that it can run directly when checked out without needing to have chmod +x ubuntu-setup.bash run first. Signed-off-by: Daniel Thomas --- ubuntu-setup.bash | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 ubuntu-setup.bash diff --git a/ubuntu-setup.bash b/ubuntu-setup.bash old mode 100644 new mode 100755 From c5aa22fd284fb8639f952969e4522c1a7709fa95 Mon Sep 17 00:00:00 2001 From: maco Date: Sat, 18 Sep 2010 04:40:33 +0800 Subject: [PATCH 066/155] ubuntu-setup.bash: for rubygems, use maverick's repo or if lucid use ppa or if old use tarball. create /var/lib/gems/1.8/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games-friendly symlink if using debs --- ubuntu-setup.bash | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/ubuntu-setup.bash b/ubuntu-setup.bash index f9d4ff9fb..533524235 100755 --- a/ubuntu-setup.bash +++ b/ubuntu-setup.bash @@ -65,18 +65,32 @@ echo "Installed git-core.." # Setting up ruby gems echo "Fetching and installing ruby gems.." ( - echo "." - cd /tmp - wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz - echo "." - tar -xf rubygems-1.3.7.tgz - echo "." - cd rubygems-1.3.7 - echo "." - sudo ruby setup.rb - echo "." - sudo ln -s /usr/bin/gem1.8 /usr/bin/gem - echo "." + RELEASE=$(lsb_release -c | cut -f2) + if [ RELEASE == "maverick" ] + then + sudo apt-get install --no-install-recommends -y rubygems + sudo ln -s /var/lib/gems/1.8/bin/bundle /usr/local/bin/bundle #for PATH + elsif [ RELEASE == "lucid" ] + then + sudo add-apt-repository ppa:maco.m/ruby + sudo apt-get update + sudo apt-get install --no-install-recommends -y rubygems + sudo ln -s /var/lib/gems/1.8/bin/bundle /usr/local/bin/bundle #for PATH + else + # Old version + echo "." + cd /tmp + wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz + echo "." + tar -xf rubygems-1.3.7.tgz + echo "." + cd rubygems-1.3.7 + echo "." + sudo ruby setup.rb + echo "." + sudo ln -s /usr/bin/gem1.8 /usr/bin/gem + echo "." + fi ) echo "Done installing the gems.." From ea2739e89225daf2ef32b384c6f8ac8e41b6ce10 Mon Sep 17 00:00:00 2001 From: maco Date: Sun, 19 Sep 2010 06:10:19 +0800 Subject: [PATCH 067/155] ubuntu-setup.bash: fix s/blunder/bundler/ and s/elsif/elif/ --- ubuntu-setup.bash | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ubuntu-setup.bash b/ubuntu-setup.bash index 533524235..08c839f33 100755 --- a/ubuntu-setup.bash +++ b/ubuntu-setup.bash @@ -70,7 +70,7 @@ echo "Fetching and installing ruby gems.." then sudo apt-get install --no-install-recommends -y rubygems sudo ln -s /var/lib/gems/1.8/bin/bundle /usr/local/bin/bundle #for PATH - elsif [ RELEASE == "lucid" ] + elif [ RELEASE == "lucid" ] then sudo add-apt-repository ppa:maco.m/ruby sudo apt-get update @@ -94,10 +94,10 @@ echo "Fetching and installing ruby gems.." ) echo "Done installing the gems.." -# Install blunder -echo "Installing blunder.." +# Install bundler +echo "Installing bundler.." sudo gem install bundler -echo "Installed blunder.." +echo "Installed bundler.." # Take a clone of Diaspora ( From e2db21d7b06f147a14fd51ab5b332bc5eacbbe8a Mon Sep 17 00:00:00 2001 From: sennewood Date: Fri, 24 Sep 2010 14:25:04 +0800 Subject: [PATCH 068/155] Use double quotes in locale files --- config/locales/devise/devise.de.yml | 42 ++++++++++++++--------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/config/locales/devise/devise.de.yml b/config/locales/devise/devise.de.yml index 7c0e0e758..82b658e99 100644 --- a/config/locales/devise/devise.de.yml +++ b/config/locales/devise/devise.de.yml @@ -12,30 +12,30 @@ de: devise: failure: - unauthenticated: 'Du musst dich anmelden oder registrieren um fortzufahren.' - unconfirmed: 'Du musst dein Konto bestätigen um fortzufahren.' - locked: 'Dein Konto ist gesperrt.' - invalid: 'Ungültige E-Mail-Adresse oder Passwort.' - invalid_token: 'Ungültiger Authentifizierungstoken.' - timeout: 'Deine Sitzung ist abgelaufen, bitte melde dich erneut an um fortzufahren.' - inactive: 'Dein Konto wurde noch nicht aktiviert.' + unauthenticated: "Du musst dich anmelden oder registrieren um fortzufahren." + unconfirmed: "Du musst dein Konto bestätigen um fortzufahren." + locked: "Dein Konto ist gesperrt." + invalid: "Ungültige E-Mail-Adresse oder Passwort." + invalid_token: "Ungültiger Authentifizierungstoken." + timeout: "Deine Sitzung ist abgelaufen, bitte melde dich erneut an um fortzufahren." + inactive: "Dein Konto wurde noch nicht aktiviert." sessions: - signed_in: 'Erfolgreich angemeldet.' - signed_out: 'Erfolgreich abgemeldet.' + signed_in: "Erfolgreich angemeldet." + signed_out: "Erfolgreich abgemeldet." passwords: - send_instructions: 'Du wirst in ein paar Minuten eine E-Mail erhalten, die beschreibt, wie du dein Passwort zurücksetzt.' - updated: 'Dein Passwort wurde erfolgreich geändert. Du bist nun angemeldet.' + send_instructions: "Du wirst in ein paar Minuten eine E-Mail erhalten, die beschreibt, wie du dein Passwort zurücksetzt." + updated: "Dein Passwort wurde erfolgreich geändert. Du bist nun angemeldet." confirmations: - send_instructions: 'Du wirst in ein paar Minuten eine E-Mail erhalten, die beschreibt, wie du dein Konto bestätigst.' - confirmed: 'Dein Konto wurde erfolgreich bestätigt. Du bist nun angemeldet.' + send_instructions: "Du wirst in ein paar Minuten eine E-Mail erhalten, die beschreibt, wie du dein Konto bestätigst." + confirmed: "Dein Konto wurde erfolgreich bestätigt. Du bist nun angemeldet." registrations: - signed_up: 'Du hast dich erfolgreich registriert. Sofern aktiviert, wurde dir eine Bestätigung per E-Mail gesendet.' - updated: 'Dein Konto wurde aktualisiert.' - destroyed: 'Tschüss! Dein Konto wurde erfolgreich gekündigt. Wir hoffen dich bald wiederzusehen.' + signed_up: "Du hast dich erfolgreich registriert. Sofern aktiviert, wurde dir eine Bestätigung per E-Mail gesendet." + updated: "Dein Konto wurde aktualisiert." + destroyed: "Tschüss! Dein Konto wurde erfolgreich gekündigt. Wir hoffen dich bald wiederzusehen." unlocks: - send_instructions: 'Du wirst in ein paar Minuten eine E-Mail erhalten, die beschreibt, wie du dein Konto entsperren kannst.' - unlocked: 'Dein Konto wurde erfolgreich entsperrt. Du bist nun angemeldet.' + send_instructions: "Du wirst in ein paar Minuten eine E-Mail erhalten, die beschreibt, wie du dein Konto entsperren kannst." + unlocked: "Dein Konto wurde erfolgreich entsperrt. Du bist nun angemeldet." mailer: - confirmation_instructions: 'Instruktionen zur Bestätigung' - reset_password_instructions: 'Instruktionen zum Zurücksetzen des Passworts' - unlock_instructions: 'Instruktionen zum Entsperren' + confirmation_instructions: "Instruktionen zur Bestätigung" + reset_password_instructions: "Instruktionen zum Zurücksetzen des Passworts" + unlock_instructions: "Instruktionen zum Entsperren" From 16e5f972d12f01eb4b788205f2796e92a04aff41 Mon Sep 17 00:00:00 2001 From: sennewood Date: Fri, 24 Sep 2010 14:44:14 +0800 Subject: [PATCH 069/155] Translation correction --- config/locales/diaspora/de.yml | 44 +++++++++++++++++----------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/config/locales/diaspora/de.yml b/config/locales/diaspora/de.yml index 1c4dfb4ad..831b92c52 100644 --- a/config/locales/diaspora/de.yml +++ b/config/locales/diaspora/de.yml @@ -14,15 +14,15 @@ de: new_requests: "neue Anfrage" dashboards: helper: - home: "home" + home: "Startseite" error_messages: helper: invalid_fields: "Ungültige Felder" - correct_the_following_errors_and_try_again: "Korrigiere die folgenden Fehler und probier es erneut." + correct_the_following_errors_and_try_again: "Korrigiere die folgenden Fehler und probiere es erneut." people: helper: - results_for: " resultados para %{params}" - people_on_pod_are_aware_of: " gente en pod estan al tanto de " + results_for: " Resultate für %{params}" + people_on_pod_are_aware_of: " people on pod are aware of" layouts: application: edit_profile: "Profil bearbeiten" @@ -85,19 +85,19 @@ de: add_a_new_aspect: "Neuen Aspekt erstellen" create: "Erstellen" create: - success: "Klicke auf das Plus auf der rechten Seite um Diaspora mitzuteilen wer deinen neuen Aspekt sehen kann." + success: "Klicke auf das Plus auf der linken Seite um Diaspora mitzuteilen wer deinen neuen Aspekt sehen kann." destroy: success: "%{name} wurde erfolgreich gelöscht." update: success: "Dein Aspekt, %{name}, wurde erfolgreich geändert." move_friends: - failure: "Aspect editing failed for friend %{real_name}." + failure: "Ändern des Aspekts für deinen Freund %{real_name} schlug fehl." success: "Aspekt erfolgreich geändert." move_friend: error: "didn't work %{inspect}" - notice: "You are now showing your friend a different aspect of yourself." + notice: "Du zeigst deinem Freund jetzt einen anderen Aspekt von dir." helper: - remove: "remove" + remove: "entfernen" aspect_not_empty: "Aspekt ist nicht leer" users: edit: @@ -109,8 +109,8 @@ de: picture: "Bild" editing_profile: "Profil bearbeiten" albums: "Alben" - you_dont_have_any_photos: "#TODO" - page_to_upload_some: "#TODO" + you_dont_have_any_photos: "Du hast keine Fotos! Gehe auf die" + page_to_upload_some: "Seite um welche hochzuladen." comments: comment: # this won't work in german at all. Needs more thorough I18n @@ -132,18 +132,18 @@ de: delete_photo: "Foto löschen" photo: show_comments: "Kommentare anzeigen" - posted_a_new_photo_to: "posted a new photo to" + posted_a_new_photo_to: "neues Fotos veröffentlicht bei" new: new_photo: "Foto erstellen" back_to_list: "Zurück zur Liste" post_it: "Hochladen" create: - runtime_error: "Photo upload failed. Are you sure that your seatbelt is fastened?" - integrity_error: "Photo upload failed. Are you sure that was an image?" - type_error: "Photo upload failed. Are you sure an image was added?" + runtime_error: "Hochladen eines Fotos fehlgeschlagen. Bist du sicher, dass dein Sicherheitsgurt befestigt ist?" + integrity_error: "Hochladen eines Fotos fehlgeschlagen. Bist du sicher, dass das ein Bild war?" + type_error: "Hochladen eines Fotos fehlgeschlagen. Bist du sicher, dass ein Bild hinzugefügt wurde?" update: notice: "Foto erfolgreich aktualisiert." - error: "Failed to edit photo." + error: "Ändern des Fotos fehlgeschlagen." destroy: notice: "Foto gelöscht." registrations: @@ -154,7 +154,7 @@ de: status_messages: new_status_message: tell_me_something_good: "Erzähl' mir was schönes!" - oh_yeah: "Hey, super!" + oh_yeah: "Oh, super!" status_message: show_comments: "Kommentare anzeigen" delete: "Löschen" @@ -166,13 +166,13 @@ de: destroy: "Löschen" view_all: "Alle anzeigen" message: "Nachricht" - owner: "Besitzer" + owner: "Eigentümer" helper: - no_message_to_display: "No message to display." + no_message_to_display: "Keine Nachricht zum anzeigen." people: index: add_friend: "Freund hinzufügen" - real_name: "real name" + real_name: "Echter Name" diaspora_handle: "diaspora handle" thats_you: "das bist du!" friend_request_pending: "Freundschaftsanfrage ausstehend" @@ -183,15 +183,15 @@ de: show: last_seen: "zuletzt gesehen: %{how_long_ago}" friends_since: "Freunde seit: %{how_long_ago}" - save: "save" + save: "speichern" are_you_sure: "Bist du sicher?" - remove_friend: "remove friend" + remove_friend: "Freund entfernen" destroy: success: "Ihr seid jetzt Freunde." error: "Bitte wähle einen Aspekt aus!" ignore: "Freundschaftsanfrage ignorieren." create: - error: "No diaspora seed found with this email!" + error: "Kein Diaspora-Seed in dieser E-Mail gefunden!" already_friends: "Du bist bereits mit %{destination_url} befreundet!" success: "Eine Freundschaftsanfrage wurde an %{destination_url} gesendet." horribly_wrong: "Etwas ging tierisch schief." From dcedc5d505f615b554d63fb9f011c17586774f83 Mon Sep 17 00:00:00 2001 From: sennewood Date: Fri, 24 Sep 2010 14:56:45 +0800 Subject: [PATCH 070/155] Added the missing lines of code and translated them. --- config/locales/diaspora/de.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/config/locales/diaspora/de.yml b/config/locales/diaspora/de.yml index 831b92c52..ae8fb13e3 100644 --- a/config/locales/diaspora/de.yml +++ b/config/locales/diaspora/de.yml @@ -91,7 +91,7 @@ de: update: success: "Dein Aspekt, %{name}, wurde erfolgreich geändert." move_friends: - failure: "Ändern des Aspekts für deinen Freund %{real_name} schlug fehl." + failure: "Ändern des Aspekts für deinen Freund %{real_name} fehlgeschlagen." success: "Aspekt erfolgreich geändert." move_friend: error: "didn't work %{inspect}" @@ -132,13 +132,13 @@ de: delete_photo: "Foto löschen" photo: show_comments: "Kommentare anzeigen" - posted_a_new_photo_to: "neues Fotos veröffentlicht bei" + posted_a_new_photo_to: "neues Foto veröffentlicht bei" new: new_photo: "Foto erstellen" back_to_list: "Zurück zur Liste" post_it: "Hochladen" create: - runtime_error: "Hochladen eines Fotos fehlgeschlagen. Bist du sicher, dass dein Sicherheitsgurt befestigt ist?" + runtime_error: "Hochladen eines Fotos fehlgeschlagen. Bist du sicher, dass dein Sicherheitsgurt befestigt ist?" integrity_error: "Hochladen eines Fotos fehlgeschlagen. Bist du sicher, dass das ein Bild war?" type_error: "Hochladen eines Fotos fehlgeschlagen. Bist du sicher, dass ein Bild hinzugefügt wurde?" update: @@ -170,13 +170,16 @@ de: helper: no_message_to_display: "Keine Nachricht zum anzeigen." people: + person: + add_friend: "Freund hinzufügen" + pending_request: "Anfrage ausstehend" index: add_friend: "Freund hinzufügen" real_name: "Echter Name" diaspora_handle: "diaspora handle" thats_you: "das bist du!" - friend_request_pending: "Freundschaftsanfrage ausstehend" - you_have_a_friend_request_from_this_person: "du hast eine Freundschaftsanfrage von dieser Person" + friend_request_pending: "Ausstehende Freundschaftsanfrage" + you_have_a_friend_request_from_this_person: "Du hast eine Freundschaftsanfrage von dieser Person" new: new_person: "Neue Person" back_to_list: "Zurück zur Liste" @@ -186,6 +189,12 @@ de: save: "speichern" are_you_sure: "Bist du sicher?" remove_friend: "Freund entfernen" + requests: + new_request: + add_a_new_friend_to: "Add a new friend to" + enter_a_diaspora_username: "Gebe einen Diaspora Benutzernamen ein:" + your_diaspora_username_is: "Dein Diaspora Benutzername ist: %{diaspora_handle}" + friends_username: "Freundes Benutzername" destroy: success: "Ihr seid jetzt Freunde." error: "Bitte wähle einen Aspekt aus!" From e414558f7903d3f01c46d360bef39dcc3889133f Mon Sep 17 00:00:00 2001 From: ilya Date: Fri, 24 Sep 2010 15:52:29 -0700 Subject: [PATCH 071/155] passing the right things to the partial --- app/models/fb_status.rb | 12 ++++++------ app/views/aspects/public.html.haml | 6 +++--- app/views/fb_status/_fb_status.html.haml | 2 +- spec/models/fb_status_spec.rb | 9 ++++----- 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/app/models/fb_status.rb b/app/models/fb_status.rb index 367549c1b..fd190c2c7 100644 --- a/app/models/fb_status.rb +++ b/app/models/fb_status.rb @@ -10,21 +10,21 @@ class FbStatus key :author_id, String key :author_name, String key :message, String - key :updated_time, DateTime + key :updated_time, Time timestamps! validates_presence_of :graph_id,:author_id,:author_name,:message,:updated_time - def self.from_api(json) - hash = JSON.parse(json) + def self.from_api(hash) #just keeping them in memory for now self.new( :graph_id => hash['id'], - :author_id => hash['from']['id'] + :author_id => hash['from']['id'], :author_name => hash['from']['name'], - :message => hash['message'] - :updated_time => Time.parse(hash['updated_time'] + :message => hash['message'], + :updated_time => Time.parse(hash['updated_time']) + ) end end diff --git a/app/views/aspects/public.html.haml b/app/views/aspects/public.html.haml index e6500e648..4399034f7 100644 --- a/app/views/aspects/public.html.haml +++ b/app/views/aspects/public.html.haml @@ -19,9 +19,9 @@ - for post in @posts = render type_partial(post), :post => post unless post.class == Album - if @logged_in - - MiniFB.get(@access_token, 'me', :type => "feed").each do |item| - - if item['type'] == 'status' - = render "fb_status", :post => FbStatus.from_api(item) + - MiniFB.get(@access_token, 'me', :type => "feed")[:data].each do |item| + - if item[:type] == 'status' + = render "fb_status/fb_status", :post => FbStatus.from_api(item) #pagination = will_paginate @posts diff --git a/app/views/fb_status/_fb_status.html.haml b/app/views/fb_status/_fb_status.html.haml index 30ec62652..d5a57bd22 100644 --- a/app/views/fb_status/_fb_status.html.haml +++ b/app/views/fb_status/_fb_status.html.haml @@ -3,7 +3,7 @@ -# the COPYRIGHT file. -%li.message{:id => post.id, :class => ("mine" if current_user.owns?(post))} +%li.message{:id => post.id} = image_tag( "http://graph.facebook.com/#{post.author_id}/picture" ) diff --git a/spec/models/fb_status_spec.rb b/spec/models/fb_status_spec.rb index a74506512..368f8bd16 100644 --- a/spec/models/fb_status_spec.rb +++ b/spec/models/fb_status_spec.rb @@ -5,7 +5,6 @@ require File.dirname(__FILE__) + '/../spec_helper' -require 'json' describe FbStatus do @@ -16,20 +15,20 @@ describe FbStatus do end describe '#from_api' do - let(:json_string) {File.open(File.dirname(__FILE__) + '/../fixtures/fb_status').read} + let!(:json_string) {File.open(File.dirname(__FILE__) + '/../fixtures/fb_status').read} let!(:json_object) { JSON.parse(json_string) } - let!(:status_from_json) {FbStatus.from_api(json_string)} + let!(:status_from_json) {FbStatus.from_api(json_object)} it 'has graph_id' do status_from_json.graph_id.should == json_object['id'] end it 'has author_id' do - status_from_json.graph_id.should == json_object['from']['id'] + status_from_json.author_id.should == json_object['from']['id'] end it 'has author_name' do - status_from_json.graph_id.should == json_object['from']['name'] + status_from_json.author_name.should == json_object['from']['name'] end it 'has message' do From f38bcc9eb34b02de5e057ea0ead0a678cf1e80ec Mon Sep 17 00:00:00 2001 From: ilya Date: Fri, 24 Sep 2010 15:54:53 -0700 Subject: [PATCH 072/155] tiny change in view --- app/views/shared/_aspect_friends.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/shared/_aspect_friends.haml b/app/views/shared/_aspect_friends.haml index 10a0da317..0a28a9676 100644 --- a/app/views/shared/_aspect_friends.haml +++ b/app/views/shared/_aspect_friends.haml @@ -8,7 +8,7 @@ - for friend in @friends = person_image_link(friend) - if @logged_in && (@aspect == :public) - Facebook Friends + %h3 Facebook Friends - @fb_friends = MiniFB.get(@access_token, 'me', :type => "friends") - @fb_friends[:data].each do |friend| = image_tag( "http://graph.facebook.com/#{friend[:id]}/picture" ) From d59330264de412227fe02f4f88fa7c9663b2fa41 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Fri, 24 Sep 2010 16:18:41 -0700 Subject: [PATCH 073/155] fixed syntax error in italian locale --- config/locales/diaspora/it.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/diaspora/it.yml b/config/locales/diaspora/it.yml index 9ef8c0f7c..418733b40 100644 --- a/config/locales/diaspora/it.yml +++ b/config/locales/diaspora/it.yml @@ -85,7 +85,7 @@ it: add_a_new_aspect: "Aggiungi un nuovo aspetto" create: "Crea" create: - success: "Clicca sul segno "più" nella parte sinistra per dire a Diaspora chi può vedere il tuo nuovo aspetto." + success: "Clicca sul segno più nella parte sinistra per dire a Diaspora chi può vedere il tuo nuovo aspetto." destroy: success: "%{name} è stato rimosso con successo." update: From f4d18ce9bc265ff7df3207ce4649d4366b721218 Mon Sep 17 00:00:00 2001 From: Raphael Date: Fri, 24 Sep 2010 17:12:18 -0700 Subject: [PATCH 074/155] don't use request.host as data --- app/controllers/users_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index dbb69d1a2..819a88d28 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -30,7 +30,8 @@ class UsersController < ApplicationController if params[:profile][:image_url].empty? params[:profile].delete(:image_url) else - params[:profile][:image_url] = "http://" + request.host + ":" + request.port.to_s + params[:profile][:image_url] + url = APP_CONFIG[:pod_url].chop if APP_CONFIG[:pod_url][-1,1] == '/' + params[:profile][:image_url] = url + params[:profile][:image_url] end end From f74b0a6f2c3e3a4286de56f5c8052c424b645c0a Mon Sep 17 00:00:00 2001 From: Chiggins Date: Tue, 21 Sep 2010 00:09:16 +0800 Subject: [PATCH 075/155] Added "shadow text" to caption text field while editing a photo, since about every other text field has "shadow text". --- app/views/photos/edit.html.haml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/photos/edit.html.haml b/app/views/photos/edit.html.haml index 1f36ae99f..bbaee2ef8 100644 --- a/app/views/photos/edit.html.haml +++ b/app/views/photos/edit.html.haml @@ -14,6 +14,7 @@ = linked_scaled_photo @photo, @album = form_for @photo do |p| + = p.label :caption = p.text_field :caption, :value => @photo.caption = p.submit From beda67aca699460e487d9388e793b7e77f163233 Mon Sep 17 00:00:00 2001 From: Raphael Date: Fri, 24 Sep 2010 17:51:51 -0700 Subject: [PATCH 076/155] Shorten git show stuff --- config/initializers/git_info.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/git_info.rb b/config/initializers/git_info.rb index a6d767aa4..ac2e4ba27 100644 --- a/config/initializers/git_info.rb +++ b/config/initializers/git_info.rb @@ -3,4 +3,4 @@ # the COPYRIGHT file. -GIT_INFO = `git show` +GIT_INFO = `git show --name-only` From e3ec00595d49c68268807a5bf218f08419e640ed Mon Sep 17 00:00:00 2001 From: Sarah Mei Date: Sat, 25 Sep 2010 04:34:48 -0700 Subject: [PATCH 077/155] Cleaned up file path joining in some of the dev utilties. Backfilled tests where necessary to make sure changes didn't break existing code. --- app/controllers/dev_utilities_controller.rb | 17 ++++---- db/seeds.rb | 2 +- db/seeds/backer.rb | 6 +-- db/seeds/dev.rb | 2 +- db/seeds/tom.rb | 3 +- .../dev_utilities_controller_spec.rb | 42 +++++++++++++++++++ 6 files changed, 57 insertions(+), 15 deletions(-) create mode 100644 spec/controllers/dev_utilities_controller_spec.rb diff --git a/app/controllers/dev_utilities_controller.rb b/app/controllers/dev_utilities_controller.rb index 30d1a1799..77867af81 100644 --- a/app/controllers/dev_utilities_controller.rb +++ b/app/controllers/dev_utilities_controller.rb @@ -16,7 +16,7 @@ class DevUtilitiesController < ApplicationController bkr_info.each do |backer| backer_email = "#{backer['username']}@#{backer['username']}.joindiaspora.com" rel_hash = relationship_flow(backer_email) - logger.info "Zombefriending #{backer['given_name']} #{backer['family_name']}" + logger.info "Zombiefriending #{backer['given_name']} #{backer['family_name']}" logger.info "Calling send_friend_request with #{rel_hash[:friend]} and #{current_user.aspects.first}" current_user.send_friend_request_to(rel_hash[:friend], current_user.aspects.first) end @@ -30,11 +30,6 @@ class DevUtilitiesController < ApplicationController } end - def backer_info - config = YAML.load_file(File.dirname(__FILE__) + '/../../config/deploy_config.yml') - config['servers']['backer'] - end - def set_backer_number render :nothing => true seed_num_hash = {:seed_number => params[:number]} @@ -44,7 +39,6 @@ class DevUtilitiesController < ApplicationController end def set_profile_photo - render :nothing => true album = Album.create(:person => current_user.person, :name => "Profile Photos") current_user.raw_visible_posts << album @@ -53,7 +47,7 @@ class DevUtilitiesController < ApplicationController backer_number = YAML.load_file(Rails.root.join('config','backer_number.yml'))[:seed_number].to_i username = backer_info[backer_number]['username'].gsub(/ /,'').downcase - @fixture_name = File.dirname(__FILE__) + "/../../public/images/user/#{username}.jpg" + @fixture_name = File.join(File.dirname(__FILE__), "..", "..", "public", "images", "user", "#{username}.jpg") photo = Photo.new(:person => current_user.person, :album => album) photo.image.store! File.open(@fixture_name) @@ -73,4 +67,11 @@ class DevUtilitiesController < ApplicationController render "shared/log" end + + protected + + def backer_info + config = YAML.load_file(File.join(File.dirname(__FILE__), "..", "..", "config", "deploy_config.yml")) + config['servers']['backer'] + end end diff --git a/db/seeds.rb b/db/seeds.rb index a21966266..5b87469ca 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -12,5 +12,5 @@ # cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }]) # Mayor.create(:name => 'Daley', :city => citie -require File.dirname(__FILE__) + '/../../config/environment' +require File.join(File.dirname(__FILE__), "..", "..", "config", "environment") diff --git a/db/seeds/backer.rb b/db/seeds/backer.rb index b80fd794b..22c81778d 100644 --- a/db/seeds/backer.rb +++ b/db/seeds/backer.rb @@ -12,12 +12,12 @@ # cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }]) # Mayor.create(:name => 'Daley', :city => citie -require File.dirname(__FILE__) + '/../../config/environment' +require File.join(File.dirname(__FILE__), "..", "..", "config", "environment") def create - config = YAML.load_file(File.dirname(__FILE__) + '/../../config/deploy_config.yml') + config = YAML.load_file(File.join(File.dirname(__FILE__), "..", "..", "config", "deploy_config.yml")) backer_info = config['servers']['backer'] backer_number = YAML.load_file(Rails.root.join('config','backer_number.yml'))[:seed_number].to_i @@ -25,7 +25,7 @@ def create #set pod url username = backer_info[backer_number]['username'].gsub(/ /,'').downcase set_app_config username - require File.dirname(__FILE__) + '/../../config/initializers/_load_app_config.rb' + require File.join(File.dirname(__FILE__), "..", "..", "config", "initializers", "_load_app_config.rb") # Create seed user user = User.instantiate!(:email => "#{username}@#{username}.joindiaspora.com", diff --git a/db/seeds/dev.rb b/db/seeds/dev.rb index dcbca72aa..375f5221f 100644 --- a/db/seeds/dev.rb +++ b/db/seeds/dev.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../../config/environment' +require File.join(File.dirname(__FILE__), "..", "..", "config", "environment") def set_app_config username current_config = YAML.load(File.read(Rails.root.join('config', 'app_config.yml.example'))) diff --git a/db/seeds/tom.rb b/db/seeds/tom.rb index 468667485..b54fedcc0 100644 --- a/db/seeds/tom.rb +++ b/db/seeds/tom.rb @@ -3,8 +3,7 @@ # the COPYRIGHT file. - -require File.dirname(__FILE__) + '/../../config/environment' +require File.join(File.dirname(__FILE__), "..", "..", "config", "environment") def set_app_config username current_config = YAML.load(File.read(Rails.root.join('config', 'app_config.yml.example'))) diff --git a/spec/controllers/dev_utilities_controller_spec.rb b/spec/controllers/dev_utilities_controller_spec.rb new file mode 100644 index 000000000..66c07350f --- /dev/null +++ b/spec/controllers/dev_utilities_controller_spec.rb @@ -0,0 +1,42 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + +require File.join(File.dirname(__FILE__), "..", "spec_helper") + +describe DevUtilitiesController do + render_views + + before do + @tom = Factory.create(:user, :email => "tom@tom.joindiaspora.org") + sign_in :user, @tom + end + + describe "#zombiefriends" do + it "succeeds" do + get :zombiefriends + response.should be_success + end + end + + describe "#set_profile_photo" do + # In case anyone wants their config/backer_number.yml to still exist after running specs + before do + @backer_number_file = File.join(File.dirname(__FILE__), "..", "..", "config", "backer_number.yml") + @temp_file = File.join(File.dirname(__FILE__), "..", "..", "config", "backer_number.yml-tmp") + FileUtils.mv(@backer_number_file, @temp_file, :force => true) + end + after do + if File.exists?(@temp_file) + FileUtils.mv(@temp_file, @backer_number_file, :force => true) + else + FileUtils.rm_rf(@backer_number_file) + end + end + it "succeeds" do + get :set_backer_number, 'number' => '3' + get :set_profile_photo + response.should be_success + end + end +end From 356a1e46b26aa64cf1667d392f8ac573eccfd9e8 Mon Sep 17 00:00:00 2001 From: Uiri Date: Sat, 25 Sep 2010 09:50:29 -0400 Subject: [PATCH 078/155] it is fixed, I think --- script/server | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/server b/script/server index 3804ccad9..f1e5b7ec5 100755 --- a/script/server +++ b/script/server @@ -8,6 +8,6 @@ then else mkdir -p -v log/thin/ bundle exec ruby ./script/websocket_server.rb& - bundle exec thin start $@ + bundle exec thin -p 80 -a 192.168.0.191 start $@ fi From 5a4f40591dc26b4336ebce8d3ed705a3bc06a6c7 Mon Sep 17 00:00:00 2001 From: Tiago Bastos Date: Sat, 25 Sep 2010 11:25:45 -0300 Subject: [PATCH 079/155] Added missing translations. --- config/locales/diaspora/pt-BR.yml | 64 ++++++++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/config/locales/diaspora/pt-BR.yml b/config/locales/diaspora/pt-BR.yml index 10425864b..f7f16366e 100644 --- a/config/locales/diaspora/pt-BR.yml +++ b/config/locales/diaspora/pt-BR.yml @@ -8,6 +8,21 @@ pt-BR: hello: "Olá mundo" + application: + helper: + unknown_person: "pessoa desconhecida" + new_requests: "nova requisição" + dashboards: + helper: + home: "casa" + error_messages: + helper: + invalid_fields: "Campos inválidos" + correct_the_following_errors_and_try_again: "Corrija os erros a seguir e tente novamente." + people: + helper: + results_for: " resultados para %{params}" + people_on_pod_are_aware_of: " pessoas no pod estão conscientes de" layouts: application: edit_profile: "editar perfil" @@ -51,6 +66,9 @@ pt-BR: failure: "Erro ao editar o álbum %{name}." destroy: success: "O álbum %{name} foi excluído com sucesso." + helper: + friends_albums: "Álbum de amigos" + your_albums: "Seus álbuns" aspects: index: photos: "photos" @@ -68,12 +86,25 @@ pt-BR: create: "Criar" create: success:"Clique no mais(+) do lado esquerdo para dizer ao Diaspora quem pode ver seu novo aspecto." + destroy: + success: "%{name} foi removido com sucesso." + update: + success: "Seu aspecto, %{name}, foi editado com sucesso." + move_friends: + failure: "Falha ao editar aspecto para o amigo(a) %{real_name}." + success: "Aspectos editados com sucesso." + move_friend: + failure: "não funcionou %{inspect}" + success: "Você está agora mostrando um diferente aspecto seu a um amigo(a)." + helper: + remove: "remover" + aspect_not_empty: "Aspecto não está vazio" users: edit: cancel: "Cancelar" update_profile: "Atualizar Perfil" home: "Home" - diaspora_username: "USUÁRIO DIASPORA" + diaspora_username: "NOME DE USUÁRIO DIASPORA" info: "Informações" picture: "Imagem" editing_profile: "Editando perfil" @@ -105,9 +136,20 @@ pt-BR: new_photo: "Nova Foto" back_to_list: "Voltar para a Lista" post_it: "enviar!" + create: + runtime_error: "Envio de foto falhou. Você tem tem certeza que seu sinto de segurança está preso?" + integrity_error: "Envio de foto falhou. Você tem certeza que é uma imagem?" + type_error: "Envio de foto falhou. Você tem certeza que adicionou uma imagem?" + update: + notice: "Foto enviada com sucesso." + error: "Falha ao editar foto." + destroy: + notice: "Foto removida." registrations: new: sign_up: "Cadastro" + create: + success: "Vocé entrou na Diaspora!" status_messages: new_status_message: tell_me_something_good: "diga-me qualquer coisa legal" @@ -124,7 +166,12 @@ pt-BR: view_all: "Exibir Todas" message: "Mensagem" owner: "Pertence a" + helper: + no_message_to_display: "Nenhuma mensagem para ser mostrada." people: + person: + add_friend: "adicionar amigo(a)" + pending_request: "requisições pendentes" index: add_friend: "adicionar amigo(a)" real_name: "nome real" @@ -141,3 +188,18 @@ pt-BR: save: "salvar" are_you_sure: "Tem certeza?" remove_friend: "excluir amigo" + requests: + new_request: + add_a_new_friend_to: "Adicionar novo amigo(a) em" + enter_a_diaspora_username: "Digite seu nome de usuário Diaspora:" + your_diaspora_username_is: "Seu nome de usuário Diaspora é: %{diaspora_handle}" + friends_username: "Nome de usuário do Amigo(a)" + destroy: + success: "Vocês agora são amigos." + error: "Favor selecionar um aspecto!" + ignore: "Requisições de amigos ignoradas." + create: + error: "Nenhum semente Diaspora encontrado com esse email." + already_friends: "Você já é amigo(a) de %{destination_url}!" + success: "Uma requisição de amizade foi enviada para %{destination_url}." + horribly_wrong: "Algo horrível aconteceu." From 4cfc7e2f89733d8010b04c526bf2eb7dc0752c79 Mon Sep 17 00:00:00 2001 From: Stephen Caudill Date: Sat, 25 Sep 2010 11:03:12 -0400 Subject: [PATCH 080/155] Add description for retab task --- lib/tasks/whitespace.rake | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/tasks/whitespace.rake b/lib/tasks/whitespace.rake index 397674ae5..e3d26c3ab 100644 --- a/lib/tasks/whitespace.rake +++ b/lib/tasks/whitespace.rake @@ -3,6 +3,7 @@ namespace :whitespace do task :cleanup do sh %{find . -name '*.rb' -exec sed -i '' 's/ *$//g' {} \\;} end + desc 'Converts hard-tabs into two-space soft-tabs' task :retab do sh %{find . -name '*.rb' -exec sed -i '' 's/\t/ /g' {} \\;} end From 821643deb9f5c648f2d33d9a3c3ff5613bcd9320 Mon Sep 17 00:00:00 2001 From: Stephen Caudill Date: Sat, 25 Sep 2010 11:27:59 -0400 Subject: [PATCH 081/155] Use the new style of spec_helper require --- spec/controllers/albums_controller_spec.rb | 2 +- spec/controllers/aspects_controller_spec.rb | 2 +- spec/controllers/people_controller_spec.rb | 2 +- spec/controllers/publics_controller_spec.rb | 2 +- spec/controllers/requests_controller_spec.rb | 2 +- spec/controllers/sockets_controller_spec.rb | 2 +- spec/helpers/application_helper_spec.rb | 2 +- spec/helpers/publics_helper_spec.rb | 2 +- spec/helpers/requests_helper_spec.rb | 2 +- spec/lib/diaspora_parser_spec.rb | 2 +- spec/lib/hcard_spec.rb | 2 +- spec/lib/message_handler_spec.rb | 2 +- spec/lib/salmon_salmon_spec.rb | 2 +- spec/lib/web_hooks_spec.rb | 2 +- spec/lib/websocket_spec.rb | 2 +- spec/misc_spec.rb | 2 +- spec/models/aspect_spec.rb | 2 +- spec/models/comments_spec.rb | 2 +- spec/models/person_spec.rb | 2 +- spec/models/photo_spec.rb | 2 +- spec/models/post_spec.rb | 2 +- spec/models/profile_spec.rb | 2 +- spec/models/request_spec.rb | 2 +- spec/models/retraction_spec.rb | 2 +- spec/models/status_message_spec.rb | 2 +- spec/models/user/posting_spec.rb | 2 +- spec/models/user/receive_spec.rb | 2 +- spec/models/user/user_friending_spec.rb | 2 +- spec/models/user/visible_posts_spec.rb | 2 +- spec/models/user_spec.rb | 2 +- spec/user_encryption_spec.rb | 2 +- 31 files changed, 31 insertions(+), 31 deletions(-) diff --git a/spec/controllers/albums_controller_spec.rb b/spec/controllers/albums_controller_spec.rb index e8ea44479..815a0663f 100644 --- a/spec/controllers/albums_controller_spec.rb +++ b/spec/controllers/albums_controller_spec.rb @@ -3,7 +3,7 @@ # the COPYRIGHT file. -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' include ApplicationHelper describe AlbumsController do render_views diff --git a/spec/controllers/aspects_controller_spec.rb b/spec/controllers/aspects_controller_spec.rb index a186e8b7c..5ce04c56c 100644 --- a/spec/controllers/aspects_controller_spec.rb +++ b/spec/controllers/aspects_controller_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' include ApplicationHelper describe AspectsController do render_views diff --git a/spec/controllers/people_controller_spec.rb b/spec/controllers/people_controller_spec.rb index badfdf496..50ee13bb4 100644 --- a/spec/controllers/people_controller_spec.rb +++ b/spec/controllers/people_controller_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' describe PeopleController do render_views diff --git a/spec/controllers/publics_controller_spec.rb b/spec/controllers/publics_controller_spec.rb index bea772e20..3e1071f16 100644 --- a/spec/controllers/publics_controller_spec.rb +++ b/spec/controllers/publics_controller_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' describe PublicsController do render_views diff --git a/spec/controllers/requests_controller_spec.rb b/spec/controllers/requests_controller_spec.rb index f0864abe1..ebde75a97 100644 --- a/spec/controllers/requests_controller_spec.rb +++ b/spec/controllers/requests_controller_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' include ApplicationHelper include RequestsHelper describe RequestsController do diff --git a/spec/controllers/sockets_controller_spec.rb b/spec/controllers/sockets_controller_spec.rb index 799d37500..d83547e98 100644 --- a/spec/controllers/sockets_controller_spec.rb +++ b/spec/controllers/sockets_controller_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' SocketsController.class_eval <<-EOT def url_options diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index 4b89c7b31..4be43a0cb 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' include ApplicationHelper describe ApplicationHelper do diff --git a/spec/helpers/publics_helper_spec.rb b/spec/helpers/publics_helper_spec.rb index 70e9d4606..ec00f671a 100644 --- a/spec/helpers/publics_helper_spec.rb +++ b/spec/helpers/publics_helper_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' include PublicsHelper describe PublicsHelper do diff --git a/spec/helpers/requests_helper_spec.rb b/spec/helpers/requests_helper_spec.rb index 2d2be1acb..50cf148cb 100644 --- a/spec/helpers/requests_helper_spec.rb +++ b/spec/helpers/requests_helper_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' include RequestsHelper diff --git a/spec/lib/diaspora_parser_spec.rb b/spec/lib/diaspora_parser_spec.rb index 3f4e20b1e..5c9a17fd5 100644 --- a/spec/lib/diaspora_parser_spec.rb +++ b/spec/lib/diaspora_parser_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' include ApplicationHelper include Diaspora::Parser diff --git a/spec/lib/hcard_spec.rb b/spec/lib/hcard_spec.rb index 89ad49924..4836c5468 100644 --- a/spec/lib/hcard_spec.rb +++ b/spec/lib/hcard_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' require File.dirname(__FILE__) + '/../../lib/hcard' describe HCard do diff --git a/spec/lib/message_handler_spec.rb b/spec/lib/message_handler_spec.rb index e6cd668e2..d60009fd9 100644 --- a/spec/lib/message_handler_spec.rb +++ b/spec/lib/message_handler_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' describe MessageHandler do before do diff --git a/spec/lib/salmon_salmon_spec.rb b/spec/lib/salmon_salmon_spec.rb index a14ef8f77..eb7a55027 100644 --- a/spec/lib/salmon_salmon_spec.rb +++ b/spec/lib/salmon_salmon_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' describe Salmon do before do diff --git a/spec/lib/web_hooks_spec.rb b/spec/lib/web_hooks_spec.rb index d3486f1b5..3b0eb26df 100644 --- a/spec/lib/web_hooks_spec.rb +++ b/spec/lib/web_hooks_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' include Diaspora diff --git a/spec/lib/websocket_spec.rb b/spec/lib/websocket_spec.rb index edac7051a..0b76e0f52 100644 --- a/spec/lib/websocket_spec.rb +++ b/spec/lib/websocket_spec.rb @@ -2,7 +2,7 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' describe Diaspora::WebSocket do before do diff --git a/spec/misc_spec.rb b/spec/misc_spec.rb index d03300211..528782f07 100644 --- a/spec/misc_spec.rb +++ b/spec/misc_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/spec_helper' +require 'spec_helper' describe 'making sure the spec runner works' do diff --git a/spec/models/aspect_spec.rb b/spec/models/aspect_spec.rb index ea5afc7cf..356e8b26c 100644 --- a/spec/models/aspect_spec.rb +++ b/spec/models/aspect_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' describe Aspect do before do diff --git a/spec/models/comments_spec.rb b/spec/models/comments_spec.rb index 1c20354cf..9d8c7314d 100644 --- a/spec/models/comments_spec.rb +++ b/spec/models/comments_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' describe Comment do describe "user" do diff --git a/spec/models/person_spec.rb b/spec/models/person_spec.rb index 721310409..f1654b25c 100644 --- a/spec/models/person_spec.rb +++ b/spec/models/person_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' describe Person do before do diff --git a/spec/models/photo_spec.rb b/spec/models/photo_spec.rb index 3e0b68520..179ed1ccd 100644 --- a/spec/models/photo_spec.rb +++ b/spec/models/photo_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' describe Photo do before do diff --git a/spec/models/post_spec.rb b/spec/models/post_spec.rb index dc9d4a9b8..c9a114b32 100644 --- a/spec/models/post_spec.rb +++ b/spec/models/post_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' describe Post do before do diff --git a/spec/models/profile_spec.rb b/spec/models/profile_spec.rb index b5bd8f9a5..0681e1e22 100644 --- a/spec/models/profile_spec.rb +++ b/spec/models/profile_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' describe Profile do before do diff --git a/spec/models/request_spec.rb b/spec/models/request_spec.rb index 5899cb7fb..e71dc1175 100644 --- a/spec/models/request_spec.rb +++ b/spec/models/request_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' describe Request do before do diff --git a/spec/models/retraction_spec.rb b/spec/models/retraction_spec.rb index 9aa2b8a76..ca93c7c0e 100644 --- a/spec/models/retraction_spec.rb +++ b/spec/models/retraction_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' describe Retraction do before do diff --git a/spec/models/status_message_spec.rb b/spec/models/status_message_spec.rb index 005038bf1..59cb70ec6 100644 --- a/spec/models/status_message_spec.rb +++ b/spec/models/status_message_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' describe StatusMessage do before do diff --git a/spec/models/user/posting_spec.rb b/spec/models/user/posting_spec.rb index d307e7a43..73672e2ec 100644 --- a/spec/models/user/posting_spec.rb +++ b/spec/models/user/posting_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../../spec_helper' +require 'spec_helper' describe User do diff --git a/spec/models/user/receive_spec.rb b/spec/models/user/receive_spec.rb index 37648a98c..97bf41197 100644 --- a/spec/models/user/receive_spec.rb +++ b/spec/models/user/receive_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../../spec_helper' +require 'spec_helper' describe User do diff --git a/spec/models/user/user_friending_spec.rb b/spec/models/user/user_friending_spec.rb index 67ed9f799..1c0f59465 100644 --- a/spec/models/user/user_friending_spec.rb +++ b/spec/models/user/user_friending_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../../spec_helper' +require 'spec_helper' describe User do before do diff --git a/spec/models/user/visible_posts_spec.rb b/spec/models/user/visible_posts_spec.rb index bcab473bc..0a2a53d84 100644 --- a/spec/models/user/visible_posts_spec.rb +++ b/spec/models/user/visible_posts_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../../spec_helper' +require 'spec_helper' describe User do let(:user) { Factory(:user) } diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 1608bbe58..5478d69fe 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' describe User do let(:user) { Factory(:user) } diff --git a/spec/user_encryption_spec.rb b/spec/user_encryption_spec.rb index 33b86d52c..4c829bcd0 100644 --- a/spec/user_encryption_spec.rb +++ b/spec/user_encryption_spec.rb @@ -4,7 +4,7 @@ -require File.dirname(__FILE__) + '/spec_helper' +require 'spec_helper' include ApplicationHelper include Diaspora::Parser From 536cea5e44ccafffc06d9cf887ac703f49db15f3 Mon Sep 17 00:00:00 2001 From: Stephen Caudill Date: Sat, 25 Sep 2010 12:06:39 -0400 Subject: [PATCH 082/155] Remove consecutive empty lines --- app/controllers/application_controller.rb | 1 - app/controllers/aspects_controller.rb | 1 - app/controllers/comments_controller.rb | 1 - app/controllers/dev_utilities_controller.rb | 2 -- app/controllers/people_controller.rb | 1 - app/controllers/photos_controller.rb | 4 ---- app/controllers/publics_controller.rb | 1 - app/controllers/requests_controller.rb | 3 --- app/controllers/sockets_controller.rb | 1 - app/controllers/status_messages_controller.rb | 1 - app/controllers/users_controller.rb | 1 - app/helpers/albums_helper.rb | 1 - app/helpers/application_helper.rb | 1 - app/helpers/aspects_helper.rb | 1 - app/helpers/dashboards_helper.rb | 1 - app/helpers/error_messages_helper.rb | 1 - app/helpers/layout_helper.rb | 1 - app/helpers/people_helper.rb | 1 - app/helpers/photos_helper.rb | 1 - app/helpers/publics_helper.rb | 1 - app/helpers/requests_helper.rb | 1 - app/helpers/sockets_helper.rb | 1 - app/helpers/status_messages_helper.rb | 1 - app/models/album.rb | 2 -- app/models/aspect.rb | 1 - app/models/comment.rb | 2 -- app/models/person.rb | 1 - app/models/photo.rb | 1 - app/models/post.rb | 2 -- app/models/profile.rb | 1 - app/models/request.rb | 1 - app/models/retraction.rb | 1 - app/models/status_message.rb | 2 -- app/models/user.rb | 3 --- app/uploaders/image_uploader.rb | 1 - autotest/discover.rb | 1 - config/application.rb | 2 -- config/boot.rb | 2 -- config/deploy.rb | 4 ---- config/environment.rb | 3 --- config/environments/development.rb | 1 - config/environments/production.rb | 1 - config/environments/test.rb | 3 --- config/initializers/backtrace_silencers.rb | 1 - config/initializers/carrierwave.rb | 1 - config/initializers/devise.rb | 1 - config/initializers/git_info.rb | 1 - config/initializers/inflections.rb | 1 - config/initializers/locale.rb | 3 +-- config/initializers/logging.rb | 1 - config/initializers/mime_types.rb | 1 - config/initializers/rspec_generator.rb | 1 - config/initializers/secret_token.rb | 1 - config/initializers/session_store.rb | 1 - config/routes.rb | 3 --- config/sprinkle/packages/database.rb | 2 -- config/sprinkle/packages/essential.rb | 2 -- config/sprinkle/packages/ruby.rb | 2 -- config/sprinkle/packages/scm.rb | 2 -- config/sprinkle/packages/server.rb | 2 -- config/sprinkle/packages/unfortunately_essential.rb | 2 -- config/sprinkle/provision.rb | 5 ----- db/schema.rb | 2 -- db/seeds.rb | 2 -- db/seeds/backer.rb | 3 --- db/seeds/dev.rb | 2 -- db/seeds/tom.rb | 4 ---- lib/chrome_frame.rb | 2 -- lib/diaspora.rb | 2 -- lib/diaspora/parser.rb | 2 -- lib/diaspora/user/friending.rb | 3 --- lib/diaspora/user/querying.rb | 2 -- lib/diaspora/webhooks.rb | 2 -- lib/diaspora/websocket.rb | 2 -- lib/encryptable.rb | 2 -- lib/encryptor.rb | 3 --- lib/hcard.rb | 2 -- lib/message_handler.rb | 3 --- lib/mongo_mapper/bson_id.rb | 2 -- lib/mongo_mapper/clear_dev_memory.rb | 2 -- lib/salmon/salmon.rb | 9 --------- spec/controllers/albums_controller_spec.rb | 1 - spec/controllers/aspects_controller_spec.rb | 2 -- spec/controllers/people_controller_spec.rb | 2 -- spec/controllers/publics_controller_spec.rb | 2 -- spec/controllers/requests_controller_spec.rb | 2 -- spec/controllers/sockets_controller_spec.rb | 2 -- spec/factories.rb | 3 --- spec/helpers/application_helper_spec.rb | 3 --- spec/helpers/publics_helper_spec.rb | 2 -- spec/helpers/requests_helper_spec.rb | 2 -- spec/lib/diaspora_parser_spec.rb | 7 ------- spec/lib/hcard_spec.rb | 2 -- spec/lib/message_handler_spec.rb | 4 ---- spec/lib/salmon_salmon_spec.rb | 3 --- spec/lib/web_hooks_spec.rb | 2 -- spec/misc_spec.rb | 2 -- spec/models/aspect_spec.rb | 2 -- spec/models/comments_spec.rb | 2 -- spec/models/person_spec.rb | 4 +--- spec/models/photo_spec.rb | 3 --- spec/models/post_spec.rb | 2 -- spec/models/profile_spec.rb | 3 --- spec/models/request_spec.rb | 2 -- spec/models/retraction_spec.rb | 2 -- spec/models/status_message_spec.rb | 3 --- spec/models/user/posting_spec.rb | 2 -- spec/models/user/receive_spec.rb | 2 -- spec/models/user/user_friending_spec.rb | 8 -------- spec/models/user/visible_posts_spec.rb | 3 --- spec/models/user_spec.rb | 2 -- spec/spec_helper.rb | 4 ---- spec/user_encryption_spec.rb | 2 -- test/performance/browsing_test.rb | 2 -- test/selenium/login_test.rb | 2 -- test/selenium/selenium_suite.rb | 2 -- test/test_helper.rb | 2 -- 117 files changed, 2 insertions(+), 241 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index f0ca5bfc8..a39d827e4 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class ApplicationController < ActionController::Base protect_from_forgery :except => :receive diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index 2bf1edb76..ba9d3ffd9 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class AspectsController < ApplicationController before_filter :authenticate_user! diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index fe11cb8ae..d1efc3e10 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class CommentsController < ApplicationController before_filter :authenticate_user! diff --git a/app/controllers/dev_utilities_controller.rb b/app/controllers/dev_utilities_controller.rb index 30d1a1799..b2ce5e813 100644 --- a/app/controllers/dev_utilities_controller.rb +++ b/app/controllers/dev_utilities_controller.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class DevUtilitiesController < ApplicationController before_filter :authenticate_user!, :except => [:set_backer_number] include ApplicationHelper @@ -63,7 +62,6 @@ class DevUtilitiesController < ApplicationController current_user.raw_visible_posts << photo current_user.save - current_user.update_profile(:image_url => photo.url(:thumb_medium)) current_user.save end diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb index 08acdd424..a8b8fffc0 100644 --- a/app/controllers/people_controller.rb +++ b/app/controllers/people_controller.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class PeopleController < ApplicationController before_filter :authenticate_user! diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index 0866751d0..4d865573c 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class PhotosController < ApplicationController before_filter :authenticate_user! @@ -35,12 +34,10 @@ class PhotosController < ApplicationController ############## - params[:user_file] = file data = clean_hash(params) - @photo = current_user.post(:photo, data) respond_to do |format| @@ -103,7 +100,6 @@ class PhotosController < ApplicationController end end - private def clean_hash(params) if params[:photo] diff --git a/app/controllers/publics_controller.rb b/app/controllers/publics_controller.rb index 6be195e30..fcfdb0db6 100644 --- a/app/controllers/publics_controller.rb +++ b/app/controllers/publics_controller.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class PublicsController < ApplicationController require File.expand_path('../../../lib/diaspora/parser', __FILE__) include Diaspora::Parser diff --git a/app/controllers/requests_controller.rb b/app/controllers/requests_controller.rb index 44e1a8016..31c6e6efd 100644 --- a/app/controllers/requests_controller.rb +++ b/app/controllers/requests_controller.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class RequestsController < ApplicationController before_filter :authenticate_user! include RequestsHelper @@ -42,8 +41,6 @@ class RequestsController < ApplicationController return end - - # rel_hash = {:friend => params[:friend_handle]} Rails.logger.debug("Sending request: #{rel_hash}") diff --git a/app/controllers/sockets_controller.rb b/app/controllers/sockets_controller.rb index 9b90ea831..88d8e6b40 100644 --- a/app/controllers/sockets_controller.rb +++ b/app/controllers/sockets_controller.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class SocketsController < ApplicationController include ApplicationHelper include SocketsHelper diff --git a/app/controllers/status_messages_controller.rb b/app/controllers/status_messages_controller.rb index 5a8efbe06..ef519a1a4 100644 --- a/app/controllers/status_messages_controller.rb +++ b/app/controllers/status_messages_controller.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class StatusMessagesController < ApplicationController before_filter :authenticate_user! diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 819a88d28..260b5b7fa 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class UsersController < ApplicationController before_filter :authenticate_user!, :except => [:new, :create] diff --git a/app/helpers/albums_helper.rb b/app/helpers/albums_helper.rb index 9a1e78fd1..6d85c747c 100644 --- a/app/helpers/albums_helper.rb +++ b/app/helpers/albums_helper.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - module AlbumsHelper def friends_albums_link if params[:friends] diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 89df26155..688ddb10b 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - module ApplicationHelper def current_aspect?(aspect) !@aspect.is_a?(Symbol) && @aspect.id == aspect.id diff --git a/app/helpers/aspects_helper.rb b/app/helpers/aspects_helper.rb index 536bb8b0b..66baffca2 100644 --- a/app/helpers/aspects_helper.rb +++ b/app/helpers/aspects_helper.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - module AspectsHelper def link_for_aspect( aspect ) link_to aspect.name, aspect diff --git a/app/helpers/dashboards_helper.rb b/app/helpers/dashboards_helper.rb index 271b68253..e8a9d8f71 100644 --- a/app/helpers/dashboards_helper.rb +++ b/app/helpers/dashboards_helper.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - module DashboardsHelper def title_for_page I18n.t('dashboards.helper.home') diff --git a/app/helpers/error_messages_helper.rb b/app/helpers/error_messages_helper.rb index 274d60edf..9a64dca36 100644 --- a/app/helpers/error_messages_helper.rb +++ b/app/helpers/error_messages_helper.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - module ErrorMessagesHelper # Render error messages for the given objects. The :message and :header_message options are allowed. def error_messages_for(*objects) diff --git a/app/helpers/layout_helper.rb b/app/helpers/layout_helper.rb index 2398771a3..e33556c35 100644 --- a/app/helpers/layout_helper.rb +++ b/app/helpers/layout_helper.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # These helper methods can be called in your template to set variables to be used in the layout # This module should be included in all views globally, # to do so you may need to add this line to your ApplicationController diff --git a/app/helpers/people_helper.rb b/app/helpers/people_helper.rb index 90ffb517d..f1fa6487f 100644 --- a/app/helpers/people_helper.rb +++ b/app/helpers/people_helper.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - module PeopleHelper def search_or_index diff --git a/app/helpers/photos_helper.rb b/app/helpers/photos_helper.rb index 2737d3a2d..1f52daa0c 100644 --- a/app/helpers/photos_helper.rb +++ b/app/helpers/photos_helper.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - module PhotosHelper def linked_scaled_photo(photo, album) link_to (image_tag photo.url(:scaled_full)), photo_path(album.next_photo(photo)), :rel => "prefetch" diff --git a/app/helpers/publics_helper.rb b/app/helpers/publics_helper.rb index 46e778e2b..f14fad7a6 100644 --- a/app/helpers/publics_helper.rb +++ b/app/helpers/publics_helper.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - module PublicsHelper def subscribe(opts = {}) subscriber = Subscriber.first(:url => opts[:callback], :topic => opts[:topic]) diff --git a/app/helpers/requests_helper.rb b/app/helpers/requests_helper.rb index fec093aac..98ccc8f75 100644 --- a/app/helpers/requests_helper.rb +++ b/app/helpers/requests_helper.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - module RequestsHelper def subscription_mode(profile) if diaspora?(profile) diff --git a/app/helpers/sockets_helper.rb b/app/helpers/sockets_helper.rb index 69135092a..892e15f59 100644 --- a/app/helpers/sockets_helper.rb +++ b/app/helpers/sockets_helper.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - module SocketsHelper include ApplicationHelper diff --git a/app/helpers/status_messages_helper.rb b/app/helpers/status_messages_helper.rb index 7c1322762..08461b635 100644 --- a/app/helpers/status_messages_helper.rb +++ b/app/helpers/status_messages_helper.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - module StatusMessagesHelper def my_latest_message unless @latest_status_message.nil? diff --git a/app/models/album.rb b/app/models/album.rb index 10737bdfa..f62cbdb79 100644 --- a/app/models/album.rb +++ b/app/models/album.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class Album < Post xml_reader :name @@ -17,7 +16,6 @@ class Album < Post before_destroy :destroy_photos - def self.mine_or_friends(friend_param, current_user) friend_param ? Album.find_all_by_person_id(current_user.friend_ids) : current_user.person.albums end diff --git a/app/models/aspect.rb b/app/models/aspect.rb index b60142671..10f7aba14 100644 --- a/app/models/aspect.rb +++ b/app/models/aspect.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class Aspect include MongoMapper::Document diff --git a/app/models/comment.rb b/app/models/comment.rb index 3fa986503..4bf0dbd5e 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class Comment include MongoMapper::Document include ROXML @@ -19,7 +18,6 @@ class Comment key :post_id, ObjectId key :person_id, ObjectId - belongs_to :post, :class_name => "Post" belongs_to :person, :class_name => "Person" diff --git a/app/models/person.rb b/app/models/person.rb index a94f4106c..38a55db2b 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - require File.expand_path('../../../lib/hcard', __FILE__) class Person diff --git a/app/models/photo.rb b/app/models/photo.rb index fbab51ea5..15d105739 100644 --- a/app/models/photo.rb +++ b/app/models/photo.rb @@ -73,4 +73,3 @@ class Photo < Post end end - diff --git a/app/models/post.rb b/app/models/post.rb index 431d1c7e0..983d0e68f 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class Post require File.expand_path('../../../lib/encryptable', __FILE__) require File.expand_path('../../../lib/diaspora/websocket', __FILE__) @@ -33,7 +32,6 @@ class Post self.create params.to_hash end - def as_json(opts={}) { :post => { diff --git a/app/models/profile.rb b/app/models/profile.rb index 2bb54028a..2b8303bd1 100644 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class Profile include MongoMapper::EmbeddedDocument require File.expand_path('../../../lib/diaspora/webhooks', __FILE__) diff --git a/app/models/request.rb b/app/models/request.rb index bf9dd8721..5ba4769a2 100644 --- a/app/models/request.rb +++ b/app/models/request.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class Request require File.expand_path('../../../lib/diaspora/webhooks', __FILE__) include MongoMapper::Document diff --git a/app/models/retraction.rb b/app/models/retraction.rb index 9c1f13f45..20f74bf29 100644 --- a/app/models/retraction.rb +++ b/app/models/retraction.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class Retraction include ROXML include Diaspora::Webhooks diff --git a/app/models/status_message.rb b/app/models/status_message.rb index f75536205..c616efc5e 100644 --- a/app/models/status_message.rb +++ b/app/models/status_message.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class StatusMessage < Post xml_name :status_message @@ -11,7 +10,6 @@ class StatusMessage < Post key :message, String validates_presence_of :message - def to_activity <<-XML diff --git a/app/models/user.rb b/app/models/user.rb index 272f404bc..ade7b7a2a 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -71,7 +71,6 @@ class User end end - def move_friend( opts = {}) return true if opts[:to] == opts[:from] friend = Person.first(:_id => opts[:friend_id]) @@ -107,7 +106,6 @@ class User intitial_post(class_name, aspect_ids, options) end - def intitial_post(class_name, aspect_ids, options = {}) post = build_post(class_name, options) post.socket_to_uid(id, :aspect_ids => aspect_ids) if post.respond_to?(:socket_to_uid) @@ -270,7 +268,6 @@ class User username.downcase! if username end - def as_json(opts={}) { :user => { diff --git a/app/uploaders/image_uploader.rb b/app/uploaders/image_uploader.rb index 6e5312341..58399c90d 100644 --- a/app/uploaders/image_uploader.rb +++ b/app/uploaders/image_uploader.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - class ImageUploader < CarrierWave::Uploader::Base include CarrierWave::MiniMagick diff --git a/autotest/discover.rb b/autotest/discover.rb index 99ab1f6e4..76b9d2044 100644 --- a/autotest/discover.rb +++ b/autotest/discover.rb @@ -2,6 +2,5 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - Autotest.add_discovery { "rails" } Autotest.add_discovery { "rspec2" } diff --git a/config/application.rb b/config/application.rb index 79302a289..59b82e216 100644 --- a/config/application.rb +++ b/config/application.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require File.expand_path('../boot', __FILE__) require 'action_controller/railtie' diff --git a/config/boot.rb b/config/boot.rb index faeac6742..0d0c42268 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'rubygems' # Set up gems listed in the Gemfile. diff --git a/config/deploy.rb b/config/deploy.rb index 2f8065134..ab240e18c 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - config = YAML.load_file(File.dirname(__FILE__) + '/deploy_config.yml') all = config['cross_server'] @@ -108,7 +106,6 @@ namespace :deploy do run 'gem install bundler' end - task :migrate do end end @@ -152,7 +149,6 @@ namespace :db do tom_seed end - end after "deploy:symlink", "deploy:symlink_images", "deploy:symlink_bundle", 'deploy:symlink_config' diff --git a/config/environment.rb b/config/environment.rb index 385a96651..5bde8792b 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - # Load the rails application require File.expand_path('../application', __FILE__) Haml::Template.options[:format] = :html5 @@ -11,4 +9,3 @@ Haml::Template.options[:escape_html] = true # Initialize the rails application Diaspora::Application.initialize! - diff --git a/config/environments/development.rb b/config/environments/development.rb index 44ba8e55e..15d1fc2bb 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - require File.expand_path('../../../lib/mongo_mapper/clear_dev_memory', __FILE__) Diaspora::Application.configure do # Settings specified here will take precedence over those in config/environment.rb diff --git a/config/environments/production.rb b/config/environments/production.rb index 3207c627d..358e6e092 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - Diaspora::Application.configure do # Settings specified here will take precedence over those in config/environment.rb diff --git a/config/environments/test.rb b/config/environments/test.rb index 4e17d81e8..46b44db55 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - Diaspora::Application.configure do # Settings specified here will take precedence over those in config/environment.rb @@ -32,13 +31,11 @@ Diaspora::Application.configure do config.active_support.deprecation = :stderr config.threadsafe! - # Use SQL instead of Active Record's schema dumper when creating the test database. # This is necessary if your schema can't be completely dumped by the schema dumper, # like if you have constraints or database-specific column types # config.active_record.schema_format = :sql - begin require 'database_cleaner' DatabaseCleaner.strategy = :truncation diff --git a/config/initializers/backtrace_silencers.rb b/config/initializers/backtrace_silencers.rb index d456f8c8b..1efed86e9 100644 --- a/config/initializers/backtrace_silencers.rb +++ b/config/initializers/backtrace_silencers.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Be sure to restart your server when you modify this file. # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces. diff --git a/config/initializers/carrierwave.rb b/config/initializers/carrierwave.rb index 6dea937e9..b28f1be66 100644 --- a/config/initializers/carrierwave.rb +++ b/config/initializers/carrierwave.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - CarrierWave.configure do |config| config.storage = :file end diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 9f483a8bf..a02045546 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Use this hook to configure devise mailer, warden hooks and so forth. The first # four configuration values can also be set straight in your models. Devise.setup do |config| diff --git a/config/initializers/git_info.rb b/config/initializers/git_info.rb index ac2e4ba27..82fc99143 100644 --- a/config/initializers/git_info.rb +++ b/config/initializers/git_info.rb @@ -2,5 +2,4 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - GIT_INFO = `git show --name-only` diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb index 3171994ee..0e4097c04 100644 --- a/config/initializers/inflections.rb +++ b/config/initializers/inflections.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Be sure to restart your server when you modify this file. # Add new inflection rules using the following format diff --git a/config/initializers/locale.rb b/config/initializers/locale.rb index dd607a273..823179842 100644 --- a/config/initializers/locale.rb +++ b/config/initializers/locale.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. I18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}')] -I18n.default_locale = :en \ No newline at end of file +I18n.default_locale = :en diff --git a/config/initializers/logging.rb b/config/initializers/logging.rb index 86abdbea3..48cc2fa30 100644 --- a/config/initializers/logging.rb +++ b/config/initializers/logging.rb @@ -2,6 +2,5 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - Rails.logger = Logger.new( Rails.root.join("log",Rails.env + ".log"),3,5*1024*1024) diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb index a5a89433a..77424db27 100644 --- a/config/initializers/mime_types.rb +++ b/config/initializers/mime_types.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Be sure to restart your server when you modify this file. # Add new mime types for use in respond_to blocks: diff --git a/config/initializers/rspec_generator.rb b/config/initializers/rspec_generator.rb index caf2be23a..bdec44a03 100644 --- a/config/initializers/rspec_generator.rb +++ b/config/initializers/rspec_generator.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - Diaspora::Application.configure do config.generators do |g| g.integration_tool :rspec diff --git a/config/initializers/secret_token.rb b/config/initializers/secret_token.rb index c61c96d33..20f6087bf 100644 --- a/config/initializers/secret_token.rb +++ b/config/initializers/secret_token.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Be sure to restart your server when you modify this file. # Your secret key for verifying the integrity of signed cookies. diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb index de79a36eb..f4e36ea89 100644 --- a/config/initializers/session_store.rb +++ b/config/initializers/session_store.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Be sure to restart your server when you modify this file. Rails.application.config.session_store :cookie_store, :key => '_diaspora_session' diff --git a/config/routes.rb b/config/routes.rb index 0ac115b76..7f60bd63b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - Diaspora::Application.routes.draw do resources :people, :only => [:index, :show, :destroy] resources :users, :except => [:create, :new, :show] @@ -18,7 +16,6 @@ Diaspora::Application.routes.draw do match 'aspects/manage', :to => 'aspects#manage' resources :aspects, :except => [:edit] - match 'warzombie', :to => "dev_utilities#warzombie" match 'zombiefriends', :to => "dev_utilities#zombiefriends" match 'zombiefriendaccept', :to => "dev_utilities#zombiefriendaccept" diff --git a/config/sprinkle/packages/database.rb b/config/sprinkle/packages/database.rb index 2463007ff..0c1b1ca50 100644 --- a/config/sprinkle/packages/database.rb +++ b/config/sprinkle/packages/database.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - #package :mongo, :provides => :database do # description 'Mongodb' # version '1.4.3' diff --git a/config/sprinkle/packages/essential.rb b/config/sprinkle/packages/essential.rb index fba076e27..8b4349d06 100644 --- a/config/sprinkle/packages/essential.rb +++ b/config/sprinkle/packages/essential.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - ## Special package, anything that defines a 'source' package means build-essential should be installed for Ubuntu package :build_essential do diff --git a/config/sprinkle/packages/ruby.rb b/config/sprinkle/packages/ruby.rb index 708ab0eeb..261cf3ffe 100644 --- a/config/sprinkle/packages/ruby.rb +++ b/config/sprinkle/packages/ruby.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - ## Defines available packages package :ruby do diff --git a/config/sprinkle/packages/scm.rb b/config/sprinkle/packages/scm.rb index 22ece7d98..981214a60 100644 --- a/config/sprinkle/packages/scm.rb +++ b/config/sprinkle/packages/scm.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - package :git, :provides => :scm do description 'Git Distributed Version Control' apt %w( git-core ) diff --git a/config/sprinkle/packages/server.rb b/config/sprinkle/packages/server.rb index 68e1a12aa..004883dad 100644 --- a/config/sprinkle/packages/server.rb +++ b/config/sprinkle/packages/server.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - package :nginx, :provides=> :webserver do description 'Nginx HTTP server' version '0.7.67' diff --git a/config/sprinkle/packages/unfortunately_essential.rb b/config/sprinkle/packages/unfortunately_essential.rb index d1504bc43..23975f870 100644 --- a/config/sprinkle/packages/unfortunately_essential.rb +++ b/config/sprinkle/packages/unfortunately_essential.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - #Fix dreamhost # diff --git a/config/sprinkle/provision.rb b/config/sprinkle/provision.rb index fc81b1ca3..3e30c26f4 100644 --- a/config/sprinkle/provision.rb +++ b/config/sprinkle/provision.rb @@ -3,10 +3,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - - - require '#{File.dirname(__FILE__)}/packages/essential' require '#{File.dirname(__FILE__)}/packages/database' require '#{File.dirname(__FILE__)}/packages/server' @@ -26,7 +22,6 @@ policy :diaspora, :roles => [:pivots] do requires :nginx_conf end - deployment do # mechanism for deployment diff --git a/db/schema.rb b/db/schema.rb index a4f92eb4b..19e6df260 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - # This file is auto-generated from the current state of the database. Instead of editing this file, # please use the migrations feature of Active Record to incrementally modify your database, and # then regenerate this schema definition. diff --git a/db/seeds.rb b/db/seeds.rb index a21966266..de3015479 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - # This file should contain all the record creation needed to seed the database with its default values. # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). # diff --git a/db/seeds/backer.rb b/db/seeds/backer.rb index b80fd794b..0851e7894 100644 --- a/db/seeds/backer.rb +++ b/db/seeds/backer.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - # This file should contain all the record creation needed to seed the database with its default values. # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). # @@ -16,7 +14,6 @@ require File.dirname(__FILE__) + '/../../config/environment' def create - config = YAML.load_file(File.dirname(__FILE__) + '/../../config/deploy_config.yml') backer_info = config['servers']['backer'] diff --git a/db/seeds/dev.rb b/db/seeds/dev.rb index dcbca72aa..8a6cf271f 100644 --- a/db/seeds/dev.rb +++ b/db/seeds/dev.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require File.dirname(__FILE__) + '/../../config/environment' def set_app_config username diff --git a/db/seeds/tom.rb b/db/seeds/tom.rb index 468667485..1c7f63027 100644 --- a/db/seeds/tom.rb +++ b/db/seeds/tom.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require File.dirname(__FILE__) + '/../../config/environment' def set_app_config username @@ -19,7 +17,6 @@ end set_app_config "tom" require 'config/initializers/_load_app_config.rb' - # Create seed user user = User.instantiate!( :email => "tom@tom.joindiaspora.com", :username => "tom", @@ -47,4 +44,3 @@ reversed_request = user2.accept_friend_request( request.id, user2.aspect(:name = user.receive reversed_request.to_diaspora_xml user.aspect(:name => "Presidents") - diff --git a/lib/chrome_frame.rb b/lib/chrome_frame.rb index 10ef3dea3..52a4eb459 100644 --- a/lib/chrome_frame.rb +++ b/lib/chrome_frame.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - module Rack class ChromeFrame diff --git a/lib/diaspora.rb b/lib/diaspora.rb index 959d0bb92..e8508b38b 100644 --- a/lib/diaspora.rb +++ b/lib/diaspora.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - module Diaspora autoload :Parser diff --git a/lib/diaspora/parser.rb b/lib/diaspora/parser.rb index 6bc5d4eab..e8e7e8a2b 100644 --- a/lib/diaspora/parser.rb +++ b/lib/diaspora/parser.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - module Diaspora module Parser def self.owner_id_from_xml(xml) diff --git a/lib/diaspora/user/friending.rb b/lib/diaspora/user/friending.rb index f3b30f9b3..35695c546 100644 --- a/lib/diaspora/user/friending.rb +++ b/lib/diaspora/user/friending.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - module Diaspora module UserModules module Friending @@ -29,7 +27,6 @@ module Diaspora request end - def accept_friend_request(friend_request_id, aspect_id) request = Request.find_by_id(friend_request_id) pending_requests.delete(request) diff --git a/lib/diaspora/user/querying.rb b/lib/diaspora/user/querying.rb index bd4174c76..29f119238 100644 --- a/lib/diaspora/user/querying.rb +++ b/lib/diaspora/user/querying.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - module Diaspora module UserModules module Querying diff --git a/lib/diaspora/webhooks.rb b/lib/diaspora/webhooks.rb index 81f7bcfaf..2be45d76a 100644 --- a/lib/diaspora/webhooks.rb +++ b/lib/diaspora/webhooks.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - module Diaspora module Webhooks def self.included(klass) diff --git a/lib/diaspora/websocket.rb b/lib/diaspora/websocket.rb index 687bd2b7c..10e8bc9c8 100644 --- a/lib/diaspora/websocket.rb +++ b/lib/diaspora/websocket.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - module Diaspora module WebSocket def self.queue_to_user(uid, data) diff --git a/lib/encryptable.rb b/lib/encryptable.rb index ba36d6ec3..5b00ca9ea 100644 --- a/lib/encryptable.rb +++ b/lib/encryptable.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - module Encryptable def signable_string raise NotImplementedException("Override this in your encryptable class") diff --git a/lib/encryptor.rb b/lib/encryptor.rb index ed9fbedb1..d90e8bdfe 100644 --- a/lib/encryptor.rb +++ b/lib/encryptor.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - module Encryptor module Public def encrypt cleartext @@ -60,6 +58,5 @@ module Encryptor txt end - end end diff --git a/lib/hcard.rb b/lib/hcard.rb index 7658c5a1d..5640e711b 100644 --- a/lib/hcard.rb +++ b/lib/hcard.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - module HCard def self.find url doc = Nokogiri::HTML(Net::HTTP.get URI.parse(url)) diff --git a/lib/message_handler.rb b/lib/message_handler.rb index 0b55ee0f7..e6ce75ffc 100644 --- a/lib/message_handler.rb +++ b/lib/message_handler.rb @@ -2,11 +2,8 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - class MessageHandler - NUM_TRIES = 3 TIMEOUT = 5 #seconds diff --git a/lib/mongo_mapper/bson_id.rb b/lib/mongo_mapper/bson_id.rb index 4de833a66..328c69a03 100644 --- a/lib/mongo_mapper/bson_id.rb +++ b/lib/mongo_mapper/bson_id.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - class String def to_id BSON::ObjectId self diff --git a/lib/mongo_mapper/clear_dev_memory.rb b/lib/mongo_mapper/clear_dev_memory.rb index 88c7facce..d63084765 100644 --- a/lib/mongo_mapper/clear_dev_memory.rb +++ b/lib/mongo_mapper/clear_dev_memory.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - module MongoMapper class ClearDevMemory def initialize(app) diff --git a/lib/salmon/salmon.rb b/lib/salmon/salmon.rb index 931598691..5d2857196 100644 --- a/lib/salmon/salmon.rb +++ b/lib/salmon/salmon.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - # Add URL safe Base64 support module Base64 module_function @@ -51,8 +49,6 @@ module Salmon sig_doc = doc.search('entry') slap.magic_sig = MagicSigEnvelope.parse sig_doc - - if 'base64url' == slap.magic_sig.encoding slap.data = decode64url(slap.magic_sig.data) slap.sig = slap.magic_sig.sig @@ -98,9 +94,6 @@ ENTRY end end - - - # Decode URL-safe-Base64. This implements def self.decode64url(str) # remove whitespace @@ -128,7 +121,6 @@ ENTRY signature = Base64.urlsafe_decode64(self.magic_sig.sig) signed_data = self.magic_sig.signable_string# Base64.urlsafe_decode64(self.magic_sig.signable_string) - public_key.verify(OpenSSL::Digest::SHA256.new, signature, signed_data ) end @@ -194,7 +186,6 @@ ENTRY env.encoding = env.get_encoding env.alg = env.get_alg - env.sig = Base64.urlsafe_encode64( user.encryption_key.sign OpenSSL::Digest::SHA256.new, env.signable_string ) diff --git a/spec/controllers/albums_controller_spec.rb b/spec/controllers/albums_controller_spec.rb index 815a0663f..b0f939548 100644 --- a/spec/controllers/albums_controller_spec.rb +++ b/spec/controllers/albums_controller_spec.rb @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - require 'spec_helper' include ApplicationHelper describe AlbumsController do diff --git a/spec/controllers/aspects_controller_spec.rb b/spec/controllers/aspects_controller_spec.rb index 5ce04c56c..fdfaa7e45 100644 --- a/spec/controllers/aspects_controller_spec.rb +++ b/spec/controllers/aspects_controller_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' include ApplicationHelper describe AspectsController do diff --git a/spec/controllers/people_controller_spec.rb b/spec/controllers/people_controller_spec.rb index 50ee13bb4..4ce6e3e69 100644 --- a/spec/controllers/people_controller_spec.rb +++ b/spec/controllers/people_controller_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' describe PeopleController do diff --git a/spec/controllers/publics_controller_spec.rb b/spec/controllers/publics_controller_spec.rb index 3e1071f16..70d851a3e 100644 --- a/spec/controllers/publics_controller_spec.rb +++ b/spec/controllers/publics_controller_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' describe PublicsController do diff --git a/spec/controllers/requests_controller_spec.rb b/spec/controllers/requests_controller_spec.rb index ebde75a97..23e0fdea9 100644 --- a/spec/controllers/requests_controller_spec.rb +++ b/spec/controllers/requests_controller_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' include ApplicationHelper include RequestsHelper diff --git a/spec/controllers/sockets_controller_spec.rb b/spec/controllers/sockets_controller_spec.rb index d83547e98..905b1611e 100644 --- a/spec/controllers/sockets_controller_spec.rb +++ b/spec/controllers/sockets_controller_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' SocketsController.class_eval <<-EOT diff --git a/spec/factories.rb b/spec/factories.rb index 21a7ad110..834304e33 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - #For Guidance #http://github.com/thoughtbot/factory_girl # http://railscasts.com/episodes/158-factories-not-fixtures @@ -55,7 +53,6 @@ Factory.define :blog do |b| b.sequence(:body) {|n| "jimmy's huge #{n} whales"} end - Factory.define :bookmark do |b| b.link "http://www.yahooligans.com/" end diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index 4be43a0cb..d894d147e 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' include ApplicationHelper @@ -13,7 +11,6 @@ describe ApplicationHelper do @person = Factory.create(:person) end - it "should provide a correct show path for a given person" do person_url(@person).should == "/people/#{@person.id}" end diff --git a/spec/helpers/publics_helper_spec.rb b/spec/helpers/publics_helper_spec.rb index ec00f671a..c58247321 100644 --- a/spec/helpers/publics_helper_spec.rb +++ b/spec/helpers/publics_helper_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' include PublicsHelper diff --git a/spec/helpers/requests_helper_spec.rb b/spec/helpers/requests_helper_spec.rb index 50cf148cb..984a56ea4 100644 --- a/spec/helpers/requests_helper_spec.rb +++ b/spec/helpers/requests_helper_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' include RequestsHelper diff --git a/spec/lib/diaspora_parser_spec.rb b/spec/lib/diaspora_parser_spec.rb index 5c9a17fd5..2fbd3e2d6 100644 --- a/spec/lib/diaspora_parser_spec.rb +++ b/spec/lib/diaspora_parser_spec.rb @@ -2,15 +2,11 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' include ApplicationHelper include Diaspora::Parser - - describe Diaspora::Parser do before do @user = Factory.create(:user, :email => "bob@aol.com") @@ -88,7 +84,6 @@ describe Diaspora::Parser do original_person_id = @user2.person.id xml = request.to_diaspora_xml - Person.all.count.should be person_count @user.receive xml Person.all.count.should be person_count @@ -121,7 +116,6 @@ describe Diaspora::Parser do @user.friends.include?(new_person).should be true end - it 'should process retraction for a person' do person_count = Person.all.count request = @user.send_friend_request_to( @user2.person, @aspect) @@ -140,7 +134,6 @@ describe Diaspora::Parser do aspect_people_count = @aspect.people.size #They are now friends - Person.count.should == person_count @user.receive retraction_xml diff --git a/spec/lib/hcard_spec.rb b/spec/lib/hcard_spec.rb index 4836c5468..45d7157b9 100644 --- a/spec/lib/hcard_spec.rb +++ b/spec/lib/hcard_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' require File.dirname(__FILE__) + '/../../lib/hcard' diff --git a/spec/lib/message_handler_spec.rb b/spec/lib/message_handler_spec.rb index d60009fd9..adb375c17 100644 --- a/spec/lib/message_handler_spec.rb +++ b/spec/lib/message_handler_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' describe MessageHandler do @@ -41,7 +39,6 @@ describe MessageHandler do } end - it 'should only retry a bad request three times ' do request = FakeHttpRequest.new(:failure) request.should_receive(:get).exactly(MessageHandler::NUM_TRIES).times.and_return(request) @@ -61,7 +58,6 @@ describe MessageHandler do describe 'POST messages' do - it 'should be able to add a post message to the queue' do EventMachine.run { @handler.size.should ==0 diff --git a/spec/lib/salmon_salmon_spec.rb b/spec/lib/salmon_salmon_spec.rb index eb7a55027..6d467d4ea 100644 --- a/spec/lib/salmon_salmon_spec.rb +++ b/spec/lib/salmon_salmon_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' describe Salmon do @@ -23,7 +21,6 @@ describe Salmon do @sent_salmon.magic_sig.sig.should == @parsed_salmon.magic_sig.sig @sent_salmon.magic_sig.signable_string.should == @parsed_salmon.magic_sig.signable_string - @parsed_salmon.verified_for_key?(OpenSSL::PKey::RSA.new(@user.exported_key)).should be true @sent_salmon.verified_for_key?(OpenSSL::PKey::RSA.new(@user.exported_key)).should be true end diff --git a/spec/lib/web_hooks_spec.rb b/spec/lib/web_hooks_spec.rb index 3b0eb26df..cb81f4ce7 100644 --- a/spec/lib/web_hooks_spec.rb +++ b/spec/lib/web_hooks_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' include Diaspora diff --git a/spec/misc_spec.rb b/spec/misc_spec.rb index 528782f07..65cb9da60 100644 --- a/spec/misc_spec.rb +++ b/spec/misc_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' describe 'making sure the spec runner works' do diff --git a/spec/models/aspect_spec.rb b/spec/models/aspect_spec.rb index 356e8b26c..23453eee9 100644 --- a/spec/models/aspect_spec.rb +++ b/spec/models/aspect_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' describe Aspect do diff --git a/spec/models/comments_spec.rb b/spec/models/comments_spec.rb index 9d8c7314d..732c4349b 100644 --- a/spec/models/comments_spec.rb +++ b/spec/models/comments_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' describe Comment do diff --git a/spec/models/person_spec.rb b/spec/models/person_spec.rb index f1654b25c..c11d03455 100644 --- a/spec/models/person_spec.rb +++ b/spec/models/person_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' describe Person do @@ -21,7 +19,7 @@ describe Person do @user.person.diaspora_handle.should == @user.username + "@example.org" end end - + context 'remote people' do it 'stores the diaspora_handle in the database' do @person.diaspora_handle.include?(APP_CONFIG[:terse_pod_url]).should be false diff --git a/spec/models/photo_spec.rb b/spec/models/photo_spec.rb index 179ed1ccd..f3f77f3db 100644 --- a/spec/models/photo_spec.rb +++ b/spec/models/photo_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' describe Photo do @@ -16,7 +14,6 @@ describe Photo do @fixture_name = File.dirname(__FILE__) + '/../fixtures/button.png' @fail_fixture_name = File.dirname(__FILE__) + '/../fixtures/msg.xml' - @photo = Photo.new(:person => @user.person, :album => @album) end diff --git a/spec/models/post_spec.rb b/spec/models/post_spec.rb index c9a114b32..b0ed59b7d 100644 --- a/spec/models/post_spec.rb +++ b/spec/models/post_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' describe Post do diff --git a/spec/models/profile_spec.rb b/spec/models/profile_spec.rb index 0681e1e22..2e38c20ae 100644 --- a/spec/models/profile_spec.rb +++ b/spec/models/profile_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' describe Profile do @@ -29,4 +27,3 @@ describe Profile do end end - diff --git a/spec/models/request_spec.rb b/spec/models/request_spec.rb index e71dc1175..4e1380df1 100644 --- a/spec/models/request_spec.rb +++ b/spec/models/request_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' describe Request do diff --git a/spec/models/retraction_spec.rb b/spec/models/retraction_spec.rb index ca93c7c0e..777855234 100644 --- a/spec/models/retraction_spec.rb +++ b/spec/models/retraction_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' describe Retraction do diff --git a/spec/models/status_message_spec.rb b/spec/models/status_message_spec.rb index 59cb70ec6..d7dbf19e4 100644 --- a/spec/models/status_message_spec.rb +++ b/spec/models/status_message_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' describe StatusMessage do @@ -37,6 +35,5 @@ describe StatusMessage do end end - end diff --git a/spec/models/user/posting_spec.rb b/spec/models/user/posting_spec.rb index 73672e2ec..2f86ac549 100644 --- a/spec/models/user/posting_spec.rb +++ b/spec/models/user/posting_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' describe User do diff --git a/spec/models/user/receive_spec.rb b/spec/models/user/receive_spec.rb index 97bf41197..5bdddce67 100644 --- a/spec/models/user/receive_spec.rb +++ b/spec/models/user/receive_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' describe User do diff --git a/spec/models/user/user_friending_spec.rb b/spec/models/user/user_friending_spec.rb index 1c0f59465..4ea51ad19 100644 --- a/spec/models/user/user_friending_spec.rb +++ b/spec/models/user/user_friending_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' describe User do @@ -24,7 +22,6 @@ describe User do aspect.requests.size.should == 1 end - it "should be able to accept a pending friend request" do friend = Factory.create(:person) r = Request.instantiate(:to => @user.receive_url, :from => friend) @@ -53,12 +50,9 @@ describe User do @user.friends << friend @user.save - proc {@user.send_friend_request_to( friend, @aspect)}.should raise_error end - - describe 'multiple users accepting/rejecting the same person' do before do @person_one = Factory.create :person @@ -144,7 +138,6 @@ describe User do Person.all.count.should be 3 end - end describe 'a user accepting rejecting multiple people' do @@ -231,6 +224,5 @@ describe User do end end - end end diff --git a/spec/models/user/visible_posts_spec.rb b/spec/models/user/visible_posts_spec.rb index 0a2a53d84..8d20bcb96 100644 --- a/spec/models/user/visible_posts_spec.rb +++ b/spec/models/user/visible_posts_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' describe User do @@ -55,7 +53,6 @@ describe User do context 'albums' do - before do @album = user.post :album, :name => "Georges", :to => aspect.id aspect.reload diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 5478d69fe..ad7070eaa 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' describe User do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index ef5db93c2..fad7dfc5a 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - # This file is copied to ~/spec when you run 'ruby script/generate rspec' # from the project root directory. @@ -16,8 +14,6 @@ require 'webmock/rspec' include Devise::TestHelpers include WebMock - - # Requires supporting files with custom matchers and macros, etc, # in ./support/ and its subdirectories. Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f} diff --git a/spec/user_encryption_spec.rb b/spec/user_encryption_spec.rb index 4c829bcd0..788d99419 100644 --- a/spec/user_encryption_spec.rb +++ b/spec/user_encryption_spec.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'spec_helper' include ApplicationHelper include Diaspora::Parser diff --git a/test/performance/browsing_test.rb b/test/performance/browsing_test.rb index 74e8c9421..9cc248c9f 100644 --- a/test/performance/browsing_test.rb +++ b/test/performance/browsing_test.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require 'test_helper' require 'rails/performance_test_help' diff --git a/test/selenium/login_test.rb b/test/selenium/login_test.rb index 321d46e1d..b60d2db8c 100644 --- a/test/selenium/login_test.rb +++ b/test/selenium/login_test.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - class SampleWebratTest < ActionController::IntegrationTest def test_widget diff --git a/test/selenium/selenium_suite.rb b/test/selenium/selenium_suite.rb index d5362b1d7..7f4df5e4c 100644 --- a/test/selenium/selenium_suite.rb +++ b/test/selenium/selenium_suite.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - require File.expand_path(File.join(File.dirname(__FILE__), '..', 'test_helper')) require 'test/unit/ui/console/testrunner' require 'webrat' diff --git a/test/test_helper.rb b/test/test_helper.rb index d9742c116..e46a0a70c 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - ENV["RAILS_ENV"] = "test" require File.expand_path('../../config/environment', __FILE__) require 'rails/test_help' From ebf49990541607ef6b79d19280dc200319048caa Mon Sep 17 00:00:00 2001 From: Stephen Caudill Date: Sat, 25 Sep 2010 12:11:04 -0400 Subject: [PATCH 083/155] Task to remove consecutive blank lines --- lib/tasks/whitespace.rake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/tasks/whitespace.rake b/lib/tasks/whitespace.rake index e3d26c3ab..c5b9d4c6e 100644 --- a/lib/tasks/whitespace.rake +++ b/lib/tasks/whitespace.rake @@ -7,5 +7,9 @@ namespace :whitespace do task :retab do sh %{find . -name '*.rb' -exec sed -i '' 's/\t/ /g' {} \\;} end + desc 'Remove consecutive blank lines' + task :scrub_gratuitous_newlines do + sh %{find . -name '*.rb' -exec sed -i '' '/./,/^$/!d' {} \\;} + end end From 8c6dff35c0d9475b09cac1781a710c42c501639b Mon Sep 17 00:00:00 2001 From: Stephen Caudill Date: Sat, 25 Sep 2010 12:26:29 -0400 Subject: [PATCH 084/155] Remove unnecessary includes --- spec/controllers/albums_controller_spec.rb | 2 +- spec/controllers/aspects_controller_spec.rb | 2 +- spec/controllers/requests_controller_spec.rb | 6 ++-- spec/helpers/application_helper_spec.rb | 1 - spec/helpers/publics_helper_spec.rb | 1 - spec/helpers/requests_helper_spec.rb | 2 -- spec/lib/diaspora_parser_spec.rb | 3 -- spec/lib/web_hooks_spec.rb | 31 ++++++++------------ spec/user_encryption_spec.rb | 2 -- 9 files changed, 18 insertions(+), 32 deletions(-) diff --git a/spec/controllers/albums_controller_spec.rb b/spec/controllers/albums_controller_spec.rb index b0f939548..a8f5f8506 100644 --- a/spec/controllers/albums_controller_spec.rb +++ b/spec/controllers/albums_controller_spec.rb @@ -3,7 +3,7 @@ # the COPYRIGHT file. require 'spec_helper' -include ApplicationHelper + describe AlbumsController do render_views before do diff --git a/spec/controllers/aspects_controller_spec.rb b/spec/controllers/aspects_controller_spec.rb index fdfaa7e45..2e05b850c 100644 --- a/spec/controllers/aspects_controller_spec.rb +++ b/spec/controllers/aspects_controller_spec.rb @@ -3,7 +3,7 @@ # the COPYRIGHT file. require 'spec_helper' -include ApplicationHelper + describe AspectsController do render_views before do diff --git a/spec/controllers/requests_controller_spec.rb b/spec/controllers/requests_controller_spec.rb index 23e0fdea9..0556ffe5c 100644 --- a/spec/controllers/requests_controller_spec.rb +++ b/spec/controllers/requests_controller_spec.rb @@ -3,10 +3,10 @@ # the COPYRIGHT file. require 'spec_helper' -include ApplicationHelper -include RequestsHelper + describe RequestsController do - render_views + include RequestsHelper + render_views before do @user = Factory.create :user stub_success("tom@tom.joindiaspora.com") diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index d894d147e..459563cff 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -4,7 +4,6 @@ require 'spec_helper' -include ApplicationHelper describe ApplicationHelper do before do @user = Factory.create(:user) diff --git a/spec/helpers/publics_helper_spec.rb b/spec/helpers/publics_helper_spec.rb index c58247321..bc6a5021b 100644 --- a/spec/helpers/publics_helper_spec.rb +++ b/spec/helpers/publics_helper_spec.rb @@ -4,7 +4,6 @@ require 'spec_helper' -include PublicsHelper describe PublicsHelper do before do @user = Factory.create(:user) diff --git a/spec/helpers/requests_helper_spec.rb b/spec/helpers/requests_helper_spec.rb index 984a56ea4..0cd1dbf88 100644 --- a/spec/helpers/requests_helper_spec.rb +++ b/spec/helpers/requests_helper_spec.rb @@ -4,8 +4,6 @@ require 'spec_helper' -include RequestsHelper - describe RequestsHelper do before do diff --git a/spec/lib/diaspora_parser_spec.rb b/spec/lib/diaspora_parser_spec.rb index 2fbd3e2d6..e37cf0116 100644 --- a/spec/lib/diaspora_parser_spec.rb +++ b/spec/lib/diaspora_parser_spec.rb @@ -4,9 +4,6 @@ require 'spec_helper' -include ApplicationHelper -include Diaspora::Parser - describe Diaspora::Parser do before do @user = Factory.create(:user, :email => "bob@aol.com") diff --git a/spec/lib/web_hooks_spec.rb b/spec/lib/web_hooks_spec.rb index cb81f4ce7..e316817d4 100644 --- a/spec/lib/web_hooks_spec.rb +++ b/spec/lib/web_hooks_spec.rb @@ -4,28 +4,23 @@ require 'spec_helper' -include Diaspora +describe Diaspora::Webhooks do + before do + @user = Factory.create(:user) + @aspect = @user.aspect(:name => "losers") + @user2 = Factory.create(:user) + @aspect2 = @user2.aspect(:name => "losers") + friend_users(@user, @aspect, @user2, @aspect2) + end -describe Diaspora do - - describe Webhooks do + describe "body" do before do - @user = Factory.create(:user) - @aspect = @user.aspect(:name => "losers") - @user2 = Factory.create(:user) - @aspect2 = @user2.aspect(:name => "losers") - friend_users(@user, @aspect, @user2, @aspect2) + @post = Factory.build(:status_message, :person => @user.person) end - describe "body" do - before do - @post = Factory.build(:status_message, :person => @user.person) - end - - it "should add the following methods to Post on inclusion" do - @post.respond_to?(:to_diaspora_xml).should be true - end - + it "should add the following methods to Post on inclusion" do + @post.respond_to?(:to_diaspora_xml).should be true end + end end diff --git a/spec/user_encryption_spec.rb b/spec/user_encryption_spec.rb index 788d99419..b74006e3d 100644 --- a/spec/user_encryption_spec.rb +++ b/spec/user_encryption_spec.rb @@ -3,8 +3,6 @@ # the COPYRIGHT file. require 'spec_helper' -include ApplicationHelper -include Diaspora::Parser describe 'user encryption' do before do From 72cefc62652c510bd9a9c6466711ad20ddb63ea7 Mon Sep 17 00:00:00 2001 From: Stephen Caudill Date: Sat, 25 Sep 2010 13:04:20 -0400 Subject: [PATCH 085/155] Move relationship_flow spec to its helper spec --- spec/controllers/requests_controller_spec.rb | 21 -------------------- spec/helpers/requests_helper_spec.rb | 13 +++++++++++- 2 files changed, 12 insertions(+), 22 deletions(-) delete mode 100644 spec/controllers/requests_controller_spec.rb diff --git a/spec/controllers/requests_controller_spec.rb b/spec/controllers/requests_controller_spec.rb deleted file mode 100644 index 0556ffe5c..000000000 --- a/spec/controllers/requests_controller_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright (c) 2010, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - -require 'spec_helper' - -describe RequestsController do - include RequestsHelper - render_views - before do - @user = Factory.create :user - stub_success("tom@tom.joindiaspora.com") - - @tom = Redfinger.finger('tom@tom.joindiaspora.com') - sign_in :user, @user - stub!(:current_user).and_return @user - end - it 'should return the correct tag and url for a given address' do - relationship_flow('tom@tom.joindiaspora.com')[:friend].receive_url.include?("receive/user").should == true - end -end diff --git a/spec/helpers/requests_helper_spec.rb b/spec/helpers/requests_helper_spec.rb index 0cd1dbf88..bf99f89d1 100644 --- a/spec/helpers/requests_helper_spec.rb +++ b/spec/helpers/requests_helper_spec.rb @@ -7,7 +7,6 @@ require 'spec_helper' describe RequestsHelper do before do - stub_success("tom@tom.joindiaspora.com") stub_success("evan@status.net") @tom = Redfinger.finger('tom@tom.joindiaspora.com') @@ -20,4 +19,16 @@ describe RequestsHelper do subscription_mode(@evan).should == :none end end + + describe "#relationship_flow" do + let(:tom){ Factory(:user, :email => 'tom@tom.joindiaspora.com') } + + before do + stub!(:current_user).and_return(tom) + end + + it 'should return the correct tag and url for a given address' do + relationship_flow('tom@tom.joindiaspora.com')[:friend].receive_url.should include("receive/user") + end + end end From f2ddb8a39cec9da8e46ff2b230ce3e524902c6e0 Mon Sep 17 00:00:00 2001 From: Yuval Adam Date: Sun, 26 Sep 2010 02:54:24 +0800 Subject: [PATCH 086/155] added Hebrew (he) locale files --- config/locales/devise/devise.he.yml | 41 ++++++ config/locales/diaspora/he.yml | 201 ++++++++++++++++++++++++++++ 2 files changed, 242 insertions(+) create mode 100644 config/locales/devise/devise.he.yml create mode 100644 config/locales/diaspora/he.yml diff --git a/config/locales/devise/devise.he.yml b/config/locales/devise/devise.he.yml new file mode 100644 index 000000000..851a90789 --- /dev/null +++ b/config/locales/devise/devise.he.yml @@ -0,0 +1,41 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + + +en: + errors: + messages: + not_found: "לא נמצא" + already_confirmed: "כבר אושר" + not_locked: "לא ננעל" + + devise: + failure: + unauthenticated: "צריך להתחבר או להירשם לפני שאפשר להמשיך." + unconfirmed: "צריך לאשר את החשבון לפני שאפשר להמשיך." + locked: "החשבון שלך נעול." + invalid: "אימייל או סיסמה לא נכונים." + invalid_token: "מספר אימות לא נכון." + timeout: "פג תוקפו של החיבור. נא להתחבר מחדש על מנת להמשיך." + inactive: "החשבון לא אומת עדיין." + sessions: + signed_in: "התחברות עברה בהצלחה." + signed_out: "התנתקות עברה בהצלחה." + passwords: + send_instructions: "אימייל עם הוראות עיצד לאפס סיסמה יתקבל בקרוב." + updated: "סיסמה הוחלפה בהצלחה, את/ה כעת מחובר/ת." + confirmations: + send_instructions: "אימייל עם הוראות כיצד לאמת את החשבון יתקבל בקרוב." + confirmed: "חשבון אומת בהצלחה. את/ה כעת מחובר/ת." + registrations: + signed_up: "התחברת בהצלחה, אם הדבר מאופשר, יתקבל אימייל אישור בקרוב.." + updated: "חשבונך עודכן בהצלחה." + destroyed: "להתראות! חשבונך נמחק בהצלחה. מקווים לראותך שוב בקרוב!" + unlocks: + send_instructions: "אימייל עם הוראות כיצד להסיר את הנעילה מחשבונך יתקבל בקרוב." + unlocked: "חשבונך נפתח בהצלחה. את/ה כעת מחובר/ת." + mailer: + confirmation_instructions: "הוראות אישור" + reset_password_instructions: "הוראות איפוס סיסמה" + unlock_instructions: "הוראות הסרת נעילה" diff --git a/config/locales/diaspora/he.yml b/config/locales/diaspora/he.yml new file mode 100644 index 000000000..90ced9435 --- /dev/null +++ b/config/locales/diaspora/he.yml @@ -0,0 +1,201 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + +he: + hello: "שלום עולם" + application: + helper: + unknown_person: "אדם לא מוכר" + new_requests: "בקשות חדשות" + dashboards: + helper: + home: "בית" + error_messages: + helper: + invalid_fields: "שדות לא חוקיים" + correct_the_following_errors_and_try_again: "נא לתקן את השגיאות הבאות ולנסות שוב." + people: + helper: + results_for: " תוצאות עבור %{params}" + people_on_pod_are_aware_of: " אנשים בפוד מכירים את" + layouts: + application: + edit_profile: "ערוך פרופיל" + logout: "התנתק" + shared: + aspect_nav: + all_aspects: "כל האספקטים" + manage: "נהל" + manage_your_aspects: "נהל אספקטים" + sub_header: + all_aspects: "כל האספקטים" + manage_aspects: "נהל אספקטים" + publisher: + share: "שתף" + aspect_friends: + add_friends: "הוסף חברים" + albums: + album: + you: "אתה" + new_album: + create: "צור" + add_a_new_album: "הוסף אלבום חדש" + show: + edit_album: "ערוך אלבום" + albums: "אלבומים" + updated: "עדכן" + by: "על ידי" + edit: + editing: "עריכה" + updated: "עודכן" + are_you_sure: "האם את/ה בטוח/ה?" + delete_album: "מחק אלבום" + cancel: "בטל" + index: + home: "בית" + new_album: "אלבום חדש" + create: + success: "יצרת אלבום בשם %{name}." + update: + success: "אלבום %{name} עודכן בהצלחה." + failure: "עריכת אלבום %{name} נכשלה." + destroy: + success: "אלבום %{name} נמחק." + helper: + friends_albums: "אלבומים של חברים" + your_albums: "האלבומים שלך" + aspects: + index: + photos: "תמונות" + show: + photos: "תמונות" + manage: + add_a_new_aspect: "הוסף אספקט" + add_a_new_friend: "הוסף חבר" + show: "הצג" + update_aspects: "עדכן אספקטים" + requests: "בקשות" + ignore_remove: "התעלם/מחק" + new_aspect: + add_a_new_aspect: "הוסף אספקט" + create: "צור" + create: + success: "לחץ על הפלוס בצד ימין על מנת לקבוע מי רשאי לצפות באספקט." + destroy: + success: "%{name} הוסר בהצלחה." + update: + success: "האספקט שלך, %{name}, נערך בהצלחה." + move_friends: + failure: "עריכת אספקט נכשלה עבור %{real_name}." + success: "אספקטים נערכו בהצלחה." + move_friend: + failure: "לא עבד %{inspect}" + success: "אתה כעת מציג לחברך אספקט שונה שלך." + helper: + remove: "מחק" + aspect_not_empty: "אספקט לא ריק" + users: + edit: + cancel: "בטל" + update_profile: "עדכן פרופיל" + home: "בית" + diaspora_username: "שם משתמש בדיאספורה" + info: "מידע" + picture: "תמונה" + editing_profile: "עורך פרופיל" + albums: "אלבומים" + you_dont_have_any_photos: "אין לך תמונות! עבור ל-" + page_to_upload_some: "דף להעלאה." + comments: + comment: + ago: "לפני" + new_comment: + comment: "הערה" + photos: + show: + prev: "קודם" + full_size: "גודל מלא" + next: "הבא" + edit_photo: "ערוך תמונה" + delete_photo: "מחק תמונה" + are_you_sure: "האם אתה בטוח?" + comments: "הערות" + edit: + editing: "עריכה" + are_you_sure: "האם אתה בטוח?" + delete_photo: "מחק תמונה" + photo: + show_comments: "הצג הערות" + posted_a_new_photo_to: "הועלתה תמונה חדשה ל-" + new: + new_photo: "תמונה חדשה" + back_to_list: "חרה לרשימה" + post_it: "שתף!" + create: + runtime_error: "העלאת תמונה נכשלה. האם אתה חוגר חגורת בטיחות?" + integrity_error: "העלאת תמונה נכשלה. האם זו אכן הייתה תמונה?" + type_error: "העלאת תמונה נכשלה. האם אכן נוספה תמונה?" + update: + notice: "תמונה עודכנה בהצלחה." + error: "עריכת תמונה נכשלה." + destroy: + notice: "תמונה נמחקה." + registrations: + new: + sign_up: "הצטרפות" + create: + success: "הצטרפת לדיאספורה!" + status_messages: + new_status_message: + tell_me_something_good: "ספר לי משהו נחמד" + oh_yeah: "אחלה!" + status_message: + show_comments: "הצג תגובות" + delete: "מחק" + are_you_sure: "האם אתה בטוח?" + show: + status_message: "הודעת סטטוס" + comments: "הערות" + are_you_sure: "האם אתה בטוח?" + destroy: "השמד" + view_all: "הצג הכל" + message: "הודעה" + owner: "בעלים" + helper: + no_message_to_display: "אין הודעה להציג." + people: + person: + add_friend: "הוסף חבר" + pending_request: "בקשה על תנאי" + index: + add_friend: "הוסף חבר" + real_name: "שם אמיתי" + diaspora_handle: "כינוי בדיאספורה" + thats_you: "זה אתה!" + friend_request_pending: "בקשת חברות ממתינה" + you_have_a_friend_request_from_this_person: "יש לך בקשת חברות מאדם זה" + new: + new_person: "אדם חדש" + back_to_list: "חזרה לרשימה" + show: + last_seen: "נראה לאחרונה: %{how_long_ago}" + friends_since: "חברים מאז: %{how_long_ago}" + save: "שמור" + are_you_sure: "האם אתה בטוח?" + remove_friend: "מחק חבר" + requests: + new_request: + add_a_new_friend_to: "הוסף חבר חדש ל-" + enter_a_diaspora_username: "הכנס שם משתמש בדיאספורה:" + your_diaspora_username_is: "שם המשתמש שלך בדיאספורה: %{diaspora_handle}" + friends_username: "שם המשתמש של חבר" + destroy: + success: "אתם כעת חברים." + error: "נא לבחור אספקט!" + ignore: "התעלמת מבקשת חברות." + create: + error: "לא נמצא זרע דיאספורה עם אימייל זה!" + already_friends: "את/ה כבר חבר של %{destination_url}!" + success: "בקשת חברות נשלחה ל%{destination_url}." + horribly_wrong: "משהו רע מאוד קרה." From 0b19b77b5fe692b978f0fffbc3e886caea82645e Mon Sep 17 00:00:00 2001 From: Uiri Date: Sat, 25 Sep 2010 17:34:13 -0400 Subject: [PATCH 087/155] A fix for the image breaking if you don't change anything on the edit profile page but hit update profile instead of cancel --- app/controllers/users_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 819a88d28..30555d20a 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -31,7 +31,7 @@ class UsersController < ApplicationController params[:profile].delete(:image_url) else url = APP_CONFIG[:pod_url].chop if APP_CONFIG[:pod_url][-1,1] == '/' - params[:profile][:image_url] = url + params[:profile][:image_url] + params[:profile][:image_url] = params[:profile][:image_url] end end From ceb4f71714091ddfd31db4c7b79dd4285c1bb401 Mon Sep 17 00:00:00 2001 From: Uiri Date: Sat, 25 Sep 2010 18:35:28 -0400 Subject: [PATCH 088/155] Don't want my personal changes to be pulled into the master with my pull request --- script/server | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/server b/script/server index f1e5b7ec5..3804ccad9 100755 --- a/script/server +++ b/script/server @@ -8,6 +8,6 @@ then else mkdir -p -v log/thin/ bundle exec ruby ./script/websocket_server.rb& - bundle exec thin -p 80 -a 192.168.0.191 start $@ + bundle exec thin start $@ fi From 28e925e40a310d89af6934002669fe663100714c Mon Sep 17 00:00:00 2001 From: koo5 Date: Sat, 25 Sep 2010 07:44:05 +0200 Subject: [PATCH 089/155] More czech translation goodness. I've added distance_in_words translations, feel free to delete it if it belongs somewhere/sometime else. --- config/locales/diaspora/cs.yml | 208 +++++++++++++++++++++++++++++++++ 1 file changed, 208 insertions(+) diff --git a/config/locales/diaspora/cs.yml b/config/locales/diaspora/cs.yml index 91c904dc1..e943eab16 100644 --- a/config/locales/diaspora/cs.yml +++ b/config/locales/diaspora/cs.yml @@ -8,3 +8,211 @@ cs: hello: "Dobrý Den" + application: + helper: + unknown_person: "neznámá osoba" + new_requests: "nové žádosti" + dashboards: + helper: + home: "domů" + datetime: + distance_in_words: + less_than_x_seconds: "méně než %{count} sekund" + half_a_minute: "půl minuty" + less_than_x_minutes: "méně než %{count} minut" + x_minutes: "%{count} minuty" + about_x_hours: "zhruba %{count} hodin" + x_days: "%{count} dní" + about_x_months: "zhruba %{count} měsíců" + x_months: "%{count} měsíců" + about_x_years: "zhruba %{count} let" + over_x_years: "přez %{count} let" + almost_x_years: "skoro %{count} let" + error_messages: + helper: + invalid_fields: "Neplatná pole" + correct_the_following_errors_and_try_again: "Opravte následující chyby a zkuste to znovu." + people: + helper: + results_for: " vysledky vyhledávání %{params}" + people_on_pod_are_aware_of: " people on pod are aware of" + layouts: + application: + edit_profile: "upravit profil" + logout: "odhlásit se" + shared: + aspect_nav: + all_aspects: "Všechny aspekty" + manage: "Spravovat" + manage_your_aspects: "Spravovat vaše aspekty" + sub_header: + all_aspects: "Všechny aspekty" + manage_aspects: "Spravovat aspekty" + publisher: + share: "Sdělit" + aspect_friends: + add_friends: "přidat přátele" + albums: + album: + you: "vy" + new_album: + create: "vytvořit" + add_a_new_album: "Přidat nové album" + show: + edit_album: "Upravit album" + albums: "alba" + updated: "aktualizované" + by: "uživatelem" + edit: + editing: "Upravuje se" + updated: "aktualizováno" + are_you_sure: "Jste si jisti?" + delete_album: "Smazat Album" + cancel: "Zrušit" + index: + home: "doma" + new_album: "Nové Album" + create: + success: "Vytvořili jste nové album nazvané %{name}." + update: + success: "Album %{name} úspěšně upraveno." + failure: "Nepodařilo se upravit album %{name}." + destroy: + success: "Album %{name} smazáno." + helper: + friends_albums: "Alba přátel" + your_albums: "Vaše Alba" + aspects: + index: + photos: "fotografie" + show: + photos: "fotografie" + manage: + add_a_new_aspect: "Přidat aspekt" + add_a_new_friend: "Přidat nového přítele" + show: "Show" + update_aspects: "Aktualizovat aspekty" + requests: "Žádosti" + ignore_remove: "Ignorovat/Odebrat" + new_aspect: + add_a_new_aspect: "Přidat nový aspekt" + create: "Vytvořit" + create: + success: "Řekněte Diaspoře kdo může vidět váš nový aspekt kliknutím na plus na levé straně." + destroy: + success: "%{name} byl úspěšně odebrán." + update: + success: "Váš aspekt, %{name}, byl úspěšně upraven." + move_friends: + failure: "Úprava aspektu přítelem %{real_name} selhala." + success: "Aspekty úspěšně upraveny." + move_friend: + failure: "nepodařilo se %{inspect}" + success: "Nyní svému příteli ukazujete jiný ze svých aspektů." + helper: + remove: "odebrat" + aspect_not_empty: "Aspekt není prázdný" + users: + edit: + cancel: "Zrušit" + update_profile: "Aktualizovat profil" + home: "Domů" + diaspora_username: "UŽIVATELSKÉ JMÉNO V DIASPOŘE" + info: "Info" + picture: "Obrázek" + editing_profile: "Upravit profil" + albums: "Alba" + you_dont_have_any_photos: "Nemáte žádné fotky. Jděte na stránku" + page_to_upload_some: "a nějaké nahrajte." + comments: + comment: + ago: "nazpět" + new_comment: + comment: "Komentář" + photos: + show: + prev: "předchozí" + full_size: "plná velkost" + next: "další" + edit_photo: "Upravit fotku" + delete_photo: "Smazat fotku" + are_you_sure: "Jste si jisti?" + comments: "komentáře" + edit: + editing: "Uprait" + are_you_sure: "Jste si jisti?" + delete_photo: "Smazat fotku" + photo: + show_comments: "zobrazit komentáře" + posted_a_new_photo_to: "poslal novou fotku do" + new: + new_photo: "Nová fotka" + back_to_list: "Zpět na seznam" + post_it: "poslat!" + create: + runtime_error: "Poslání fotky selhalo. Jste si jisti, že máte zapnuté pásy?" + integrity_error: "Poslání fotky selhalo. Jste si jisti že to byl obrázek?" + type_error: "Poslání fotky selhalo. Jste si jisti zě byl přidán obrázek?" + update: + notice: "Fotka úspěšně aktualizována." + error: "Nepodařilo se upravit fotku." + destroy: + notice: "Fotka smazána." + registrations: + new: + sign_up: "Zapsat se" + create: + success: "Připojili jste se k Diaspoře!" + status_messages: + new_status_message: + tell_me_something_good: "pověz mi něco dobrého" + oh_yeah: "ó ano!" + status_message: + show_comments: "zobrazit komentáře" + delete: "Smazat" + are_you_sure: "Jste si jisti?" + show: + status_message: "Zpráva o stavu" + comments: "komentáře" + are_you_sure: "Jste si jisti?" + destroy: "Zničit" + view_all: "Zobrazit Vše" + message: "Zpráva" + owner: "Vlastník" + helper: + no_message_to_display: "Není k zobrazení žádná zpráva." + people: + person: + add_friend: "přidat přítele" + pending_request: "nevyřízené žádosti" + index: + add_friend: "přidat přítele" + real_name: "pravé jméno" + diaspora_handle: "adresa v diaspoře" + thats_you: "to jste vy!" + friend_request_pending: "nevyřízená žádost o přátelství" + you_have_a_friend_request_from_this_person: "od této osoby máte žádost o přátelství" + new: + new_person: "Nová Osoba" + back_to_list: "Zpět na Seznam" + show: + last_seen: "naposledy viděni: %{how_long_ago}" + friends_since: "přáteli od: %{how_long_ago}" + save: "save" + are_you_sure: "Jste si jisti?" + remove_friend: "odebrat přítele" + requests: + new_request: + add_a_new_friend_to: "Pridat nového přítele do" + enter_a_diaspora_username: "Vložte uživatelské jméno v diaspoře:" + your_diaspora_username_is: "Vaše uživatelské jméno v diaspoře je: %{diaspora_handle}" + friends_username: "Uživatelské jméno přítele" + destroy: + success: "Nyní jste přáteli." + error: "Prosím vyberte aspekt!" + ignore: "Ignorovat žádost o přátelství." + create: + error: "Semínko diaspory s touto adresou nenalezeno!" + already_friends: "S %{destination_url} už jste přáteli!" + success: "byla poslána žádost o přátelství na %{destination_url}" + horribly_wrong: "Něco se ošklivě pokazilo." From 64e1912c37b955a2d72955e16881dc21ceb9fcaf Mon Sep 17 00:00:00 2001 From: Sarah Mei Date: Sun, 26 Sep 2010 00:40:40 -0700 Subject: [PATCH 090/155] Disabled image resizing in specs => 15% faster test suite. FTW --- spec/spec_helper.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index fad7dfc5a..4149200d8 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -41,6 +41,9 @@ RSpec.configure do |config| DatabaseCleaner.clean end end + +ImageUploader.enable_processing = false + def stub_sockets Diaspora::WebSocket.stub!(:queue_to_user).and_return(true) Diaspora::WebSocket.stub!(:subscribe).and_return(true) From 294da214f73ccd6aa211f58a2df553cc7c4107a3 Mon Sep 17 00:00:00 2001 From: Stephen Caudill Date: Sat, 25 Sep 2010 13:26:26 -0400 Subject: [PATCH 091/155] Make ruby-debug available in test env --- Gemfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index cf863eb43..1525b735a 100644 --- a/Gemfile +++ b/Gemfile @@ -39,11 +39,12 @@ gem 'mini_magick' group :test, :development do gem 'factory_girl_rails' + gem 'ruby-debug' end group :test do - gem 'rspec', '>= 2.0.0.beta.17' - gem 'rspec-rails', '2.0.0.beta.17' + gem 'rspec', '>= 2.0.0.beta.17' + gem 'rspec-rails', '2.0.0.beta.17' gem 'mocha' gem 'webrat', '0.7.2.beta.1' gem 'autotest' From af938fe74fa4175ba65b27c7f9dc8d9b90bad99a Mon Sep 17 00:00:00 2001 From: Stephen Caudill Date: Sat, 25 Sep 2010 13:29:08 -0400 Subject: [PATCH 092/155] Remove unused/broken Selenium tests --- Gemfile | 4 +-- Gemfile.lock | 20 ++++------- lib/tasks/saucelabs_adapter.rake | 59 ------------------------------- test/performance/browsing_test.rb | 13 ------- test/selenium/login_test.rb | 11 ------ test/selenium/selenium_suite.rb | 15 -------- test/test_helper.rb | 17 --------- 7 files changed, 8 insertions(+), 131 deletions(-) delete mode 100644 lib/tasks/saucelabs_adapter.rake delete mode 100644 test/performance/browsing_test.rb delete mode 100644 test/selenium/login_test.rb delete mode 100644 test/selenium/selenium_suite.rb delete mode 100644 test/test_helper.rb diff --git a/Gemfile b/Gemfile index 1525b735a..d58183d77 100644 --- a/Gemfile +++ b/Gemfile @@ -46,11 +46,9 @@ group :test do gem 'rspec', '>= 2.0.0.beta.17' gem 'rspec-rails', '2.0.0.beta.17' gem 'mocha' - gem 'webrat', '0.7.2.beta.1' + gem 'redgreen' gem 'autotest' gem 'database_cleaner' - gem 'saucelabs-adapter', '= 0.8.12' - gem 'selenium-rc' gem 'webmock' end diff --git a/Gemfile.lock b/Gemfile.lock index ac66e59c1..6aed3dd32 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -128,7 +128,7 @@ GEM highline (1.6.1) i18n (0.4.1) json (1.4.6) - lsof (0.3.0) + linecache (0.43) mail (2.2.6.1) activesupport (>= 2.3.6) mime-types @@ -189,15 +189,11 @@ GEM rspec-rails (2.0.0.beta.17) rspec (>= 2.0.0.beta.14) webrat (>= 0.7.0) - saucelabs-adapter (0.8.12) - lsof (>= 0.3.0) - net-ssh (>= 2.0.12) - net-ssh-gateway (>= 1.0.1) - rest-client (>= 1.2.0) - selenium-client (>= 1.2.17) - selenium-client (1.2.18) - selenium-rc (2.2.4) - selenium-client (>= 1.2.18) + ruby-debug (0.10.3) + columnize (>= 0.1) + ruby-debug-base (~> 0.10.3.0) + ruby-debug-base (0.10.3) + linecache (>= 0.3) subexec (0.0.4) thin (1.2.7) daemons (>= 1.0.9) @@ -247,10 +243,8 @@ DEPENDENCIES roxml! rspec (>= 2.0.0.beta.17) rspec-rails (= 2.0.0.beta.17) - saucelabs-adapter (= 0.8.12) - selenium-rc + ruby-debug sprinkle! thin webmock - webrat (= 0.7.2.beta.1) will_paginate (= 3.0.pre2) diff --git a/lib/tasks/saucelabs_adapter.rake b/lib/tasks/saucelabs_adapter.rake deleted file mode 100644 index 76f6cbbc4..000000000 --- a/lib/tasks/saucelabs_adapter.rake +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright (c) 2010, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - - - -require 'saucelabs_adapter/run_utils' - -class Rake::Task - def self.exists?(name) - tasks.any? { |t| t.name == name } - end -end - -namespace :selenium do - - # Rake tasks are cumulative, and some old plugins are still defining selenium:server, so clear it. - Rake::Task[:'selenium:server'].clear_actions if Rake::Task.exists?('selenium:server') - - desc "Run the selenium remote-control server" - task :server do - system('bundle exec selenium-rc') - end - - desc "Run the selenium remote-control server in the background" - task :server_bg do - system('nohup selenium-rc 2&>1 &') - end - - desc "Runs Selenium tests locally (selenium server must already be started)" - task :local => [:local_env, :suite] - - desc "Run Selenium tests at saucelabs.com (using configuration 'saucelabs' in config/selenium.yml)" - task :sauce => [:sauce_env, :suite] - - desc "Run Selenium tests using configuration SELENIUM_ENV (from config/selenium.yml)" - task :custom => [:check_selenium_env_is_set, :suite] - - task :local_env do - ENV['SELENIUM_ENV'] = 'local' - end - - task :sauce_env do - ENV['SELENIUM_ENV'] = 'saucelabs' - end - - task :check_selenium_env_is_set do - raise "SELENIUM_ENV must be set" unless ENV['SELENIUM_ENV'] - end - - task :suite do - if (File.exists?("test/selenium/selenium_suite.rb")) - RunUtils.run "ruby test/selenium/selenium_suite.rb" - else - puts "test/selenium/selenium_suite.rb not found, bailing.\nPlease create a script that will run your selenium tests." - exit 1 - end - end -end diff --git a/test/performance/browsing_test.rb b/test/performance/browsing_test.rb deleted file mode 100644 index 9cc248c9f..000000000 --- a/test/performance/browsing_test.rb +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright (c) 2010, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - -require 'test_helper' -require 'rails/performance_test_help' - -# Profiling results for each test method are written to tmp/performance. -class BrowsingTest < ActionDispatch::PerformanceTest - def test_homepage - get '/' - end -end diff --git a/test/selenium/login_test.rb b/test/selenium/login_test.rb deleted file mode 100644 index b60d2db8c..000000000 --- a/test/selenium/login_test.rb +++ /dev/null @@ -1,11 +0,0 @@ -# Copyright (c) 2010, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - -class SampleWebratTest < ActionController::IntegrationTest - - def test_widget - visit "/" - assert_contain "sign in" - end -end diff --git a/test/selenium/selenium_suite.rb b/test/selenium/selenium_suite.rb deleted file mode 100644 index 7f4df5e4c..000000000 --- a/test/selenium/selenium_suite.rb +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright (c) 2010, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - -require File.expand_path(File.join(File.dirname(__FILE__), '..', 'test_helper')) -require 'test/unit/ui/console/testrunner' -require 'webrat' -require 'saucelabs_adapter' - -Webrat.configure do |config| - config.mode = :selenium - config.application_framework = :rack -end - -require File.join(File.dirname(__FILE__), 'sample_webrat_test') diff --git a/test/test_helper.rb b/test/test_helper.rb deleted file mode 100644 index e46a0a70c..000000000 --- a/test/test_helper.rb +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (c) 2010, Diaspora Inc. This file is -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - -ENV["RAILS_ENV"] = "test" -require File.expand_path('../../config/environment', __FILE__) -require 'rails/test_help' - -class ActiveSupport::TestCase - # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order. - # - # Note: You'll currently still have to declare fixtures explicitly in integration tests - # -- they do not yet inherit this setting - #fixtures :all - - # Add more helper methods to be used by all tests here... -end From 05c2da81e5785703dfb2609c8d914726ef205857 Mon Sep 17 00:00:00 2001 From: Stephen Caudill Date: Sat, 25 Sep 2010 13:44:20 -0400 Subject: [PATCH 093/155] Add cucumber and run the generator --- Gemfile | 2 + Gemfile.lock | 35 ++++ config/cucumber.yml | 8 + features/step_definitions/web_steps.rb | 219 +++++++++++++++++++++++++ features/support/env.rb | 44 +++++ features/support/paths.rb | 33 ++++ lib/tasks/cucumber.rake | 53 ++++++ script/cucumber | 10 ++ 8 files changed, 404 insertions(+) create mode 100644 config/cucumber.yml create mode 100644 features/step_definitions/web_steps.rb create mode 100644 features/support/env.rb create mode 100644 features/support/paths.rb create mode 100644 lib/tasks/cucumber.rake create mode 100755 script/cucumber diff --git a/Gemfile b/Gemfile index d58183d77..419f75094 100644 --- a/Gemfile +++ b/Gemfile @@ -43,6 +43,8 @@ group :test, :development do end group :test do + gem 'capybara', '~> 0.3.9' + gem 'cucumber-rails', '0.3.2' gem 'rspec', '>= 2.0.0.beta.17' gem 'rspec-rails', '2.0.0.beta.17' gem 'mocha' diff --git a/Gemfile.lock b/Gemfile.lock index 6aed3dd32..a56760270 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -109,7 +109,24 @@ GEM net-sftp (>= 2.0.0) net-ssh (>= 2.0.14) net-ssh-gateway (>= 1.0.0) + capybara (0.3.9) + culerity (>= 0.2.4) + mime-types (>= 1.16) + nokogiri (>= 1.3.3) + rack (>= 1.0.0) + rack-test (>= 0.5.4) + selenium-webdriver (>= 0.0.3) + columnize (0.3.1) crack (0.1.8) + cucumber (0.9.0) + builder (~> 2.1.2) + diff-lcs (~> 1.1.2) + gherkin (~> 2.2.2) + json (~> 1.4.6) + term-ansicolor (~> 1.0.5) + cucumber-rails (0.3.2) + cucumber (>= 0.8.0) + culerity (0.2.12) daemons (1.1.0) database_cleaner (0.5.2) diff-lcs (1.1.2) @@ -123,11 +140,18 @@ GEM factory_girl_rails (1.0) factory_girl (~> 1.3) rails (>= 3.0.0.beta4) + ffi (0.6.3) + rake (>= 0.8.7) + gherkin (2.2.4) + json (~> 1.4.6) + term-ansicolor (~> 1.0.5) + trollop (~> 1.16.2) haml (3.0.18) hashie (0.4.0) highline (1.6.1) i18n (0.4.1) json (1.4.6) + json_pure (1.4.6) linecache (0.43) mail (2.2.6.1) activesupport (>= 2.3.6) @@ -174,6 +198,7 @@ GEM rake (>= 0.8.4) thor (~> 0.14.0) rake (0.8.7) + redgreen (1.2.2) rest-client (1.6.1) mime-types (>= 1.16) rspec (2.0.0.beta.22) @@ -194,7 +219,13 @@ GEM ruby-debug-base (~> 0.10.3.0) ruby-debug-base (0.10.3) linecache (>= 0.3) + rubyzip (0.9.4) + selenium-webdriver (0.0.28) + ffi (>= 0.6.1) + json_pure + rubyzip subexec (0.0.4) + term-ansicolor (1.0.5) thin (1.2.7) daemons (>= 1.0.9) eventmachine (>= 0.12.6) @@ -202,6 +233,7 @@ GEM thor (0.14.0) treetop (1.4.8) polyglot (>= 0.3.1) + trollop (1.16.2) tzinfo (0.3.23) uuidtools (2.1.1) warden (0.10.7) @@ -224,7 +256,9 @@ DEPENDENCIES bson (= 1.0.7) bson_ext (= 1.0.7) bundler (= 1.0.0) + capybara (~> 0.3.9) carrierwave! + cucumber-rails (= 0.3.2) database_cleaner devise! em-http-request! @@ -240,6 +274,7 @@ DEPENDENCIES pubsubhubbub rails (= 3.0.0) redfinger! + redgreen roxml! rspec (>= 2.0.0.beta.17) rspec-rails (= 2.0.0.beta.17) diff --git a/config/cucumber.yml b/config/cucumber.yml new file mode 100644 index 000000000..621a14cea --- /dev/null +++ b/config/cucumber.yml @@ -0,0 +1,8 @@ +<% +rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : "" +rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}" +std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} --strict --tags ~@wip" +%> +default: <%= std_opts %> features +wip: --tags @wip:3 --wip features +rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip diff --git a/features/step_definitions/web_steps.rb b/features/step_definitions/web_steps.rb new file mode 100644 index 000000000..0f0af8aa2 --- /dev/null +++ b/features/step_definitions/web_steps.rb @@ -0,0 +1,219 @@ +# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril. +# It is recommended to regenerate this file in the future when you upgrade to a +# newer version of cucumber-rails. Consider adding your own code to a new file +# instead of editing this one. Cucumber will automatically load all features/**/*.rb +# files. + + +require 'uri' +require 'cgi' +require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "paths")) + +module WithinHelpers + def with_scope(locator) + locator ? within(locator) { yield } : yield + end +end +World(WithinHelpers) + +Given /^(?:|I )am on (.+)$/ do |page_name| + visit path_to(page_name) +end + +When /^(?:|I )go to (.+)$/ do |page_name| + visit path_to(page_name) +end + +When /^(?:|I )press "([^"]*)"(?: within "([^"]*)")?$/ do |button, selector| + with_scope(selector) do + click_button(button) + end +end + +When /^(?:|I )follow "([^"]*)"(?: within "([^"]*)")?$/ do |link, selector| + with_scope(selector) do + click_link(link) + end +end + +When /^(?:|I )fill in "([^"]*)" with "([^"]*)"(?: within "([^"]*)")?$/ do |field, value, selector| + with_scope(selector) do + fill_in(field, :with => value) + end +end + +When /^(?:|I )fill in "([^"]*)" for "([^"]*)"(?: within "([^"]*)")?$/ do |value, field, selector| + with_scope(selector) do + fill_in(field, :with => value) + end +end + +# Use this to fill in an entire form with data from a table. Example: +# +# When I fill in the following: +# | Account Number | 5002 | +# | Expiry date | 2009-11-01 | +# | Note | Nice guy | +# | Wants Email? | | +# +# TODO: Add support for checkbox, select og option +# based on naming conventions. +# +When /^(?:|I )fill in the following(?: within "([^"]*)")?:$/ do |selector, fields| + with_scope(selector) do + fields.rows_hash.each do |name, value| + When %{I fill in "#{name}" with "#{value}"} + end + end +end + +When /^(?:|I )select "([^"]*)" from "([^"]*)"(?: within "([^"]*)")?$/ do |value, field, selector| + with_scope(selector) do + select(value, :from => field) + end +end + +When /^(?:|I )check "([^"]*)"(?: within "([^"]*)")?$/ do |field, selector| + with_scope(selector) do + check(field) + end +end + +When /^(?:|I )uncheck "([^"]*)"(?: within "([^"]*)")?$/ do |field, selector| + with_scope(selector) do + uncheck(field) + end +end + +When /^(?:|I )choose "([^"]*)"(?: within "([^"]*)")?$/ do |field, selector| + with_scope(selector) do + choose(field) + end +end + +When /^(?:|I )attach the file "([^"]*)" to "([^"]*)"(?: within "([^"]*)")?$/ do |path, field, selector| + with_scope(selector) do + attach_file(field, path) + end +end + +Then /^(?:|I )should see JSON:$/ do |expected_json| + require 'json' + expected = JSON.pretty_generate(JSON.parse(expected_json)) + actual = JSON.pretty_generate(JSON.parse(response.body)) + expected.should == actual +end + +Then /^(?:|I )should see "([^"]*)"(?: within "([^"]*)")?$/ do |text, selector| + with_scope(selector) do + if page.respond_to? :should + page.should have_content(text) + else + assert page.has_content?(text) + end + end +end + +Then /^(?:|I )should see \/([^\/]*)\/(?: within "([^"]*)")?$/ do |regexp, selector| + regexp = Regexp.new(regexp) + with_scope(selector) do + if page.respond_to? :should + page.should have_xpath('//*', :text => regexp) + else + assert page.has_xpath?('//*', :text => regexp) + end + end +end + +Then /^(?:|I )should not see "([^"]*)"(?: within "([^"]*)")?$/ do |text, selector| + with_scope(selector) do + if page.respond_to? :should + page.should have_no_content(text) + else + assert page.has_no_content?(text) + end + end +end + +Then /^(?:|I )should not see \/([^\/]*)\/(?: within "([^"]*)")?$/ do |regexp, selector| + regexp = Regexp.new(regexp) + with_scope(selector) do + if page.respond_to? :should + page.should have_no_xpath('//*', :text => regexp) + else + assert page.has_no_xpath?('//*', :text => regexp) + end + end +end + +Then /^the "([^"]*)" field(?: within "([^"]*)")? should contain "([^"]*)"$/ do |field, selector, value| + with_scope(selector) do + field = find_field(field) + field_value = (field.tag_name == 'textarea') ? field.text : field.value + if field_value.respond_to? :should + field_value.should =~ /#{value}/ + else + assert_match(/#{value}/, field_value) + end + end +end + +Then /^the "([^"]*)" field(?: within "([^"]*)")? should not contain "([^"]*)"$/ do |field, selector, value| + with_scope(selector) do + field = find_field(field) + field_value = (field.tag_name == 'textarea') ? field.text : field.value + if field_value.respond_to? :should_not + field_value.should_not =~ /#{value}/ + else + assert_no_match(/#{value}/, field_value) + end + end +end + +Then /^the "([^"]*)" checkbox(?: within "([^"]*)")? should be checked$/ do |label, selector| + with_scope(selector) do + field_checked = find_field(label)['checked'] + if field_checked.respond_to? :should + field_checked.should be_true + else + assert field_checked + end + end +end + +Then /^the "([^"]*)" checkbox(?: within "([^"]*)")? should not be checked$/ do |label, selector| + with_scope(selector) do + field_checked = find_field(label)['checked'] + if field_checked.respond_to? :should + field_checked.should be_false + else + assert !field_checked + end + end +end + +Then /^(?:|I )should be on (.+)$/ do |page_name| + current_path = URI.parse(current_url).path + if current_path.respond_to? :should + current_path.should == path_to(page_name) + else + assert_equal path_to(page_name), current_path + end +end + +Then /^(?:|I )should have the following query string:$/ do |expected_pairs| + query = URI.parse(current_url).query + actual_params = query ? CGI.parse(query) : {} + expected_params = {} + expected_pairs.rows_hash.each_pair{|k,v| expected_params[k] = v.split(',')} + + if actual_params.respond_to? :should + actual_params.should == expected_params + else + assert_equal expected_params, actual_params + end +end + +Then /^show me the page$/ do + save_and_open_page +end diff --git a/features/support/env.rb b/features/support/env.rb new file mode 100644 index 000000000..fa71d7577 --- /dev/null +++ b/features/support/env.rb @@ -0,0 +1,44 @@ +# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril. +# It is recommended to regenerate this file in the future when you upgrade to a +# newer version of cucumber-rails. Consider adding your own code to a new file +# instead of editing this one. Cucumber will automatically load all features/**/*.rb +# files. + +ENV["RAILS_ENV"] ||= "test" +require File.expand_path(File.dirname(__FILE__) + '/../../config/environment') + +require 'cucumber/formatter/unicode' # Remove this line if you don't want Cucumber Unicode support +require 'cucumber/rails/rspec' +require 'cucumber/rails/world' +require 'cucumber/web/tableish' + +require 'capybara/rails' +require 'capybara/cucumber' +require 'capybara/session' +require 'cucumber/rails/capybara_javascript_emulation' # Lets you click links with onclick javascript handlers without using @culerity or @javascript +# Capybara defaults to XPath selectors rather than Webrat's default of CSS3. In +# order to ease the transition to Capybara we set the default here. If you'd +# prefer to use XPath just remove this line and adjust any selectors in your +# steps to use the XPath syntax. +Capybara.default_selector = :css + +# If you set this to false, any error raised from within your app will bubble +# up to your step definition and out to cucumber unless you catch it somewhere +# on the way. You can make Rails rescue errors and render error pages on a +# per-scenario basis by tagging a scenario or feature with the @allow-rescue tag. +# +# If you set this to true, Rails will rescue all errors and render error +# pages, more or less in the same way your application would behave in the +# default production environment. It's not recommended to do this for all +# of your scenarios, as this makes it hard to discover errors in your application. +ActionController::Base.allow_rescue = false + +# How to clean your database when transactions are turned off. See +# http://github.com/bmabey/database_cleaner for more info. +if defined?(ActiveRecord::Base) + begin + require 'database_cleaner' + DatabaseCleaner.strategy = :truncation + rescue LoadError => ignore_if_database_cleaner_not_present + end +end diff --git a/features/support/paths.rb b/features/support/paths.rb new file mode 100644 index 000000000..06b3efb0b --- /dev/null +++ b/features/support/paths.rb @@ -0,0 +1,33 @@ +module NavigationHelpers + # Maps a name to a path. Used by the + # + # When /^I go to (.+)$/ do |page_name| + # + # step definition in web_steps.rb + # + def path_to(page_name) + case page_name + + when /the home\s?page/ + '/' + + # Add more mappings here. + # Here is an example that pulls values out of the Regexp: + # + # when /^(.*)'s profile page$/i + # user_profile_path(User.find_by_login($1)) + + else + begin + page_name =~ /the (.*) page/ + path_components = $1.split(/\s+/) + self.send(path_components.push('path').join('_').to_sym) + rescue Object => e + raise "Can't find mapping from \"#{page_name}\" to a path.\n" + + "Now, go and add a mapping in #{__FILE__}" + end + end + end +end + +World(NavigationHelpers) diff --git a/lib/tasks/cucumber.rake b/lib/tasks/cucumber.rake new file mode 100644 index 000000000..7db1a5570 --- /dev/null +++ b/lib/tasks/cucumber.rake @@ -0,0 +1,53 @@ +# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril. +# It is recommended to regenerate this file in the future when you upgrade to a +# newer version of cucumber-rails. Consider adding your own code to a new file +# instead of editing this one. Cucumber will automatically load all features/**/*.rb +# files. + + +unless ARGV.any? {|a| a =~ /^gems/} # Don't load anything when running the gems:* tasks + +vendored_cucumber_bin = Dir["#{Rails.root}/vendor/{gems,plugins}/cucumber*/bin/cucumber"].first +$LOAD_PATH.unshift(File.dirname(vendored_cucumber_bin) + '/../lib') unless vendored_cucumber_bin.nil? + +begin + require 'cucumber/rake/task' + + namespace :cucumber do + Cucumber::Rake::Task.new({:ok => 'db:test:prepare'}, 'Run features that should pass') do |t| + t.binary = vendored_cucumber_bin # If nil, the gem's binary is used. + t.fork = true # You may get faster startup if you set this to false + t.profile = 'default' + end + + Cucumber::Rake::Task.new({:wip => 'db:test:prepare'}, 'Run features that are being worked on') do |t| + t.binary = vendored_cucumber_bin + t.fork = true # You may get faster startup if you set this to false + t.profile = 'wip' + end + + Cucumber::Rake::Task.new({:rerun => 'db:test:prepare'}, 'Record failing features and run only them if any exist') do |t| + t.binary = vendored_cucumber_bin + t.fork = true # You may get faster startup if you set this to false + t.profile = 'rerun' + end + + desc 'Run all features' + task :all => [:ok, :wip] + end + desc 'Alias for cucumber:ok' + task :cucumber => 'cucumber:ok' + + task :default => :cucumber + + task :features => :cucumber do + STDERR.puts "*** The 'features' task is deprecated. See rake -T cucumber ***" + end +rescue LoadError + desc 'cucumber rake task not available (cucumber not installed)' + task :cucumber do + abort 'Cucumber rake task is not available. Be sure to install cucumber as a gem or plugin' + end +end + +end diff --git a/script/cucumber b/script/cucumber new file mode 100755 index 000000000..7fa5c9208 --- /dev/null +++ b/script/cucumber @@ -0,0 +1,10 @@ +#!/usr/bin/env ruby + +vendored_cucumber_bin = Dir["#{File.dirname(__FILE__)}/../vendor/{gems,plugins}/cucumber*/bin/cucumber"].first +if vendored_cucumber_bin + load File.expand_path(vendored_cucumber_bin) +else + require 'rubygems' unless ENV['NO_RUBYGEMS'] + require 'cucumber' + load Cucumber::BINARY +end From 8a93c67166bd30bcab61349b748a9c83b81a6ff6 Mon Sep 17 00:00:00 2001 From: Stephen Caudill Date: Sat, 25 Sep 2010 15:20:08 -0400 Subject: [PATCH 094/155] Add the Hashrocket default step definitions Tweaked for mongomapper and diaspora --- features/step_definitions/debug_steps.rb | 4 ++ features/step_definitions/factory_steps.rb | 68 ++++++++++++++++++++++ features/step_definitions/scope_steps.rb | 30 ++++++++++ features/step_definitions/session_steps.rb | 26 +++++++++ features/support/paths.rb | 31 +++------- 5 files changed, 135 insertions(+), 24 deletions(-) create mode 100644 features/step_definitions/debug_steps.rb create mode 100644 features/step_definitions/factory_steps.rb create mode 100644 features/step_definitions/scope_steps.rb create mode 100644 features/step_definitions/session_steps.rb diff --git a/features/step_definitions/debug_steps.rb b/features/step_definitions/debug_steps.rb new file mode 100644 index 000000000..c56973edf --- /dev/null +++ b/features/step_definitions/debug_steps.rb @@ -0,0 +1,4 @@ +When 'I debug' do + debugger + true +end diff --git a/features/step_definitions/factory_steps.rb b/features/step_definitions/factory_steps.rb new file mode 100644 index 000000000..cf1495e99 --- /dev/null +++ b/features/step_definitions/factory_steps.rb @@ -0,0 +1,68 @@ +module FactoryMethods + def create_from_table(model_name, table, extra = {}) + factory_name = model_name.gsub(/\W+/, '_').downcase.singularize.to_sym + is_singular = model_name.to_s.singularize == model_name.to_s + hashes = if is_singular + if table.kind_of?(Hash) + [table] + else + [table.rows_hash] + end + else + table.hashes + end + klass = Factory.factories[factory_name].class_name.to_s.classify.constantize + @they = hashes.map do |hash| + hash = hash.merge(extra).inject({}) do |h,(k,v)| + k = k.gsub(/\W+/,'_') + v = v.split(/\s*,\s*/) if klass.serialized_attributes[k] == Array + h.update(k.to_sym => v) + end + object = Factory.build(factory_name, hash) + yield object if block_given? + object.save! + object + end + if is_singular + @it = @they.last + instance_variable_set("@#{factory_name}", @it) + end + end +end + +World(FactoryMethods) + +Given %r{^I have a (.+)$} do |model_name| + create_from_table(model_name, {}, 'user' => @me) +end + +Given %r{^I have the following (.+):$} do |child, table| + Given "that me has the following #{child}:", table +end + +Given %r{^the following (.+):$} do |model_name, table| + create_from_table(model_name, table) +end + +Given %r{^that (.+) has the following (.+):$} do |parent, child, table| + child= child.gsub(/\W+/,'_') + parent = parent.gsub(/\W+/,'_').downcase.sub(/^_/, '') + parent_instance = instance_variable_get("@#{parent}") + parent_class = parent_instance.class + if assoc = parent_class.reflect_on_association(child.to_sym) || parent_class.reflect_on_association(child.pluralize.to_sym) + parent = (assoc.options[:as] || parent).to_s + child = (assoc.options[:class_name] || child).to_s + end + if child.classify.constantize.method_defined?(parent.pluralize) + create_from_table(child, table, parent.pluralize => [parent_instance]) + elsif child.classify.constantize.method_defined?(parent) + create_from_table(child, table, parent => parent_instance) + else + create_from_table(child, table) + if assoc.macro == :has_many + parent_instance.send("#{assoc.name}=", @they) + else + parent_instance.send("#{assoc.name}=", @they.first) + end + end +end diff --git a/features/step_definitions/scope_steps.rb b/features/step_definitions/scope_steps.rb new file mode 100644 index 000000000..cb39d33ad --- /dev/null +++ b/features/step_definitions/scope_steps.rb @@ -0,0 +1,30 @@ +module SectionLocator + + def within_parent(content, elements = ['*'], &block) + expr = %(//*[(#{elements.join('|')})/descendant-or-self::*[contains(., "#{content}")]]) + within(expr, &block) + end + +end + +World(SectionLocator) + +sections = %w(h1 h2 h3 h4 h5 h6 legend caption dt strong) + +When /^(.*) in the "([^\"]*)" section$/ do |action, title| + within_parent(title, sections) do + When action + end +end + +When /^(.*) in the "([^\"]*)" section:$/ do |action, title, table| + within_parent(title, sections) do + When "#{action}:", table + end +end + +When /^(.*) in the "([^\"]*)" row$/ do |action, title| + within_parent(title, %w(th td)) do + When action + end +end diff --git a/features/step_definitions/session_steps.rb b/features/step_definitions/session_steps.rb new file mode 100644 index 000000000..abc9e87df --- /dev/null +++ b/features/step_definitions/session_steps.rb @@ -0,0 +1,26 @@ +Given /^I am signed in as the following (\w+):$/ do |role, table| + Given %(the following #{role}:), table + @me = @it + Given 'I am signed in' +end + +Given /^I (?:am signed|sign) in as an? (\w+)$/ do |role| + @me = Factory(role.to_sym) + Given 'I am signed in' +end + + +Given 'I am signed in' do + @me ||= Factory(:user) + When %(I go to the new user session page) + When %(I fill in "Username" with "#{@me.username}") + When %(I fill in "Password" with "#{@me.password}") + When %(I press "Sign in") +end + + +When /^I sign in as "([^"]*)"$/ do |email| + @me = User.find_by_email(email) + @me.password ||= 'password' + Given 'I am signed in' +end diff --git a/features/support/paths.rb b/features/support/paths.rb index 06b3efb0b..3d3f64724 100644 --- a/features/support/paths.rb +++ b/features/support/paths.rb @@ -1,31 +1,14 @@ module NavigationHelpers - # Maps a name to a path. Used by the - # - # When /^I go to (.+)$/ do |page_name| - # - # step definition in web_steps.rb - # def path_to(page_name) case page_name - - when /the home\s?page/ - '/' - - # Add more mappings here. - # Here is an example that pulls values out of the Regexp: - # - # when /^(.*)'s profile page$/i - # user_profile_path(User.find_by_login($1)) - + when /^its ([\w ]+) page$/ + send("#{$1.gsub(/\W+/, '_')}_path", @it) + when /^the ([\w ]+) page$/ + send("#{$1.gsub(/\W+/, '_')}_path") + when /^"(\/.*)"/ + $1 else - begin - page_name =~ /the (.*) page/ - path_components = $1.split(/\s+/) - self.send(path_components.push('path').join('_').to_sym) - rescue Object => e - raise "Can't find mapping from \"#{page_name}\" to a path.\n" + - "Now, go and add a mapping in #{__FILE__}" - end + raise "Can't find mapping from \"#{page_name}\" to a path." end end end From 9038d6b0ed6e05c48cb5b2af876dc6eda77c24aa Mon Sep 17 00:00:00 2001 From: Stephen Caudill Date: Sat, 25 Sep 2010 15:21:19 -0400 Subject: [PATCH 095/155] Allow connections to be passed through to Selenium --- features/support/env.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/features/support/env.rb b/features/support/env.rb index fa71d7577..4774a3d27 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -22,6 +22,8 @@ require 'cucumber/rails/capybara_javascript_emulation' # Lets you click links wi # steps to use the XPath syntax. Capybara.default_selector = :css +WebMock.disable_net_connect!(:allow_localhost => true) + # If you set this to false, any error raised from within your app will bubble # up to your step definition and out to cucumber unless you catch it somewhere # on the way. You can make Rails rescue errors and render error pages on a From 5f2d4ba07318866c6d95a2ad0cf69f030a0836e7 Mon Sep 17 00:00:00 2001 From: Stephen Caudill Date: Sat, 25 Sep 2010 15:22:10 -0400 Subject: [PATCH 096/155] Use the mongo_mapper and cucumber Cleaner strategy --- features/support/env.rb | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/features/support/env.rb b/features/support/env.rb index 4774a3d27..bcb1fdd00 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -37,10 +37,9 @@ ActionController::Base.allow_rescue = false # How to clean your database when transactions are turned off. See # http://github.com/bmabey/database_cleaner for more info. -if defined?(ActiveRecord::Base) - begin - require 'database_cleaner' - DatabaseCleaner.strategy = :truncation - rescue LoadError => ignore_if_database_cleaner_not_present - end +begin + require 'database_cleaner' + require 'database_cleaner/cucumber' + DatabaseCleaner.strategy = :truncation + DatabaseCleaner.orm = "mongo_mapper" end From 3e499c0f1b8a5fd97f607e7850223befb69d342c Mon Sep 17 00:00:00 2001 From: Stephen Caudill Date: Sat, 25 Sep 2010 21:29:42 -0400 Subject: [PATCH 097/155] Hack the rake tasks to run cucumber + rspec --- Rakefile | 1 + lib/tasks/cucumber.rake | 10 ++++++---- lib/tasks/rspec.rake | 3 --- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Rakefile b/Rakefile index c9b50786e..f00478e2e 100644 --- a/Rakefile +++ b/Rakefile @@ -10,4 +10,5 @@ require File.expand_path('../config/application', __FILE__) require 'rake' ENV['GNUPGHOME'] = File.expand_path("../../gpg/diaspora-#{Rails.env}/", __FILE__) + Diaspora::Application.load_tasks diff --git a/lib/tasks/cucumber.rake b/lib/tasks/cucumber.rake index 7db1a5570..15d405ad4 100644 --- a/lib/tasks/cucumber.rake +++ b/lib/tasks/cucumber.rake @@ -14,19 +14,19 @@ begin require 'cucumber/rake/task' namespace :cucumber do - Cucumber::Rake::Task.new({:ok => 'db:test:prepare'}, 'Run features that should pass') do |t| + Cucumber::Rake::Task.new(:ok, 'Run features that should pass') do |t| t.binary = vendored_cucumber_bin # If nil, the gem's binary is used. t.fork = true # You may get faster startup if you set this to false t.profile = 'default' end - Cucumber::Rake::Task.new({:wip => 'db:test:prepare'}, 'Run features that are being worked on') do |t| + Cucumber::Rake::Task.new(:wip, 'Run features that are being worked on') do |t| t.binary = vendored_cucumber_bin t.fork = true # You may get faster startup if you set this to false t.profile = 'wip' end - Cucumber::Rake::Task.new({:rerun => 'db:test:prepare'}, 'Record failing features and run only them if any exist') do |t| + Cucumber::Rake::Task.new(:rerun, 'Record failing features and run only them if any exist') do |t| t.binary = vendored_cucumber_bin t.fork = true # You may get faster startup if you set this to false t.profile = 'rerun' @@ -38,7 +38,9 @@ begin desc 'Alias for cucumber:ok' task :cucumber => 'cucumber:ok' - task :default => :cucumber + Rake.application.instance_variable_get('@tasks').delete('default') + + task :default => [:cucumber, :spec] task :features => :cucumber do STDERR.puts "*** The 'features' task is deprecated. See rake -T cucumber ***" diff --git a/lib/tasks/rspec.rake b/lib/tasks/rspec.rake index 85ae513f6..35f0b8a98 100644 --- a/lib/tasks/rspec.rake +++ b/lib/tasks/rspec.rake @@ -32,13 +32,10 @@ MSG end end -Rake.application.instance_variable_get('@tasks').delete('default') - spec_prereq = Rails.root.join('config', 'database.yml').exist? ? "db:test:prepare" : :noop task :noop do end -task :default => :spec task :stats => "spec:statsetup" desc "Run all specs in spec directory (excluding plugin specs)" From 151a57cc93f02e06b6d2b5f55e4acbd79ad69069 Mon Sep 17 00:00:00 2001 From: Uiri Date: Sun, 26 Sep 2010 11:47:34 -0400 Subject: [PATCH 098/155] well, that explains why it was adding the url variable. Fixed so that now new pictures work too. --- app/controllers/users_controller.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 7041066bd..13d97479c 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -26,11 +26,15 @@ class UsersController < ApplicationController private def prep_image_url(params) + url = APP_CONFIG[:pod_url].chop if APP_CONFIG[:pod_url][-1,1] == '/' if params[:profile][:image_url].empty? params[:profile].delete(:image_url) else - url = APP_CONFIG[:pod_url].chop if APP_CONFIG[:pod_url][-1,1] == '/' - params[:profile][:image_url] = params[:profile][:image_url] + if /^http:\/\// =~ params[:profile][:image_url] + params[:profile][:image_url] = params[:profile][:image_url] + else + params[:profile][:image_url] = url + params[:profile][:image_url] + end end end From fd69f0201f2c16bcd5aef212efc75ee5d61c1c04 Mon Sep 17 00:00:00 2001 From: Stephen Caudill Date: Sat, 25 Sep 2010 21:05:01 -0400 Subject: [PATCH 099/155] User creates an aspect --- app/controllers/aspects_controller.rb | 8 +++++-- config/locales/diaspora/en.yml | 1 + features/step_definitions/custom_web_steps.rb | 17 ++++++++++++++ features/step_definitions/scope_steps.rb | 2 +- features/user_creates_an_aspect.feature | 23 +++++++++++++++++++ 5 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 features/step_definitions/custom_web_steps.rb create mode 100644 features/user_creates_an_aspect.feature diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index ba9d3ffd9..9b0b5faa3 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -14,8 +14,12 @@ class AspectsController < ApplicationController end def create - @aspect = current_user.aspect params[:aspect] - flash[:notice] = I18n.t('aspects.create.success') + @aspect = current_user.aspect(params[:aspect]) + if @aspect.valid? + flash[:notice] = I18n.t('aspects.create.success') + else + flash[:notice] = I18n.t('aspects.create.failure') + end respond_with :location => aspects_manage_path end diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 8e6542639..a6a98c7cd 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -86,6 +86,7 @@ en: create: "Create" create: success: "Click on the plus on the left side to tell Diaspora who can see your new aspect." + failure: "Aspect creation failed." destroy: success: "%{name} was successfully removed." update: diff --git a/features/step_definitions/custom_web_steps.rb b/features/step_definitions/custom_web_steps.rb new file mode 100644 index 000000000..e3f8bc373 --- /dev/null +++ b/features/step_definitions/custom_web_steps.rb @@ -0,0 +1,17 @@ +When /^(.*) in the header$/ do |action| + within('header') do + When action + end +end + +When /^(.*) in the modal window$/ do |action| + within('#fancybox-wrap') do + When action + end +end + +When /^(.*) in the aspect list$/ do |action| + within('#aspect_list') do + When action + end +end diff --git a/features/step_definitions/scope_steps.rb b/features/step_definitions/scope_steps.rb index cb39d33ad..43fe2f48a 100644 --- a/features/step_definitions/scope_steps.rb +++ b/features/step_definitions/scope_steps.rb @@ -9,7 +9,7 @@ end World(SectionLocator) -sections = %w(h1 h2 h3 h4 h5 h6 legend caption dt strong) +sections = %w(h1 h2 h3 h4 h5 h6 legend caption dt strong header) When /^(.*) in the "([^\"]*)" section$/ do |action, title| within_parent(title, sections) do diff --git a/features/user_creates_an_aspect.feature b/features/user_creates_an_aspect.feature new file mode 100644 index 000000000..27cb6f2f3 --- /dev/null +++ b/features/user_creates_an_aspect.feature @@ -0,0 +1,23 @@ +@aspects @javascript +Feature: User creates an aspect + In order to share with a limited group + As a User + I want to create a new aspect + + Scenario: success + Given I am signed in + And I follow "Manage" in the header + And I follow "Add a new aspect" + When I fill in "Name" with "Dorm Mates" in the modal window + And I press "Create" in the modal window + Then I should see "Manage Aspects" + And I should see "Dorm Mates" in the header + And I should see "Dorm Mates" in the aspect list + + Scenario: I omit the name + Given I am signed in + And I follow "Manage" in the header + And I follow "Add a new aspect" + When I press "Create" in the modal window + Then I should see "Manage Aspects" + And I should see "Aspect creation failed." From 6ffc03a4c92fed1d533921269ab503d2d10ab45f Mon Sep 17 00:00:00 2001 From: Dorian Date: Sat, 25 Sep 2010 12:35:20 +0200 Subject: [PATCH 100/155] Big clean up: delete trailing whitespace --- COPYRIGHT | 6 +- app/controllers/aspects_controller.rb | 2 +- app/models/person.rb | 6 +- app/models/user.rb | 10 +-- app/views/albums/_album.html.haml | 2 +- app/views/aspects/index.html.haml | 2 +- app/views/aspects/manage.html.haml | 8 +- app/views/comments/_comment.html.haml | 2 +- app/views/comments/_comments.html.haml | 2 +- app/views/devise/sessions/new.html.haml | 4 +- app/views/js/_websocket_js.haml | 20 ++--- app/views/layouts/application.html.haml | 10 +-- app/views/layouts/session_wall.html.haml | 10 +-- app/views/people/index.html.haml | 2 +- app/views/people/new.html.haml | 4 +- app/views/people/show.html.haml | 2 +- app/views/photos/_new_photo.haml | 6 +- app/views/photos/_photo.haml | 4 +- app/views/photos/show.html.haml | 2 +- app/views/posts/_post.html.haml | 4 +- app/views/publics/hcard.erb | 80 +++++++++---------- app/views/publics/host_meta.erb | 4 +- app/views/requests/_new_request.haml | 2 +- app/views/shared/_aspect_friends.haml | 6 +- app/views/shared/_publisher.haml | 2 +- app/views/shared/_reshare.haml | 2 +- .../status_messages/_status_message.html.haml | 8 +- app/views/status_messages/index.html.haml | 2 +- app/views/users/edit.html.haml | 2 +- config/app_config.yml.example | 2 +- config/environments/production.rb | 2 +- config/initializers/_load_app_config.rb | 2 +- config/locales/devise/devise.cy.yml | 72 ++++++++--------- config/locales/devise/devise.fi.yml | 2 +- config/locales/devise/devise.sv.yml | 2 +- config/locales/diaspora/cy.yml | 2 +- config/locales/diaspora/de.yml | 6 +- config/locales/diaspora/en.yml | 2 +- config/locales/diaspora/es.yml | 6 +- config/locales/diaspora/fr-informal.yml | 2 +- config/locales/diaspora/fr.yml | 2 +- config/locales/diaspora/it.yml | 2 +- config/locales/diaspora/ro.yml | 2 +- config/locales/diaspora/ru.yml | 2 +- config/locales/diaspora/sv.yml | 2 +- config/routes.rb | 2 +- config/sprinkle/packages/ruby.rb | 2 +- lib/diaspora/user/friending.rb | 4 +- lib/tasks/db.rake | 10 +-- public/javascripts/aspect-edit.js | 20 ++--- public/javascripts/view.js | 8 +- public/stylesheets/sass/application.sass | 44 +++++----- public/stylesheets/sass/sessions.sass | 4 +- spec/fixtures/evan_hcard | 2 +- spec/fixtures/hcard_response | 80 +++++++++---------- spec/fixtures/host_xrd | 2 +- spec/misc_spec.rb | 2 +- spec/models/request_spec.rb | 2 +- spec/models/user_spec.rb | 2 +- ubuntu-setup.bash | 36 ++++----- 60 files changed, 273 insertions(+), 273 deletions(-) diff --git a/COPYRIGHT b/COPYRIGHT index f1bed1a6b..b150ae948 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -16,8 +16,8 @@ including the two. You must obey the GNU Affero General Public License V3 or later in all respects for all of the code used other than OpenSSL or the components mentioned -above. If you modify file(s) with this exception, you may extend this -exception to your version of the file(s), but you are not obligated to +above. If you modify file(s) with this exception, you may extend this +exception to your version of the file(s), but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your -version. If you delete this exception statement from all source files in the +version. If you delete this exception statement from all source files in the program, then also delete it here. diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index 9b0b5faa3..80e4c7d0d 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -33,7 +33,7 @@ class AspectsController < ApplicationController begin current_user.drop_aspect @aspect flash[:notice] = i18n.t 'aspects.destroy.success',:name => @aspect.name - rescue RuntimeError => e + rescue RuntimeError => e flash[:error] = e.message end diff --git a/app/models/person.rb b/app/models/person.rb index 38a55db2b..9527a7bb7 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -78,7 +78,7 @@ class Person def self.by_webfinger( identifier, opts = {}) #need to check if this is a valid email structure, maybe should do in JS local_person = Person.first(:diaspora_handle => identifier.gsub('acct:', '').to_s.downcase) - + if local_person Rails.logger.info("Do not need to webfinger, found a local person #{local_person.real_name}") local_person @@ -100,9 +100,9 @@ class Person new_person = Person.new public_key_entry = profile.links.select{|x| x.rel == 'diaspora-public-key'} - + return nil unless public_key_entry - + pubkey = public_key_entry.first.href new_person.exported_key = Base64.decode64 pubkey diff --git a/app/models/user.rb b/app/models/user.rb index ade7b7a2a..6f74fa8de 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -66,7 +66,7 @@ class User def drop_aspect( aspect ) if aspect.people.size == 0 aspect.destroy - else + else raise "Aspect not empty" end end @@ -106,11 +106,11 @@ class User intitial_post(class_name, aspect_ids, options) end - def intitial_post(class_name, aspect_ids, options = {}) + def intitial_post(class_name, aspect_ids, options = {}) post = build_post(class_name, options) post.socket_to_uid(id, :aspect_ids => aspect_ids) if post.respond_to?(:socket_to_uid) push_to_aspects(post, aspect_ids) - post + post end def repost( post, options = {} ) @@ -137,9 +137,9 @@ class User end aspect_ids.each do |aspect_id| - unless self.aspects.find(aspect_id) + unless self.aspects.find(aspect_id) raise ArgumentError.new("Cannot post to an aspect you do not own.") - end + end end aspect_ids diff --git a/app/views/albums/_album.html.haml b/app/views/albums/_album.html.haml index a2d2eb46b..4f41e5cfb 100644 --- a/app/views/albums/_album.html.haml +++ b/app/views/albums/_album.html.haml @@ -15,4 +15,4 @@ %div.image_cycle - for photo in post.photos[0..3] = link_to (image_tag photo.url(:thumb_large)), album_path(post, :aspect => @aspect) - + diff --git a/app/views/aspects/index.html.haml b/app/views/aspects/index.html.haml index 47a68ffeb..11275b6b4 100644 --- a/app/views/aspects/index.html.haml +++ b/app/views/aspects/index.html.haml @@ -5,7 +5,7 @@ - content_for :page_title do = link_to t('.photos'), albums_path(:aspect => @aspect) - + - content_for :left_pane do = render "shared/aspect_friends" diff --git a/app/views/aspects/manage.html.haml b/app/views/aspects/manage.html.haml index af64fcc23..043ce3308 100644 --- a/app/views/aspects/manage.html.haml +++ b/app/views/aspects/manage.html.haml @@ -3,7 +3,7 @@ -# the COPYRIGHT file. -- content_for :head do +- content_for :head do = javascript_include_tag 'jquery-ui-1.8.4.custom.min.js' = javascript_include_tag 'aspect-edit.js' @@ -34,7 +34,7 @@ %ul#aspect_list - for aspect in @aspects %li.aspect - + .aspect_name %span.edit_name_field %h1{:contenteditable => true}= aspect.name @@ -44,9 +44,9 @@ %li= link_to t('.add_a_new_friend'), "#add_request_pane_#{aspect.id}", :class => 'add_request_button' %li= link_to t('.show'), aspect_path(aspect) %li!= remove_link(aspect) - + %ul.dropzone{:id => aspect.id} - + -if aspect.people.size < 1 %li.grey Drag to add people diff --git a/app/views/comments/_comment.html.haml b/app/views/comments/_comment.html.haml index 4fd46eb56..2c233f1dc 100644 --- a/app/views/comments/_comment.html.haml +++ b/app/views/comments/_comment.html.haml @@ -3,7 +3,7 @@ -# the COPYRIGHT file. -%li.comment{:id => post.id} +%li.comment{:id => post.id} = person_image_tag(post.person) %span.from = link_to post.person.real_name, post.person diff --git a/app/views/comments/_comments.html.haml b/app/views/comments/_comments.html.haml index fc5c64da7..87e1c1db1 100644 --- a/app/views/comments/_comments.html.haml +++ b/app/views/comments/_comments.html.haml @@ -9,4 +9,4 @@ = render 'comments/comment', :post => comment %li.comment.show = render 'comments/new_comment', :post => post - + diff --git a/app/views/devise/sessions/new.html.haml b/app/views/devise/sessions/new.html.haml index a2de719b5..5803415b4 100644 --- a/app/views/devise/sessions/new.html.haml +++ b/app/views/devise/sessions/new.html.haml @@ -1,7 +1,7 @@ %h1 This is a technology preview, do not provide any private information. -%h3 - your account may be deleted until we move into a more stable development period. +%h3 + your account may be deleted until we move into a more stable development period. %h3 USE AT YOUR OWN RISK!! = form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| diff --git a/app/views/js/_websocket_js.haml b/app/views/js/_websocket_js.haml index 33af68cce..45a358652 100644 --- a/app/views/js/_websocket_js.haml +++ b/app/views/js/_websocket_js.haml @@ -19,18 +19,18 @@ if (obj['class']=="retractions"){ processRetraction(obj['post_id']); - + }else if (obj['class']=="comments"){ - processComment(obj['post_id'], obj['html']) - + processComment(obj['post_id'], obj['html']) + }else if (obj['class']=='photos' && onPageForClass('albums')){ processPhotoInAlbum(obj['photo_hash']) }else{ processPost(obj['class'], obj['html'], obj['aspect_ids']) } - - }; + + }; ws.onclose = function() { debug("socket closed"); }; ws.onopen = function() { ws.send(location.pathname); @@ -66,7 +66,7 @@ $(html).fadeIn("fast", function(){ $("#stream label:first").inFieldLabels(); }) - ); + ); } } @@ -77,13 +77,13 @@ html = "

" + " $("#thumbnails").append( $(html) ) $("#"+ photoHash['id'] + " img").load( function() { $(this).fadeIn("slow"); }); } - + function onPageForClass(className){ return (location.href.indexOf(className) != -1 ); } @@ -100,9 +100,9 @@ } function onPageForAspect(aspectId){ - return (location.href.indexOf(aspectId) != -1 ) + return (location.href.indexOf(aspectId) != -1 ) } - + function onPageOne() { var c = document.location.search.charAt(document.location.search.length-1); return ((c =='') || (c== '1')); diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 7a48d7ed7..71976017c 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -10,24 +10,24 @@ = "#{current_user.real_name} | diaspora" if current_user %meta{"http-equiv"=>"Content-Type", :content=>"text/html; charset=utf-8"}/ - + = stylesheet_link_tag "blueprint/screen", :media => 'screen' = stylesheet_link_tag "application", "ui" - = stylesheet_link_tag "/../javascripts/fancybox/jquery.fancybox-1.3.1" - = stylesheet_link_tag "fileuploader" + = stylesheet_link_tag "/../javascripts/fancybox/jquery.fancybox-1.3.1" + = stylesheet_link_tag "fileuploader" /= javascript_include_tag "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" = javascript_include_tag 'jquery-1.4.2.min', 'rails' = javascript_include_tag 'jquery.infieldlabel', 'jquery.cycle/jquery.cycle.min.js' - + = javascript_include_tag 'fancybox/jquery.fancybox-1.3.1.pack' = javascript_include_tag 'fileuploader' = javascript_include_tag 'view', 'image_picker', 'stream' = render 'js/websocket_js' - + = csrf_meta_tag = yield(:head) diff --git a/app/views/layouts/session_wall.html.haml b/app/views/layouts/session_wall.html.haml index 351daee0e..5611fd479 100644 --- a/app/views/layouts/session_wall.html.haml +++ b/app/views/layouts/session_wall.html.haml @@ -10,7 +10,7 @@ DIASPORA | login %meta{"http-equiv"=>"Content-Type", :content=>"text/html; charset=utf-8"}/ %meta{"http-equiv"=> "X-UA-Compatible", :content =>"chrome=1" } - + = stylesheet_link_tag "sessions" /= javascript_include_tag"http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" = javascript_include_tag 'jquery142' @@ -18,10 +18,10 @@ :javascript $(document).ready(function(){ - $("#user_username").focus(); + $("#user_username").focus(); $("label").inFieldLabels(); }); - + = csrf_meta_tag = yield(:head) @@ -44,11 +44,11 @@ - + - flash.each do |name, msg| = content_tag :div, msg, :id => "flash_#{name}" %div#huge_text DIASPORA* = yield - + /= link_to "signup", "/signup" diff --git a/app/views/people/index.html.haml b/app/views/people/index.html.haml index 2cd1dc4a7..c8425551d 100644 --- a/app/views/people/index.html.haml +++ b/app/views/people/index.html.haml @@ -21,5 +21,5 @@ %ul#stream - for person in @people = render 'people/person', :person => person - + = will_paginate @people diff --git a/app/views/people/new.html.haml b/app/views/people/new.html.haml index 25821ed37..2b635e997 100644 --- a/app/views/people/new.html.haml +++ b/app/views/people/new.html.haml @@ -15,13 +15,13 @@ = f.label :url %br = f.text_field :url - + =f.fields_for :profile do |p| %p = p.label :first_name %br = p.text_field :first_name - + %p = p.label :last_name %br diff --git a/app/views/people/show.html.haml b/app/views/people/show.html.haml index 23e6ea64d..3fc80cfd7 100644 --- a/app/views/people/show.html.haml +++ b/app/views/people/show.html.haml @@ -28,7 +28,7 @@ = link_to t('.remove_friend'), @person, :confirm => t('.are_you_sure'), :method => :delete, :class => "button" .span-20.last - + .span-19.last - if @posts %ul#stream diff --git a/app/views/photos/_new_photo.haml b/app/views/photos/_new_photo.haml index abb8cf528..7c3e7e76e 100644 --- a/app/views/photos/_new_photo.haml +++ b/app/views/photos/_new_photo.haml @@ -4,14 +4,14 @@ :javascript - function createUploader(){ + function createUploader(){ var uploader = new qq.FileUploader({ element: document.getElementById('file-upload'), params: {'album_id' : "#{@album.id}"}, allowedExtensions: ['jpg', 'jpeg', 'png', 'gif'], action: "#{photos_path}" - }); + }); } - window.onload = createUploader; + window.onload = createUploader; #file-upload diff --git a/app/views/photos/_photo.haml b/app/views/photos/_photo.haml index ae8829c61..9fadad187 100644 --- a/app/views/photos/_photo.haml +++ b/app/views/photos/_photo.haml @@ -17,9 +17,9 @@ %br = render "albums/album", :post => post.album, :current_user => current_user = link_to (image_tag post.url(:thumb_medium)), object_path(post) - + .info = link_to(how_long_ago(post), photo_path(post)) \-- = link_to "#{t('.show_comments')} (#{post.comments.count})", '#', :class => "show_post_comments" - = render "comments/comments", :post => post + = render "comments/comments", :post => post diff --git a/app/views/photos/show.html.haml b/app/views/photos/show.html.haml index 21ce72181..08eba0c29 100644 --- a/app/views/photos/show.html.haml +++ b/app/views/photos/show.html.haml @@ -53,4 +53,4 @@ %h4{:class => "show_post_comments"} = "#{t('.comments')} (#{@photo.comments.count})" = render "comments/comments", :post => @photo - + diff --git a/app/views/posts/_post.html.haml b/app/views/posts/_post.html.haml index 217441465..5b4493286 100644 --- a/app/views/posts/_post.html.haml +++ b/app/views/posts/_post.html.haml @@ -4,6 +4,6 @@ %ul - %h3= link_to post.class, object_path(post) + %h3= link_to post.class, object_path(post) - for field in object_fields(post) - %li= "#{field}: #{post.attributes[field]}" + %li= "#{field}: #{post.attributes[field]}" diff --git a/app/views/publics/hcard.erb b/app/views/publics/hcard.erb index f8a3fef91..9e3f27796 100644 --- a/app/views/publics/hcard.erb +++ b/app/views/publics/hcard.erb @@ -1,42 +1,42 @@ -
-

<%=@person.real_name%>

-
-
-

User profile

-
-
Nickname
-
- <%= @person.real_name%> -
-
-
-
Full name
-
- <%= @person.profile.first_name %> -
+
+

<%=@person.real_name%>

+
+
+

User profile

+
+
Nickname
+
+ <%= @person.real_name%> +
+
+
+
Full name
+
+ <%= @person.profile.first_name %> +
-
-
Full name
-
- <%= @person.profile.last_name %> -
+
+
Full name
+
+ <%= @person.profile.last_name %> +
-
-
Full name
-
- <%= @person.real_name %> -
-
-
-
URL
-
- <%= @person.url%> -
-
-
-
Note
-
Diaspora is awesome! vi is better than emacs!
-
-
-
-
+
+
Full name
+
+ <%= @person.real_name %> +
+
+
+
URL
+
+ <%= @person.url%> +
+
+
+
Note
+
Diaspora is awesome! vi is better than emacs!
+
+
+
+
diff --git a/app/views/publics/host_meta.erb b/app/views/publics/host_meta.erb index e28fb6211..ff24552b9 100644 --- a/app/views/publics/host_meta.erb +++ b/app/views/publics/host_meta.erb @@ -1,8 +1,8 @@ - <%= terse_url(root_url) %> - Resource Descriptor diff --git a/app/views/requests/_new_request.haml b/app/views/requests/_new_request.haml index 70c204e7c..f47e47371 100644 --- a/app/views/requests/_new_request.haml +++ b/app/views/requests/_new_request.haml @@ -10,7 +10,7 @@ = form_for Request.new do |f| = f.error_messages - =t('.enter_a_diaspora_username') + =t('.enter_a_diaspora_username') %br %i= t '.your_diaspora_username_is', :diaspora_handle => current_user.diaspora_handle diff --git a/app/views/shared/_aspect_friends.haml b/app/views/shared/_aspect_friends.haml index 5e1dfe213..e27bb3fdb 100644 --- a/app/views/shared/_aspect_friends.haml +++ b/app/views/shared/_aspect_friends.haml @@ -10,11 +10,11 @@ -unless @aspect == :all = link_to (image_tag('add_friend_button.png', :height => "50px", :width => "50px")), "#add_request_pane", :id => 'add_request_button' - + .yo{:style => 'display:none'} #add_request_pane - = render "requests/new_request", :aspect => @aspect + = render "requests/new_request", :aspect => @aspect -else .clear - = link_to t('.add_friends'), aspects_manage_path + = link_to t('.add_friends'), aspects_manage_path diff --git a/app/views/shared/_publisher.haml b/app/views/shared/_publisher.haml index 040d3e3c2..e163a3ba0 100644 --- a/app/views/shared/_publisher.haml +++ b/app/views/shared/_publisher.haml @@ -18,5 +18,5 @@ %li = check_box_tag("aspect_ids[]", aspect.id, @aspect == :all || current_aspect?(aspect) ) = aspect.name - + = f.submit t('.share') diff --git a/app/views/shared/_reshare.haml b/app/views/shared/_reshare.haml index 0b4120d52..1861c7d27 100644 --- a/app/views/shared/_reshare.haml +++ b/app/views/shared/_reshare.haml @@ -19,7 +19,7 @@ %ul.reshare_box - for aspect in current_user.aspects_with_post( post.id ) - + %li.currently_sharing= aspect.name - for aspect in current_user.aspects diff --git a/app/views/status_messages/_status_message.html.haml b/app/views/status_messages/_status_message.html.haml index 4d73f4251..f136a4c33 100644 --- a/app/views/status_messages/_status_message.html.haml +++ b/app/views/status_messages/_status_message.html.haml @@ -9,17 +9,17 @@ .content %span.from - = link_to post.person.real_name, post.person + = link_to post.person.real_name, post.person = post.message - + .info %span.time= link_to(how_long_ago(post), object_path(post)) \-- = link_to "#{t('.show_comments')} (#{post.comments.count})", '#', :class => "show_post_comments" - = render "comments/comments", :post => post + = render "comments/comments", :post => post - if current_user.owns?(post) .destroy_link = link_to t('.delete'), status_message_path(post), :confirm => t('.are_you_sure'), :method => :delete, :remote => true, :class => "delete" - = render "shared/reshare", :post => post, :current_user => current_user + = render "shared/reshare", :post => post, :current_user => current_user diff --git a/app/views/status_messages/index.html.haml b/app/views/status_messages/index.html.haml index c2a579d87..42ed5fc09 100644 --- a/app/views/status_messages/index.html.haml +++ b/app/views/status_messages/index.html.haml @@ -6,7 +6,7 @@ %h1.big_text status messages = render "status_messages/new_status_message", :status_message => @status_message %ul#stream - + - for status_message in @status_messages = render "status_message", :post => status_message #pagination diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index 25668776f..46e966f54 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -49,7 +49,7 @@ = p.label :first_name = p.text_field :first_name, :value => @profile.first_name %p - = p.label :last_name + = p.label :last_name = p.text_field :last_name, :value => @profile.last_name #submit_block diff --git a/config/app_config.yml.example b/config/app_config.yml.example index 75568dd11..b2251fefc 100644 --- a/config/app_config.yml.example +++ b/config/app_config.yml.example @@ -13,7 +13,7 @@ default: pubsub_server: 'https://pubsubhubbub.appspot.com/' mongo_host: 'localhost' mongo_port: 27017 - + development: test: diff --git a/config/environments/production.rb b/config/environments/production.rb index 358e6e092..cb13c1d1c 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -15,7 +15,7 @@ Diaspora::Application.configure do # Specifies the header that your server uses for sending files #config.action_dispatch.x_sendfile_header = "X-Sendfile" - + config.active_support.deprecation = :notify # For nginx: diff --git a/config/initializers/_load_app_config.rb b/config/initializers/_load_app_config.rb index e739941e9..22bf14ead 100644 --- a/config/initializers/_load_app_config.rb +++ b/config/initializers/_load_app_config.rb @@ -20,7 +20,7 @@ else APP_CONFIG = all_envs['default'].symbolize_keys end -APP_CONFIG[:terse_pod_url] = APP_CONFIG[:pod_url].gsub(/(https?:|www\.)\/\//, '') +APP_CONFIG[:terse_pod_url] = APP_CONFIG[:pod_url].gsub(/(https?:|www\.)\/\//, '') APP_CONFIG[:terse_pod_url].chop! if APP_CONFIG[:terse_pod_url][-1, 1] == '/' puts "WARNING: Please modify your app_config.yml to have a proper pod_url!" if APP_CONFIG[:terse_pod_url] == "example.org" && Rails.env != :test diff --git a/config/locales/devise/devise.cy.yml b/config/locales/devise/devise.cy.yml index 5d6d6049a..2d09ac956 100644 --- a/config/locales/devise/devise.cy.yml +++ b/config/locales/devise/devise.cy.yml @@ -1,42 +1,42 @@ # Copyright (c) 2010, Diaspora Inc. This file is # licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - +# the COPYRIGHT file. -cy: - errors: - messages: - not_found: "ni chanfuwyd" - already_confirmed: "cadarnhawyd eisioes" - not_locked: "heb ei gloi" - - devise: - failure: + +cy: + errors: + messages: + not_found: "ni chanfuwyd" + already_confirmed: "cadarnhawyd eisioes" + not_locked: "heb ei gloi" + + devise: + failure: unauthenticated: "Mae angen i chi arwyddo i mewn neu ymuno cyn parhau." unconfirmed: "Rhaid i chi gadarnhau eich cyfrif cyn parhau." locked: "Mae eich cyfrif wedi'i gloi." - invalid: "E-bost neu gyfrinair annilys." - invalid_token: "Tocyn dilysu annilys." - timeout: "Mae eich sesiwn wedi dod i ben, arwyddwch i mewn eto i barhau." - inactive: "Nid yw eich cyfrif wedi'i actifadu." - sessions: - signed_in: "Arwyddwyd i fewn yn llwyddiannus." - signed_out: "Arwyddwyd allan yn llwyddiannus." - passwords: - send_instructions: "Byddwch yn derbyn e-bost â chyfarwyddiadau ar sut i gadarnhau eich cyfrif mewn ychydig funudau." - updated: "Newidiwyd eich cyfrinair yn llwyddiannus. Rydych chi wedi arwyddo i fewn." - confirmations: - send_instructions: "Byddwch yn derbyn e-bost â chyfarwyddiadau ar sut i gadarnhau eich cyfrif mewn ychydig funudau." - confirmed: "Cadarnhawyd eich cyfrif yn llwyddiannus. Rydych chi wedi arwyddo i fewn." - registrations: - signed_up: "Rydych chi wedi arwyddo i fyny yn llwyddiannus. Anfonwyd cadarnhad at eich e-bost os yw wedi'i alluogi." - updated: "Diweddarwyd eich cyfrif yn llwyddiannus." - destroyed: "Hwyl fawr! Canslwyd eich cyfrif yn llwyddiannus. Rydym yn gobeithio gweld chi eto yn fuan." - unlocks: - send_instructions: "Byddwch yn derbyn e-bost gyda cyfarwyddiadau ar sut i agor eich cyfrif mewn ychydig funudau." - unlocked: "Datglowyd eich cyfrif yn llwyddiannus. Rydych chi wedi arwyddo i fewn." - mailer: - confirmation_instructions: "Cyfarwyddiadau cadarnhad." - reset_password_instructions: "Ailosod cyfarwyddiadau cyfrinair" - unlock_instructions: "Cyfarwyddiadau Datgloi" - + invalid: "E-bost neu gyfrinair annilys." + invalid_token: "Tocyn dilysu annilys." + timeout: "Mae eich sesiwn wedi dod i ben, arwyddwch i mewn eto i barhau." + inactive: "Nid yw eich cyfrif wedi'i actifadu." + sessions: + signed_in: "Arwyddwyd i fewn yn llwyddiannus." + signed_out: "Arwyddwyd allan yn llwyddiannus." + passwords: + send_instructions: "Byddwch yn derbyn e-bost â chyfarwyddiadau ar sut i gadarnhau eich cyfrif mewn ychydig funudau." + updated: "Newidiwyd eich cyfrinair yn llwyddiannus. Rydych chi wedi arwyddo i fewn." + confirmations: + send_instructions: "Byddwch yn derbyn e-bost â chyfarwyddiadau ar sut i gadarnhau eich cyfrif mewn ychydig funudau." + confirmed: "Cadarnhawyd eich cyfrif yn llwyddiannus. Rydych chi wedi arwyddo i fewn." + registrations: + signed_up: "Rydych chi wedi arwyddo i fyny yn llwyddiannus. Anfonwyd cadarnhad at eich e-bost os yw wedi'i alluogi." + updated: "Diweddarwyd eich cyfrif yn llwyddiannus." + destroyed: "Hwyl fawr! Canslwyd eich cyfrif yn llwyddiannus. Rydym yn gobeithio gweld chi eto yn fuan." + unlocks: + send_instructions: "Byddwch yn derbyn e-bost gyda cyfarwyddiadau ar sut i agor eich cyfrif mewn ychydig funudau." + unlocked: "Datglowyd eich cyfrif yn llwyddiannus. Rydych chi wedi arwyddo i fewn." + mailer: + confirmation_instructions: "Cyfarwyddiadau cadarnhad." + reset_password_instructions: "Ailosod cyfarwyddiadau cyfrinair" + unlock_instructions: "Cyfarwyddiadau Datgloi" + diff --git a/config/locales/devise/devise.fi.yml b/config/locales/devise/devise.fi.yml index 9109b40a8..c77ead4b2 100644 --- a/config/locales/devise/devise.fi.yml +++ b/config/locales/devise/devise.fi.yml @@ -1,7 +1,7 @@ # Copyright (c) 2010, Diaspora Inc. This file is # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. -# Translator: jarkko moilanen, jm60697@gmail.com +# Translator: jarkko moilanen, jm60697@gmail.com fi: errors: diff --git a/config/locales/devise/devise.sv.yml b/config/locales/devise/devise.sv.yml index b434666ce..3c41ea81b 100644 --- a/config/locales/devise/devise.sv.yml +++ b/config/locales/devise/devise.sv.yml @@ -1,7 +1,7 @@ # Copyright (c) 2010, Diaspora Inc. This file is # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - + sv: errors: diff --git a/config/locales/diaspora/cy.yml b/config/locales/diaspora/cy.yml index b7d9c9af4..e0198b1b6 100644 --- a/config/locales/diaspora/cy.yml +++ b/config/locales/diaspora/cy.yml @@ -30,7 +30,7 @@ cy: new_album: create: "creu" add_a_new_album: "Ychwanegu albwm newydd" - show: + show: edit_album: "Golygu Albwm" albums: "albymau" updated: "diweddarwyd" diff --git a/config/locales/diaspora/de.yml b/config/locales/diaspora/de.yml index ae8fb13e3..9c7d67f4d 100644 --- a/config/locales/diaspora/de.yml +++ b/config/locales/diaspora/de.yml @@ -45,7 +45,7 @@ de: new_album: create: "erstellen" add_a_new_album: "Album hinzufügen" - show: + show: edit_album: "Album bearbeiten" albums: "Alben" updated: "aktualisiert" @@ -98,7 +98,7 @@ de: notice: "Du zeigst deinem Freund jetzt einen anderen Aspekt von dir." helper: remove: "entfernen" - aspect_not_empty: "Aspekt ist nicht leer" + aspect_not_empty: "Aspekt ist nicht leer" users: edit: cancel: "Abbrechen" @@ -132,7 +132,7 @@ de: delete_photo: "Foto löschen" photo: show_comments: "Kommentare anzeigen" - posted_a_new_photo_to: "neues Foto veröffentlicht bei" + posted_a_new_photo_to: "neues Foto veröffentlicht bei" new: new_photo: "Foto erstellen" back_to_list: "Zurück zur Liste" diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index a6a98c7cd..9db808746 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -45,7 +45,7 @@ en: new_album: create: "create" add_a_new_album: "Add a new album" - show: + show: edit_album: "Edit Album" albums: "albums" updated: "updated" diff --git a/config/locales/diaspora/es.yml b/config/locales/diaspora/es.yml index 5af6c70aa..1f6b6b2e7 100644 --- a/config/locales/diaspora/es.yml +++ b/config/locales/diaspora/es.yml @@ -45,7 +45,7 @@ es: new_album: create: "Crear" add_a_new_album: "Añade un nuevo álbum" - show: + show: edit_album: "Editar Álbum" albums: "álbumes" updated: "actualizar" @@ -167,7 +167,7 @@ es: message: "Mensaje" owner: "Dueño" helper: - no_message_to_display: "No hay mensajes que mostrar." + no_message_to_display: "No hay mensajes que mostrar." people: person: add_friend: "añadir amigo" @@ -178,7 +178,7 @@ es: diaspora_handle: "usuario en diaspora" thats_you: "ese eres tu!" friend_request_pending: "friend request pending" - you_have_a_friend_request_from_this_person: "you have a friend request from this person" + you_have_a_friend_request_from_this_person: "you have a friend request from this person" show: last_seen: "ultima vez visto: %{how_long_ago}" friends_since: "amigos desde: %{how_long_ago}" diff --git a/config/locales/diaspora/fr-informal.yml b/config/locales/diaspora/fr-informal.yml index f70812fdf..2342ff1ce 100644 --- a/config/locales/diaspora/fr-informal.yml +++ b/config/locales/diaspora/fr-informal.yml @@ -45,7 +45,7 @@ fr-informal: new_album: create: "créer" add_a_new_album: "Ajouter un nouvel album" - show: + show: edit_album: "Éditer l’album" albums: "albums" updated: "mis à jour" diff --git a/config/locales/diaspora/fr.yml b/config/locales/diaspora/fr.yml index 6d77dcf00..8a44e6dac 100644 --- a/config/locales/diaspora/fr.yml +++ b/config/locales/diaspora/fr.yml @@ -44,7 +44,7 @@ fr: new_album: create: "créer" add_a_new_album: "Ajouter un nouvel album" - show: + show: edit_album: "Éditer l’album" albums: "albums" updated: "mis à jour" diff --git a/config/locales/diaspora/it.yml b/config/locales/diaspora/it.yml index 418733b40..bb44c6f27 100644 --- a/config/locales/diaspora/it.yml +++ b/config/locales/diaspora/it.yml @@ -45,7 +45,7 @@ it: new_album: create: "crea" add_a_new_album: "Aggiungi un nuovo album" - show: + show: edit_album: "Modifica album" albums: "album" updated: "aggiornato" diff --git a/config/locales/diaspora/ro.yml b/config/locales/diaspora/ro.yml index c99bd2a85..5800f4a30 100644 --- a/config/locales/diaspora/ro.yml +++ b/config/locales/diaspora/ro.yml @@ -26,7 +26,7 @@ ro: new_album: create: "crează" add_a_new_album: "Album nou" - show: + show: edit_album: "Editare Album" albums: "albume" updated: "actualizat" diff --git a/config/locales/diaspora/ru.yml b/config/locales/diaspora/ru.yml index d0d9e8039..1b5d3b958 100644 --- a/config/locales/diaspora/ru.yml +++ b/config/locales/diaspora/ru.yml @@ -30,7 +30,7 @@ ru: new_album: create: "создать" add_a_new_album: "Добавить новый альбом" - show: + show: edit_album: "Редактировать альбом" albums: "альбомы" updated: "обновленные" diff --git a/config/locales/diaspora/sv.yml b/config/locales/diaspora/sv.yml index 1caf878b8..dfb8deb7f 100644 --- a/config/locales/diaspora/sv.yml +++ b/config/locales/diaspora/sv.yml @@ -3,7 +3,7 @@ # the COPYRIGHT file. -# Swedish localization file. +# Swedish localization file. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. sv: diff --git a/config/routes.rb b/config/routes.rb index 7f60bd63b..c2a38dbc6 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -29,7 +29,7 @@ Diaspora::Application.routes.draw do match 'logout', :to => 'devise/sessions#destroy', :as => "destroy_user_session" match 'signup', :to => 'registrations#new', :as => "new_user_registration" - match 'get_to_the_choppa', :to => redirect("/signup") + match 'get_to_the_choppa', :to => redirect("/signup") #public routes # match 'webfinger', :to => 'publics#webfinger' diff --git a/config/sprinkle/packages/ruby.rb b/config/sprinkle/packages/ruby.rb index 261cf3ffe..947732a79 100644 --- a/config/sprinkle/packages/ruby.rb +++ b/config/sprinkle/packages/ruby.rb @@ -41,7 +41,7 @@ package :diaspora_dependencies do end #package :diaspora do # description 'Diaspora' - + =begin package :rails do description 'Ruby on Rails' diff --git a/lib/diaspora/user/friending.rb b/lib/diaspora/user/friending.rb index 35695c546..0f6cc6c5c 100644 --- a/lib/diaspora/user/friending.rb +++ b/lib/diaspora/user/friending.rb @@ -7,7 +7,7 @@ module Diaspora module Friending def send_friend_request_to(desired_friend, aspect) # should have different exception types for these? - raise "You have already sent a friend request to that person!" if self.pending_requests.detect{ + raise "You have already sent a friend request to that person!" if self.pending_requests.detect{ |x| x.destination_url == desired_friend.receive_url } raise "You are already friends with that person!" if self.friends.detect{ |x| x.receive_url == desired_friend.receive_url} @@ -86,7 +86,7 @@ module Diaspora def remove_friend(bad_friend) raise "Friend not deleted" unless self.friend_ids.delete( bad_friend.id ) - aspects.each{|aspect| + aspects.each{|aspect| aspect.person_ids.delete( bad_friend.id )} self.save diff --git a/lib/tasks/db.rake b/lib/tasks/db.rake index 9c438ddb1..4b6202f29 100644 --- a/lib/tasks/db.rake +++ b/lib/tasks/db.rake @@ -22,7 +22,7 @@ namespace :db do require File.dirname(__FILE__) + '/../../db/seeds/backer' create end - + end desc 'Delete the collections in the current RAILS_ENV database' @@ -33,7 +33,7 @@ namespace :db do # Specifiy what models to remove # No! Drop the fucking database. - MongoMapper::connection.drop_database(MongoMapper::database.name) + MongoMapper::connection.drop_database(MongoMapper::database.name) puts 'Deleting tmp folder...' `rm -rf #{File.dirname(__FILE__)}/../../public/uploads/*` @@ -41,7 +41,7 @@ namespace :db do desc 'Purge and seed the current RAILS_ENV database using information from db/seeds.rb' task :reset do - + puts "Resetting the database for #{Rails.env}".upcase Rake::Task['db:purge'].invoke Rake::Task['db:seed:tom'].invoke @@ -54,7 +54,7 @@ namespace :db do Rake::Task['db:seed:dev'].invoke puts "you did it!" end - + task :fix_diaspora_handle do puts "fixing the people in this seed" require File.dirname(__FILE__) + '/../../config/environment' @@ -62,7 +62,7 @@ namespace :db do if person.owner person.url = APP_CONFIG[:pod_url] person.diaspora_handle = person.owner.diaspora_handle - person.save + person.save end } puts "everything should be peachy" diff --git a/public/javascripts/aspect-edit.js b/public/javascripts/aspect-edit.js index 9f9e5803e..cb36d394e 100644 --- a/public/javascripts/aspect-edit.js +++ b/public/javascripts/aspect-edit.js @@ -5,7 +5,7 @@ function decrementRequestsCounter() { var $new_requests = $(".new_requests"), - request_html = $new_requests.html(), + request_html = $new_requests.html(), old_request_count = request_html.match(/\d+/); if( old_request_count == 1 ) { @@ -24,11 +24,11 @@ $(function() { $("ul .person").draggable({ revert: true }); - + $("ul .requested_person").draggable({ revert: true }); - + $(".aspect ul").droppable({ hoverClass: 'active', drop: function(event, ui) { @@ -72,32 +72,32 @@ $(function() { if ($(ui.draggable[0]).hasClass('requested_person')){ $.ajax({ type: "DELETE", - url: "/requests/" + ui.draggable.attr('request_id'), + url: "/requests/" + ui.draggable.attr('request_id'), success: function () { decrementRequestsCounter(); } }); - + } else { $.ajax({ type: "DELETE", - url: "/people/" + ui.draggable.attr('id'), + url: "/people/" + ui.draggable.attr('id'), success: function () { alert("Removed Friend, proably want an undo countdown.") } }); - + } - $(ui.draggable[0]).fadeOut('slow'); // ui.draggable.fadeOut('slow') + $(ui.draggable[0]).fadeOut('slow'); // ui.draggable.fadeOut('slow') } }); $(".aspect h1").live( 'focus', function() { - var $this = $(this), - id = $this.closest("li").children("ul").attr("id"), + var $this = $(this), + id = $this.closest("li").children("ul").attr("id"), link = "/aspects/"+ id; $this.keypress(function(e) { diff --git a/public/javascripts/view.js b/public/javascripts/view.js index 092d69f16..1509145da 100644 --- a/public/javascripts/view.js +++ b/public/javascripts/view.js @@ -5,15 +5,15 @@ $(document).ready(function(){ - + $('#debug_info').click(function() { $('#debug_more').toggle('fast'); }); - + $("label").inFieldLabels(); - + $('#flash_notice, #flash_error, #flash_alert').delay(2500).slideUp(130); - + $("div.image_cycle").cycle({ fx: 'fade', random: 1, diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 1291313de..e9f9b2188 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -35,7 +35,7 @@ h1 h3 :font - :size 18px + :size 18px :weight bold .avatar @@ -54,7 +54,7 @@ h3 :left 50% :text :align center - :font + :font :size 14px :padding 3px 0 @@ -205,7 +205,7 @@ li.message .delete:hover :background #eee - + .content :padding :left 65px @@ -240,7 +240,7 @@ li.message :margin :top 5px :padding 0 - + :background :color #fafafa @@ -254,7 +254,7 @@ li.message :text-shadow 0 2px #fff :color #000 - > li + > li :font :weight bold @@ -285,11 +285,11 @@ form :size 120% :margin 1em :left 0em - + #user_name :margin :bottom 20px - + img :margin :right 10px @@ -305,7 +305,7 @@ form :color #000 span - :size small + :size small :font :weight normal :color #999 @@ -321,7 +321,7 @@ form :display inline :margin :right 1em - + #stream div.comments :display none @@ -336,7 +336,7 @@ input.comment_submit :display none :margin :right -10px - + ul.comment_set :margin 0 @@ -360,7 +360,7 @@ ul.comment_set .from :font :size 1em - + div.time :color #666 :font-size 70% @@ -385,7 +385,7 @@ ul.comment_set :list-style-type none :margin 0 :padding 0 - + #stream, #profile, .comments @@ -399,12 +399,12 @@ ul.comment_set :float left :margin :right 10px - + .pagination a :padding 3px - + .destroy_link, .request_button :position absolute :right 2em @@ -496,9 +496,9 @@ label p :position absolute - :left 0 + :left 0 :top 0 - + form :display inline @@ -526,7 +526,7 @@ label :-webkit-box-shadow 0 1px 0 #fff :border 1px solid #bbb :top 1px solid #666 - + #image_picker @@ -563,13 +563,13 @@ label .name :position absolute - :z-index 6 + :z-index 6 :padding 1em :background rgba(0,0,0,0.8) :bottom 20px :font :size 18px - + :text-shadow 0 2px 0 #000 .time @@ -586,7 +586,7 @@ label .field_with_submit input[type='text'] :width 82% - :display inline + :display inline h1.big_text :position relative @@ -615,7 +615,7 @@ h1.big_text :margin 0 :top 25px - :bottom 25px + :bottom 25px :min-height 36px @@ -815,7 +815,7 @@ h1.big_text .person, .requested_person :display inline-block - :padding 5px + :padding 5px :cursor move :margin 5px :z-index 10 diff --git a/public/stylesheets/sass/sessions.sass b/public/stylesheets/sass/sessions.sass index 326d46b0f..d7cf4644e 100644 --- a/public/stylesheets/sass/sessions.sass +++ b/public/stylesheets/sass/sessions.sass @@ -24,7 +24,7 @@ :left 50% :text :align center - :font + :font :size 14px :padding 3px 0 @@ -135,7 +135,7 @@ input[type='password'] .username :width 200px :display inline - + input :display inline :width 200px diff --git a/spec/fixtures/evan_hcard b/spec/fixtures/evan_hcard index d34408759..8944ef1e3 100644 --- a/spec/fixtures/evan_hcard +++ b/spec/fixtures/evan_hcard @@ -62,7 +62,7 @@

Creative Commons Attribution 3.0:w - + All Evan Prodromou content and data are available under the Creative Commons Attribution 3.0 license.

diff --git a/spec/fixtures/hcard_response b/spec/fixtures/hcard_response index d87957a93..bbd06c4bf 100644 --- a/spec/fixtures/hcard_response +++ b/spec/fixtures/hcard_response @@ -1,44 +1,44 @@ -
-

Alexander Hamiltom

-
-
-

User profile

-
-
Nickname
-
- Alexander Hamiltom -
-
-
-
Full name
-
- Alexander -
+
+

Alexander Hamiltom

+
+
+

User profile

+
+
Nickname
+
+ Alexander Hamiltom +
+
+
+
Full name
+
+ Alexander +
-
-
Full name
-
- Hamiltom -
+
+
Full name
+
+ Hamiltom +
-
-
Full name
-
- Alexander Hamiltom -
-
-
-
URL
-
- http://tom.joindiaspora.com/ -
-
-
-
Note
-
Diaspora is awesome! vi is better than emacs!
-
-
-
+
+
Full name
+
+ Alexander Hamiltom +
+
+
+
URL
+
+ http://tom.joindiaspora.com/ +
+
+
+
Note
+
Diaspora is awesome! vi is better than emacs!
+
+
+
-
+
diff --git a/spec/fixtures/host_xrd b/spec/fixtures/host_xrd index dcb67d767..8118fa94a 100644 --- a/spec/fixtures/host_xrd +++ b/spec/fixtures/host_xrd @@ -1,6 +1,6 @@ - Resource Descriptor diff --git a/spec/misc_spec.rb b/spec/misc_spec.rb index 65cb9da60..c4b2cc67c 100644 --- a/spec/misc_spec.rb +++ b/spec/misc_spec.rb @@ -44,7 +44,7 @@ describe 'making sure the spec runner works' do @user2.reload @aspect2.reload end - + it 'makes the first user friends with the second' do @aspect1.people.include?(@user2.person).should be_true end diff --git a/spec/models/request_spec.rb b/spec/models/request_spec.rb index 4e1380df1..c8fb8af05 100644 --- a/spec/models/request_spec.rb +++ b/spec/models/request_spec.rb @@ -17,7 +17,7 @@ describe Request do person_request.valid?.should be true end - it 'should generate xml for the User as a Person' do + it 'should generate xml for the User as a Person' do request = @user.send_friend_request_to Factory.create(:person), @aspect xml = request.to_xml.to_s diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index ad7070eaa..a2e964dfd 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -8,7 +8,7 @@ describe User do let(:user) { Factory(:user) } let(:aspect) { user.aspect(:name => 'heroes') } - describe '#diaspora_handle' do + describe '#diaspora_handle' do it 'uses the pod config url to set the diaspora_handle' do user.diaspora_handle.should == user.username + "@example.org" end diff --git a/ubuntu-setup.bash b/ubuntu-setup.bash index 08c839f33..117a78ed9 100755 --- a/ubuntu-setup.bash +++ b/ubuntu-setup.bash @@ -9,29 +9,29 @@ # the COPYRIGHT file. -# Set extented globbing +# Set extented globbing shopt -s extglob # Check if the user has sudo privileges. sudo -v >/dev/null 2>&1 || { echo $(whoami) has no sudo privileges ; exit 1; } -# Check if universal repository is enabled +# Check if universal repository is enabled grep -i universe /etc/apt/sources.list > /dev/null || { echo "Please enable universe repository" ; exit 1 ; } -# Check if wget is installed +# Check if wget is installed test wget || echo "Installing wget.." && sudo apt-get install wget && echo "Installed wget.." -# Install build tools +# Install build tools echo "Installing build tools.." sudo apt-get -y --no-install-recommends install build-essential libxslt1.1 libxslt1-dev libxml2 echo "..Done installing build tools" -# Install Ruby 1.8.7 -echo "Installing ruby-full Ruby 1.8.7.." +# Install Ruby 1.8.7 +echo "Installing ruby-full Ruby 1.8.7.." sudo apt-get -y --no-install-recommends install ruby-full echo "..Done installing Ruby" -# Install Rake +# Install Rake echo "Installing rake.." sudo apt-get -y --no-install-recommends install rake echo "..Done installing rake" @@ -79,7 +79,7 @@ echo "Fetching and installing ruby gems.." else # Old version echo "." - cd /tmp + cd /tmp wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz echo "." tar -xf rubygems-1.3.7.tgz @@ -88,10 +88,10 @@ echo "Fetching and installing ruby gems.." echo "." sudo ruby setup.rb echo "." - sudo ln -s /usr/bin/gem1.8 /usr/bin/gem - echo "." - fi -) + sudo ln -s /usr/bin/gem1.8 /usr/bin/gem + echo "." + fi +) echo "Done installing the gems.." # Install bundler @@ -102,22 +102,22 @@ echo "Installed bundler.." # Take a clone of Diaspora ( -# Check if the user is already in a cloned source if not clone the source -[[ $( basename $PWD ) == "diaspora" ]] && echo "Already in diaspora directory" || git clone http://github.com/diaspora/diaspora.git ; cd diaspora +# Check if the user is already in a cloned source if not clone the source +[[ $( basename $PWD ) == "diaspora" ]] && echo "Already in diaspora directory" || git clone http://github.com/diaspora/diaspora.git ; cd diaspora echo "Cloned the source.." -# Install extra gems +# Install extra gems cd diaspora echo "Installing more gems.." sudo bundle install echo "Installed." -# Install DB setup +# Install DB setup echo "Seting up DB.." rake db:seed:tom echo "DB ready. Login -> tom and password -> evankorth. More details ./diaspora/db/seeds/tom.rb." -# Run appserver +# Run appserver echo "Starting server" -bundle exec thin start +bundle exec thin start ) From d8c497177f32de1f6fa7a7e16dda7562bb8a4ef5 Mon Sep 17 00:00:00 2001 From: Dorian Date: Sat, 25 Sep 2010 23:15:04 +0200 Subject: [PATCH 101/155] Improve whitespace:cleanup and whitespace:retab --- lib/tasks/whitespace.rake | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/tasks/whitespace.rake b/lib/tasks/whitespace.rake index c5b9d4c6e..657054aa9 100644 --- a/lib/tasks/whitespace.rake +++ b/lib/tasks/whitespace.rake @@ -1,15 +1,18 @@ namespace :whitespace do desc 'Removes trailing whitespace' task :cleanup do - sh %{find . -name '*.rb' -exec sed -i '' 's/ *$//g' {} \\;} + sh %{for f in `find . -type f | grep -v -e '.git/' -e 'public/' -e '.png'`; + do cat $f | sed 's/[ \t]*$//' > tmp; cp tmp $f; rm tmp; echo -n .; + done} end desc 'Converts hard-tabs into two-space soft-tabs' task :retab do - sh %{find . -name '*.rb' -exec sed -i '' 's/\t/ /g' {} \\;} + sh %{for f in `find . -type f | grep -v -e '.git/' -e 'public/' -e '.png'`; + do cat $f | sed 's/\t/ /g' > tmp; cp tmp $f; rm tmp; echo -n .; + done} end desc 'Remove consecutive blank lines' task :scrub_gratuitous_newlines do sh %{find . -name '*.rb' -exec sed -i '' '/./,/^$/!d' {} \\;} end end - From 4223769df08e9c0933579742b90d2b343c5ccef2 Mon Sep 17 00:00:00 2001 From: Dorian Date: Sun, 26 Sep 2010 11:47:05 +0200 Subject: [PATCH 102/155] Improve task which remove consecutive blank lines --- lib/tasks/whitespace.rake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/tasks/whitespace.rake b/lib/tasks/whitespace.rake index 657054aa9..7af099dd6 100644 --- a/lib/tasks/whitespace.rake +++ b/lib/tasks/whitespace.rake @@ -13,6 +13,8 @@ namespace :whitespace do end desc 'Remove consecutive blank lines' task :scrub_gratuitous_newlines do - sh %{find . -name '*.rb' -exec sed -i '' '/./,/^$/!d' {} \\;} + sh %{for f in `find . -type f | grep -v -e '.git/' -e 'public/' -e '.png'`; + do cat $f | sed '/./,/^$/!d' > tmp; cp tmp $f; rm tmp; echo -n .; + done} end end From e792344c0e9d88a6eb774810f9e35d08c05cf519 Mon Sep 17 00:00:00 2001 From: Dorian Date: Sun, 26 Sep 2010 11:48:19 +0200 Subject: [PATCH 103/155] Use improved whitespace:scrub_gratuitous_newlines --- Capfile | 2 -- Gemfile | 1 - README.md | 2 -- Rakefile | 2 -- app/views/albums/_new_album.haml | 1 - app/views/albums/edit.html.haml | 1 - app/views/albums/index.html.haml | 1 - app/views/albums/show.html.haml | 3 --- app/views/aspects/_new_aspect.haml | 1 - app/views/aspects/index.html.haml | 2 -- app/views/aspects/manage.html.haml | 3 --- app/views/aspects/show.html.haml | 1 - app/views/comments/_comment.html.haml | 1 - app/views/comments/_comments.html.haml | 1 - app/views/comments/_new_comment.html.haml | 1 - app/views/js/_websocket_js.haml | 3 --- app/views/layouts/application.html.haml | 1 - app/views/layouts/session_wall.html.haml | 1 - app/views/people/index.html.haml | 1 - app/views/people/new.html.haml | 2 -- app/views/people/show.html.haml | 1 - app/views/photos/_new_photo.haml | 1 - app/views/photos/_photo.haml | 1 - app/views/photos/edit.html.haml | 1 - app/views/photos/new.html.haml | 1 - app/views/photos/show.html.haml | 2 -- app/views/posts/_debug.haml | 1 - app/views/posts/_post.html.haml | 1 - app/views/registrations/new.html.haml | 1 - app/views/requests/_new_request.haml | 1 - app/views/shared/_aspect_friends.haml | 1 - app/views/shared/_aspect_nav.haml | 1 - app/views/shared/_post_wrapper.haml | 1 - app/views/shared/_publisher.haml | 1 - app/views/shared/_reshare.haml | 2 -- app/views/shared/log.haml | 1 - app/views/status_messages/_new_status_message.haml | 1 - app/views/status_messages/_status_message.html.haml | 1 - app/views/status_messages/index.html.haml | 1 - app/views/users/edit.html.haml | 1 - config.ru | 2 -- config/app_config.yml.example | 1 - config/deploy_config.yml | 2 -- config/locales/devise/devise.cs.yml | 1 - config/locales/devise/devise.cy.yml | 1 - config/locales/devise/devise.de.yml | 1 - config/locales/devise/devise.en.yml | 1 - config/locales/devise/devise.fr-informal.yml | 1 - config/locales/devise/devise.fr.yml | 1 - config/locales/devise/devise.he.yml | 1 - config/locales/devise/devise.it.yml | 1 - config/locales/devise/devise.lt.yml | 1 - config/locales/devise/devise.pl.yml | 1 - config/locales/devise/devise.pt-BR.yml | 1 - config/locales/devise/devise.pt-PT.yml | 1 - config/locales/devise/devise.ro.yml | 1 - config/locales/devise/devise.ru.yml | 1 - config/locales/devise/devise.sv.yml | 1 - config/locales/diaspora/cs.yml | 1 - config/locales/diaspora/cy.yml | 1 - config/locales/diaspora/de.yml | 1 - config/locales/diaspora/en.yml | 1 - config/locales/diaspora/es.yml | 1 - config/locales/diaspora/fr-informal.yml | 1 - config/locales/diaspora/it.yml | 1 - config/locales/diaspora/lt.yml | 1 - config/locales/diaspora/pl.yml | 1 - config/locales/diaspora/pt-BR.yml | 1 - config/locales/diaspora/pt-PT.yml | 1 - config/locales/diaspora/ru.yml | 1 - config/locales/diaspora/sv.yml | 1 - config/selenium.yml | 2 -- config/sprinkle/conf/nginx.conf | 2 -- config/thin.yml | 2 -- lib/tasks/db.rake | 2 -- lib/tasks/rspec.rake | 2 -- ubuntu-setup.bash | 1 - 77 files changed, 97 deletions(-) diff --git a/Capfile b/Capfile index af77f235a..306a9d64b 100644 --- a/Capfile +++ b/Capfile @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - load 'deploy' if respond_to?(:namespace) # cap2 differentiator Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) } diff --git a/Gemfile b/Gemfile index 419f75094..7fde201c1 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,6 @@ source 'http://rubygems.org' gem 'rails', '3.0.0' gem 'bundler', '1.0.0' - #Security gem 'devise', :git => 'http://github.com/BadMinus/devise.git' diff --git a/README.md b/README.md index 97ec66834..c8f193afe 100644 --- a/README.md +++ b/README.md @@ -32,8 +32,6 @@ We are continuing to build features and improve the code base. When we think it is ready for general use, we will post more final instructions. - - ## Resources We are maintaining a diff --git a/Rakefile b/Rakefile index f00478e2e..fa9be254a 100644 --- a/Rakefile +++ b/Rakefile @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - # Add your own tasks in files placed in lib/tasks ending in .rake, # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. diff --git a/app/views/albums/_new_album.haml b/app/views/albums/_new_album.haml index daefe15f3..e0212a6b4 100644 --- a/app/views/albums/_new_album.haml +++ b/app/views/albums/_new_album.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - %h1=t('.add_a_new_album') = form_for Album.new do |f| diff --git a/app/views/albums/edit.html.haml b/app/views/albums/edit.html.haml index 4dfb2294c..67cc3071d 100644 --- a/app/views/albums/edit.html.haml +++ b/app/views/albums/edit.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - .back= link_to "⇧ #{@album.name}", @album %h1.big_text diff --git a/app/views/albums/index.html.haml b/app/views/albums/index.html.haml index af83b53eb..2e680c110 100644 --- a/app/views/albums/index.html.haml +++ b/app/views/albums/index.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - - content_for :head do :javascript $(document).ready(function(){ diff --git a/app/views/albums/show.html.haml b/app/views/albums/show.html.haml index 7b5e6c8be..4c9ba19b8 100644 --- a/app/views/albums/show.html.haml +++ b/app/views/albums/show.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - :javascript $(document).ready(function(){ $(".image_thumb img").load( function() { @@ -25,8 +24,6 @@ = @album.name ="#{t('.updated')} #{how_long_ago(@album)}" - - .album_id{:id => @album.id, :style => "display:hidden;"} -unless current_user.owns? @album diff --git a/app/views/aspects/_new_aspect.haml b/app/views/aspects/_new_aspect.haml index 9f0b662dd..548abd0d1 100644 --- a/app/views/aspects/_new_aspect.haml +++ b/app/views/aspects/_new_aspect.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - %h1=t('.add_a_new_aspect') = form_for Aspect.new do |f| = f.error_messages diff --git a/app/views/aspects/index.html.haml b/app/views/aspects/index.html.haml index 11275b6b4..ae24e8e3b 100644 --- a/app/views/aspects/index.html.haml +++ b/app/views/aspects/index.html.haml @@ -2,11 +2,9 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - - content_for :page_title do = link_to t('.photos'), albums_path(:aspect => @aspect) - - content_for :left_pane do = render "shared/aspect_friends" diff --git a/app/views/aspects/manage.html.haml b/app/views/aspects/manage.html.haml index 043ce3308..e08f6dabd 100644 --- a/app/views/aspects/manage.html.haml +++ b/app/views/aspects/manage.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - - content_for :head do = javascript_include_tag 'jquery-ui-1.8.4.custom.min.js' = javascript_include_tag 'aspect-edit.js' @@ -29,8 +28,6 @@ - content_for :publish do = link_to(t('.add_a_new_aspect'), "#add_aspect_pane", :id => "add_aspect_button", :class => "new_aspect button", :title => t('.add_a_new_aspect')) - - %ul#aspect_list - for aspect in @aspects %li.aspect diff --git a/app/views/aspects/show.html.haml b/app/views/aspects/show.html.haml index d4262f838..ae24e8e3b 100644 --- a/app/views/aspects/show.html.haml +++ b/app/views/aspects/show.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - - content_for :page_title do = link_to t('.photos'), albums_path(:aspect => @aspect) diff --git a/app/views/comments/_comment.html.haml b/app/views/comments/_comment.html.haml index 2c233f1dc..03a2fcf61 100644 --- a/app/views/comments/_comment.html.haml +++ b/app/views/comments/_comment.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - %li.comment{:id => post.id} = person_image_tag(post.person) %span.from diff --git a/app/views/comments/_comments.html.haml b/app/views/comments/_comments.html.haml index 87e1c1db1..aecfb4bf1 100644 --- a/app/views/comments/_comments.html.haml +++ b/app/views/comments/_comments.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - %div.comments %ul.comment_set{:id => post.id} - for comment in post.comments diff --git a/app/views/comments/_new_comment.html.haml b/app/views/comments/_new_comment.html.haml index a4268082d..99c03f898 100644 --- a/app/views/comments/_new_comment.html.haml +++ b/app/views/comments/_new_comment.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - = form_for Comment.new, :remote => true do |f| %p %label{:for => "comment_text_on_#{post.id}"} Comment diff --git a/app/views/js/_websocket_js.haml b/app/views/js/_websocket_js.haml index 45a358652..4677f6ce6 100644 --- a/app/views/js/_websocket_js.haml +++ b/app/views/js/_websocket_js.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - = javascript_include_tag 'FABridge', 'swfobject', 'web_socket' :javascript WebSocket.__swfLocation = "/javascripts/WebSocketMain.swf"; @@ -29,7 +28,6 @@ processPost(obj['class'], obj['html'], obj['aspect_ids']) } - }; ws.onclose = function() { debug("socket closed"); }; ws.onopen = function() { @@ -37,7 +35,6 @@ debug("connected..."); }; - }); function processRetraction(post_id){ $('#' + post_id ).fadeOut(500, function(){ diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 71976017c..fc063e0b6 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - !!! %html %head diff --git a/app/views/layouts/session_wall.html.haml b/app/views/layouts/session_wall.html.haml index 5611fd479..29b863b32 100644 --- a/app/views/layouts/session_wall.html.haml +++ b/app/views/layouts/session_wall.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - !!! %html %head diff --git a/app/views/people/index.html.haml b/app/views/people/index.html.haml index c8425551d..5981569b8 100644 --- a/app/views/people/index.html.haml +++ b/app/views/people/index.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - - content_for :publish do %h1 Search diff --git a/app/views/people/new.html.haml b/app/views/people/new.html.haml index 2b635e997..0584732bc 100644 --- a/app/views/people/new.html.haml +++ b/app/views/people/new.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - - title=t('.new_person') = form_for @person do |f| @@ -28,5 +27,4 @@ = p.text_field :last_name = f.submit - %p= link_to t('.back_to_list'), people_path diff --git a/app/views/people/show.html.haml b/app/views/people/show.html.haml index 3fc80cfd7..9b5128160 100644 --- a/app/views/people/show.html.haml +++ b/app/views/people/show.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - - content_for :page_title do profile diff --git a/app/views/photos/_new_photo.haml b/app/views/photos/_new_photo.haml index 7c3e7e76e..d1a4fc73f 100644 --- a/app/views/photos/_new_photo.haml +++ b/app/views/photos/_new_photo.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - :javascript function createUploader(){ var uploader = new qq.FileUploader({ diff --git a/app/views/photos/_photo.haml b/app/views/photos/_photo.haml index 9fadad187..d39fd0666 100644 --- a/app/views/photos/_photo.haml +++ b/app/views/photos/_photo.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - %li.message{:id => post.id} = person_image_tag(post.person) diff --git a/app/views/photos/edit.html.haml b/app/views/photos/edit.html.haml index bbaee2ef8..06556039c 100644 --- a/app/views/photos/edit.html.haml +++ b/app/views/photos/edit.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - %h1.big_text .back = link_to "⇧ #{@album.name}", album_path(@album) diff --git a/app/views/photos/new.html.haml b/app/views/photos/new.html.haml index 1fdf71a84..d8701c265 100644 --- a/app/views/photos/new.html.haml +++ b/app/views/photos/new.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - - title t('.new_photo') = form_for( @photo, :html => {:multipart => true}) do |f| diff --git a/app/views/photos/show.html.haml b/app/views/photos/show.html.haml index 08eba0c29..787f5861d 100644 --- a/app/views/photos/show.html.haml +++ b/app/views/photos/show.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - :javascript $(document).keydown(function(e){ switch(e.keyCode) { @@ -35,7 +34,6 @@ -if current_user.owns? @album = link_to t('.edit_photo'), edit_photo_path(@photo), :class => "button" - %div{:id => @photo.id} #show_photo = linked_scaled_photo @photo, @album diff --git a/app/views/posts/_debug.haml b/app/views/posts/_debug.haml index 17d7baad8..ef1984d7d 100644 --- a/app/views/posts/_debug.haml +++ b/app/views/posts/_debug.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - #debug_info %h5 DEBUG INFO #debug_more{ :style => "display:none;" } diff --git a/app/views/posts/_post.html.haml b/app/views/posts/_post.html.haml index 5b4493286..acad2e12b 100644 --- a/app/views/posts/_post.html.haml +++ b/app/views/posts/_post.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - %ul %h3= link_to post.class, object_path(post) - for field in object_fields(post) diff --git a/app/views/registrations/new.html.haml b/app/views/registrations/new.html.haml index f837c92de..25902720e 100644 --- a/app/views/registrations/new.html.haml +++ b/app/views/registrations/new.html.haml @@ -1,6 +1,5 @@ = image_tag "http://needcoffee.cachefly.net/needcoffee/uploads/2009/02/predator-arnold-schwarzenegger.jpg" - = form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %p = f.label :username diff --git a/app/views/requests/_new_request.haml b/app/views/requests/_new_request.haml index f47e47371..0dbf5b0a1 100644 --- a/app/views/requests/_new_request.haml +++ b/app/views/requests/_new_request.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - %h1 =t('.add_a_new_friend_to') %i= aspect.name diff --git a/app/views/shared/_aspect_friends.haml b/app/views/shared/_aspect_friends.haml index e27bb3fdb..b4927edc6 100644 --- a/app/views/shared/_aspect_friends.haml +++ b/app/views/shared/_aspect_friends.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - #friend_pictures = owner_image_link - for friend in @friends diff --git a/app/views/shared/_aspect_nav.haml b/app/views/shared/_aspect_nav.haml index 8e900e42d..a0a0ee0ad 100644 --- a/app/views/shared/_aspect_nav.haml +++ b/app/views/shared/_aspect_nav.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - #aspect_nav %ul - for aspect in @aspects diff --git a/app/views/shared/_post_wrapper.haml b/app/views/shared/_post_wrapper.haml index b901fc608..956706b68 100644 --- a/app/views/shared/_post_wrapper.haml +++ b/app/views/shared/_post_wrapper.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - %li.message{:id => post.id, :class => ("mine" if current_user.owns?(post))} = person_image_link(post.person) = yield post_yield_tag(post) diff --git a/app/views/shared/_publisher.haml b/app/views/shared/_publisher.haml index e163a3ba0..1a440b838 100644 --- a/app/views/shared/_publisher.haml +++ b/app/views/shared/_publisher.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - #publisher = owner_image_tag diff --git a/app/views/shared/_reshare.haml b/app/views/shared/_reshare.haml index 1861c7d27..9df1c9ce1 100644 --- a/app/views/shared/_reshare.haml +++ b/app/views/shared/_reshare.haml @@ -2,8 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - - :javascript $(".reshare_button").toggle(function(e){ e.preventDefault(); diff --git a/app/views/shared/log.haml b/app/views/shared/log.haml index 7472689e3..bf957bf7c 100644 --- a/app/views/shared/log.haml +++ b/app/views/shared/log.haml @@ -2,5 +2,4 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - = @log.to_s diff --git a/app/views/status_messages/_new_status_message.haml b/app/views/status_messages/_new_status_message.haml index b515dadff..c27585f0a 100644 --- a/app/views/status_messages/_new_status_message.haml +++ b/app/views/status_messages/_new_status_message.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - = form_for StatusMessage.new, :remote => true do |f| = f.error_messages %p diff --git a/app/views/status_messages/_status_message.html.haml b/app/views/status_messages/_status_message.html.haml index f136a4c33..55c5123b7 100644 --- a/app/views/status_messages/_status_message.html.haml +++ b/app/views/status_messages/_status_message.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - %li.message{:id => post.id, :class => ("mine" if current_user.owns?(post))} = person_image_link(post.person) diff --git a/app/views/status_messages/index.html.haml b/app/views/status_messages/index.html.haml index 42ed5fc09..43c065380 100644 --- a/app/views/status_messages/index.html.haml +++ b/app/views/status_messages/index.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - %h1.big_text status messages = render "status_messages/new_status_message", :status_message => @status_message %ul#stream diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index 46e966f54..3385cb5ea 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -2,7 +2,6 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - - content_for :publish do %h1="#{t('.editing_profile')}" diff --git a/config.ru b/config.ru index cb12bcfa2..0c65f5908 100644 --- a/config.ru +++ b/config.ru @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - # This file is used by Rack-based servers to start the application. require ::File.expand_path('../config/environment', __FILE__) diff --git a/config/app_config.yml.example b/config/app_config.yml.example index b2251fefc..069823a05 100644 --- a/config/app_config.yml.example +++ b/config/app_config.yml.example @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - default: pod_url: "http://example.org/" debug: false diff --git a/config/deploy_config.yml b/config/deploy_config.yml index 9bd7a6b96..6aacbf3ff 100644 --- a/config/deploy_config.yml +++ b/config/deploy_config.yml @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - cross_server: deploy_to: '/usr/local/app/diaspora' user: 'root' diff --git a/config/locales/devise/devise.cs.yml b/config/locales/devise/devise.cs.yml index 34d9eb7c1..26ff8044d 100644 --- a/config/locales/devise/devise.cs.yml +++ b/config/locales/devise/devise.cs.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - cs: errors: messages: diff --git a/config/locales/devise/devise.cy.yml b/config/locales/devise/devise.cy.yml index 2d09ac956..d8b6d94f4 100644 --- a/config/locales/devise/devise.cy.yml +++ b/config/locales/devise/devise.cy.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - cy: errors: messages: diff --git a/config/locales/devise/devise.de.yml b/config/locales/devise/devise.de.yml index 82b658e99..e6608c181 100644 --- a/config/locales/devise/devise.de.yml +++ b/config/locales/devise/devise.de.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - de: errors: messages: diff --git a/config/locales/devise/devise.en.yml b/config/locales/devise/devise.en.yml index 8876bc5bf..7ab686bd4 100644 --- a/config/locales/devise/devise.en.yml +++ b/config/locales/devise/devise.en.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - en: errors: messages: diff --git a/config/locales/devise/devise.fr-informal.yml b/config/locales/devise/devise.fr-informal.yml index 9578af9d9..6fe14382e 100644 --- a/config/locales/devise/devise.fr-informal.yml +++ b/config/locales/devise/devise.fr-informal.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - fr-informal: errors: messages: diff --git a/config/locales/devise/devise.fr.yml b/config/locales/devise/devise.fr.yml index b8691eb3a..240e9d967 100644 --- a/config/locales/devise/devise.fr.yml +++ b/config/locales/devise/devise.fr.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - fr: errors: messages: diff --git a/config/locales/devise/devise.he.yml b/config/locales/devise/devise.he.yml index 851a90789..4ae726a4d 100644 --- a/config/locales/devise/devise.he.yml +++ b/config/locales/devise/devise.he.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - en: errors: messages: diff --git a/config/locales/devise/devise.it.yml b/config/locales/devise/devise.it.yml index 76f761e37..96044d191 100644 --- a/config/locales/devise/devise.it.yml +++ b/config/locales/devise/devise.it.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - it: errors: messages: diff --git a/config/locales/devise/devise.lt.yml b/config/locales/devise/devise.lt.yml index d6e33c1cb..8ae8f027b 100644 --- a/config/locales/devise/devise.lt.yml +++ b/config/locales/devise/devise.lt.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - lt: errors: messages: diff --git a/config/locales/devise/devise.pl.yml b/config/locales/devise/devise.pl.yml index a490a1a39..503fb6d61 100644 --- a/config/locales/devise/devise.pl.yml +++ b/config/locales/devise/devise.pl.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - pl: errors: messages: diff --git a/config/locales/devise/devise.pt-BR.yml b/config/locales/devise/devise.pt-BR.yml index ba2b3b5de..5a39a4734 100644 --- a/config/locales/devise/devise.pt-BR.yml +++ b/config/locales/devise/devise.pt-BR.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - pt-BR: errors: messages: diff --git a/config/locales/devise/devise.pt-PT.yml b/config/locales/devise/devise.pt-PT.yml index cf16fd20d..c0c955517 100644 --- a/config/locales/devise/devise.pt-PT.yml +++ b/config/locales/devise/devise.pt-PT.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - pt-PT: errors: messages: diff --git a/config/locales/devise/devise.ro.yml b/config/locales/devise/devise.ro.yml index 63501ea7b..b4d12e6b6 100644 --- a/config/locales/devise/devise.ro.yml +++ b/config/locales/devise/devise.ro.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - ro: errors: messages: diff --git a/config/locales/devise/devise.ru.yml b/config/locales/devise/devise.ru.yml index 670d57026..1ac626861 100644 --- a/config/locales/devise/devise.ru.yml +++ b/config/locales/devise/devise.ru.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - ru: errors: messages: diff --git a/config/locales/devise/devise.sv.yml b/config/locales/devise/devise.sv.yml index 3c41ea81b..c83179bde 100644 --- a/config/locales/devise/devise.sv.yml +++ b/config/locales/devise/devise.sv.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - sv: errors: messages: diff --git a/config/locales/diaspora/cs.yml b/config/locales/diaspora/cs.yml index 91c904dc1..0f9ec4f09 100644 --- a/config/locales/diaspora/cs.yml +++ b/config/locales/diaspora/cs.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Sample localization file for Lithuanian. Add more files in this directory for other locales. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. diff --git a/config/locales/diaspora/cy.yml b/config/locales/diaspora/cy.yml index e0198b1b6..97b4fd3df 100644 --- a/config/locales/diaspora/cy.yml +++ b/config/locales/diaspora/cy.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Sample localization file for English. Add more files in this directory for other locales. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. diff --git a/config/locales/diaspora/de.yml b/config/locales/diaspora/de.yml index 9c7d67f4d..dd3cead59 100644 --- a/config/locales/diaspora/de.yml +++ b/config/locales/diaspora/de.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Localization file for German. Add more files in this directory for other locales. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 9db808746..025aed149 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Sample localization file for English. Add more files in this directory for other locales. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. diff --git a/config/locales/diaspora/es.yml b/config/locales/diaspora/es.yml index 1f6b6b2e7..37657e1f4 100644 --- a/config/locales/diaspora/es.yml +++ b/config/locales/diaspora/es.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Sample localization file for English. Add more files in this directory for other locales. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. diff --git a/config/locales/diaspora/fr-informal.yml b/config/locales/diaspora/fr-informal.yml index 2342ff1ce..141584dad 100644 --- a/config/locales/diaspora/fr-informal.yml +++ b/config/locales/diaspora/fr-informal.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Localization file for French (Informal Honorifics). Add more files in this directory for other locales. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. diff --git a/config/locales/diaspora/it.yml b/config/locales/diaspora/it.yml index bb44c6f27..4730b3cea 100644 --- a/config/locales/diaspora/it.yml +++ b/config/locales/diaspora/it.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Sample localization file for Italian. Add more files in this directory for other locales. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. diff --git a/config/locales/diaspora/lt.yml b/config/locales/diaspora/lt.yml index e1a529431..01295e389 100644 --- a/config/locales/diaspora/lt.yml +++ b/config/locales/diaspora/lt.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Sample localization file for Lithuanian. Add more files in this directory for other locales. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. diff --git a/config/locales/diaspora/pl.yml b/config/locales/diaspora/pl.yml index 2052779bd..c55b79691 100644 --- a/config/locales/diaspora/pl.yml +++ b/config/locales/diaspora/pl.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Sample localization file for English. Add more files in this directory for other locales. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. diff --git a/config/locales/diaspora/pt-BR.yml b/config/locales/diaspora/pt-BR.yml index 10425864b..aa7a7af35 100644 --- a/config/locales/diaspora/pt-BR.yml +++ b/config/locales/diaspora/pt-BR.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Sample localization file for Portuguese Brazilian. Add more files in this directory for other locales. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. diff --git a/config/locales/diaspora/pt-PT.yml b/config/locales/diaspora/pt-PT.yml index ce3d9abbc..6df399150 100644 --- a/config/locales/diaspora/pt-PT.yml +++ b/config/locales/diaspora/pt-PT.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Sample localization file for Portuguese Portugal. Add more files in this directory for other locales. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. diff --git a/config/locales/diaspora/ru.yml b/config/locales/diaspora/ru.yml index 1b5d3b958..cc76b9b42 100644 --- a/config/locales/diaspora/ru.yml +++ b/config/locales/diaspora/ru.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Sample localization file for Russian. Add more files in this directory for other locales. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. diff --git a/config/locales/diaspora/sv.yml b/config/locales/diaspora/sv.yml index dfb8deb7f..1aa9ac2dc 100644 --- a/config/locales/diaspora/sv.yml +++ b/config/locales/diaspora/sv.yml @@ -2,7 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Swedish localization file. # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. diff --git a/config/selenium.yml b/config/selenium.yml index 74ce21d73..0d679b602 100644 --- a/config/selenium.yml +++ b/config/selenium.yml @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - common: &common # Try to kill mongrel after suite if tmp/pids/mongrel_selenium.pid exists # kill_mongrel_after_suite: true diff --git a/config/sprinkle/conf/nginx.conf b/config/sprinkle/conf/nginx.conf index eba9fa45b..188daedcb 100644 --- a/config/sprinkle/conf/nginx.conf +++ b/config/sprinkle/conf/nginx.conf @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - worker_processes 1; pid /tmp/pids/nginx.pid; diff --git a/config/thin.yml b/config/thin.yml index ad91436c1..a49d85ce4 100644 --- a/config/thin.yml +++ b/config/thin.yml @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - rackup: /usr/local/app/diaspora/current/config.ru pid: /tmp/pids/thin.pid wait: 30 diff --git a/lib/tasks/db.rake b/lib/tasks/db.rake index 4b6202f29..e4e379a2a 100644 --- a/lib/tasks/db.rake +++ b/lib/tasks/db.rake @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - namespace :db do desc 'Seed the current RAILS_ENV database from db/seeds.rb' namespace :seed do diff --git a/lib/tasks/rspec.rake b/lib/tasks/rspec.rake index 35f0b8a98..54442d71e 100644 --- a/lib/tasks/rspec.rake +++ b/lib/tasks/rspec.rake @@ -2,8 +2,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - begin require 'rspec/core' require 'rspec/core/rake_task' diff --git a/ubuntu-setup.bash b/ubuntu-setup.bash index 117a78ed9..83c779b0c 100755 --- a/ubuntu-setup.bash +++ b/ubuntu-setup.bash @@ -8,7 +8,6 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - # Set extented globbing shopt -s extglob From 7e73f20c2aeebe536e5f40f2cdffbcac8a3f6a71 Mon Sep 17 00:00:00 2001 From: Dorian Date: Sun, 26 Sep 2010 11:51:25 +0200 Subject: [PATCH 104/155] Use whitespace:retab; manually retab ubuntu-setup.bash --- ubuntu-setup.bash | 52 +++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/ubuntu-setup.bash b/ubuntu-setup.bash index 83c779b0c..95d2a9628 100755 --- a/ubuntu-setup.bash +++ b/ubuntu-setup.bash @@ -64,32 +64,32 @@ echo "Installed git-core.." # Setting up ruby gems echo "Fetching and installing ruby gems.." ( - RELEASE=$(lsb_release -c | cut -f2) - if [ RELEASE == "maverick" ] - then - sudo apt-get install --no-install-recommends -y rubygems - sudo ln -s /var/lib/gems/1.8/bin/bundle /usr/local/bin/bundle #for PATH - elif [ RELEASE == "lucid" ] - then - sudo add-apt-repository ppa:maco.m/ruby - sudo apt-get update - sudo apt-get install --no-install-recommends -y rubygems - sudo ln -s /var/lib/gems/1.8/bin/bundle /usr/local/bin/bundle #for PATH - else - # Old version - echo "." - cd /tmp - wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz - echo "." - tar -xf rubygems-1.3.7.tgz - echo "." - cd rubygems-1.3.7 - echo "." - sudo ruby setup.rb - echo "." - sudo ln -s /usr/bin/gem1.8 /usr/bin/gem - echo "." - fi + RELEASE=$(lsb_release -c | cut -f2) + if [ RELEASE == "maverick" ] + then + sudo apt-get install --no-install-recommends -y rubygems + sudo ln -s /var/lib/gems/1.8/bin/bundle /usr/local/bin/bundle #for PATH + elif [ RELEASE == "lucid" ] + then + sudo add-apt-repository ppa:maco.m/ruby + sudo apt-get update + sudo apt-get install --no-install-recommends -y rubygems + sudo ln -s /var/lib/gems/1.8/bin/bundle /usr/local/bin/bundle #for PATH + else + # Old version + echo "." + cd /tmp + wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz + echo "." + tar -xf rubygems-1.3.7.tgz + echo "." + cd rubygems-1.3.7 + echo "." + sudo ruby setup.rb + echo "." + sudo ln -s /usr/bin/gem1.8 /usr/bin/gem + echo "." + fi ) echo "Done installing the gems.." From 611852bb74a61ce05f42cd36e70a101286cb75ec Mon Sep 17 00:00:00 2001 From: Dorian Date: Sun, 26 Sep 2010 11:53:42 +0200 Subject: [PATCH 105/155] Use rake whitespace:cleanup --- config/locales/diaspora/he.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/diaspora/he.yml b/config/locales/diaspora/he.yml index 90ced9435..9f7670a97 100644 --- a/config/locales/diaspora/he.yml +++ b/config/locales/diaspora/he.yml @@ -41,7 +41,7 @@ he: new_album: create: "צור" add_a_new_album: "הוסף אלבום חדש" - show: + show: edit_album: "ערוך אלבום" albums: "אלבומים" updated: "עדכן" From 0ec074be6d1ba626ea4814b4d06091b7a2f0d51f Mon Sep 17 00:00:00 2001 From: Sarah Mei Date: Sun, 26 Sep 2010 10:00:29 -0700 Subject: [PATCH 106/155] Remove annoying deprecation warning from spec runs Add spec for validation hook --- app/models/user.rb | 2 +- spec/models/user_spec.rb | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index ade7b7a2a..1e062b0c8 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -35,7 +35,7 @@ class User after_create :seed_aspects - before_validation_on_create :downcase_username + before_validation :downcase_username, :on => :create def self.find_for_authentication(conditions={}) if conditions[:username] =~ /^([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})$/i # email regex diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index ad7070eaa..46327576a 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -6,7 +6,14 @@ require 'spec_helper' describe User do let(:user) { Factory(:user) } - let(:aspect) { user.aspect(:name => 'heroes') } + + describe "validations" do + it "downcases the username" do + user = Factory.build(:user, :username => "ALLUPPERCASE") + user.valid? + user.username.should == "alluppercase" + end + end describe '#diaspora_handle' do it 'uses the pod config url to set the diaspora_handle' do @@ -27,6 +34,7 @@ describe User do end context 'aspects' do + let(:aspect) { user.aspect(:name => 'heroes') } let(:user2) { Factory(:user) } let(:aspect2) { user2.aspect(:name => 'stuff') } From 8d17b3537cdbd4a8b2e8ff5c780e579697dbe569 Mon Sep 17 00:00:00 2001 From: Stephen Caudill Date: Sun, 26 Sep 2010 14:18:58 -0400 Subject: [PATCH 107/155] Refactor to use a Background --- features/user_creates_an_aspect.feature | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/features/user_creates_an_aspect.feature b/features/user_creates_an_aspect.feature index 27cb6f2f3..fb65fde4c 100644 --- a/features/user_creates_an_aspect.feature +++ b/features/user_creates_an_aspect.feature @@ -4,20 +4,20 @@ Feature: User creates an aspect As a User I want to create a new aspect - Scenario: success + Background: Given I am signed in And I follow "Manage" in the header And I follow "Add a new aspect" - When I fill in "Name" with "Dorm Mates" in the modal window - And I press "Create" in the modal window + + Scenario: success + Given I fill in "Name" with "Dorm Mates" in the modal window + When I press "Create" in the modal window Then I should see "Manage Aspects" And I should see "Dorm Mates" in the header And I should see "Dorm Mates" in the aspect list Scenario: I omit the name - Given I am signed in - And I follow "Manage" in the header - And I follow "Add a new aspect" + Given I fill in "Name" with "" in the modal window When I press "Create" in the modal window Then I should see "Manage Aspects" And I should see "Aspect creation failed." From 5d1afe21be813c851e8b4ae8289a3d2472d76d2e Mon Sep 17 00:00:00 2001 From: Sarah Mei Date: Sun, 26 Sep 2010 13:08:30 -0700 Subject: [PATCH 108/155] Refactor user specs to speed up spec runs. --- spec/factories.rb | 16 +++- spec/models/user/posting_spec.rb | 111 +++++++++++++------------ spec/models/user/visible_posts_spec.rb | 68 ++++++--------- 3 files changed, 94 insertions(+), 101 deletions(-) diff --git a/spec/factories.rb b/spec/factories.rb index 834304e33..aecbf74cf 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -37,10 +37,18 @@ Factory.define :user do |u| u.sequence(:email) {|n| "bob#{n}@pivotallabs.com"} u.password "bluepin7" u.password_confirmation "bluepin7" - u.person { |a| Factory.create(:person_with_user, - :owner_id => a._id, - :diaspora_handle => "#{a.username}@#{APP_CONFIG[:pod_url].gsub(/(https?:|www\.)\/\//, '').chop!}") - } + u.after_build do |user| + user.person = Factory(:person_with_private_key, :owner_id => user._id, + :diaspora_handle => "#{user.username}@#{APP_CONFIG[:pod_url].gsub(/(https?:|www\.)\/\//, '').chop!}") + end +end + +Factory.define :user_with_aspect, :parent => :user do |u| + u.after_build { |user| user.aspects << Factory(:aspect) } +end + +Factory.define :aspect do |aspect| + aspect.name "generic" end Factory.define :status_message do |m| diff --git a/spec/models/user/posting_spec.rb b/spec/models/user/posting_spec.rb index 2f86ac549..76f4243f7 100644 --- a/spec/models/user/posting_spec.rb +++ b/spec/models/user/posting_spec.rb @@ -6,77 +6,78 @@ require 'spec_helper' describe User do - let(:user) { Factory(:user) } - let(:user2) { Factory(:user) } - let(:user3) { Factory(:user) } - let(:user4) { Factory(:user) } + let!(:user) { Factory(:user) } + let!(:aspect) { user.aspect(:name => 'heroes') } + let!(:aspect1) { user.aspect(:name => 'other') } - let(:aspect) {user.aspect(:name => 'heroes')} - let!(:aspect1) {user.aspect(:name => 'heroes')} - let!(:aspect2) {user2.aspect(:name => 'losers')} - let!(:aspect3) {user3.aspect(:name => 'heroes')} - let!(:aspect4) {user4.aspect(:name => 'heroes')} + let!(:user2) { Factory(:user) } + let!(:aspect2) { user2.aspect(:name => 'losers') } - before do - friend_users(user, aspect, user2, aspect2) - friend_users(user, aspect, user3, aspect3) - friend_users(user, aspect1, user4, aspect4) + describe '#validate_aspect_permissions' do + it 'requires an aspect' do + proc { + user.validate_aspect_permissions([]) + }.should raise_error /You must post to someone/ + end + + it "won't let you post to someone else's aspect" do + proc { + user.validate_aspect_permissions(aspect2.id) + }.should raise_error /Cannot post to an aspect you do not own./ + end + + it "lets you post to your own aspects" do + user.validate_aspect_permissions(aspect.id).should be_true + user.validate_aspect_permissions(aspect1.id).should be_true + end end - context 'posting' do - - describe '#validate_aspect_permissions' do - it 'should not be able to post without a aspect' do - proc { - user.validate_aspect_permissions([]) - }.should raise_error /You must post to someone/ - end - - it 'should not be able to post to someone elses aspect' do - proc { - user.validate_aspect_permissions(aspect2.id) - }.should raise_error /Cannot post to an aspect you do not own./ - end + describe '#post' do + it 'should put the post in the aspect post array' do + post = user.post(:status_message, :message => "hey", :to => aspect.id) + aspect.reload + aspect.posts.should include post end - describe '#post' do - it 'should put the post in the aspect post array' do - post = user.post(:status_message, :message => "hey", :to => aspect.id) - aspect.reload - aspect.posts.should include post - end - - it 'should put an album in the aspect post array' do - album = user.post :album, :name => "Georges", :to => aspect.id - aspect.reload - aspect.posts.should include album - end + it 'should put an album in the aspect post array' do + album = user.post :album, :name => "Georges", :to => aspect.id + aspect.reload + aspect.posts.should include album end + end - describe '#repost' do - let!(:status_message) { user.post(:status_message, :message => "hello", :to => aspect.id) } - - it 'should make the post visible in another aspect' do - user.repost( status_message, :to => aspect1.id ) - aspect1.reload - aspect1.posts.count.should be 1 - end + describe '#repost' do + it 'should make the post visible in another aspect' do + status_message = user.post(:status_message, :message => "hello", :to => aspect.id) + user.repost(status_message, :to => aspect1.id) + aspect1.reload + aspect1.posts.count.should be 1 end + end - describe '#update_post' do - let!(:album) { user.post(:album, :name => "Profile Photos", :to => aspect.id) } - - it 'should update fields' do - update_hash = { :name => "Other Photos" } - user.update_post( album, update_hash ) - album.name.should == "Other Photos" - end + describe '#update_post' do + it 'should update fields' do + album = user.post(:album, :name => "Profile Photos", :to => aspect.id) + update_hash = {:name => "Other Photos"} + user.update_post(album, update_hash) + album.name.should == "Other Photos" end end context 'dispatching' do + let!(:user3) { Factory(:user) } + let!(:aspect3) { user3.aspect(:name => 'heroes') } + let!(:user4) { Factory(:user) } + let!(:aspect4) { user4.aspect(:name => 'heroes') } + let!(:post) { user.build_post :status_message, :message => "hey" } + before do + friend_users(user, aspect, user2, aspect2) + friend_users(user, aspect, user3, aspect3) + friend_users(user, aspect1, user4, aspect4) + end + describe '#push_to_aspects' do it 'should push a post to a aspect' do user.should_receive(:salmon).twice diff --git a/spec/models/user/visible_posts_spec.rb b/spec/models/user/visible_posts_spec.rb index 8d20bcb96..e0a3d5215 100644 --- a/spec/models/user/visible_posts_spec.rb +++ b/spec/models/user/visible_posts_spec.rb @@ -5,41 +5,35 @@ require 'spec_helper' describe User do - let(:user) { Factory(:user) } + let!(:user) { Factory(:user_with_aspect) } + let!(:first_aspect) { user.aspects.first } + let!(:second_aspect) { user.aspect(:name => 'losers') } - let(:user2) { Factory(:user) } - let(:user3) { Factory(:user) } - let(:user4) { Factory(:user) } + let!(:user2) { Factory(:user_with_aspect) } - let!(:aspect) { user.aspect(:name => 'heroes') } - let!(:aspect2) { user.aspect(:name => 'losers') } - - let!(:user2_aspect) { user2.aspect(:name => 'dudes') } - let!(:user3_aspect) { user3.aspect(:name => 'dudes') } - let!(:user4_aspect) { user4.aspect(:name => 'dudes') } - - let(:status_message1) { user2.post :status_message, :message => "hi", :to => user2_aspect.id } - let(:status_message2) { user3.post :status_message, :message => "heyyyy", :to => user3_aspect.id } - let(:status_message3) { user4.post :status_message, :message => "yooo", :to => user4_aspect.id } + let!(:status_message1) { user2.post :status_message, :message => "hi", :to => user2.aspects.first.id } before do - friend_users(user, aspect, user2, user2_aspect) - friend_users(user, aspect2, user3, user3_aspect) - friend_users(user, aspect2, user4, user4_aspect) + friend_users(user, first_aspect, user2, user2.aspects.first) end - it 'should generate a valid stream for a aspect of people' do - (1..3).each{ |n| - eval("user.receive status_message#{n}.to_diaspora_xml") - } + describe "#visible_posts" do + it "generates a stream for each aspect that includes only that aspect's posts" do + user3 = Factory(:user_with_aspect) + status_message2 = user3.post :status_message, :message => "heyyyy", :to => user3.aspects.first.id + user4 = Factory(:user_with_aspect) + status_message3 = user4.post :status_message, :message => "yooo", :to => user4.aspects.first.id - user.visible_posts(:by_members_of => aspect).should include status_message1 - user.visible_posts(:by_members_of => aspect).should_not include status_message2 - user.visible_posts(:by_members_of => aspect).should_not include status_message3 + friend_users(user, second_aspect, user3, user3.aspects.first) + friend_users(user, second_aspect, user4, user4.aspects.first) - user.visible_posts(:by_members_of => aspect2).should_not include status_message1 - user.visible_posts(:by_members_of => aspect2).should include status_message2 - user.visible_posts(:by_members_of => aspect2).should include status_message3 + user.receive status_message1.to_diaspora_xml + user.receive status_message2.to_diaspora_xml + user.receive status_message3.to_diaspora_xml + + user.visible_posts(:by_members_of => first_aspect).should =~ [status_message1] + user.visible_posts(:by_members_of => second_aspect).should =~ [status_message2, status_message3] + end end context 'querying' do @@ -54,19 +48,9 @@ describe User do context 'albums' do before do - @album = user.post :album, :name => "Georges", :to => aspect.id - aspect.reload - aspect2.reload - user.reload - - @album2 = user.post :album, :name => "Borges", :to => aspect.id - aspect.reload - aspect2.reload - user.reload - - user.post :album, :name => "Luises", :to => aspect2.id - aspect.reload - aspect2.reload + user.post :album, :name => "Georges", :to => first_aspect.id + user.post :album, :name => "Borges", :to => first_aspect.id + user.post :album, :name => "Luises", :to => second_aspect.id user.reload end @@ -75,8 +59,8 @@ describe User do end it 'should return the right number of albums' do - user.albums_by_aspect(aspect).should have(2).albums - user.albums_by_aspect(aspect2).should have(1).album + user.albums_by_aspect(first_aspect.reload).should have(2).albums + user.albums_by_aspect(second_aspect.reload).should have(1).album end end end From 43fa70f90b9fcf7639756e35eea122b73e24ea27 Mon Sep 17 00:00:00 2001 From: Stephen Caudill Date: Sun, 26 Sep 2010 16:10:13 -0400 Subject: [PATCH 109/155] Label error notification as such. --- app/controllers/aspects_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index 80e4c7d0d..2bfdee238 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -18,7 +18,7 @@ class AspectsController < ApplicationController if @aspect.valid? flash[:notice] = I18n.t('aspects.create.success') else - flash[:notice] = I18n.t('aspects.create.failure') + flash[:error] = I18n.t('aspects.create.failure') end respond_with :location => aspects_manage_path end From cf0df90daecb6c7ba5b602d3f11db38326b7784c Mon Sep 17 00:00:00 2001 From: ilya Date: Sun, 26 Sep 2010 22:08:42 -0700 Subject: [PATCH 110/155] moved the private key into user where it belongs, two failing cucumber tests --- app/models/person.rb | 20 ++++++-------------- app/models/user.rb | 24 ++++++++++++++++++++---- lib/diaspora/user/receiving.rb | 2 +- lib/encryptable.rb | 4 ++-- lib/encryptor.rb | 2 +- spec/factories.rb | 9 ++++----- spec/lib/diaspora_parser_spec.rb | 9 ++++++--- spec/user_encryption_spec.rb | 32 ++++++++++++++------------------ 8 files changed, 54 insertions(+), 48 deletions(-) diff --git a/app/models/person.rb b/app/models/person.rb index 9527a7bb7..2601de2bc 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -17,7 +17,7 @@ class Person key :url, String key :diaspora_handle, String, :unique => true - key :serialized_key, String + key :serialized_public_key, String key :owner_id, ObjectId @@ -29,7 +29,7 @@ class Person before_destroy :remove_all_traces before_validation :clean_url - validates_presence_of :url, :profile, :serialized_key + validates_presence_of :url, :profile, :serialized_public_key validates_format_of :url, :with => /^(https?):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*(\.[a-z]{2,5})?(:[0-9]{1,5})?(\/.*)?$/ix @@ -49,30 +49,22 @@ class Person "#{self.url}receive/users/#{self.id}/" end - def encryption_key - OpenSSL::PKey::RSA.new( serialized_key ) - end - - def encryption_key= new_key - raise TypeError unless new_key.class == OpenSSL::PKey::RSA - serialized_key = new_key.export - end def public_key_hash Base64.encode64 OpenSSL::Digest::SHA256.new(self.exported_key).to_s end def public_key - encryption_key.public_key + OpenSSL::PKey::RSA.new( serialized_public_key ) end def exported_key - encryption_key.public_key.export + serialized_public_key end def exported_key= new_key - raise "Don't change a key" if serialized_key - @serialized_key = new_key + raise "Don't change a key" if serialized_public_key + @serialized_public_key = new_key end def self.by_webfinger( identifier, opts = {}) diff --git a/app/models/user.rb b/app/models/user.rb index a93b3a727..535577fd3 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -18,6 +18,7 @@ class User devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable key :username, :unique => true + key :serialized_private_key, String key :friend_ids, Array key :pending_request_ids, Array @@ -251,7 +252,9 @@ class User def self.instantiate!( opts = {} ) opts[:person][:diaspora_handle] = "#{opts[:username]}@#{APP_CONFIG[:terse_pod_url]}" opts[:person][:url] = APP_CONFIG[:pod_url] - opts[:person][:serialized_key] = generate_key + + opts[:serialized_private_key] = generate_key + opts[:person][:serialized_public_key] = opts[:serialized_private_key].public_key User.create(opts) end @@ -278,7 +281,20 @@ class User } } end - def self.generate_key - OpenSSL::PKey::RSA::generate 4096 - end + + + def self.generate_key + OpenSSL::PKey::RSA::generate 4096 + end + + def encryption_key + OpenSSL::PKey::RSA.new( serialized_private_key ) + end + + def encryption_key= new_key + raise TypeError unless new_key.class == OpenSSL::PKey::RSA + serialized_private_key = new_key.export + end + + end diff --git a/lib/diaspora/user/receiving.rb b/lib/diaspora/user/receiving.rb index 39b1af5d2..5d737d8e9 100644 --- a/lib/diaspora/user/receiving.rb +++ b/lib/diaspora/user/receiving.rb @@ -43,7 +43,7 @@ module Diaspora def receive_request request, xml person = Diaspora::Parser.parse_or_find_person_from_xml( xml ) - person.serialized_key ||= request.exported_key + person.serialized_public_key ||= request.exported_key request.person = person request.person.save old_request = Request.first(:id => request.id) diff --git a/lib/encryptable.rb b/lib/encryptable.rb index 5b00ca9ea..133c05156 100644 --- a/lib/encryptable.rb +++ b/lib/encryptable.rb @@ -15,7 +15,7 @@ if person.nil? Rails.logger.info("Verifying sig on #{signable_string} but no person is here") return false - elsif person.encryption_key.nil? + elsif person.public_key.nil? Rails.logger.info("Verifying sig on #{signable_string} but #{person.real_name} has no key") return false elsif signature.nil? @@ -23,7 +23,7 @@ return false end Rails.logger.debug("Verifying sig on #{signable_string} from person #{person.real_name}") - validity = person.encryption_key.verify "SHA", Base64.decode64(signature), signable_string + validity = person.public_key.verify "SHA", Base64.decode64(signature), signable_string Rails.logger.debug("Validity: #{validity}") validity end diff --git a/lib/encryptor.rb b/lib/encryptor.rb index d90e8bdfe..e9c4936e1 100644 --- a/lib/encryptor.rb +++ b/lib/encryptor.rb @@ -31,7 +31,7 @@ module Encryptor end def encrypt_aes_key key - Base64.encode64 encryption_key.public_encrypt( key.to_json ) + Base64.encode64 public_key.public_encrypt( key.to_json ) end end diff --git a/spec/factories.rb b/spec/factories.rb index aecbf74cf..826ca970d 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -17,7 +17,7 @@ Factory.define :person do |p| p.sequence(:url) {|n| "http://google-#{n}.com/"} p.profile Factory.create(:profile) - p.serialized_key OpenSSL::PKey::RSA.generate(1024).public_key.export + p.serialized_public_key OpenSSL::PKey::RSA.generate(1024).public_key.export end Factory.define :album do |p| @@ -29,16 +29,15 @@ Factory.define :person_with_private_key, :parent => :person do |p| p.serialized_key OpenSSL::PKey::RSA.generate(1024).export end -Factory.define :person_with_user, :parent => :person_with_private_key do |p| -end - Factory.define :user do |u| u.sequence(:username) {|n| "bob#{n}"} u.sequence(:email) {|n| "bob#{n}@pivotallabs.com"} u.password "bluepin7" u.password_confirmation "bluepin7" + u.serialized_private_key OpenSSL::PKey::RSA.generate(1024).export u.after_build do |user| - user.person = Factory(:person_with_private_key, :owner_id => user._id, + user.person = Factory(:person, :owner_id => user._id, + :serialized_public_key => user.encryption_key.public_key.export, :diaspora_handle => "#{user.username}@#{APP_CONFIG[:pod_url].gsub(/(https?:|www\.)\/\//, '').chop!}") end end diff --git a/spec/lib/diaspora_parser_spec.rb b/spec/lib/diaspora_parser_spec.rb index e37cf0116..530dca211 100644 --- a/spec/lib/diaspora_parser_spec.rb +++ b/spec/lib/diaspora_parser_spec.rb @@ -8,7 +8,9 @@ describe Diaspora::Parser do before do @user = Factory.create(:user, :email => "bob@aol.com") @aspect = @user.aspect(:name => 'spies') - @person = Factory.create(:person_with_private_key, :diaspora_handle => "bill@gates.com") + + @user3 = Factory.create :user + @person = @user3.person @user2 = Factory.create(:user) end @@ -64,12 +66,13 @@ describe Diaspora::Parser do original_person_id = @person.id xml = request.to_diaspora_xml + @user3.destroy @person.destroy Person.all.count.should == person_count -1 @user.receive xml Person.all.count.should == person_count - Person.first(:_id => original_person_id).serialized_key.include?("PUBLIC").should be true + Person.first(:_id => original_person_id).serialized_public_key.include?("PUBLIC").should be true url = "http://" + request.callback_url.split("/")[2] + "/" Person.where(:url => url).first.id.should == original_person_id end @@ -87,7 +90,7 @@ describe Diaspora::Parser do @user2.reload @user2.person.reload - @user2.person.serialized_key.include?("PRIVATE").should be true + @user2.serialized_private_key.include?("PRIVATE").should be true url = "http://" + request.callback_url.split("/")[2] + "/" Person.where(:url => url).first.id.should == original_person_id diff --git a/spec/user_encryption_spec.rb b/spec/user_encryption_spec.rb index b74006e3d..2188b106e 100644 --- a/spec/user_encryption_spec.rb +++ b/spec/user_encryption_spec.rb @@ -9,16 +9,9 @@ describe 'user encryption' do unstub_mocha_stubs @user = Factory.create(:user) @aspect = @user.aspect(:name => 'dudes') - @person = Factory.create(:person_with_private_key, - :profile => Profile.new(:first_name => 'Remote', - :last_name => 'Friend'), - :diaspora_handle => 'somewhere@else.com', - :url => 'http://distant-example.com/') - @person2 = Factory.create(:person_with_private_key, - :profile => Profile.new(:first_name => 'Second', - :last_name => 'Friend'), - :diaspora_handle => 'elsewhere@else.com', - :url => 'http://distanter-example.com/') + + @user2 = Factory.create(:user) + @aspect2 = @user2.aspect(:name => 'dudes') end after do @@ -74,7 +67,10 @@ describe 'user encryption' do describe 'comments' do before do - @remote_message = Factory.create(:status_message, :person => @person) + friend_users(@user, @aspect, @user2, @aspect2) + @remote_message = @user2.post :status_message, :message => "hello", :to => @aspect2.id + + @message = @user.post :status_message, :message => "hi", :to => @aspect.id end it 'should attach the creator signature if the user is commenting' do @@ -90,24 +86,24 @@ describe 'user encryption' do end it 'should verify a comment made on a remote post by a different friend' do - comment = Comment.new(:person => @person2, :text => "balls", :post => @remote_message) - comment.creator_signature = comment.send(:sign_with_key,@person2.encryption_key) + comment = Comment.new(:person => @user2.person, :text => "cats", :post => @remote_message) + comment.creator_signature = comment.send(:sign_with_key,@user2.encryption_key) comment.signature_valid?.should be true comment.verify_post_creator_signature.should be false - comment.post_creator_signature = comment.send(:sign_with_key,@person.encryption_key) + comment.post_creator_signature = comment.send(:sign_with_key,@user.encryption_key) comment.verify_post_creator_signature.should be true end it 'should reject comments on a remote post with only a creator sig' do - comment = Comment.new(:person => @person2, :text => "balls", :post => @remote_message) - comment.creator_signature = comment.send(:sign_with_key,@person2.encryption_key) + comment = Comment.new(:person => @user2.person, :text => "cats", :post => @remote_message) + comment.creator_signature = comment.send(:sign_with_key,@user2.encryption_key) comment.signature_valid?.should be true comment.verify_post_creator_signature.should be false end it 'should receive remote comments on a user post with a creator sig' do - comment = Comment.new(:person => @person2, :text => "balls", :post => @message) - comment.creator_signature = comment.send(:sign_with_key,@person2.encryption_key) + comment = Comment.new(:person => @user2.person, :text => "cats", :post => @message) + comment.creator_signature = comment.send(:sign_with_key,@user2.encryption_key) comment.signature_valid?.should be true comment.verify_post_creator_signature.should be false end From f36b99b03c008cd344d28b2db104877a75756b3a Mon Sep 17 00:00:00 2001 From: ilya Date: Sun, 26 Sep 2010 22:13:28 -0700 Subject: [PATCH 111/155] changed the deploy_config to play on remote --- config/deploy_config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/deploy_config.yml b/config/deploy_config.yml index 6aacbf3ff..6443a51ac 100644 --- a/config/deploy_config.yml +++ b/config/deploy_config.yml @@ -6,7 +6,7 @@ cross_server: deploy_to: '/usr/local/app/diaspora' user: 'root' repo: 'git://github.com/diaspora/diaspora.git' - branch: 'master' + branch: 'private_key_user_refactor' default_env: 'development' servers: tom: From b4d4986758f0cf17e3ceca0f706ca80e6652d98f Mon Sep 17 00:00:00 2001 From: danielvincent Date: Sun, 26 Sep 2010 22:20:01 -0700 Subject: [PATCH 112/155] removed inclusion block --- lib/diaspora/webhooks.rb | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/lib/diaspora/webhooks.rb b/lib/diaspora/webhooks.rb index 2be45d76a..fc241a6d3 100644 --- a/lib/diaspora/webhooks.rb +++ b/lib/diaspora/webhooks.rb @@ -4,16 +4,12 @@ module Diaspora module Webhooks - def self.included(klass) - klass.class_eval do - def to_diaspora_xml - xml = "" - xml += "#{self.to_xml.to_s}" - xml += "" - end - - end + def to_diaspora_xml + xml = "" + xml += "#{to_xml.to_s}" + xml += "" end + end end From 08c0c345f5f163d84b832e2c31ae4bf15c7364fc Mon Sep 17 00:00:00 2001 From: Yaron Shahrabani Date: Mon, 27 Sep 2010 09:49:38 +0200 Subject: [PATCH 113/155] Updated Hebrew translation --- config/locales/devise/devise.he.yml | 43 +++--- config/locales/diaspora/he.yml | 195 ++++++++++++++-------------- 2 files changed, 122 insertions(+), 116 deletions(-) diff --git a/config/locales/devise/devise.he.yml b/config/locales/devise/devise.he.yml index 4ae726a4d..c33cfa678 100644 --- a/config/locales/devise/devise.he.yml +++ b/config/locales/devise/devise.he.yml @@ -1,8 +1,9 @@ # Copyright (c) 2010, Diaspora Inc. This file is # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. +# Translated to Hebrew by Yaron Shahrabani , 2010. -en: +he: errors: messages: not_found: "לא נמצא" @@ -11,30 +12,30 @@ en: devise: failure: - unauthenticated: "צריך להתחבר או להירשם לפני שאפשר להמשיך." - unconfirmed: "צריך לאשר את החשבון לפני שאפשר להמשיך." - locked: "החשבון שלך נעול." - invalid: "אימייל או סיסמה לא נכונים." - invalid_token: "מספר אימות לא נכון." - timeout: "פג תוקפו של החיבור. נא להתחבר מחדש על מנת להמשיך." - inactive: "החשבון לא אומת עדיין." + unauthenticated: "עליך להיכנס או להירשם לפני המשך הפעילות." + unconfirmed: "עליך לאמת את חשבונך לפי המשך הפעילות." + locked: "חשבונך נעול." + invalid: "הססמה או הדוא״ל שגויים." + invalid_token: "אסימון האימות שגוי." + timeout: "ההפעלה שלך פגה, נא להיכנס שוב כדי להמשיך." + inactive: "חשבונך לא הופעל עדין." sessions: - signed_in: "התחברות עברה בהצלחה." - signed_out: "התנתקות עברה בהצלחה." + signed_in: "נכנסת בהצלחה." + signed_out: "יצאת בהצלחה." passwords: - send_instructions: "אימייל עם הוראות עיצד לאפס סיסמה יתקבל בקרוב." - updated: "סיסמה הוחלפה בהצלחה, את/ה כעת מחובר/ת." + send_instructions: "בעוד מספר דקות תתקבל לתיבת הדוא״ל שלך הודעה עם הנחיות כיצד לאפס את ססמתך." + updated: "ססמתך הוחלפה בהצלחה. נכנסת כעת." confirmations: - send_instructions: "אימייל עם הוראות כיצד לאמת את החשבון יתקבל בקרוב." - confirmed: "חשבון אומת בהצלחה. את/ה כעת מחובר/ת." + send_instructions: "בעוד מספר דקות תתקבל לתיבת הדוא״ל שלך הודעה עם הנחיות כיצד לאמת את חשבונך." + confirmed: "חשבונך אומת בהצלחה. נכנסת כעת." registrations: - signed_up: "התחברת בהצלחה, אם הדבר מאופשר, יתקבל אימייל אישור בקרוב.." + signed_up: "נרשמת בהצלחה. הודעת אימות תישלח אליך לדוא״ל במידה שהוגדרה." updated: "חשבונך עודכן בהצלחה." - destroyed: "להתראות! חשבונך נמחק בהצלחה. מקווים לראותך שוב בקרוב!" + destroyed: "להתראות! חשבונך בוטל בהצלחה. מקווים לראותך שוב בקרוב." unlocks: - send_instructions: "אימייל עם הוראות כיצד להסיר את הנעילה מחשבונך יתקבל בקרוב." - unlocked: "חשבונך נפתח בהצלחה. את/ה כעת מחובר/ת." + send_instructions: "בעוד מספר דקות תתקבל לתיבת הודא״ל שלך הודעה עם הנחיות כיצד לשחרר את חשבונך." + unlocked: "חשבונך שוחרר בהצלחה. נכנסת כעת." mailer: - confirmation_instructions: "הוראות אישור" - reset_password_instructions: "הוראות איפוס סיסמה" - unlock_instructions: "הוראות הסרת נעילה" + confirmation_instructions: "הנחיות לאימות" + reset_password_instructions: "הנחיות לאיפוס הססמה" + unlock_instructions: "הנחיות לשחרור" diff --git a/config/locales/diaspora/he.yml b/config/locales/diaspora/he.yml index 9f7670a97..8b348b3c7 100644 --- a/config/locales/diaspora/he.yml +++ b/config/locales/diaspora/he.yml @@ -1,67 +1,72 @@ # Copyright (c) 2010, Diaspora Inc. This file is # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. +# Translated to Hebrew by Yaron Shahrabani , 2010. + + +# Sample localization file for English. Add more files in this directory for other locales. +# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. he: hello: "שלום עולם" application: helper: - unknown_person: "אדם לא מוכר" + unknown_person: "אדם לא ידוע" new_requests: "בקשות חדשות" dashboards: helper: home: "בית" error_messages: helper: - invalid_fields: "שדות לא חוקיים" - correct_the_following_errors_and_try_again: "נא לתקן את השגיאות הבאות ולנסות שוב." + invalid_fields: "שדות שגויים" + correct_the_following_errors_and_try_again: "יש לתקן את השגיאות הבאות ולנסות שוב." people: helper: results_for: " תוצאות עבור %{params}" - people_on_pod_are_aware_of: " אנשים בפוד מכירים את" + people_on_pod_are_aware_of: " אנשים בפוד מודעים לכך" layouts: application: - edit_profile: "ערוך פרופיל" - logout: "התנתק" + edit_profile: "עריכת הפרופיל" + logout: "יציאה" shared: aspect_nav: - all_aspects: "כל האספקטים" - manage: "נהל" - manage_your_aspects: "נהל אספקטים" + all_aspects: "כל ההיבטים" + manage: "ניהול" + manage_your_aspects: "ניהול ההיבטים שלך" sub_header: - all_aspects: "כל האספקטים" - manage_aspects: "נהל אספקטים" + all_aspects: "כל ההיבטים" + manage_aspects: "ניהול ההיבטים" publisher: - share: "שתף" + share: "שיתוף" aspect_friends: - add_friends: "הוסף חברים" + add_friends: "הוספת חברים" albums: album: - you: "אתה" + you: "את/ה" new_album: - create: "צור" - add_a_new_album: "הוסף אלבום חדש" - show: - edit_album: "ערוך אלבום" + create: "יצירה" + add_a_new_album: "הוספת אלבום חדש" + show: + edit_album: "עריכת אלבום" albums: "אלבומים" - updated: "עדכן" + updated: "תאריך העדכון" by: "על ידי" edit: editing: "עריכה" - updated: "עודכן" - are_you_sure: "האם את/ה בטוח/ה?" - delete_album: "מחק אלבום" - cancel: "בטל" + updated: "תאריך העדכון" + are_you_sure: "בבטחה?" + delete_album: "מחיקת אלבום" + cancel: "ביטול" index: home: "בית" new_album: "אלבום חדש" create: success: "יצרת אלבום בשם %{name}." update: - success: "אלבום %{name} עודכן בהצלחה." - failure: "עריכת אלבום %{name} נכשלה." + success: "האלבום %{name} נערך בהצלחה." + failure: "אירע כשל בעריכת האלבום %{name}." destroy: - success: "אלבום %{name} נמחק." + success: "האלבום %{name} נמחק." helper: friends_albums: "אלבומים של חברים" your_albums: "האלבומים שלך" @@ -71,42 +76,42 @@ he: show: photos: "תמונות" manage: - add_a_new_aspect: "הוסף אספקט" - add_a_new_friend: "הוסף חבר" - show: "הצג" - update_aspects: "עדכן אספקטים" + add_a_new_aspect: "הוספת היבט חדש" + add_a_new_friend: "הוספת חבר חדש" + show: "הצגה" + update_aspects: "עדכון ההיבטים" requests: "בקשות" - ignore_remove: "התעלם/מחק" + ignore_remove: "התעלמות/הסרה" new_aspect: - add_a_new_aspect: "הוסף אספקט" - create: "צור" + add_a_new_aspect: "הוספת היבט חדש" + create: "יציאה" create: - success: "לחץ על הפלוס בצד ימין על מנת לקבוע מי רשאי לצפות באספקט." + success: "יש ללחוץ על סמל הפלוס שמימין כדי לומר לדיאספורה מי יעול לצפות בהיבט החדש שלך." destroy: success: "%{name} הוסר בהצלחה." update: - success: "האספקט שלך, %{name}, נערך בהצלחה." + success: "ההיבט שלך, %{name}, נערך בהצלחה." move_friends: - failure: "עריכת אספקט נכשלה עבור %{real_name}." - success: "אספקטים נערכו בהצלחה." + failure: "עריכת ההיבט נכשלה עבור החבר %{real_name}." + success: "ההיבטים נערכו בהצלחה." move_friend: failure: "לא עבד %{inspect}" - success: "אתה כעת מציג לחברך אספקט שונה שלך." + success: "כעת יופיע בפני החברים שלך היבט אחר שלך." helper: - remove: "מחק" - aspect_not_empty: "אספקט לא ריק" + remove: "הסרה" + aspect_not_empty: "ההיסט אינו ריק" users: edit: - cancel: "בטל" - update_profile: "עדכן פרופיל" + cancel: "ביטול" + update_profile: "עדכון הפרופיל" home: "בית" - diaspora_username: "שם משתמש בדיאספורה" - info: "מידע" + diaspora_username: "שם המשתמש בדיאספורה" + info: "פרטים" picture: "תמונה" - editing_profile: "עורך פרופיל" + editing_profile: "עריכת הפרופיל" albums: "אלבומים" - you_dont_have_any_photos: "אין לך תמונות! עבור ל-" - page_to_upload_some: "דף להעלאה." + you_dont_have_any_photos: "אין לך תמונות! באפשרותך לגשת לעמוד" + page_to_upload_some: "כדי להעלות כמה." comments: comment: ago: "לפני" @@ -114,88 +119,88 @@ he: comment: "הערה" photos: show: - prev: "קודם" + prev: "הקודמת" full_size: "גודל מלא" - next: "הבא" - edit_photo: "ערוך תמונה" - delete_photo: "מחק תמונה" - are_you_sure: "האם אתה בטוח?" + next: "הבאה" + edit_photo: "עריכת תמונה" + delete_photo: "מחיקת תמונה" + are_you_sure: "בבטחה?" comments: "הערות" edit: editing: "עריכה" - are_you_sure: "האם אתה בטוח?" - delete_photo: "מחק תמונה" + are_you_sure: "בבטחה?" + delete_photo: "מחיקת תמונה" photo: - show_comments: "הצג הערות" - posted_a_new_photo_to: "הועלתה תמונה חדשה ל-" + show_comments: "הצגת הערות" + posted_a_new_photo_to: "פורסמה תמונה חדשה אל" new: new_photo: "תמונה חדשה" - back_to_list: "חרה לרשימה" - post_it: "שתף!" + back_to_list: "חזרה לרשימה" + post_it: "פרסום!" create: - runtime_error: "העלאת תמונה נכשלה. האם אתה חוגר חגורת בטיחות?" - integrity_error: "העלאת תמונה נכשלה. האם זו אכן הייתה תמונה?" - type_error: "העלאת תמונה נכשלה. האם אכן נוספה תמונה?" + runtime_error: "העלאת התמונה נכשלה. האם החגורה שלך מהודקת?" + integrity_error: "העלאת התמונה נכשלה. האם זו באמת הייתה תמונה?" + type_error: "העלאת התמונה נכשלה. האם באמת נוספה תמונה?" update: - notice: "תמונה עודכנה בהצלחה." - error: "עריכת תמונה נכשלה." + notice: "התמונה עודכנה בהצלחה." + error: "אירע כשל בעריכת התמונה." destroy: - notice: "תמונה נמחקה." + notice: "התמונה נמחקה." registrations: new: - sign_up: "הצטרפות" + sign_up: "הרשמה" create: success: "הצטרפת לדיאספורה!" status_messages: new_status_message: - tell_me_something_good: "ספר לי משהו נחמד" + tell_me_something_good: "בא לי לשמוע סיפור טוב" oh_yeah: "אחלה!" status_message: - show_comments: "הצג תגובות" - delete: "מחק" - are_you_sure: "האם אתה בטוח?" + show_comments: "הצגת הערות" + delete: "מחיקה" + are_you_sure: "בבטחה?" show: - status_message: "הודעת סטטוס" + status_message: "הודעת מצב" comments: "הערות" - are_you_sure: "האם אתה בטוח?" - destroy: "השמד" - view_all: "הצג הכל" + are_you_sure: "בבטחה?" + destroy: "הריבה" + view_all: "צפייה בכול" message: "הודעה" owner: "בעלים" helper: - no_message_to_display: "אין הודעה להציג." + no_message_to_display: "אין הודעה להצגה." people: person: - add_friend: "הוסף חבר" - pending_request: "בקשה על תנאי" + add_friend: "הוספת חבר" + pending_request: "בקשה ממתינה" index: - add_friend: "הוסף חבר" - real_name: "שם אמיתי" + add_friend: "הוספת חבר" + real_name: "שם אמתי" diaspora_handle: "כינוי בדיאספורה" - thats_you: "זה אתה!" - friend_request_pending: "בקשת חברות ממתינה" + thats_you: "מדובר בך!" + friend_request_pending: "בקשת החברות ממתינה" you_have_a_friend_request_from_this_person: "יש לך בקשת חברות מאדם זה" new: new_person: "אדם חדש" back_to_list: "חזרה לרשימה" show: - last_seen: "נראה לאחרונה: %{how_long_ago}" + last_seen: "פעילות אחרונה: %{how_long_ago}" friends_since: "חברים מאז: %{how_long_ago}" - save: "שמור" - are_you_sure: "האם אתה בטוח?" - remove_friend: "מחק חבר" + save: "שמירה" + are_you_sure: "בבטחה?" + remove_friend: "הסרת חבר" requests: new_request: - add_a_new_friend_to: "הוסף חבר חדש ל-" - enter_a_diaspora_username: "הכנס שם משתמש בדיאספורה:" - your_diaspora_username_is: "שם המשתמש שלך בדיאספורה: %{diaspora_handle}" - friends_username: "שם המשתמש של חבר" + add_a_new_friend_to: "הוספת חבר חדש אל" + enter_a_diaspora_username: "נא להזין שם משתמש בדיאספורה:" + your_diaspora_username_is: "שם המשתמש שלך בדיאספורה הוא: %{diaspora_handle}" + friends_username: "שם המשתמש של החבר" destroy: - success: "אתם כעת חברים." - error: "נא לבחור אספקט!" - ignore: "התעלמת מבקשת חברות." + success: "אתם חברים כעת." + error: "נא לבחור בהיבט!" + ignore: "בקשות חברות מהן התעלמת." create: - error: "לא נמצא זרע דיאספורה עם אימייל זה!" - already_friends: "את/ה כבר חבר של %{destination_url}!" - success: "בקשת חברות נשלחה ל%{destination_url}." - horribly_wrong: "משהו רע מאוד קרה." + error: "לא נמצא זרע של דיאספורה בכתובת דוא״ל זו!" + already_friends: "את/ה ו%{destination_url} כבר חברים!" + success: "בקשת חברות נשלחה אל %{destination_url}." + horribly_wrong: "משהו השתבש לגמרי." From 98bc2df841506ecccbec96274e65e8d88d042e65 Mon Sep 17 00:00:00 2001 From: ilya Date: Mon, 27 Sep 2010 10:10:54 -0700 Subject: [PATCH 114/155] removed the encryption key= method, and user with private key factory --- app/models/user.rb | 6 ------ spec/factories.rb | 4 ---- 2 files changed, 10 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 535577fd3..d89b8b59a 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -291,10 +291,4 @@ class User OpenSSL::PKey::RSA.new( serialized_private_key ) end - def encryption_key= new_key - raise TypeError unless new_key.class == OpenSSL::PKey::RSA - serialized_private_key = new_key.export - end - - end diff --git a/spec/factories.rb b/spec/factories.rb index 826ca970d..9f8efc4c3 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -25,10 +25,6 @@ Factory.define :album do |p| p.person { |a| Factory.create(:person) } end -Factory.define :person_with_private_key, :parent => :person do |p| - p.serialized_key OpenSSL::PKey::RSA.generate(1024).export -end - Factory.define :user do |u| u.sequence(:username) {|n| "bob#{n}"} u.sequence(:email) {|n| "bob#{n}@pivotallabs.com"} From 0aa8e0e7539cac21bbdd05ca52ea3d43d947e2b3 Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 27 Sep 2010 10:39:29 -0700 Subject: [PATCH 115/155] Unfortunately, we can't put ruby-debug in the gemfile because it breaks 1.9.2 compatibility. Just put it back in locally when you want to use it, or figure out how to do a switch by ruby verison in the Gemfile --- Gemfile | 1 - Gemfile.lock | 8 -------- 2 files changed, 9 deletions(-) diff --git a/Gemfile b/Gemfile index 7fde201c1..9560f07d1 100644 --- a/Gemfile +++ b/Gemfile @@ -38,7 +38,6 @@ gem 'mini_magick' group :test, :development do gem 'factory_girl_rails' - gem 'ruby-debug' end group :test do diff --git a/Gemfile.lock b/Gemfile.lock index a56760270..71e42e422 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -116,7 +116,6 @@ GEM rack (>= 1.0.0) rack-test (>= 0.5.4) selenium-webdriver (>= 0.0.3) - columnize (0.3.1) crack (0.1.8) cucumber (0.9.0) builder (~> 2.1.2) @@ -152,7 +151,6 @@ GEM i18n (0.4.1) json (1.4.6) json_pure (1.4.6) - linecache (0.43) mail (2.2.6.1) activesupport (>= 2.3.6) mime-types @@ -214,11 +212,6 @@ GEM rspec-rails (2.0.0.beta.17) rspec (>= 2.0.0.beta.14) webrat (>= 0.7.0) - ruby-debug (0.10.3) - columnize (>= 0.1) - ruby-debug-base (~> 0.10.3.0) - ruby-debug-base (0.10.3) - linecache (>= 0.3) rubyzip (0.9.4) selenium-webdriver (0.0.28) ffi (>= 0.6.1) @@ -278,7 +271,6 @@ DEPENDENCIES roxml! rspec (>= 2.0.0.beta.17) rspec-rails (= 2.0.0.beta.17) - ruby-debug sprinkle! thin webmock From 4f89f957f10ac251c6b8659fa45ca70b5efbf09b Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 27 Sep 2010 10:51:29 -0700 Subject: [PATCH 116/155] Putting in version switches for gems that don't work in 1.9 --- Gemfile | 3 ++- Gemfile.lock | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 9560f07d1..55e340dec 100644 --- a/Gemfile +++ b/Gemfile @@ -38,6 +38,7 @@ gem 'mini_magick' group :test, :development do gem 'factory_girl_rails' + gem 'ruby-debug' if RUBY_VERSION.include? "1.8" end group :test do @@ -46,7 +47,7 @@ group :test do gem 'rspec', '>= 2.0.0.beta.17' gem 'rspec-rails', '2.0.0.beta.17' gem 'mocha' - gem 'redgreen' + gem 'redgreen' if RUBY_VERSION.include? "1.8" gem 'autotest' gem 'database_cleaner' gem 'webmock' diff --git a/Gemfile.lock b/Gemfile.lock index 71e42e422..a56760270 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -116,6 +116,7 @@ GEM rack (>= 1.0.0) rack-test (>= 0.5.4) selenium-webdriver (>= 0.0.3) + columnize (0.3.1) crack (0.1.8) cucumber (0.9.0) builder (~> 2.1.2) @@ -151,6 +152,7 @@ GEM i18n (0.4.1) json (1.4.6) json_pure (1.4.6) + linecache (0.43) mail (2.2.6.1) activesupport (>= 2.3.6) mime-types @@ -212,6 +214,11 @@ GEM rspec-rails (2.0.0.beta.17) rspec (>= 2.0.0.beta.14) webrat (>= 0.7.0) + ruby-debug (0.10.3) + columnize (>= 0.1) + ruby-debug-base (~> 0.10.3.0) + ruby-debug-base (0.10.3) + linecache (>= 0.3) rubyzip (0.9.4) selenium-webdriver (0.0.28) ffi (>= 0.6.1) @@ -271,6 +278,7 @@ DEPENDENCIES roxml! rspec (>= 2.0.0.beta.17) rspec-rails (= 2.0.0.beta.17) + ruby-debug sprinkle! thin webmock From ce0accafbbafa06b0ea5218763527ef7a335e3c2 Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 27 Sep 2010 11:03:48 -0700 Subject: [PATCH 117/155] Don't depend on user => person delagation so we can eventually get rid of that, thanks astronouth7303 --- app/controllers/users_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 260b5b7fa..243d448d8 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -10,7 +10,7 @@ class UsersController < ApplicationController def edit @user = current_user @person = @user.person - @profile = @user.profile + @profile = @user.person.profile @photos = Photo.find_all_by_person_id(@person.id).paginate :page => params[:page], :order => 'created_at DESC' end From 6b9bcfda6301ff5246432aeeb30a77e7e853246c Mon Sep 17 00:00:00 2001 From: Daniele Di Sarli Date: Sun, 26 Sep 2010 17:57:41 +0800 Subject: [PATCH 118/155] Corrected Italian translation --- config/locales/diaspora/it.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/locales/diaspora/it.yml b/config/locales/diaspora/it.yml index 4730b3cea..707704d25 100644 --- a/config/locales/diaspora/it.yml +++ b/config/locales/diaspora/it.yml @@ -21,7 +21,7 @@ it: people: helper: results_for: " risultati per %{params}" - people_on_pod_are_aware_of: " people on pod are aware of" + people_on_pod_are_aware_of: " persone su pod sono consapevoli di" layouts: application: edit_profile: "modifica profilo" @@ -136,7 +136,7 @@ it: back_to_list: "Torna all'elenco" post_it: "inseriscila!" create: - runtime_error: "Caricamento della foto fallito. Sei sicuro che la tua cintura di sicurezza è allacciata?" + runtime_error: "Caricamento della foto fallito. Hai allacciato le cinture?" integrity_error: "Caricamento della foto fallito. Sei sicuro che era un'immagine?" type_error: "Caricamento della foto fallito. Sei sicuro di aver aggiunto un'immagine?" update: From 2c55e700673494ca4baf392f49db227ef51da380 Mon Sep 17 00:00:00 2001 From: "michael.scheffler" Date: Mon, 27 Sep 2010 19:18:36 +0800 Subject: [PATCH 119/155] Replaced hardcoded '@example.com' with APP_CONFIG[:terse_pod_url] --- spec/models/person_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/models/person_spec.rb b/spec/models/person_spec.rb index c11d03455..6df3ddc1c 100644 --- a/spec/models/person_spec.rb +++ b/spec/models/person_spec.rb @@ -16,7 +16,7 @@ describe Person do describe '#diaspora_handle' do context 'local people' do it 'uses the pod config url to set the diaspora_handle' do - @user.person.diaspora_handle.should == @user.username + "@example.org" + @user.person.diaspora_handle.should == @user.username + "@" + APP_CONFIG[:terse_pod_url] end end From 1a876355d57602a0fbf78baeab6d9ee8d7beeddc Mon Sep 17 00:00:00 2001 From: Guillermo Date: Mon, 27 Sep 2010 02:49:31 +0800 Subject: [PATCH 120/155] Some fixes in spanish locale --- config/locales/diaspora/es.yml | 87 +++++++++++++++++----------------- 1 file changed, 44 insertions(+), 43 deletions(-) diff --git a/config/locales/diaspora/es.yml b/config/locales/diaspora/es.yml index 37657e1f4..f62c20480 100644 --- a/config/locales/diaspora/es.yml +++ b/config/locales/diaspora/es.yml @@ -6,7 +6,7 @@ # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. es: - hello: "Hola Mundo" + hello: "Hola mundo" application: helper: unknown_person: "persona desconocida" @@ -17,15 +17,15 @@ es: error_messages: helper: invalid_fields: "Campos Invalidos" - correct_the_following_errors_and_try_again: "Corrija los siguentes errores y trate de nuevo." + correct_the_following_errors_and_try_again: "Corrija los siguentes errores e intente de nuevo." people: helper: results_for: " resultados para %{params}" - people_on_pod_are_aware_of: " gente en pod estan al tanto de " + people_on_pod_are_aware_of: " personas en pod estan al tanto de" layouts: application: edit_profile: "editar perfil" - logout: "desloguear" + logout: "cerrar sesión" shared: aspect_nav: all_aspects: "Todos los Aspectos" @@ -42,29 +42,29 @@ es: album: you: "usted" new_album: - create: "Crear" + create: "crear" add_a_new_album: "Añade un nuevo álbum" show: edit_album: "Editar Álbum" albums: "álbumes" - updated: "actualizar" + updated: "actualizado" by: "por" edit: editing: "Editando" updated: "actualizado" - are_you_sure: "Esta seguro?" + are_you_sure: "¿Está seguro?" delete_album: "Eliminar Álbum" cancel: "Cancelar" index: home: "home" new_album: "Nuevo Álbum" create: - success: "Creo el álbum llamado %{name}." + success: "Has creado el álbum llamado %{name}." update: - success: "Álbum %{name} fue editado exitosamente." - failure: "Fallo el editar el álbum %{name}." + success: "El álbum %{name} fue editado exitosamente." + failure: "Fallo al editar el álbum %{name}." destroy: - success: "Álbum %{name} fue eliminado." + success: "El álbum %{name} fue eliminado." helper: friends_albums: "Álbumes de amigos" your_albums: "Tus Álbumes" @@ -74,38 +74,39 @@ es: show: photos: "fotos" manage: - add_a_new_aspect: "Añadir nuevo aspecto" - add_a_new_friend: "Añadir nuevo amigo" + add_a_new_aspect: "Añadir un nuevo aspecto" + add_a_new_friend: "Añadir un nuevo amigo" show: "Mostrar" update_aspects: "Actualizar Aspectos" - requests: "Requests" + requests: "Peticiones" ignore_remove: "Ignorar/Remover" new_aspect: - add_a_new_aspect: "Añadir nuevo aspecto" + add_a_new_aspect: "Añadir un nuevo aspecto" create: "Crear" create: - success:"Pulsa en el signo de mas a la izquierda para escojer quien puede ver su nuevo aspecto." + success:"Pulsa el signo de mas a la izquierda para escojer quien puede ver su nuevo aspecto." + failure: "La creación del Aspecto falló." destroy: - success: "%{name} fue removido exitosamente." + success: "%{name} fue eliminado exitosamente." update: success: "Su aspecto, %{name}, fue editado exitosamente." move_friends: failure: "Fallo el editar aspecto para el amigo %{real_name}." - success: "Los aspectos fueron editados exitosamente." + success: "Aspectos editados exitosamente." move_friend: - error: "no funciono %{inspect}" + error: "no funcionó %{inspect}" notice: "Ahora estas mostrando a tu amigo un aspecto diferente de ti." helper: - remove: "remover" - aspect_not_empty: "Aspecto no esta vacio" + remove: "eliminar" + aspect_not_empty: "Aspecto no vacio" users: edit: cancel: "Cancelar" update_profile: "Actualizar Perfil" home: "Home" - diaspora_username: "USUARIO DE DIASPORA" + diaspora_username: "NOMBRE DE USUARIO DE DIASPORA" info: "Info" - picture: "Picture" + picture: "Foto" editing_profile: "Editando perfil" albums: "Álbums" you_dont_have_any_photos: "No tienes ninguna foto! ve a la pagina" @@ -114,41 +115,41 @@ es: comment: ago: "atras" new_comment: - comment: "Commentario" + comment: "Comentario" photos: show: prev: "prev" - full_size: "tamaño actual" + full_size: "tamaño completo" next: "prox" edit_photo: "Editar Foto" delete_photo: "Eliminar Foto" - are_you_sure: "Esta seguro?" + are_you_sure: "¿Está seguro?" comments: "comentarios" edit: editing: "Editando" - are_you_sure: "Esta seguro?" + are_you_sure: "¿Está seguro?" delete_photo: "Eliminar Foto" photo: show_comments: "mostrar comentarios" posted_a_new_photo_to: "a puesto una nueva foto en" new: new_photo: "Nueva Foto" - back_to_list: "Devuelta a la lista" + back_to_list: "Volver a la lista" post_it: "post it!" create: runtime_error: "Photo upload failed. Are you sure that your seatbelt is fastened?" - integrity_error: "Photo upload failed. Are you sure that was an image?" - type_error: "Photo upload failed. Are you sure an image was added?" + integrity_error: "Falló carga de la foto. ¿Está seguro de que era una imagen?" + type_error: "Falló carga de la foto. ¿Está seguro de que una imagen fue añadida?" update: - notice: "Photo successfully updated." - error: "Failed to edit photo." + notice: "Foto actualizada satisfactoriamente." + error: "Falló la edición de la foto." destroy: - notice: "Photo deleted." + notice: "Foto eliminada." registrations: new: - sign_up: "Registrate" + sign_up: "Regístrate" create: - success: "Esta registrado en Diaspora!" + success: "Se ha unido a Diaspora!" status_messages: new_status_message: tell_me_something_good: "dime algo bueno" @@ -160,8 +161,8 @@ es: show: status_message: "Mensaje de status" comments: "comentarios" - are_you_sure: "Esta seguro?" - destroy: "Destruir" + are_you_sure: "¿Está seguro?" + destroy: "Borrar" view_all: "Ver Todos" message: "Mensaje" owner: "Dueño" @@ -176,20 +177,20 @@ es: real_name: "nombre real" diaspora_handle: "usuario en diaspora" thats_you: "ese eres tu!" - friend_request_pending: "friend request pending" - you_have_a_friend_request_from_this_person: "you have a friend request from this person" + friend_request_pending: "petición de amistad pendiente" + you_have_a_friend_request_from_this_person: "tienes una petición de amistad de esta persona" show: last_seen: "ultima vez visto: %{how_long_ago}" friends_since: "amigos desde: %{how_long_ago}" save: "guardar" - are_you_sure: "Esta seguro?" - remove_friend: "remover amigo" + are_you_sure: "¿Está seguro?" + remove_friend: "eliminar amigo" requests: new_request: add_a_new_friend_to: "Añade un nuevo amigo a " enter_a_diaspora_username: "Escribe el usuario de Diaspora:" your_diaspora_username_is: "Tu usuario de Diaspora es: %{diaspora_handle}" - friends_username: "Usuario de amigo" + friends_username: "Nombre de usuario de amigo" destroy: success: "Ahora son amigos." error: "Seleccione un aspecto!" @@ -198,4 +199,4 @@ es: error: "No diaspora seed found with this email!" already_friends: "Ya eres amigo de %{destination_url}!" success: "Una peticion de amistad se envio a %{destination_url}." - horribly_wrong: "Algo horriblemente mal sucedio" + horribly_wrong: "Algo horriblemente incorrecto ha sucedido" From b823213c0db600eaab02fb6c5a923283996988dd Mon Sep 17 00:00:00 2001 From: ilya Date: Mon, 27 Sep 2010 15:29:55 -0700 Subject: [PATCH 121/155] added a generate:secret_token task, and added an initializer to generate one if the file does not exist --- .gitignore | 1 + config/initializers/check_session_secret.rb | 5 ++++ config/initializers/secret_token.rb | 2 +- lib/tasks/generate_session_secret.rake | 26 +++++++++++++++++++++ 4 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 config/initializers/check_session_secret.rb create mode 100644 lib/tasks/generate_session_secret.rake diff --git a/.gitignore b/.gitignore index 4a78ed39f..d02467332 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ public/uploads/* config/app_config.yml bin/* nbproject +config/initializers/secret_token.rb diff --git a/config/initializers/check_session_secret.rb b/config/initializers/check_session_secret.rb new file mode 100644 index 000000000..1970c5078 --- /dev/null +++ b/config/initializers/check_session_secret.rb @@ -0,0 +1,5 @@ +unless File.exists?( File.join(Rails.root, 'config', 'initializers', 'secret_token.rb')) + `rake generate:secret_token` + require File.join(Rails.root, 'config', 'initializers', 'secret_token.rb') +end + diff --git a/config/initializers/secret_token.rb b/config/initializers/secret_token.rb index 20f6087bf..66c59261a 100644 --- a/config/initializers/secret_token.rb +++ b/config/initializers/secret_token.rb @@ -8,4 +8,4 @@ # If you change this key, all old signed cookies will become invalid! # Make sure the secret is at least 30 characters and all random, # no regular words or you'll be exposed to dictionary attacks. -Rails.application.config.secret_token = 'ea08916110cae7f10fe9e1f7c7cb8c1fee13c3c3bee35180ac3061c370bd9ad985f28fcf2eb5f5684d0d618855efdeb862918628e994ed3e7fc806777428ef40' +Rails.application.config.secret_token = '3484b78b0f9d88f40cd44a20cf647140e5900632d0c9b85e1fd91dc539811d243f2f0756f791019c' diff --git a/lib/tasks/generate_session_secret.rake b/lib/tasks/generate_session_secret.rake new file mode 100644 index 000000000..90274dff3 --- /dev/null +++ b/lib/tasks/generate_session_secret.rake @@ -0,0 +1,26 @@ +namespace :generate do + desc 'Generates a Session Secret Token' + task :secret_token do + + path = File.join(Rails.root, 'config', 'initializers', 'secret_token.rb') + secret = ActiveSupport::SecureRandom.hex(40) + File.open(path, 'w') do |f| + f.write <<"EOF" +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + +# Be sure to restart your server when you modify this file. + +# Your secret key for verifying the integrity of signed cookies. +# If you change this key, all old signed cookies will become invalid! +# Make sure the secret is at least 30 characters and all random, +# no regular words or you'll be exposed to dictionary attacks. +Rails.application.config.secret_token = '#{secret}' +EOF + +puts "YAY!!" +end + + end +end From 7b29e6ec269e322743f73e2bac738d7b81e8356a Mon Sep 17 00:00:00 2001 From: ilya Date: Mon, 27 Sep 2010 15:50:52 -0700 Subject: [PATCH 122/155] checking that a user is logged in before doing fb checking --- app/controllers/application_controller.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 46b011a61..8817bc645 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -40,8 +40,10 @@ class ApplicationController < ActionController::Base end def fb_user_info - @access_token = env['warden'].session[:access_token] - @logged_in = @access_token.present? + if current_user + @access_token = env['warden'].session[:access_token] + @logged_in = @access_token.present? + end end end From 50234b095b2ca3b71699c380a4accf059bb87c88 Mon Sep 17 00:00:00 2001 From: ilya Date: Mon, 27 Sep 2010 16:02:08 -0700 Subject: [PATCH 123/155] had to move translation around slightly, now the profile edit will be missing a template --- config/locales/diaspora/en.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml index 025aed149..838339641 100644 --- a/config/locales/diaspora/en.yml +++ b/config/locales/diaspora/en.yml @@ -101,6 +101,8 @@ en: aspect_not_empty: "Aspect not empty" users: edit: + editing_profile: "Editing profile" + profile: cancel: "Cancel" update_profile: "Update Profile" home: "Home" From a8f05244bae7a5b55076cd3c4668b1abe35ac917 Mon Sep 17 00:00:00 2001 From: ilya Date: Mon, 27 Sep 2010 16:07:24 -0700 Subject: [PATCH 124/155] localization should be fixed --- config/locales/diaspora/cs.yml | 2 ++ config/locales/diaspora/cy.yml | 4 +++- config/locales/diaspora/de.yml | 2 ++ config/locales/diaspora/es.yml | 2 ++ config/locales/diaspora/fr-informal.yml | 2 ++ config/locales/diaspora/fr.yml | 2 ++ config/locales/diaspora/he.yml | 2 ++ config/locales/diaspora/it.yml | 2 ++ config/locales/diaspora/pt-BR.yml | 2 ++ config/locales/diaspora/ro.yml | 2 ++ config/locales/diaspora/ru.yml | 2 ++ 11 files changed, 23 insertions(+), 1 deletion(-) diff --git a/config/locales/diaspora/cs.yml b/config/locales/diaspora/cs.yml index 78666424c..898428db2 100644 --- a/config/locales/diaspora/cs.yml +++ b/config/locales/diaspora/cs.yml @@ -113,6 +113,8 @@ cs: aspect_not_empty: "Aspekt není prázdný" users: edit: + editing_profile: "Upravit profil" + profile: cancel: "Zrušit" update_profile: "Aktualizovat profil" home: "Domů" diff --git a/config/locales/diaspora/cy.yml b/config/locales/diaspora/cy.yml index 97b4fd3df..cd1c7dbd6 100644 --- a/config/locales/diaspora/cy.yml +++ b/config/locales/diaspora/cy.yml @@ -69,6 +69,8 @@ cy: success:"Cliciwch ar y plus ar y chwith i ddweud wrth Diaspora pwy all weld eich agwedd newydd." users: edit: + editing_profile: "Golygu proffil" + profile: cancel: "Cancel" update_profile: "Diweddaru Proffil" home: "Adref" @@ -139,4 +141,4 @@ cy: friends_since: "yn ffrindiau ers: %{how_long_ago}" save: "arbed" are_you_sure: "Ydych chi'n sicr?" - remove_friend: "dileu ffrind" \ No newline at end of file + remove_friend: "dileu ffrind" diff --git a/config/locales/diaspora/de.yml b/config/locales/diaspora/de.yml index dd3cead59..e277a5efd 100644 --- a/config/locales/diaspora/de.yml +++ b/config/locales/diaspora/de.yml @@ -100,6 +100,8 @@ de: aspect_not_empty: "Aspekt ist nicht leer" users: edit: + editing_profile: "Profil bearbeiten" + profile: cancel: "Abbrechen" update_profile: "Profil aktualisieren" home: "Startseite" diff --git a/config/locales/diaspora/es.yml b/config/locales/diaspora/es.yml index f62c20480..5a73715b9 100644 --- a/config/locales/diaspora/es.yml +++ b/config/locales/diaspora/es.yml @@ -101,6 +101,8 @@ es: aspect_not_empty: "Aspecto no vacio" users: edit: + editing_profile: "Editando perfil" + profile: cancel: "Cancelar" update_profile: "Actualizar Perfil" home: "Home" diff --git a/config/locales/diaspora/fr-informal.yml b/config/locales/diaspora/fr-informal.yml index 141584dad..1c7950fe5 100644 --- a/config/locales/diaspora/fr-informal.yml +++ b/config/locales/diaspora/fr-informal.yml @@ -100,6 +100,8 @@ fr-informal: aspect_not_empty: "L’aspect n’est pas vide" users: edit: + editing_profile: "Édition du profil" + profile: cancel: "Annuler" update_profile: "Mettre à jour le profil" home: "Accueil" diff --git a/config/locales/diaspora/fr.yml b/config/locales/diaspora/fr.yml index 8a44e6dac..bab6f3852 100644 --- a/config/locales/diaspora/fr.yml +++ b/config/locales/diaspora/fr.yml @@ -87,6 +87,8 @@ fr: success:"Cliquez sur plus situé sur le côté gauche afin d’en informer Diaspora qui peut voir votre nouvel aspect." users: edit: + editing_profile: "Édition du profil" + profile: cancel: "Annuler" update_profile: "Mettre à jour le profil" home: "Accueil" diff --git a/config/locales/diaspora/he.yml b/config/locales/diaspora/he.yml index 8b348b3c7..47f2a52c2 100644 --- a/config/locales/diaspora/he.yml +++ b/config/locales/diaspora/he.yml @@ -102,6 +102,8 @@ he: aspect_not_empty: "ההיסט אינו ריק" users: edit: + editing_profile: "עריכת הפרופיל" + profile: cancel: "ביטול" update_profile: "עדכון הפרופיל" home: "בית" diff --git a/config/locales/diaspora/it.yml b/config/locales/diaspora/it.yml index 707704d25..24681fbe0 100644 --- a/config/locales/diaspora/it.yml +++ b/config/locales/diaspora/it.yml @@ -100,6 +100,8 @@ it: aspect_not_empty: "Aspetto non vuoto" users: edit: + editing_profile: "Modifica del profilo" + profile: cancel: "Annulla" update_profile: "Aggiorna profilo" home: "Home" diff --git a/config/locales/diaspora/pt-BR.yml b/config/locales/diaspora/pt-BR.yml index 8e87425e9..e8ffcc8e1 100644 --- a/config/locales/diaspora/pt-BR.yml +++ b/config/locales/diaspora/pt-BR.yml @@ -100,6 +100,8 @@ pt-BR: aspect_not_empty: "Aspecto não está vazio" users: edit: + editing_profile: "Editando perfil" + profile: cancel: "Cancelar" update_profile: "Atualizar Perfil" home: "Home" diff --git a/config/locales/diaspora/ro.yml b/config/locales/diaspora/ro.yml index 5800f4a30..ed3234571 100644 --- a/config/locales/diaspora/ro.yml +++ b/config/locales/diaspora/ro.yml @@ -66,6 +66,8 @@ ro: success:"Click pe semnul plus în partea stângă pentru a indica cine poate accesa noul aspect." users: edit: + editing_profile: "Editare profil" + profile: cancel: "Renunță" update_profile: "Actualizează Profil" home: "Home" diff --git a/config/locales/diaspora/ru.yml b/config/locales/diaspora/ru.yml index cc76b9b42..daeb35915 100644 --- a/config/locales/diaspora/ru.yml +++ b/config/locales/diaspora/ru.yml @@ -69,6 +69,8 @@ ru: success:"Нажмите на плюс слева, для того, что-бы указать Diaspora тех, кто может видеть ваш новый аспект." users: edit: + editing_profile: "Редактирование профиля" + profile: cancel: "Отмена" update_profile: "Обновить профиль" home: "Домой" From d41b37063023cec4b61fb9a4c7be4107ff9a8107 Mon Sep 17 00:00:00 2001 From: ilya Date: Mon, 27 Sep 2010 16:20:27 -0700 Subject: [PATCH 125/155] removing the fb feed for now --- app/views/aspects/public.html.haml | 4 ---- app/views/fb_status/_fb_status.html.haml | 13 ------------- 2 files changed, 17 deletions(-) delete mode 100644 app/views/fb_status/_fb_status.html.haml diff --git a/app/views/aspects/public.html.haml b/app/views/aspects/public.html.haml index 4399034f7..f04b63489 100644 --- a/app/views/aspects/public.html.haml +++ b/app/views/aspects/public.html.haml @@ -18,10 +18,6 @@ %ul#stream - for post in @posts = render type_partial(post), :post => post unless post.class == Album - - if @logged_in - - MiniFB.get(@access_token, 'me', :type => "feed")[:data].each do |item| - - if item[:type] == 'status' - = render "fb_status/fb_status", :post => FbStatus.from_api(item) #pagination = will_paginate @posts diff --git a/app/views/fb_status/_fb_status.html.haml b/app/views/fb_status/_fb_status.html.haml deleted file mode 100644 index d5a57bd22..000000000 --- a/app/views/fb_status/_fb_status.html.haml +++ /dev/null @@ -1,13 +0,0 @@ --# Copyright (c) 2010, Diaspora Inc. This file is --# licensed under the Affero General Public License version 3. See --# the COPYRIGHT file. - - -%li.message{:id => post.id} - - = image_tag( "http://graph.facebook.com/#{post.author_id}/picture" ) - - .content - %span.from - = post.author_name - = post.message From 52313b799b8e9aea4204e405ea99660d4e224a50 Mon Sep 17 00:00:00 2001 From: ilya Date: Mon, 27 Sep 2010 16:31:05 -0700 Subject: [PATCH 126/155] added a warning, moved connected as into a partial, removed the publishing box from settings page --- app/helpers/application_helper.rb | 5 +++++ app/views/shared/_publisher.haml | 2 +- app/views/users/_services.haml | 12 ++++-------- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 688ddb10b..7745ace96 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -66,4 +66,9 @@ module ApplicationHelper def post_yield_tag(post) (':' + post.id.to_s).to_sym end + + def connected_fb_as token + response_hash = MiniFB.get(token, 'me') + "Connected to facebook as #{response_hash[:name]}" + end end diff --git a/app/views/shared/_publisher.haml b/app/views/shared/_publisher.haml index 5db168f6f..d1ad995df 100644 --- a/app/views/shared/_publisher.haml +++ b/app/views/shared/_publisher.haml @@ -10,7 +10,7 @@ %p %label{:for => "status_message_message"} Message = f.text_area :message, :rows => 2, :value => params[:prefill] - = "going to Facebook as #{MiniFB.get(@access_token, 'me')[:name]}" if @logged_in && @aspect == :public + = connected_fb_as(@access_token) if @logged_in && @aspect == :public = f.hidden_field( :public, :value => (params[:action] == 'public') ) %ul.aspect_selector{ :style => "display:none;"} diff --git a/app/views/users/_services.haml b/app/views/users/_services.haml index c6e31939a..f2d976a79 100644 --- a/app/views/users/_services.haml +++ b/app/views/users/_services.haml @@ -8,20 +8,16 @@ %h3 Facebook %p - if @logged_in - Connected to facebook as - - @response_hash = MiniFB.get(@access_token, 'me') - = @response_hash[:name] - + = connected_fb_as(@access_token) + + %p - @fb_friends = MiniFB.get(@access_token, 'me', :type => "friends") - @fb_friends[:data].each do |friend| = image_tag( "http://graph.facebook.com/#{friend[:id]}/picture" ) - - form_tag "/services/fb_post" do - = text_area_tag "message" - = submit_tag "send it off" = link_to "Disconnect from Facebook", services_destroy_path - else - = link_to "Connect to Facebook", @fb_access_url + = link_to "Connect to Facebook (DO NOT USE WITH A REAL ACCOUNT)", @fb_access_url #content_bottom .back From e9f433e12f1879e5b55499887571a95b9c4c2c94 Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 27 Sep 2010 16:54:08 -0700 Subject: [PATCH 127/155] Add spec for not overwriting the image_url on profile update --- spec/controllers/users_controller_spec.rb | 33 +++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 spec/controllers/users_controller_spec.rb diff --git a/spec/controllers/users_controller_spec.rb b/spec/controllers/users_controller_spec.rb new file mode 100644 index 000000000..a050738e1 --- /dev/null +++ b/spec/controllers/users_controller_spec.rb @@ -0,0 +1,33 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + +require 'spec_helper' + +describe UsersController do + before do + @user = Factory.create(:user) + sign_in :user, @user + @user.aspect(:name => "lame-os") + end + + describe '#update' do + context 'with a profile photo set' do + before do + @user.person.profile.image_url = "http://tom.joindiaspora.com/images/user/tom.jpg" + @user.person.profile.save + end + + it "doesn't overwrite the profile photo when an empty string is passed in" do + image_url = @user.person.profile.image_url + put("update", :id => @user.id, "user"=> {"profile"=> + {"image_url" => "", + "last_name" => @user.person.profile.last_name, + "first_name" => @user.person.profile.first_name}}) + + @user.person.profile.image_url.should == image_url + end + + end + end +end From efe85a4c28624d1ed4374065473b072bf1df8476 Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 27 Sep 2010 16:54:42 -0700 Subject: [PATCH 128/155] db:reset should call db:seed:dev, not db:seed:tom --- lib/tasks/db.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/db.rake b/lib/tasks/db.rake index e4e379a2a..396bb145d 100644 --- a/lib/tasks/db.rake +++ b/lib/tasks/db.rake @@ -42,7 +42,7 @@ namespace :db do puts "Resetting the database for #{Rails.env}".upcase Rake::Task['db:purge'].invoke - Rake::Task['db:seed:tom'].invoke + Rake::Task['db:seed:dev'].invoke puts "Success!" end From c2b84fd9c686beeb06449e45bf1972ee1b2abc77 Mon Sep 17 00:00:00 2001 From: ilya Date: Mon, 27 Sep 2010 16:59:54 -0700 Subject: [PATCH 129/155] added a public key to post --- app/controllers/aspects_controller.rb | 2 +- app/models/post.rb | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index 722828a2e..33a33db71 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -52,7 +52,7 @@ class AspectsController < ApplicationController @fb_access_url = MiniFB.oauth_url(FB_APP_ID, APP_CONFIG[:pod_url] + "services/create", :scope=>MiniFB.scopes.join(",")) - @posts = current_user.visible_posts(:by_members_of => :all).paginate :page => params[:page], :per_page => 15, :order => 'created_at DESC' + @posts = current_user.raw_visible_posts.all(:public => true, :order => 'created_at DESC').paginate :page => params[:page], :per_page => 15, :order => 'created_at DESC' respond_with @aspect end diff --git a/app/models/post.rb b/app/models/post.rb index 983d0e68f..aba822160 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -13,6 +13,9 @@ class Post xml_accessor :_id xml_accessor :person, :as => Person + xml_reader :public + + key :public , Boolean, :default => false key :person_id, ObjectId key :user_refs, Integer, :default => 0 From 6e407572c43b006b5d8011566378fc59e1d381da Mon Sep 17 00:00:00 2001 From: ilya Date: Mon, 27 Sep 2010 17:27:49 -0700 Subject: [PATCH 130/155] removed unused repost method, going through the warden object --- app/controllers/application_controller.rb | 2 +- app/controllers/services_controller.rb | 6 +++--- app/models/user.rb | 6 ------ spec/models/user/posting_spec.rb | 9 --------- 4 files changed, 4 insertions(+), 19 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 8817bc645..52975730b 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -41,7 +41,7 @@ class ApplicationController < ActionController::Base def fb_user_info if current_user - @access_token = env['warden'].session[:access_token] + @access_token = warden.session[:access_token] @logged_in = @access_token.present? end end diff --git a/app/controllers/services_controller.rb b/app/controllers/services_controller.rb index b39538d96..82a58c508 100644 --- a/app/controllers/services_controller.rb +++ b/app/controllers/services_controller.rb @@ -17,15 +17,15 @@ class ServicesController < ApplicationController # TODO: This is where you'd want to store the token in your database # but for now, we'll just keep it in the session so we don't need a database - env['warden'].session[:access_token] = @access_token + warden.session[:access_token] = @access_token flash[:success] = "Authentication successful." end redirect_to edit_user_url current_user end def destroy - env['warden'].session[:access_token] = nil - env['warden'].session[:user_id] = nil + warden.session[:access_token] = nil + warden.session[:user_id] = nil redirect_to edit_user_url current_user end diff --git a/app/models/user.rb b/app/models/user.rb index d89b8b59a..ca248a8f2 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -114,12 +114,6 @@ class User post end - def repost( post, options = {} ) - aspect_ids = validate_aspect_permissions(options[:to]) - push_to_aspects(post, aspect_ids) - post - end - def update_post( post, post_hash = {} ) if self.owns? post post.update_attributes(post_hash) diff --git a/spec/models/user/posting_spec.rb b/spec/models/user/posting_spec.rb index 76f4243f7..d86433ad6 100644 --- a/spec/models/user/posting_spec.rb +++ b/spec/models/user/posting_spec.rb @@ -46,15 +46,6 @@ describe User do end end - describe '#repost' do - it 'should make the post visible in another aspect' do - status_message = user.post(:status_message, :message => "hello", :to => aspect.id) - user.repost(status_message, :to => aspect1.id) - aspect1.reload - aspect1.posts.count.should be 1 - end - end - describe '#update_post' do it 'should update fields' do album = user.post(:album, :name => "Profile Photos", :to => aspect.id) From fad27483cdecab227d0016eaef0b595e275782df Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 27 Sep 2010 17:54:20 -0700 Subject: [PATCH 131/155] Pulling in drt24's changes to ubuntu-setup.bash --- ubuntu-setup.bash | 181 +++++++++++++++++++++++++++++----------------- 1 file changed, 115 insertions(+), 66 deletions(-) diff --git a/ubuntu-setup.bash b/ubuntu-setup.bash index 95d2a9628..c335fcf65 100755 --- a/ubuntu-setup.bash +++ b/ubuntu-setup.bash @@ -8,48 +8,81 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. -# Set extented globbing +# USAGE: ./script/ubuntu-setup.bash +# Do NOT run this script as root. + +# Set extented globbing shopt -s extglob +# fail on error +set -e + +[ "$(whoami)" == "root" ] && echo "Please do not run this script as root/sudo +We need to do some actions as an ordinary user. We use sudo where necessary." && exit 1 + # Check if the user has sudo privileges. sudo -v >/dev/null 2>&1 || { echo $(whoami) has no sudo privileges ; exit 1; } -# Check if universal repository is enabled -grep -i universe /etc/apt/sources.list > /dev/null || { echo "Please enable universe repository" ; exit 1 ; } +# Check if universal repository is enabled +grep -i universe /etc/apt/sources.list > /dev/null || \ + { echo "Please enable universe repository" ; exit 1 ; } -# Check if wget is installed -test wget || echo "Installing wget.." && sudo apt-get install wget && echo "Installed wget.." +# Make sure that we only install the latest version of packages +sudo apt-get update -# Install build tools +# Check if wget is installed +test wget || { echo "Installing wget.." && sudo apt-get install wget \ + && echo "Installed wget.." ; } + +# Install build tools echo "Installing build tools.." -sudo apt-get -y --no-install-recommends install build-essential libxslt1.1 libxslt1-dev libxml2 +sudo apt-get -y --no-install-recommends install \ + build-essential libxslt1.1 libxslt1-dev libxml2 echo "..Done installing build tools" -# Install Ruby 1.8.7 -echo "Installing ruby-full Ruby 1.8.7.." +# Install Ruby 1.8.7 +echo "Installing ruby-full Ruby 1.8.7.." sudo apt-get -y --no-install-recommends install ruby-full echo "..Done installing Ruby" -# Install Rake +# Install Rake echo "Installing rake.." sudo apt-get -y --no-install-recommends install rake echo "..Done installing rake" +#Store the release name so we can use it here and later +RELEASE=$(lsb_release -c | cut -f2) + # Get the current release and install mongodb -lsb=$(lsb_release -rs) -ver=${lsb//.+(0)/.} -repo="deb http://downloads.mongodb.org/distros/ubuntu ${ver} 10gen" -echo "Setting up MongoDB.." -echo "." -echo ${repo} | sudo tee -a /etc/apt/sources.list -echo "." -echo "Fetching keys.." -sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 -echo "." -sudo apt-get update -echo "." -sudo apt-get -y --no-install-recommends install mongodb-stable -echo "Done installing monngodb-stable.." +if [ $RELEASE == "maverick" ] +then + #mongodb does not supply a repository for maverick yet so install + # an older version from the ubuntu repositories + if [ ! -f /usr/lib/libmozjs.so ] + then + echo "Lanchpad bug https://bugs.launchpad.net/ubuntu/+source/mongodb/+bug/557024 +has not been fixed using workaround:" + echo "sudo ln -s /usr/lib/xulrunner-1.9.2.10/libmozjs.so /usr/lib/libmozjs.so" + sudo ln -s /usr/lib/xulrunner-1.9.2.10/libmozjs.so /usr/lib/libmozjs.so + fi + + sudo apt-get -y --no-install-recommends install mongodb +else + lsb=$(lsb_release -rs) + ver=${lsb//.+(0)/.} + repo="deb http://downloads.mongodb.org/distros/ubuntu ${ver} 10gen" + echo "Setting up MongoDB.." + echo "." + echo ${repo} | sudo tee -a /etc/apt/sources.list + echo "." + echo "Fetching keys.." + sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 + echo "." + sudo apt-get update + echo "." + sudo apt-get -y --no-install-recommends install mongodb-stable + echo "Done installing monngodb-stable.." +fi # Install imagemagick echo "Installing imagemagick.." @@ -64,33 +97,32 @@ echo "Installed git-core.." # Setting up ruby gems echo "Fetching and installing ruby gems.." ( - RELEASE=$(lsb_release -c | cut -f2) - if [ RELEASE == "maverick" ] - then - sudo apt-get install --no-install-recommends -y rubygems - sudo ln -s /var/lib/gems/1.8/bin/bundle /usr/local/bin/bundle #for PATH - elif [ RELEASE == "lucid" ] - then - sudo add-apt-repository ppa:maco.m/ruby - sudo apt-get update - sudo apt-get install --no-install-recommends -y rubygems - sudo ln -s /var/lib/gems/1.8/bin/bundle /usr/local/bin/bundle #for PATH - else - # Old version - echo "." - cd /tmp - wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz - echo "." - tar -xf rubygems-1.3.7.tgz - echo "." - cd rubygems-1.3.7 - echo "." - sudo ruby setup.rb - echo "." - sudo ln -s /usr/bin/gem1.8 /usr/bin/gem - echo "." - fi -) + if [ $RELEASE == "maverick" ] + then + sudo apt-get install --no-install-recommends -y rubygems + sudo ln -s /var/lib/gems/1.8/bin/bundle /usr/local/bin/bundle #for PATH + elif [ $RELEASE == "lucid" ] + then + sudo add-apt-repository ppa:maco.m/ruby + sudo apt-get update + sudo apt-get install --no-install-recommends -y rubygems + sudo ln -s /var/lib/gems/1.8/bin/bundle /usr/local/bin/bundle #for PATH + else + # Old version + echo "." + cd /tmp + wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz + echo "." + tar -xf rubygems-1.3.7.tgz + echo "." + cd rubygems-1.3.7 + echo "." + sudo ruby setup.rb + echo "." + sudo ln -s /usr/bin/gem1.8 /usr/bin/gem + echo "." + fi +) echo "Done installing the gems.." # Install bundler @@ -100,23 +132,40 @@ echo "Installed bundler.." # Take a clone of Diaspora ( + # Check if the user is already in a cloned source if not clone the source + [[ $( basename $PWD ) == "diaspora" ]] && \ + echo "Already in diaspora directory" || \ + { git clone http://github.com/diaspora/diaspora.git && cd diaspora + echo "Cloned the source.." + } -# Check if the user is already in a cloned source if not clone the source -[[ $( basename $PWD ) == "diaspora" ]] && echo "Already in diaspora directory" || git clone http://github.com/diaspora/diaspora.git ; cd diaspora -echo "Cloned the source.." + # Install extra gems + echo "Installing more gems.." + bundle install + echo "Installed." -# Install extra gems -cd diaspora -echo "Installing more gems.." -sudo bundle install -echo "Installed." + #Configure diaspora + cp config/app_config.yml.example config/app_config.yml + echo "You need to configure diaspora to tell it which URL it has. +Opening editor in 5 seconds and then continuing with install." + sleep 5 + #ensure EDITOR is set + if [ -z "${EDITOR}"] + then + EDITOR=vi + fi + $EDITOR config/app_config.yml -# Install DB setup -echo "Seting up DB.." -rake db:seed:tom -echo "DB ready. Login -> tom and password -> evankorth. More details ./diaspora/db/seeds/tom.rb." + # Create the shared directory which is used by rake db:seed:tom + mkdir shared -# Run appserver -echo "Starting server" -bundle exec thin start + # Install DB setup + echo "Seting up DB.." + rake db:seed:tom + echo "DB ready. Login -> tom and password -> evankorth. +More details ./diaspora/db/seeds/tom.rb." + + # Run appserver + echo "Starting server" + bundle exec thin start ) From 77356d7a17213ad7290a4484e29ae20ee2c0af2b Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 27 Sep 2010 17:55:04 -0700 Subject: [PATCH 132/155] Moving ubuntu-setup.bash to script/ --- ubuntu-setup.bash => script/ubuntu-setup.bash | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename ubuntu-setup.bash => script/ubuntu-setup.bash (100%) diff --git a/ubuntu-setup.bash b/script/ubuntu-setup.bash similarity index 100% rename from ubuntu-setup.bash rename to script/ubuntu-setup.bash From df800dc87ee0ae1dfc3bafc2bfac9e107ede822c Mon Sep 17 00:00:00 2001 From: danielvincent Date: Mon, 27 Sep 2010 17:58:34 -0700 Subject: [PATCH 133/155] ostatus builder --- app/models/person.rb | 4 ++ lib/diaspora/ostatus_builder.rb | 71 +++++++++++++++++++++++ spec/lib/diaspora_ostatus_builder_spec.rb | 18 ++++++ 3 files changed, 93 insertions(+) create mode 100644 lib/diaspora/ostatus_builder.rb create mode 100644 spec/lib/diaspora_ostatus_builder_spec.rb diff --git a/app/models/person.rb b/app/models/person.rb index 2601de2bc..0cbde015a 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -49,6 +49,10 @@ class Person "#{self.url}receive/users/#{self.id}/" end + def public_url + "#{self.url}users/#{self.id}/public" + end + def public_key_hash Base64.encode64 OpenSSL::Digest::SHA256.new(self.exported_key).to_s diff --git a/lib/diaspora/ostatus_builder.rb b/lib/diaspora/ostatus_builder.rb new file mode 100644 index 000000000..f243a6d73 --- /dev/null +++ b/lib/diaspora/ostatus_builder.rb @@ -0,0 +1,71 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + +module Diaspora + module OstatusBuilder + + def build(user) + if @user = User.find_by_id(user.id) + xml = "" + xml << create_headers + xml << create_endpoints + xml << create_subject + xml << create_body + xml << create_footer + else raise "Invalid user sent to builder" end + end + + def create_headers + <<-XML + + + Diaspora + #{@user.username}/public + Stream + its a stream + #{Time.now.xmlschema} + + #{@user.real_name} + #{@user.public_url} + + XML + end + + def create_endpoints + <<-XML + + XML + end + + def create_subject + <<-XML + + http://activitystrea.ms/schema/1.0/person + #{@user.public_url} + #{@user.real_name} + + + XML + end + + def create_body + @user.raw_visible_posts.all.inject do |xml,curr| + if curr.respond_to?(:to_activity) + unless xml + xml = curr.to_activity + else + xml + curr.to_activity + end + end + end + end + + def create_footer + <<-XML + + XML + end + + end +end diff --git a/spec/lib/diaspora_ostatus_builder_spec.rb b/spec/lib/diaspora_ostatus_builder_spec.rb new file mode 100644 index 000000000..ce29e1543 --- /dev/null +++ b/spec/lib/diaspora_ostatus_builder_spec.rb @@ -0,0 +1,18 @@ +# Copyright (c) 2010, Diaspora Inc. This file is +# licensed under the Affero General Public License version 3. See +# the COPYRIGHT file. + +require 'spec_helper' +require File.dirname(__FILE__) + '/../../lib/diaspora/ostatus_builder' + +describe Diaspora::OstatusBuilder do + + let(:user) { Factory(:user) } + let(:aspect) { user.aspect(:name => "Public People") } + let!(:status_message1) { user.post(:status_message, :message => "One", :to => aspect.id) } + let!(:status_message2) { user.post(:status_message, :message => "Two", :to => aspect.id) } + + let!(:atom) { Diaspora::OstatusBuilder::build(user) } + +end + From 6100b318e47276f5abc58c48b5dd2fc1f504d651 Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 27 Sep 2010 18:12:55 -0700 Subject: [PATCH 134/155] More accurately describe a spec --- spec/lib/message_handler_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/lib/message_handler_spec.rb b/spec/lib/message_handler_spec.rb index adb375c17..cb0592e9a 100644 --- a/spec/lib/message_handler_spec.rb +++ b/spec/lib/message_handler_spec.rb @@ -39,7 +39,7 @@ describe MessageHandler do } end - it 'should only retry a bad request three times ' do + it 'should only retry a bad request the correct number of times' do request = FakeHttpRequest.new(:failure) request.should_receive(:get).exactly(MessageHandler::NUM_TRIES).times.and_return(request) EventMachine::HttpRequest.stub!(:new).and_return(request) From 7852c346f2823e64ec1eaee21ca83d80ca039ffc Mon Sep 17 00:00:00 2001 From: ilya Date: Mon, 27 Sep 2010 18:31:37 -0700 Subject: [PATCH 135/155] mode the visible posts api more general and moved to it on the public controller --- app/controllers/aspects_controller.rb | 2 +- app/controllers/people_controller.rb | 2 +- lib/diaspora/user/querying.rb | 5 +++-- spec/models/user/visible_posts_spec.rb | 27 +++++++++++++++++++++++++- 4 files changed, 31 insertions(+), 5 deletions(-) diff --git a/app/controllers/aspects_controller.rb b/app/controllers/aspects_controller.rb index 33a33db71..cf9cc1583 100644 --- a/app/controllers/aspects_controller.rb +++ b/app/controllers/aspects_controller.rb @@ -52,7 +52,7 @@ class AspectsController < ApplicationController @fb_access_url = MiniFB.oauth_url(FB_APP_ID, APP_CONFIG[:pod_url] + "services/create", :scope=>MiniFB.scopes.join(",")) - @posts = current_user.raw_visible_posts.all(:public => true, :order => 'created_at DESC').paginate :page => params[:page], :per_page => 15, :order => 'created_at DESC' + @posts = current_user.visible_posts(:public => true).paginate :page => params[:page], :per_page => 15, :order => 'created_at DESC' respond_with @aspect end diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb index a8b8fffc0..be1f89991 100644 --- a/app/controllers/people_controller.rb +++ b/app/controllers/people_controller.rb @@ -21,7 +21,7 @@ class PeopleController < ApplicationController @profile = @person.profile @aspects_with_person = current_user.aspects_with_person(@person) @aspects_dropdown_array = current_user.aspects.collect{|x| [x.to_s, x.id]} - @posts = current_user.visible_posts(:from => @person).paginate :page => params[:page], :order => 'created_at DESC' + @posts = current_user.visible_posts(:person_id => @person.id).paginate :page => params[:page], :order => 'created_at DESC' @latest_status_message = current_user.raw_visible_posts.find_all_by__type_and_person_id("StatusMessage", params[:id]).last @post_count = @posts.count respond_with @person diff --git a/lib/diaspora/user/querying.rb b/lib/diaspora/user/querying.rb index 29f119238..7d74df4ed 100644 --- a/lib/diaspora/user/querying.rb +++ b/lib/diaspora/user/querying.rb @@ -11,12 +11,13 @@ module Diaspora end def visible_posts( opts = {} ) + opts[:order] ||= 'created_at DESC' if opts[:by_members_of] return raw_visible_posts if opts[:by_members_of] == :all aspect = self.aspects.find_by_id( opts[:by_members_of].id ) aspect.posts - elsif opts[:from] - self.raw_visible_posts.find_all_by_person_id(opts[:from].id, :order => 'created_at DESC') + else + self.raw_visible_posts.all(opts) end end diff --git a/spec/models/user/visible_posts_spec.rb b/spec/models/user/visible_posts_spec.rb index e0a3d5215..040fcd1bc 100644 --- a/spec/models/user/visible_posts_spec.rb +++ b/spec/models/user/visible_posts_spec.rb @@ -12,13 +12,38 @@ describe User do let!(:user2) { Factory(:user_with_aspect) } let!(:status_message1) { user2.post :status_message, :message => "hi", :to => user2.aspects.first.id } + let!(:status_message2) { user2.post :status_message, :message => "hey", :public => true , :to => user2.aspects.first.id } + let!(:status_message3) { user2.post :status_message, :message => "va", :to => user2.aspects.first.id } + let!(:status_message4) { user2.post :status_message, :message => "da", :public => true , :to => user2.aspects.first.id } + before do friend_users(user, first_aspect, user2, user2.aspects.first) end describe "#visible_posts" do - it "generates a stream for each aspect that includes only that aspect's posts" do + it "queries by person id" do + user2.visible_posts(:person_id => user2.person.id).include?(status_message1).should == true + user2.visible_posts(:person_id => user2.person.id).include?(status_message2).should == true + user2.visible_posts(:person_id => user2.person.id).include?(status_message3).should == true + user2.visible_posts(:person_id => user2.person.id).include?(status_message4).should == true + end + + it "selects public posts" do + user2.visible_posts(:public => true).include?(status_message2).should == true + user2.visible_posts(:public => true).include?(status_message4).should == true + end + + it "selects non public posts" do + user2.visible_posts(:public => false).include?(status_message1).should == true + user2.visible_posts(:public => false).include?(status_message3).should == true + end + + it "selects by message contents" do + user2.visible_posts(:message => "hi").include?(status_message1).should == true + end + + it "queries by aspect" do user3 = Factory(:user_with_aspect) status_message2 = user3.post :status_message, :message => "heyyyy", :to => user3.aspects.first.id user4 = Factory(:user_with_aspect) From 3b8ddf76a36341ec4979421f6a850a1b8eff31fa Mon Sep 17 00:00:00 2001 From: danielvincent Date: Mon, 27 Sep 2010 18:34:47 -0700 Subject: [PATCH 136/155] temp route for atom feed. also, public atom currently displays all posts. --- app/controllers/publics_controller.rb | 7 +++++++ config/routes.rb | 2 ++ lib/diaspora/ostatus_builder.rb | 14 +++++++------- spec/lib/diaspora_ostatus_builder_spec.rb | 4 ++++ 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/app/controllers/publics_controller.rb b/app/controllers/publics_controller.rb index fcfdb0db6..76360fb90 100644 --- a/app/controllers/publics_controller.rb +++ b/app/controllers/publics_controller.rb @@ -4,7 +4,9 @@ class PublicsController < ApplicationController require File.expand_path('../../../lib/diaspora/parser', __FILE__) + require File.expand_path('../../../lib/diaspora/ostatus_builder', __FILE__) include Diaspora::Parser + include Diaspora::OstatusBuilder layout false def hcard @@ -40,4 +42,9 @@ class PublicsController < ApplicationController @user.receive_salmon params[:xml] end + def public + user = User.find_by_username(params[:username]) + render :xml => Diaspora::OstatusBuilder::build(user) + end + end diff --git a/config/routes.rb b/config/routes.rb index c2a38dbc6..4d227a0a1 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -32,6 +32,8 @@ Diaspora::Application.routes.draw do match 'get_to_the_choppa', :to => redirect("/signup") #public routes # + match 'public/:username', :to => 'publics#public' + match 'webfinger', :to => 'publics#webfinger' match 'hcard/users/:id', :to => 'publics#hcard' diff --git a/lib/diaspora/ostatus_builder.rb b/lib/diaspora/ostatus_builder.rb index f243a6d73..0770f4c5c 100644 --- a/lib/diaspora/ostatus_builder.rb +++ b/lib/diaspora/ostatus_builder.rb @@ -5,7 +5,7 @@ module Diaspora module OstatusBuilder - def build(user) + def self.build(user) if @user = User.find_by_id(user.id) xml = "" xml << create_headers @@ -16,8 +16,8 @@ module Diaspora else raise "Invalid user sent to builder" end end - def create_headers - <<-XML + def self.create_headers + <<-XML.strip Diaspora @@ -32,13 +32,13 @@ module Diaspora XML end - def create_endpoints + def self.create_endpoints <<-XML XML end - def create_subject + def self.create_subject <<-XML http://activitystrea.ms/schema/1.0/person @@ -49,7 +49,7 @@ module Diaspora XML end - def create_body + def self.create_body @user.raw_visible_posts.all.inject do |xml,curr| if curr.respond_to?(:to_activity) unless xml @@ -61,7 +61,7 @@ module Diaspora end end - def create_footer + def self.create_footer <<-XML XML diff --git a/spec/lib/diaspora_ostatus_builder_spec.rb b/spec/lib/diaspora_ostatus_builder_spec.rb index ce29e1543..cc46bd0c5 100644 --- a/spec/lib/diaspora_ostatus_builder_spec.rb +++ b/spec/lib/diaspora_ostatus_builder_spec.rb @@ -14,5 +14,9 @@ describe Diaspora::OstatusBuilder do let!(:atom) { Diaspora::OstatusBuilder::build(user) } + it 'should include a users posts' do + atom.should include status_message.message + end + end From 58b688aa6872df557f6d645bd1286a4ac455ed15 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Mon, 27 Sep 2010 21:28:21 -0700 Subject: [PATCH 137/155] fixed builder spec --- lib/diaspora/ostatus_builder.rb | 4 ++-- spec/lib/diaspora_ostatus_builder_spec.rb | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/diaspora/ostatus_builder.rb b/lib/diaspora/ostatus_builder.rb index 0770f4c5c..ce4ebfeb4 100644 --- a/lib/diaspora/ostatus_builder.rb +++ b/lib/diaspora/ostatus_builder.rb @@ -50,10 +50,10 @@ module Diaspora end def self.create_body - @user.raw_visible_posts.all.inject do |xml,curr| + @user.visible_posts(:public=>true).inject("") do |xml,curr| if curr.respond_to?(:to_activity) unless xml - xml = curr.to_activity + curr.to_activity else xml + curr.to_activity end diff --git a/spec/lib/diaspora_ostatus_builder_spec.rb b/spec/lib/diaspora_ostatus_builder_spec.rb index cc46bd0c5..0670755f7 100644 --- a/spec/lib/diaspora_ostatus_builder_spec.rb +++ b/spec/lib/diaspora_ostatus_builder_spec.rb @@ -9,13 +9,16 @@ describe Diaspora::OstatusBuilder do let(:user) { Factory(:user) } let(:aspect) { user.aspect(:name => "Public People") } - let!(:status_message1) { user.post(:status_message, :message => "One", :to => aspect.id) } - let!(:status_message2) { user.post(:status_message, :message => "Two", :to => aspect.id) } + let!(:status_message1) { user.post(:status_message, :message => "One", :public => true, :to => aspect.id) } + let!(:status_message2) { user.post(:status_message, :message => "Two", :public => true, :to => aspect.id) } + let!(:status_message3) { user.post(:status_message, :message => "Three", :public => false, :to => aspect.id) } let!(:atom) { Diaspora::OstatusBuilder::build(user) } it 'should include a users posts' do - atom.should include status_message.message + atom.should include status_message1.message + atom.should include status_message2.message + atom.should_not include status_message3.message end end From eac6b8a63b6550d634f158198f88a8d291613852 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Mon, 27 Sep 2010 21:54:01 -0700 Subject: [PATCH 138/155] builder is now a class initialized with a user. added director class. --- app/controllers/publics_controller.rb | 8 +++- lib/diaspora/ostatus_builder.rb | 39 +++++++++++-------- ...uilder_spec.rb => ostatus_builder_spec.rb} | 4 +- 3 files changed, 31 insertions(+), 20 deletions(-) rename spec/lib/{diaspora_ostatus_builder_spec.rb => ostatus_builder_spec.rb} (86%) diff --git a/app/controllers/publics_controller.rb b/app/controllers/publics_controller.rb index 76360fb90..c4ea0d29a 100644 --- a/app/controllers/publics_controller.rb +++ b/app/controllers/publics_controller.rb @@ -6,7 +6,7 @@ class PublicsController < ApplicationController require File.expand_path('../../../lib/diaspora/parser', __FILE__) require File.expand_path('../../../lib/diaspora/ostatus_builder', __FILE__) include Diaspora::Parser - include Diaspora::OstatusBuilder + layout false def hcard @@ -44,7 +44,11 @@ class PublicsController < ApplicationController def public user = User.find_by_username(params[:username]) - render :xml => Diaspora::OstatusBuilder::build(user) + + director = Diaspora::Director.new + ostatus_builder = Diaspora::OstatusBuilder.new(user) + + render :xml => director.build(ostatus_builder) end end diff --git a/lib/diaspora/ostatus_builder.rb b/lib/diaspora/ostatus_builder.rb index ce4ebfeb4..d3640771c 100644 --- a/lib/diaspora/ostatus_builder.rb +++ b/lib/diaspora/ostatus_builder.rb @@ -3,20 +3,27 @@ # the COPYRIGHT file. module Diaspora - module OstatusBuilder - def self.build(user) - if @user = User.find_by_id(user.id) - xml = "" - xml << create_headers - xml << create_endpoints - xml << create_subject - xml << create_body - xml << create_footer - else raise "Invalid user sent to builder" end + class Director + def initialize + @structure = [:create_headers, :create_endpoints, :create_subject, + :create_body, :create_footer] end - def self.create_headers + def build(builder) + @structure.inject("") do |xml, method| + xml << builder.send(method) + end + end + end + + + class OstatusBuilder + def initialize(user) + @user = user + end + + def create_headers <<-XML.strip @@ -32,13 +39,13 @@ module Diaspora XML end - def self.create_endpoints + def create_endpoints <<-XML XML end - def self.create_subject + def create_subject <<-XML http://activitystrea.ms/schema/1.0/person @@ -49,7 +56,7 @@ module Diaspora XML end - def self.create_body + def create_body @user.visible_posts(:public=>true).inject("") do |xml,curr| if curr.respond_to?(:to_activity) unless xml @@ -61,11 +68,11 @@ module Diaspora end end - def self.create_footer + def create_footer <<-XML XML end - end + end diff --git a/spec/lib/diaspora_ostatus_builder_spec.rb b/spec/lib/ostatus_builder_spec.rb similarity index 86% rename from spec/lib/diaspora_ostatus_builder_spec.rb rename to spec/lib/ostatus_builder_spec.rb index 0670755f7..042bf202b 100644 --- a/spec/lib/diaspora_ostatus_builder_spec.rb +++ b/spec/lib/ostatus_builder_spec.rb @@ -7,13 +7,13 @@ require File.dirname(__FILE__) + '/../../lib/diaspora/ostatus_builder' describe Diaspora::OstatusBuilder do - let(:user) { Factory(:user) } + let!(:user) { Factory(:user) } let(:aspect) { user.aspect(:name => "Public People") } let!(:status_message1) { user.post(:status_message, :message => "One", :public => true, :to => aspect.id) } let!(:status_message2) { user.post(:status_message, :message => "Two", :public => true, :to => aspect.id) } let!(:status_message3) { user.post(:status_message, :message => "Three", :public => false, :to => aspect.id) } - let!(:atom) { Diaspora::OstatusBuilder::build(user) } + let!(:atom) { director = Diaspora::Director.new; director.build(Diaspora::OstatusBuilder.new(user)) } it 'should include a users posts' do atom.should include status_message1.message From 44c29cf8e6794d5a3f6fff400f15376bae4adec6 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Mon, 27 Sep 2010 21:57:52 -0700 Subject: [PATCH 139/155] deploy_config back to master --- config/deploy_config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/deploy_config.yml b/config/deploy_config.yml index b6cba3056..6aacbf3ff 100644 --- a/config/deploy_config.yml +++ b/config/deploy_config.yml @@ -6,7 +6,7 @@ cross_server: deploy_to: '/usr/local/app/diaspora' user: 'root' repo: 'git://github.com/diaspora/diaspora.git' - branch: 'fb' + branch: 'master' default_env: 'development' servers: tom: From d8c49e88521b5a9cd15a960c7f89584980d4c7db Mon Sep 17 00:00:00 2001 From: ilya Date: Mon, 27 Sep 2010 22:06:47 -0700 Subject: [PATCH 140/155] moved stuff around in the readme --- README.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index c8f193afe..f21676bdd 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,18 @@ +# Diaspora + +The privacy aware, personally controlled, do-it-all, open source social +network. + +**DISCLAIMER: THIS IS PRE-ALPHA SOFTWARE AND SHOULD BE TREATED ACCORDINGLY.** +**PLEASE, DO NOT RUN IN PRODUCTION. IT IS FUN TO GET RUNNING, BUT EXPECT THINGS +TO BE BROKEN** + +Initial installation instructions are [here](http://github.com/diaspora/diaspora/wiki/Installing-and-Running-Diaspora). + +We are continuing to build features and improve the code base. +When we think it is ready for general use, we will post more final +instructions. + ## Commit Guidlines You are welcome to contribute, add to and extend Diaspora however you see fit. We @@ -17,21 +32,6 @@ Nokogiri, Mongomapper, and EM::HttpRequest as much as possible. We have a few gems in the project we'd rather not use, but if you can, use dependencies we already have. -# Diaspora - -The privacy aware, personally controlled, do-it-all, open source social -network. - -**DISCLAIMER: THIS IS PRE-ALPHA SOFTWARE AND SHOULD BE TREATED ACCORDINGLY.** -**PLEASE, DO NOT RUN IN PRODUCTION. IT IS FUN TO GET RUNNING, BUT EXPECT THINGS -TO BE BROKEN** - -Some initial installation instructions are [here](http://github.com/diaspora/diaspora/wiki/Installing-and-Running-Diaspora). - -We are continuing to build features and improve the code base. -When we think it is ready for general use, we will post more final -instructions. - ## Resources We are maintaining a From 762646dbe80a89cfb30dd5c033e847379acdb335 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Mon, 27 Sep 2010 22:11:14 -0700 Subject: [PATCH 141/155] make the director more forgiving --- lib/diaspora/ostatus_builder.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/diaspora/ostatus_builder.rb b/lib/diaspora/ostatus_builder.rb index d3640771c..997e538f3 100644 --- a/lib/diaspora/ostatus_builder.rb +++ b/lib/diaspora/ostatus_builder.rb @@ -12,7 +12,7 @@ module Diaspora def build(builder) @structure.inject("") do |xml, method| - xml << builder.send(method) + xml << builder.send(method) if builder.respond_to? method end end end From 15a4609c1428c1701e3ece297a9288c99cb5e292 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Mon, 27 Sep 2010 22:30:16 -0700 Subject: [PATCH 142/155] moved user's public route to user controller. changed person.public_url to reflect change. --- app/controllers/publics_controller.rb | 10 ---------- app/controllers/users_controller.rb | 12 +++++++++++- app/models/person.rb | 2 +- config/routes.rb | 6 ++++-- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/app/controllers/publics_controller.rb b/app/controllers/publics_controller.rb index c4ea0d29a..e3c90fc16 100644 --- a/app/controllers/publics_controller.rb +++ b/app/controllers/publics_controller.rb @@ -4,7 +4,6 @@ class PublicsController < ApplicationController require File.expand_path('../../../lib/diaspora/parser', __FILE__) - require File.expand_path('../../../lib/diaspora/ostatus_builder', __FILE__) include Diaspora::Parser layout false @@ -42,13 +41,4 @@ class PublicsController < ApplicationController @user.receive_salmon params[:xml] end - def public - user = User.find_by_username(params[:username]) - - director = Diaspora::Director.new - ostatus_builder = Diaspora::OstatusBuilder.new(user) - - render :xml => director.build(ostatus_builder) - end - end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index ac284a219..0d5c4d449 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -3,7 +3,9 @@ # the COPYRIGHT file. class UsersController < ApplicationController - before_filter :authenticate_user!, :except => [:new, :create] + require File.expand_path('../../../lib/diaspora/ostatus_builder', __FILE__) + + before_filter :authenticate_user!, :except => [:new, :create, :public] respond_to :html @@ -27,6 +29,14 @@ class UsersController < ApplicationController respond_with(@user, :location => root_url) end + def public + user = User.find_by_username(params[:username]) + director = Diaspora::Director.new + ostatus_builder = Diaspora::OstatusBuilder.new(user) + + render :xml => director.build(ostatus_builder) + end + private def prep_image_url(params) url = APP_CONFIG[:pod_url].chop if APP_CONFIG[:pod_url][-1,1] == '/' diff --git a/app/models/person.rb b/app/models/person.rb index 0cbde015a..28503e921 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -50,7 +50,7 @@ class Person end def public_url - "#{self.url}users/#{self.id}/public" + "#{self.url}users/#{self.owner.username}/public" end diff --git a/config/routes.rb b/config/routes.rb index 0a8aa2630..56ec559c9 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -4,12 +4,15 @@ Diaspora::Application.routes.draw do resources :people, :only => [:index, :show, :destroy] - resources :users, :except => [:create, :new, :show] resources :status_messages, :only => [:create, :destroy, :show] resources :comments, :except => [:index] resources :requests, :except => [:edit, :update] resources :photos, :except => [:index] resources :albums + + # added public route to user + match 'users/:username/public', :to => 'users#public' + resources :users, :except => [:create, :new, :show] match 'aspects/move_friends', :to => 'aspects#move_friends', :as => 'move_friends' match 'aspects/move_friend', :to => 'aspects#move_friend', :as => 'move_friend' @@ -36,7 +39,6 @@ Diaspora::Application.routes.draw do match 'get_to_the_choppa', :to => redirect("/signup") #public routes # - match 'public/:username', :to => 'publics#public' match 'webfinger', :to => 'publics#webfinger' match 'hcard/users/:id', :to => 'publics#hcard' From bf587be4618c412884a2b6522fd328cb632df083 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Mon, 27 Sep 2010 22:50:11 -0700 Subject: [PATCH 143/155] public indicator tag on status message partial. --- .../status_messages/_status_message.html.haml | 5 ++++ public/stylesheets/application.css | 15 ++++++++++++ public/stylesheets/sass/application.sass | 23 +++++++++++++++++++ 3 files changed, 43 insertions(+) diff --git a/app/views/status_messages/_status_message.html.haml b/app/views/status_messages/_status_message.html.haml index 55c5123b7..f4ac1cadf 100644 --- a/app/views/status_messages/_status_message.html.haml +++ b/app/views/status_messages/_status_message.html.haml @@ -22,3 +22,8 @@ .destroy_link = link_to t('.delete'), status_message_path(post), :confirm => t('.are_you_sure'), :method => :delete, :remote => true, :class => "delete" = render "shared/reshare", :post => post, :current_user => current_user + + - if post.public? + .aspect_tag + public + diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 53da697cc..23ef5ff7a 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -675,3 +675,18 @@ ul#settings_nav { #fancybox-close:hover { background-color: transparent; } + +.aspect_tag { + position: absolute; + top: 15px; + right: 2em; + background-color: #fffc7f; + border-radius: 5px; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + font-size: smaller; + padding: 0 6px; + color: #999999; + text-shadow: 0 1px white; + border-bottom: 1px solid #eeeeee; + cursor: default; } diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 2a3136393..133fe9dcb 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -866,3 +866,26 @@ ul#settings_nav :background :color transparent +.aspect_tag + :position absolute + :top 15px + :right 2em + :background + :color #FFFC7F + + :border-radius 5px + :-webkit-border-radius 5px + :-moz-border-radius 5px + + :font + :size smaller + :padding 0 6px + + :color #999 + :text + :shadow 0 1px #fff + + :border + :bottom 1px solid #eee + + :cursor default From cb7c35af73416f4deaa17f73ee1b510135236f93 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Mon, 27 Sep 2010 23:15:48 -0700 Subject: [PATCH 144/155] fixed thumbnail positioning --- app/views/shared/_aspect_friends.haml | 28 ++++++++++++++++++++++++ public/stylesheets/application.css | 8 +++++++ public/stylesheets/sass/application.sass | 8 +++++++ 3 files changed, 44 insertions(+) diff --git a/app/views/shared/_aspect_friends.haml b/app/views/shared/_aspect_friends.haml index f8e635f8d..6d1a0e2f4 100644 --- a/app/views/shared/_aspect_friends.haml +++ b/app/views/shared/_aspect_friends.haml @@ -3,6 +3,34 @@ -# the COPYRIGHT file. #friend_pictures + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link + = owner_image_link = owner_image_link - for friend in @friends = person_image_link(friend) diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 23ef5ff7a..e886e3480 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -690,3 +690,11 @@ ul#settings_nav { text-shadow: 0 1px white; border-bottom: 1px solid #eeeeee; cursor: default; } + +#friend_pictures { + line-height: 1em; } + #friend_pictures img { + margin-right: -1px; } + +#thumbnails { + line-height: 14px; } diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 133fe9dcb..ab4674760 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -889,3 +889,11 @@ ul#settings_nav :bottom 1px solid #eee :cursor default + +#friend_pictures + :line-height 1em + img + :margin-right -1px + +#thumbnails + :line-height 14px From 79926da3d32aa0895c461fdfb0dc2f34e2dc06a8 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Mon, 27 Sep 2010 23:16:19 -0700 Subject: [PATCH 145/155] removed owner image repeat --- app/views/shared/_aspect_friends.haml | 28 --------------------------- 1 file changed, 28 deletions(-) diff --git a/app/views/shared/_aspect_friends.haml b/app/views/shared/_aspect_friends.haml index 6d1a0e2f4..f8e635f8d 100644 --- a/app/views/shared/_aspect_friends.haml +++ b/app/views/shared/_aspect_friends.haml @@ -3,34 +3,6 @@ -# the COPYRIGHT file. #friend_pictures - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link - = owner_image_link = owner_image_link - for friend in @friends = person_image_link(friend) From 263615ad14ea9acf5dff2ad7f7f0747c2730b904 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Mon, 27 Sep 2010 23:51:20 -0700 Subject: [PATCH 146/155] all status messages have labels --- .../status_messages/_status_message.html.haml | 7 +++- public/stylesheets/application.css | 26 +++++++++++- public/stylesheets/sass/application.sass | 41 +++++++++++++++++-- 3 files changed, 68 insertions(+), 6 deletions(-) diff --git a/app/views/status_messages/_status_message.html.haml b/app/views/status_messages/_status_message.html.haml index f4ac1cadf..d1568c7bb 100644 --- a/app/views/status_messages/_status_message.html.haml +++ b/app/views/status_messages/_status_message.html.haml @@ -24,6 +24,11 @@ = render "shared/reshare", :post => post, :current_user => current_user - if post.public? - .aspect_tag + .public_aspect_tag public + - else + .aspect_tag + %ul + - for aspect in current_user.aspects_with_post( post.id ) + %li= aspect.name diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index e886e3480..42b61f513 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -676,11 +676,11 @@ ul#settings_nav { #fancybox-close:hover { background-color: transparent; } -.aspect_tag { +.aspect_tag, +.public_aspect_tag { position: absolute; top: 15px; right: 2em; - background-color: #fffc7f; border-radius: 5px; -webkit-border-radius: 5px; -moz-border-radius: 5px; @@ -691,6 +691,28 @@ ul#settings_nav { border-bottom: 1px solid #eeeeee; cursor: default; } +.public_aspect_tag { + background-color: #fffc7f; } + +.aspect_tag { + background-color: #eeeeee; + color: #999999; + text-shadow: 0 1px white; } + .aspect_tag ul { + display: inline; + margin: 0; + padding: 0; + list-style: none; } + .aspect_tag ul li { + display: inline; + margin-right: 2px; + padding-right: 4px; + border-right: 1px solid #cccccc; } + .aspect_tag ul li:last-child { + margin-right: 0; + padding-right: 0; + border-right: none; } + #friend_pictures { line-height: 1em; } #friend_pictures img { diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index ab4674760..71589e3cc 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -866,12 +866,11 @@ ul#settings_nav :background :color transparent -.aspect_tag +.aspect_tag, +.public_aspect_tag :position absolute :top 15px :right 2em - :background - :color #FFFC7F :border-radius 5px :-webkit-border-radius 5px @@ -890,6 +889,42 @@ ul#settings_nav :cursor default +.public_aspect_tag + :background + :color #FFFC7F + +.aspect_tag + :background + :color #eee + :color #999 + :text + :shadow 0 1px #fff + + ul + :display inline + :margin 0 + :padding 0 + :list + :style none + + li + :display inline + :margin + :right 2px + :padding + :right 4px + :border + :right 1px solid #ccc + + &:last-child + :margin + :right 0 + :padding + :right 0 + :border + :right none + + #friend_pictures :line-height 1em img From bf15514bc969d272e32182038062debc3ace0b48 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 28 Sep 2010 10:23:03 -0700 Subject: [PATCH 147/155] redirect users#public to root_url if user does not exist. --- app/controllers/users_controller.rb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 0d5c4d449..1cc280577 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -31,10 +31,16 @@ class UsersController < ApplicationController def public user = User.find_by_username(params[:username]) - director = Diaspora::Director.new - ostatus_builder = Diaspora::OstatusBuilder.new(user) - render :xml => director.build(ostatus_builder) + if user + director = Diaspora::Director.new + ostatus_builder = Diaspora::OstatusBuilder.new(user) + + render :xml => director.build(ostatus_builder) + else + flash[:error] = "User #{params[:username]} does not exist!" + redirect_to root_url + end end private From 241ea4559ab69c55110a2834d9814bf98dde5c47 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 28 Sep 2010 10:41:38 -0700 Subject: [PATCH 148/155] gradients on aspect tags on status messages --- public/stylesheets/application.css | 12 +++++++++--- public/stylesheets/sass/application.sass | 10 ++++++++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 42b61f513..5b8a656da 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -692,12 +692,18 @@ ul#settings_nav { cursor: default; } .public_aspect_tag { - background-color: #fffc7f; } + background: -moz-linear-gradient(19% 75% 90deg, #fffa75, #fff8ba); + background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#fff8ba), to(#fffa75)); + background-color: #fffc7f; + border-top: 1px solid #ebe66c; } .aspect_tag { - background-color: #eeeeee; + background: -moz-linear-gradient(19% 75% 90deg, #e0e0e0, #f0f0f0); + background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#f0f0f0), to(#e0e0e0)); + background-color: #eeeeee; color: #999999; - text-shadow: 0 1px white; } + text-shadow: 0 1px white; + border-top: 1px solid #dddddd; } .aspect_tag ul { display: inline; margin: 0; diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 71589e3cc..0fcc6eab2 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -890,15 +890,21 @@ ul#settings_nav :cursor default .public_aspect_tag - :background + :background -moz-linear-gradient(19% 75% 90deg,#FFFA75, #FFF8BA) + :background -webkit-gradient(linear, 0% 0%, 0% 100%, from(#FFF8BA), to(#FFFA75)) :color #FFFC7F + :border + :top 1px solid #EBE66C .aspect_tag - :background + :background -moz-linear-gradient(19% 75% 90deg,#E0E0E0, #F0F0F0) + :background -webkit-gradient(linear, 0% 0%, 0% 100%, from(#F0F0F0), to(#E0E0E0)) :color #eee :color #999 :text :shadow 0 1px #fff + :border + :top 1px solid #ddd ul :display inline From b068eaf15cd0e550eb2287fd07f819a08d9235e7 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 28 Sep 2010 10:48:45 -0700 Subject: [PATCH 149/155] limit content width to 600px --- public/stylesheets/application.css | 3 ++- public/stylesheets/sass/application.sass | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 5b8a656da..92944841c 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -160,7 +160,8 @@ li.message { li.message .delete:hover { background: #eeeeee; } li.message .content { - padding-left: 65px; } + padding-left: 65px; + width: 600px; } li.message .content span.from { color: black; font-weight: normal; diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 0fcc6eab2..b86ddc1bf 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -209,6 +209,7 @@ li.message .content :padding :left 65px + :width 600px span.from :color #000 From 577b5545bf66730cfb4fe3f0b792779da4926249 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 28 Sep 2010 11:50:13 -0700 Subject: [PATCH 150/155] comment blocks slide --- public/javascripts/stream.js | 4 ++-- public/stylesheets/application.css | 4 ++-- public/stylesheets/sass/application.sass | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/public/javascripts/stream.js b/public/javascripts/stream.js index e8db10abd..7811fb1a3 100644 --- a/public/javascripts/stream.js +++ b/public/javascripts/stream.js @@ -21,10 +21,10 @@ $(".show_post_comments").live('click', function(event) { if( $this.hasClass( "visible")) { $this.html($(this).html().replace("hide", "show")); - $this.closest("li").children(".content").children(".comments").fadeOut(100); + $this.closest("li").children(".content").children(".comments").slideUp(150); } else { $this.html($(this).html().replace("show", "hide")); - $this.closest("li").children(".content").children(".comments").fadeIn(100); + $this.closest("li").children(".content").children(".comments").slideDown(150); } $(this).toggleClass( "visible" ); }); diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 92944841c..afaebdb29 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -263,7 +263,7 @@ ul.comment_set { margin-bottom: 0.5em; background-color: rgba(10, 81, 109, 0.05); padding: 0.6em; - border-bottom: 1px solid #cccccc; } + border-bottom: 1px solid #dddddd; } ul.comment_set li.comment .from { font-size: 1em; } ul.comment_set li.comment div.time { @@ -711,7 +711,7 @@ ul#settings_nav { padding: 0; list-style: none; } .aspect_tag ul li { - display: inline; + display: inlinte; margin-right: 2px; padding-right: 4px; border-right: 1px solid #cccccc; } diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index b86ddc1bf..f7c58beac 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -356,7 +356,7 @@ ul.comment_set :color rgba(10,81,109,0.05) :padding 0.6em :border - :bottom 1px solid #ccc + :bottom 1px solid #ddd .from :font @@ -915,7 +915,7 @@ ul#settings_nav :style none li - :display inline + :display inlinte :margin :right 2px :padding From 0a34c24f226dac74b9e640009b9d5af23293ce45 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 28 Sep 2010 11:51:52 -0700 Subject: [PATCH 151/155] tag fix --- public/stylesheets/application.css | 2 +- public/stylesheets/sass/application.sass | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index afaebdb29..7c8c9beb4 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -711,7 +711,7 @@ ul#settings_nav { padding: 0; list-style: none; } .aspect_tag ul li { - display: inlinte; + display: inline-block; margin-right: 2px; padding-right: 4px; border-right: 1px solid #cccccc; } diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index f7c58beac..b7af588fe 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -915,7 +915,7 @@ ul#settings_nav :style none li - :display inlinte + :display inline-block :margin :right 2px :padding From 4627c5338ee3eeea3cffdd427f9eeb30c568ffc0 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 28 Sep 2010 12:29:35 -0700 Subject: [PATCH 152/155] found placement of all aspects tab confusing; moved it to be the first tab --- app/views/shared/_aspect_nav.haml | 4 ++-- public/stylesheets/application.css | 10 +++++++--- public/stylesheets/sass/application.sass | 12 +++++++++--- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/app/views/shared/_aspect_nav.haml b/app/views/shared/_aspect_nav.haml index 4c4a501d2..dc01afd20 100644 --- a/app/views/shared/_aspect_nav.haml +++ b/app/views/shared/_aspect_nav.haml @@ -4,11 +4,11 @@ #aspect_nav %ul + %li{:class => ("selected" if @aspect == :all)} + = link_to t('.all_aspects'), root_url - for aspect in @aspects %li{:class => ("selected" if current_aspect?(aspect))} = link_for_aspect aspect - %li{:class => ("selected" if @aspect == :all)} - = link_to t('.all_aspects'), root_url %ul{ :style => "position:absolute;right:0;bottom:0.01em;"} %li{:class => ("selected" if @aspect == :public)} diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 7c8c9beb4..18e6ce4ba 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -118,6 +118,10 @@ header { header #session_action ul li:last-child { margin-right: 0; } header #aspect_header { + -webkit-box-shadow: 0px -4px 6px -2px #777777; + -moz-box-shadow: 0px -4px 6px -2px #777777; + background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#f7f7f7), to(#eeeeee)); + background: -moz-linear-gradient(19% 75% 90deg, #eeeeee, #f7f7f7); background-color: #eeeeee; border-top: 1px solid white; padding: 20px 0; } @@ -529,10 +533,10 @@ h1.big_text { line-height: 18px; font-weight: bold; background-color: #eeeeee; - background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(white), to(#eeeeee)); - background: -moz-linear-gradient(19% 75% 90deg, #eeeeee, white); + background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(white), to(#f7f7f7)); + background: -moz-linear-gradient(19% 75% 90deg, #f7f7f7, white); border: 1px solid white; - border-bottom: 1px solid #eeeeee; + border-bottom: 1px solid #f7f7f7; color: black; } #aspect_nav ul > li.selected a:hover { background-color: #efefef; } diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index b7af588fe..b3397e68c 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -146,6 +146,12 @@ header :right 0 #aspect_header + :-webkit-box-shadow 0px -4px 6px -2px #777 + :-moz-box-shadow 0px -4px 6px -2px #777 + + :background -webkit-gradient(linear, 0% 0%, 0% 100%, from(#F7F7F7), to(#EEEEEE)) + :background -moz-linear-gradient(19% 75% 90deg, #eee, #f7f7f7) + :background :color #eee :border @@ -713,11 +719,11 @@ h1.big_text :background :color #eee - :background -webkit-gradient(linear, 0% 0%, 0% 100%, from(#fff), to(#eee)) - :background -moz-linear-gradient(19% 75% 90deg, #eee, #fff) + :background -webkit-gradient(linear, 0% 0%, 0% 100%, from(#fff), to(#F7F7F7)) + :background -moz-linear-gradient(19% 75% 90deg, #f7f7f7, #fff) :border 1px solid #fff - :bottom 1px solid #eee + :bottom 1px solid #F7F7F7 :color #000 &:hover :background From e0159aaaeb8737771095e4cfe0da9620cd49e963 Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 28 Sep 2010 12:58:34 -0700 Subject: [PATCH 153/155] small visual tweaks --- app/views/status_messages/show.html.haml | 1 + public/stylesheets/application.css | 14 +++++++++----- public/stylesheets/sass/application.sass | 15 +++++++++++---- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/app/views/status_messages/show.html.haml b/app/views/status_messages/show.html.haml index ae4ece073..3d78dd29e 100644 --- a/app/views/status_messages/show.html.haml +++ b/app/views/status_messages/show.html.haml @@ -7,6 +7,7 @@ = @status_message.message %h4= "#{t('.comments')} (#{@status_message.comments.count})" + = render "comments/comments", :post => @status_message %p diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 18e6ce4ba..2b752f9ce 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -147,7 +147,9 @@ ul#stream { padding: 12px 0; border-bottom: 1px solid #eeeeee; } ul#stream > li:hover { - background-color: #fafafa; } + background: -webkit-gradient(linear, 0% 0%, 0% 50%, from(#fafafa), to(#fcfcfc)); + background-color: #fafafa; + border-bottom: 1px solid #dddddd; } ul#stream > li:hover .destroy_link { display: inline; } ul#stream .right { @@ -392,13 +394,15 @@ label { height: 42px; margin-top: 0; margin-bottom: 0; - box-shadow: 0 1px white; - -moz-box-shadow: 0 1px white; - -webkit-box-shadow: 0 1px white; } + box-shadow: 0 1px 2px white; + -moz-box-shadow: 0 1px 2px white; + -webkit-box-shadow: 0 1px 2px white; } #publisher .button { margin-left: 100px; } #publisher img { - -webkit-box-shadow: 0 1px 0 white; + box-shadow: 0 1px 2px white; + -moz-box-shadow: 0 1px 2px white; + -webkit-box-shadow: 0 1px 2px white; border: 1px solid #bbbbbb; border-top: 1px solid #666666; } diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index b3397e68c..abf7bd147 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -188,9 +188,14 @@ ul#stream :bottom 1px solid #eee &:hover + :background -webkit-gradient(linear, 0% 0%, 0% 50%, from(#FAFAFA), to(#FCFCFC)) + :background :color #fafafa + :border + :bottom 1px solid #ddd + .destroy_link :display inline @@ -522,15 +527,17 @@ label :top 0 :bottom 0 - :box-shadow 0 1px #fff - :-moz-box-shadow 0 1px #fff - :-webkit-box-shadow 0 1px #fff + :box-shadow 0 1px 2px #fff + :-moz-box-shadow 0 1px 2px #fff + :-webkit-box-shadow 0 1px 2px #fff .button :margin-left 100px img - :-webkit-box-shadow 0 1px 0 #fff + :box-shadow 0 1px 2px #fff + :-moz-box-shadow 0 1px 2px #fff + :-webkit-box-shadow 0 1px 2px #fff :border 1px solid #bbb :top 1px solid #666 From f5a57a6f4afed5dc7b0e017628b8a5e69d22f69e Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 28 Sep 2010 13:05:58 -0700 Subject: [PATCH 154/155] photo partial now has labels --- app/views/photos/_photo.haml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/views/photos/_photo.haml b/app/views/photos/_photo.haml index d39fd0666..5e86e32a6 100644 --- a/app/views/photos/_photo.haml +++ b/app/views/photos/_photo.haml @@ -22,3 +22,13 @@ \-- = link_to "#{t('.show_comments')} (#{post.comments.count})", '#', :class => "show_post_comments" = render "comments/comments", :post => post + + - if post.public? + .public_aspect_tag + public + - else + .aspect_tag + %ul + - for aspect in current_user.aspects_with_post( post.id ) + %li= aspect.name + From fa8cc5b8769dc2ee6cf8b870c0687087b32a0e1d Mon Sep 17 00:00:00 2001 From: danielvincent Date: Tue, 28 Sep 2010 23:24:04 -0400 Subject: [PATCH 155/155] moz box shadow does not like negative blur --- public/stylesheets/application.css | 1 - public/stylesheets/sass/application.sass | 1 - 2 files changed, 2 deletions(-) diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 2b752f9ce..27f5543f1 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -119,7 +119,6 @@ header { margin-right: 0; } header #aspect_header { -webkit-box-shadow: 0px -4px 6px -2px #777777; - -moz-box-shadow: 0px -4px 6px -2px #777777; background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#f7f7f7), to(#eeeeee)); background: -moz-linear-gradient(19% 75% 90deg, #eeeeee, #f7f7f7); background-color: #eeeeee; diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index abf7bd147..a3873d4c8 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -147,7 +147,6 @@ header #aspect_header :-webkit-box-shadow 0px -4px 6px -2px #777 - :-moz-box-shadow 0px -4px 6px -2px #777 :background -webkit-gradient(linear, 0% 0%, 0% 100%, from(#F7F7F7), to(#EEEEEE)) :background -moz-linear-gradient(19% 75% 90deg, #eee, #f7f7f7)