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/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 cf863eb43..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' @@ -39,17 +38,18 @@ 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 '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' - 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..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,12 +140,19 @@ 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) - lsof (0.3.0) + json_pure (1.4.6) + linecache (0.43) mail (2.2.6.1) activesupport (>= 2.3.6) mime-types @@ -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) @@ -189,16 +214,18 @@ 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) + 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) @@ -206,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) @@ -228,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! @@ -244,13 +274,12 @@ DEPENDENCIES pubsubhubbub rails (= 3.0.0) redfinger! + redgreen 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/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 c9b50786e..fa9be254a 100644 --- a/Rakefile +++ b/Rakefile @@ -2,12 +2,11 @@ # 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. 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/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..80e4c7d0d 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! @@ -15,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 @@ -30,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/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..9527a7bb7 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 @@ -79,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 @@ -101,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/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..6f74fa8de 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -66,12 +66,11 @@ class User def drop_aspect( aspect ) if aspect.people.size == 0 aspect.destroy - else + else raise "Aspect not empty" end end - def move_friend( opts = {}) return true if opts[:to] == opts[:from] friend = Person.first(:_id => opts[:friend_id]) @@ -107,12 +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 = {} ) @@ -139,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 @@ -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/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/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 47a68ffeb..ae24e8e3b 100644 --- a/app/views/aspects/index.html.haml +++ b/app/views/aspects/index.html.haml @@ -2,10 +2,8 @@ -# 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 af64fcc23..e08f6dabd 100644 --- a/app/views/aspects/manage.html.haml +++ b/app/views/aspects/manage.html.haml @@ -2,8 +2,7 @@ -# licensed under the Affero General Public License version 3. See -# 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' @@ -29,12 +28,10 @@ - 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 - + .aspect_name %span.edit_name_field %h1{:contenteditable => true}= aspect.name @@ -44,9 +41,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/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 4fd46eb56..03a2fcf61 100644 --- a/app/views/comments/_comment.html.haml +++ b/app/views/comments/_comment.html.haml @@ -2,8 +2,7 @@ -# licensed under the Affero General Public License version 3. See -# 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..aecfb4bf1 100644 --- a/app/views/comments/_comments.html.haml +++ b/app/views/comments/_comments.html.haml @@ -2,11 +2,10 @@ -# 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 = render 'comments/comment', :post => comment %li.comment.show = render 'comments/new_comment', :post => post - + 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/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..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"; @@ -19,25 +18,23 @@ 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); debug("connected..."); }; - }); function processRetraction(post_id){ $('#' + post_id ).fadeOut(500, function(){ @@ -66,7 +63,7 @@ $(html).fadeIn("fast", function(){ $("#stream label:first").inFieldLabels(); }) - ); + ); } } @@ -77,13 +74,13 @@ html = "
\ \ \"New \ -
" + " $("#thumbnails").append( $(html) ) $("#"+ photoHash['id'] + " img").load( function() { $(this).fadeIn("slow"); }); } - + function onPageForClass(className){ return (location.href.indexOf(className) != -1 ); } @@ -100,9 +97,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..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 @@ -10,24 +9,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..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 @@ -10,7 +9,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 +17,10 @@ :javascript $(document).ready(function(){ - $("#user_username").focus(); + $("#user_username").focus(); $("label").inFieldLabels(); }); - + = csrf_meta_tag = yield(:head) @@ -44,11 +43,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..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 @@ -21,5 +20,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..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| @@ -15,18 +14,17 @@ = 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 = 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 23e6ea64d..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 @@ -28,7 +27,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..d1a4fc73f 100644 --- a/app/views/photos/_new_photo.haml +++ b/app/views/photos/_new_photo.haml @@ -2,16 +2,15 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - :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..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) @@ -17,9 +16,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/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 21ce72181..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 @@ -53,4 +51,4 @@ %h4{:class => "show_post_comments"} = "#{t('.comments')} (#{@photo.comments.count})" = render "comments/comments", :post => @photo - + 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 217441465..acad2e12b 100644 --- a/app/views/posts/_post.html.haml +++ b/app/views/posts/_post.html.haml @@ -2,8 +2,7 @@ -# licensed under the Affero General Public License version 3. See -# the COPYRIGHT file. - %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/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 70c204e7c..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 @@ -10,7 +9,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..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 @@ -10,11 +9,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/_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 040d3e3c2..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 @@ -18,5 +17,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..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(); @@ -19,7 +17,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/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 4d73f4251..55c5123b7 100644 --- a/app/views/status_messages/_status_message.html.haml +++ b/app/views/status_messages/_status_message.html.haml @@ -2,24 +2,23 @@ -# 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) .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..43c065380 100644 --- a/app/views/status_messages/index.html.haml +++ b/app/views/status_messages/index.html.haml @@ -2,11 +2,10 @@ -# 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 - + - 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..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')}" @@ -49,7 +48,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/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.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 75568dd11..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 @@ -13,7 +12,7 @@ default: pubsub_server: 'https://pubsubhubbub.appspot.com/' mongo_host: 'localhost' mongo_port: 27017 - + development: test: 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/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/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/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/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..cb13c1d1c 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 @@ -16,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/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/_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/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/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 5d6d6049a..d8b6d94f4 100644 --- a/config/locales/devise/devise.cy.yml +++ b/config/locales/devise/devise.cy.yml @@ -1,42 +1,41 @@ # 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.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.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.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 new file mode 100644 index 000000000..4ae726a4d --- /dev/null +++ b/config/locales/devise/devise.he.yml @@ -0,0 +1,40 @@ +# 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/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 b434666ce..c83179bde 100644 --- a/config/locales/devise/devise.sv.yml +++ b/config/locales/devise/devise.sv.yml @@ -1,7 +1,6 @@ # 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/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 b7d9c9af4..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. @@ -30,7 +29,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..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. @@ -45,7 +44,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 +97,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 +131,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 8e6542639..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. @@ -45,7 +44,7 @@ en: new_album: create: "create" add_a_new_album: "Add a new album" - show: + show: edit_album: "Edit Album" albums: "albums" updated: "updated" @@ -86,6 +85,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/config/locales/diaspora/es.yml b/config/locales/diaspora/es.yml index 5af6c70aa..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. @@ -45,7 +44,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 +166,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 +177,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..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. @@ -45,7 +44,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/he.yml b/config/locales/diaspora/he.yml new file mode 100644 index 000000000..9f7670a97 --- /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: "משהו רע מאוד קרה." diff --git a/config/locales/diaspora/it.yml b/config/locales/diaspora/it.yml index 418733b40..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. @@ -45,7 +44,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/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/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..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. @@ -30,7 +29,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..1aa9ac2dc 100644 --- a/config/locales/diaspora/sv.yml +++ b/config/locales/diaspora/sv.yml @@ -2,8 +2,7 @@ # licensed under the Affero General Public License version 3. See # 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 0ac115b76..c2a38dbc6 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" @@ -32,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/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/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..947732a79 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 @@ -43,7 +41,7 @@ package :diaspora_dependencies do end #package :diaspora do # description 'Diaspora' - + =begin package :rails do description 'Ruby on Rails' 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/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/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/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/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..43fe2f48a --- /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 header) + +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/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..bcb1fdd00 --- /dev/null +++ b/features/support/env.rb @@ -0,0 +1,45 @@ +# 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 + +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 +# 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. +begin + require 'database_cleaner' + require 'database_cleaner/cucumber' + DatabaseCleaner.strategy = :truncation + DatabaseCleaner.orm = "mongo_mapper" +end diff --git a/features/support/paths.rb b/features/support/paths.rb new file mode 100644 index 000000000..3d3f64724 --- /dev/null +++ b/features/support/paths.rb @@ -0,0 +1,16 @@ +module NavigationHelpers + def path_to(page_name) + case page_name + when /^its ([\w ]+) page$/ + send("#{$1.gsub(/\W+/, '_')}_path", @it) + when /^the ([\w ]+) page$/ + send("#{$1.gsub(/\W+/, '_')}_path") + when /^"(\/.*)"/ + $1 + else + raise "Can't find mapping from \"#{page_name}\" to a path." + end + end +end + +World(NavigationHelpers) diff --git a/features/user_creates_an_aspect.feature b/features/user_creates_an_aspect.feature new file mode 100644 index 000000000..fb65fde4c --- /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 + + Background: + Given I am signed in + And I follow "Manage" in the header + And I follow "Add a new aspect" + + 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 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." 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..0f6cc6c5c 100644 --- a/lib/diaspora/user/friending.rb +++ b/lib/diaspora/user/friending.rb @@ -2,14 +2,12 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - module Diaspora module UserModules 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} @@ -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) @@ -89,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/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/lib/tasks/cucumber.rake b/lib/tasks/cucumber.rake new file mode 100644 index 000000000..15d405ad4 --- /dev/null +++ b/lib/tasks/cucumber.rake @@ -0,0 +1,55 @@ +# 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, '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, '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, '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' + + 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 ***" + 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/lib/tasks/db.rake b/lib/tasks/db.rake index 9c438ddb1..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 @@ -22,7 +20,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 +31,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 +39,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 +52,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 +60,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/lib/tasks/rspec.rake b/lib/tasks/rspec.rake index 85ae513f6..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' @@ -32,13 +30,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)" 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/lib/tasks/whitespace.rake b/lib/tasks/whitespace.rake index 397674ae5..7af099dd6 100644 --- a/lib/tasks/whitespace.rake +++ b/lib/tasks/whitespace.rake @@ -1,10 +1,20 @@ 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 %{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 - 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/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 diff --git a/spec/controllers/albums_controller_spec.rb b/spec/controllers/albums_controller_spec.rb index e8ea44479..a8f5f8506 100644 --- a/spec/controllers/albums_controller_spec.rb +++ b/spec/controllers/albums_controller_spec.rb @@ -2,9 +2,8 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. +require 'spec_helper' -require File.dirname(__FILE__) + '/../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 a186e8b7c..2e05b850c 100644 --- a/spec/controllers/aspects_controller_spec.rb +++ b/spec/controllers/aspects_controller_spec.rb @@ -2,10 +2,8 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. +require 'spec_helper' - -require File.dirname(__FILE__) + '/../spec_helper' -include ApplicationHelper describe AspectsController do render_views before do diff --git a/spec/controllers/people_controller_spec.rb b/spec/controllers/people_controller_spec.rb index badfdf496..4ce6e3e69 100644 --- a/spec/controllers/people_controller_spec.rb +++ b/spec/controllers/people_controller_spec.rb @@ -2,9 +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 PeopleController do render_views diff --git a/spec/controllers/publics_controller_spec.rb b/spec/controllers/publics_controller_spec.rb index bea772e20..70d851a3e 100644 --- a/spec/controllers/publics_controller_spec.rb +++ b/spec/controllers/publics_controller_spec.rb @@ -2,9 +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 PublicsController do render_views diff --git a/spec/controllers/requests_controller_spec.rb b/spec/controllers/requests_controller_spec.rb deleted file mode 100644 index f0864abe1..000000000 --- a/spec/controllers/requests_controller_spec.rb +++ /dev/null @@ -1,23 +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.dirname(__FILE__) + '/../spec_helper' -include ApplicationHelper -include RequestsHelper -describe RequestsController do - 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/controllers/sockets_controller_spec.rb b/spec/controllers/sockets_controller_spec.rb index 799d37500..905b1611e 100644 --- a/spec/controllers/sockets_controller_spec.rb +++ b/spec/controllers/sockets_controller_spec.rb @@ -2,9 +2,7 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' SocketsController.class_eval <<-EOT def url_options 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/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/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index 4b89c7b31..459563cff 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -2,18 +2,14 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. +require 'spec_helper' - -require File.dirname(__FILE__) + '/../spec_helper' - -include ApplicationHelper describe ApplicationHelper do before do @user = Factory.create(:user) @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 70e9d4606..bc6a5021b 100644 --- a/spec/helpers/publics_helper_spec.rb +++ b/spec/helpers/publics_helper_spec.rb @@ -2,11 +2,8 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. +require 'spec_helper' - -require File.dirname(__FILE__) + '/../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 2d2be1acb..bf99f89d1 100644 --- a/spec/helpers/requests_helper_spec.rb +++ b/spec/helpers/requests_helper_spec.rb @@ -2,16 +2,11 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - -require File.dirname(__FILE__) + '/../spec_helper' - -include RequestsHelper +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') @@ -24,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 diff --git a/spec/lib/diaspora_parser_spec.rb b/spec/lib/diaspora_parser_spec.rb index 3f4e20b1e..e37cf0116 100644 --- a/spec/lib/diaspora_parser_spec.rb +++ b/spec/lib/diaspora_parser_spec.rb @@ -2,14 +2,7 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - -require File.dirname(__FILE__) + '/../spec_helper' - -include ApplicationHelper -include Diaspora::Parser - - +require 'spec_helper' describe Diaspora::Parser do before do @@ -88,7 +81,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 +113,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 +131,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 89ad49924..45d7157b9 100644 --- a/spec/lib/hcard_spec.rb +++ b/spec/lib/hcard_spec.rb @@ -2,9 +2,7 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - -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..adb375c17 100644 --- a/spec/lib/message_handler_spec.rb +++ b/spec/lib/message_handler_spec.rb @@ -2,9 +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 MessageHandler do before 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 a14ef8f77..6d467d4ea 100644 --- a/spec/lib/salmon_salmon_spec.rb +++ b/spec/lib/salmon_salmon_spec.rb @@ -2,9 +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 Salmon do before 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 d3486f1b5..e316817d4 100644 --- a/spec/lib/web_hooks_spec.rb +++ b/spec/lib/web_hooks_spec.rb @@ -2,32 +2,25 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. +require 'spec_helper' +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 -require File.dirname(__FILE__) + '/../spec_helper' - -include Diaspora - -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/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..c4b2cc67c 100644 --- a/spec/misc_spec.rb +++ b/spec/misc_spec.rb @@ -2,9 +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 'making sure the spec runner works' do @@ -46,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/aspect_spec.rb b/spec/models/aspect_spec.rb index ea5afc7cf..23453eee9 100644 --- a/spec/models/aspect_spec.rb +++ b/spec/models/aspect_spec.rb @@ -2,9 +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 Aspect do before do diff --git a/spec/models/comments_spec.rb b/spec/models/comments_spec.rb index 1c20354cf..732c4349b 100644 --- a/spec/models/comments_spec.rb +++ b/spec/models/comments_spec.rb @@ -2,9 +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 Comment do describe "user" do diff --git a/spec/models/person_spec.rb b/spec/models/person_spec.rb index 721310409..c11d03455 100644 --- a/spec/models/person_spec.rb +++ b/spec/models/person_spec.rb @@ -2,9 +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 Person do before 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 3e0b68520..f3f77f3db 100644 --- a/spec/models/photo_spec.rb +++ b/spec/models/photo_spec.rb @@ -2,9 +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 Photo do before 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 dc9d4a9b8..b0ed59b7d 100644 --- a/spec/models/post_spec.rb +++ b/spec/models/post_spec.rb @@ -2,9 +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 Post do before do diff --git a/spec/models/profile_spec.rb b/spec/models/profile_spec.rb index b5bd8f9a5..2e38c20ae 100644 --- a/spec/models/profile_spec.rb +++ b/spec/models/profile_spec.rb @@ -2,9 +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 Profile do before 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 5899cb7fb..c8fb8af05 100644 --- a/spec/models/request_spec.rb +++ b/spec/models/request_spec.rb @@ -2,9 +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 Request do before do @@ -19,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/retraction_spec.rb b/spec/models/retraction_spec.rb index 9aa2b8a76..777855234 100644 --- a/spec/models/retraction_spec.rb +++ b/spec/models/retraction_spec.rb @@ -2,9 +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 Retraction do before do diff --git a/spec/models/status_message_spec.rb b/spec/models/status_message_spec.rb index 005038bf1..d7dbf19e4 100644 --- a/spec/models/status_message_spec.rb +++ b/spec/models/status_message_spec.rb @@ -2,9 +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 StatusMessage do before 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 d307e7a43..2f86ac549 100644 --- a/spec/models/user/posting_spec.rb +++ b/spec/models/user/posting_spec.rb @@ -2,9 +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 User do diff --git a/spec/models/user/receive_spec.rb b/spec/models/user/receive_spec.rb index 37648a98c..5bdddce67 100644 --- a/spec/models/user/receive_spec.rb +++ b/spec/models/user/receive_spec.rb @@ -2,9 +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 User do diff --git a/spec/models/user/user_friending_spec.rb b/spec/models/user/user_friending_spec.rb index 67ed9f799..4ea51ad19 100644 --- a/spec/models/user/user_friending_spec.rb +++ b/spec/models/user/user_friending_spec.rb @@ -2,9 +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 User do before 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 bcab473bc..8d20bcb96 100644 --- a/spec/models/user/visible_posts_spec.rb +++ b/spec/models/user/visible_posts_spec.rb @@ -2,9 +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 User do let(:user) { Factory(:user) } @@ -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 1608bbe58..a2e964dfd 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -2,15 +2,13 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - -require File.dirname(__FILE__) + '/../spec_helper' +require 'spec_helper' 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/spec/spec_helper.rb b/spec/spec_helper.rb index ef5db93c2..4149200d8 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} @@ -45,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) diff --git a/spec/user_encryption_spec.rb b/spec/user_encryption_spec.rb index 33b86d52c..b74006e3d 100644 --- a/spec/user_encryption_spec.rb +++ b/spec/user_encryption_spec.rb @@ -2,11 +2,7 @@ # licensed under the Affero General Public License version 3. See # the COPYRIGHT file. - - -require File.dirname(__FILE__) + '/spec_helper' -include ApplicationHelper -include Diaspora::Parser +require 'spec_helper' describe 'user encryption' do before do diff --git a/test/performance/browsing_test.rb b/test/performance/browsing_test.rb deleted file mode 100644 index 74e8c9421..000000000 --- a/test/performance/browsing_test.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 '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 321d46e1d..000000000 --- a/test/selenium/login_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. - - - -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 d5362b1d7..000000000 --- a/test/selenium/selenium_suite.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. - - - -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 d9742c116..000000000 --- a/test/test_helper.rb +++ /dev/null @@ -1,19 +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 diff --git a/ubuntu-setup.bash b/ubuntu-setup.bash index 08c839f33..95d2a9628 100755 --- a/ubuntu-setup.bash +++ b/ubuntu-setup.bash @@ -8,30 +8,29 @@ # licensed under the Affero General Public License version 3. See # 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" @@ -65,33 +64,33 @@ 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.." # Install bundler @@ -102,22 +101,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 )