diff --git a/Gemfile b/Gemfile index 623aca3a167cb41aa1f5914ea3c74d823c65d010..18c09345a009c4f600e16aa6fa9723dc17d79bf3 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,7 @@ source 'http://rubygems.org' gem 'mysql2', '0.2.6' #gem 'pg' #gem 'sqlite3' -gem 'rails', '3.0.3' +gem 'rails', '3.0.9' gem 'foreigner', '0.9.1' gem 'activerecord-import' @@ -32,7 +32,8 @@ gem 'faraday' gem 'faraday-stack' #Views -gem 'haml', '3.0.25' +gem 'haml', '3.1.2' +gem 'sass', '3.1.4' gem 'will_paginate', '3.0.pre2' #Localization diff --git a/Gemfile.lock b/Gemfile.lock index 5c58dbdeddc021d0a8d9e589605c609f407273f8..50650d9f614719aca4e6e38b167192329d25c33c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -31,7 +31,7 @@ GIT GIT remote: git://github.com/diaspora/diaspora-client.git - revision: 7924e3cc576e54b5ade4014caea8b79e9f1d6343 + revision: 1421deef3df1f7fd9e04d13cc4c86e0d08747f1a specs: diaspora-client (0.0.0) activerecord @@ -72,34 +72,34 @@ GEM Platform (0.4.0) SystemTimer (1.2.1) abstract (1.0.0) - actionmailer (3.0.3) - actionpack (= 3.0.3) - mail (~> 2.2.9) - actionpack (3.0.3) - activemodel (= 3.0.3) - activesupport (= 3.0.3) + actionmailer (3.0.9) + actionpack (= 3.0.9) + mail (~> 2.2.19) + actionpack (3.0.9) + activemodel (= 3.0.9) + activesupport (= 3.0.9) builder (~> 2.1.2) erubis (~> 2.6.6) - i18n (~> 0.4) + i18n (~> 0.5.0) rack (~> 1.2.1) - rack-mount (~> 0.6.13) - rack-test (~> 0.5.6) + rack-mount (~> 0.6.14) + rack-test (~> 0.5.7) tzinfo (~> 0.3.23) - activemodel (3.0.3) - activesupport (= 3.0.3) + activemodel (3.0.9) + activesupport (= 3.0.9) builder (~> 2.1.2) - i18n (~> 0.4) - activerecord (3.0.3) - activemodel (= 3.0.3) - activesupport (= 3.0.3) - arel (~> 2.0.2) + i18n (~> 0.5.0) + activerecord (3.0.9) + activemodel (= 3.0.9) + activesupport (= 3.0.9) + arel (~> 2.0.10) tzinfo (~> 0.3.23) activerecord-import (0.2.7) activerecord (~> 3.0.0) - activeresource (3.0.3) - activemodel (= 3.0.3) - activesupport (= 3.0.3) - activesupport (3.0.3) + activeresource (3.0.9) + activemodel (= 3.0.9) + activesupport (= 3.0.9) + activesupport (3.0.9) addressable (2.2.4) archive-tar-minitar (0.5.2) arel (2.0.10) @@ -148,19 +148,19 @@ GEM closure-compiler (1.1.1) cloudfiles (1.4.10) mime-types (>= 1.16) - columnize (0.3.2) - configuration (1.2.0) + columnize (0.3.4) + configuration (1.3.1) crack (0.1.8) - cucumber (0.10.3) + cucumber (1.0.1) builder (>= 2.1.2) diff-lcs (>= 1.1.2) - gherkin (>= 2.3.8) + gherkin (~> 2.4.5) json (>= 1.4.6) term-ansicolor (>= 1.0.5) cucumber-rails (0.3.2) cucumber (>= 0.8.0) culerity (0.2.15) - daemons (1.1.3) + daemons (1.1.4) database_cleaner (0.6.0) devise (1.3.4) bcrypt-ruby (~> 2.1.2) @@ -183,9 +183,9 @@ GEM addressable (~> 2.2.4) multipart-post (~> 1.1.0) rack (< 2, >= 1.1.0) - faraday-stack (0.1.2) + faraday-stack (0.1.3) faraday (~> 0.6) - faraday_middleware (0.6.3) + faraday_middleware (0.6.5) faraday (~> 0.6.0) fastercsv (1.5.4) fastthread (1.0.7) @@ -201,19 +201,19 @@ GEM nokogiri (~> 1.4.3.1) ruby-hmac foreigner (0.9.1) - formatador (0.1.4) + formatador (0.1.5) fuubar (0.0.5) rspec (~> 2.0) rspec-instafail (~> 0.1.4) ruby-progressbar (~> 0.0.10) gem_plugin (0.2.3) - gherkin (2.3.10) + gherkin (2.4.5) json (>= 1.4.6) - haml (3.0.25) + haml (3.1.2) hashie (1.0.0) highline (1.6.2) http_connection (1.4.1) - i18n (0.6.0) + i18n (0.5.0) i18n-inflector (2.6.1) i18n (>= 0.4.1) i18n-inflector-rails (1.0.4) @@ -267,7 +267,7 @@ GEM net-ssh (2.0.24) net-ssh-gateway (1.1.0) net-ssh (>= 1.99.1) - newrelic_rpm (3.0.1) + newrelic_rpm (3.1.0) nokogiri (1.4.3.1) oa-basic (0.2.6) oa-core (= 0.2.6) @@ -295,7 +295,7 @@ GEM oa-core (= 0.2.6) rack-openid (~> 1.3.1) ruby-openid-apps-discovery (~> 1.2.0) - oauth (0.4.4) + oauth (0.4.5) oauth2 (0.4.1) faraday (~> 0.6.1) multi_json (>= 0.0.5) @@ -316,7 +316,7 @@ GEM oa-more (= 0.2.6) oa-oauth (= 0.2.6) oa-openid (= 0.2.6) - open4 (1.0.1) + open4 (1.1.0) orm_adapter (0.0.5) polyglot (0.3.1) pyu-ruby-sasl (0.0.3.3) @@ -328,26 +328,28 @@ GEM ruby-openid (>= 2.1.8) rack-test (0.5.7) rack (>= 1.0) - rails (3.0.3) - actionmailer (= 3.0.3) - actionpack (= 3.0.3) - activerecord (= 3.0.3) - activeresource (= 3.0.3) - activesupport (= 3.0.3) + rails (3.0.9) + actionmailer (= 3.0.9) + actionpack (= 3.0.9) + activerecord (= 3.0.9) + activeresource (= 3.0.9) + activesupport (= 3.0.9) bundler (~> 1.0) - railties (= 3.0.3) + railties (= 3.0.9) rails-i18n (0.1.0) activesupport (~> 3) - railties (3.0.3) - actionpack (= 3.0.3) - activesupport (= 3.0.3) + railties (3.0.9) + actionpack (= 3.0.9) + activesupport (= 3.0.9) rake (>= 0.8.7) + rdoc (~> 3.4) thor (~> 0.14.4) rake (0.9.2) rash (0.3.0) hashie (~> 1.0.0) rcov (0.9.9) - redis (2.2.0) + rdoc (3.8) + redis (2.2.1) redis-namespace (0.8.0) redis (< 3.0.0) resque (1.10.0) @@ -367,7 +369,7 @@ GEM rspec-core (2.6.0) rspec-expectations (2.6.0) diff-lcs (~> 1.1.2) - rspec-instafail (0.1.7) + rspec-instafail (0.1.8) rspec-mocks (2.6.0) rspec-rails (2.6.1) actionpack (~> 3.0) @@ -396,6 +398,7 @@ GEM archive-tar-minitar (>= 0.5.2) rubyntlm (0.1.1) rubyzip (0.9.4) + sass (3.1.4) selenium-webdriver (0.2.2) childprocess (>= 0.1.9) ffi (>= 1.0.7) @@ -439,8 +442,8 @@ GEM addressable (>= 2.2.2) crack (>= 0.1.7) will_paginate (3.0.pre2) - xml-simple (1.0.16) - yard (0.7.1) + xml-simple (1.1.0) + yard (0.7.2) yui-compressor (0.9.6) POpen4 (>= 0.1.4) @@ -475,7 +478,7 @@ DEPENDENCIES fog (= 0.3.25) foreigner (= 0.9.1) fuubar - haml (= 3.0.25) + haml (= 3.1.2) http_accept_language! i18n-inflector-rails (~> 1.0) jammit (= 0.5.4) @@ -492,7 +495,7 @@ DEPENDENCIES oauth2-provider (= 0.0.16) ohai (= 0.5.8) omniauth (= 0.2.6) - rails (= 3.0.3) + rails (= 3.0.9) rails-i18n rcov resque (= 1.10.0) @@ -505,6 +508,7 @@ DEPENDENCIES rspec-rails (>= 2.0.0) ruby-debug ruby-debug19 + sass (= 3.1.4) selenium-webdriver (= 0.2.2) settingslogic (= 2.0.6) sod! diff --git a/app/helpers/comments_helper.rb b/app/helpers/comments_helper.rb index ef1a2bcedd6b9da83e450c65e6d070f01f45ac9f..a8edd58ba82878039149b67629dd659c6a800891 100644 --- a/app/helpers/comments_helper.rb +++ b/app/helpers/comments_helper.rb @@ -20,6 +20,6 @@ module CommentsHelper def new_comment_form(post_id, current_user) @form ||= controller.render_to_string( :partial => 'comments/new_comment', :locals => {:post_id => GSUB_THIS, :current_user => current_user}) - @form.gsub(GSUB_THIS, post_id.to_s) + @form.gsub(GSUB_THIS, post_id.to_s).html_safe end end diff --git a/app/helpers/markdownify_helper.rb b/app/helpers/markdownify_helper.rb index 21aa70a7311ac5e6fbfea8f7e9d07a18c0ebe95d..edf3c7f740d6eda8d1d10afcae3a80fca8bf0dac 100644 --- a/app/helpers/markdownify_helper.rb +++ b/app/helpers/markdownify_helper.rb @@ -4,7 +4,7 @@ module MarkdownifyHelper def markdownify(message, options={}) - message = h(message).html_safe + message = h(message).to_str options[:newlines] = true if !options.has_key?(:newlines) options[:specialchars] = true if !options.has_key?(:specialchars) @@ -17,7 +17,7 @@ module MarkdownifyHelper message = process_specialchars(message) if options[:specialchars] message = process_newlines(message) if options[:newlines] - message + message.html_safe end def process_newlines(message) @@ -132,4 +132,4 @@ module MarkdownifyHelper end message end -end \ No newline at end of file +end diff --git a/app/models/invitation.rb b/app/models/invitation.rb index 078b18d563679cef5b8e30bb8869fb17bc122de1..e600f8a0a5a3468dea56c8b6d3a160ab9db42b09 100644 --- a/app/models/invitation.rb +++ b/app/models/invitation.rb @@ -1,6 +1,12 @@ # Copyright (c) 2010, Diaspora Inc. This file is # licensed under the Affero General Public License version 3 or later. See # the COPYRIGHT file. +# +class OpenSSL::PKey::RSA + def to_yaml + self.to_s + end +end class Invitation < ActiveRecord::Base @@ -26,7 +32,6 @@ class Invitation < ActiveRecord::Base raise "You already invited this person" end end - opts[:existing_user] = existing_user create_invitee(opts) end diff --git a/app/models/status_message.rb b/app/models/status_message.rb index 3701d30668b510613900e70705986c38eb92e399..f59f4fe0654bde1d1f94ac9bce2aa2605b39447f 100644 --- a/app/models/status_message.rb +++ b/app/models/status_message.rb @@ -47,7 +47,7 @@ class StatusMessage < Post def format_mentions(text, opts = {}) regex = /@\{([^;]+); ([^\}]+)\}/ - form_message = text.gsub(regex) do |matched_string| + form_message = text.to_str.gsub(regex) do |matched_string| people = self.mentioned_people person = people.detect{ |p| p.diaspora_handle == $~[2] unless p.nil? diff --git a/app/models/user.rb b/app/models/user.rb index d75b91f4d840e35da414616a86e812e52b6359d9..008bfac03e3d8de6835c4ed4d01e5615b75d4bdb 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -343,7 +343,7 @@ class User < ActiveRecord::Base def self.generate_key key_size = (Rails.env == 'test' ? 512 : 4096) - OpenSSL::PKey::RSA::generate key_size + OpenSSL::PKey::RSA::generate(key_size) end def encryption_key diff --git a/app/views/status_messages/bookmarklet.html.haml b/app/views/status_messages/bookmarklet.html.haml index e25248aa4b9fcc33e6a93d617ff12934e15f94a4..134d01303c74455c1d6d897b0a6f220fd22a846f 100644 --- a/app/views/status_messages/bookmarklet.html.haml +++ b/app/views/status_messages/bookmarklet.html.haml @@ -32,9 +32,7 @@ #new_status_message_pane .span-15.last - #facebox_header - %h4 - =t('bookmarklet.post_something') - + %h4 + =t('bookmarklet.post_something') = render :partial => 'shared/publisher', :locals => { :aspect => :profile, :aspects_with_person => @aspects, :aspect_ids => @aspect_ids} diff --git a/config/initializers/locale.rb b/config/initializers/locale.rb index 79a74a2eec6e602fbbff997a7c858e03a00c5206..86ae3c07b611ceaf3c571a45c30394717b28f944 100644 --- a/config/initializers/locale.rb +++ b/config/initializers/locale.rb @@ -14,13 +14,3 @@ AVAILABLE_LANGUAGE_CODES.each do |c| I18n.fallbacks[c.to_sym] = [c.to_sym, DEFAULT_LANGUAGE.to_sym, :en] end end - -# Workaround for https://rails.lighthouseapp.com/projects/8994/tickets/5329-using-i18nwith_locale-in-actionmailer-raises-systemstackerror -module AbstractController - class I18nProxy - def initialize(i18n_config, lookup_context) - @i18n_config, @lookup_context = i18n_config, lookup_context - @i18n_config = @i18n_config.i18n_config if @i18n_config.respond_to?(:i18n_config) - end - end -end diff --git a/lib/diaspora/taggable.rb b/lib/diaspora/taggable.rb index 0c706a8eb169e549ad57187d81bfc23d03e7c9a4..73f9d4b5457cbdf9f45a18c6930151990e73a09c 100644 --- a/lib/diaspora/taggable.rb +++ b/lib/diaspora/taggable.rb @@ -42,7 +42,7 @@ module Diaspora return text if opts[:plain_text] text = ERB::Util.h(text) unless opts[:no_escape] regex = /(^|\s)#(#{VALID_TAG_BODY})/ - form_message = text.gsub(regex) do |matched_string| + form_message = text.to_str.gsub(regex) do |matched_string| "#{$~[1]}<a href=\"/tags/#{$~[2]}\" class=\"tag\">##{$~[2]}</a>" end form_message.html_safe diff --git a/spec/controllers/admins_controller_spec.rb b/spec/controllers/admins_controller_spec.rb index 5b744d9c5171c856461024c3427fc98b02e2706f..5585f889851a1b0ff765076a44758054cf948ad5 100644 --- a/spec/controllers/admins_controller_spec.rb +++ b/spec/controllers/admins_controller_spec.rb @@ -100,6 +100,16 @@ describe AdminsController do AppConfig[:admins] = [@user.username] end + it 'succeeds' do + get :admin_inviter, :identifier => 'bob@moms.com' + response.should be_redirect + end + + it 'does not die if you do it twice' do + get :admin_inviter, :identifier => 'bob@moms.com' + get :admin_inviter, :identifier => 'bob@moms.com' + response.should be_redirect + end it 'invites a new user' do Invitation.should_receive(:create_invitee).with(:service => 'email', :identifier => 'bob@moms.com') get :admin_inviter, :identifier => 'bob@moms.com' diff --git a/spec/controllers/people_controller_spec.rb b/spec/controllers/people_controller_spec.rb index eadac9b6002b150651992888fb7c6859a98662ed..7bb2b4d955a3b8893141ca83a1e4c3cd10a7e78c 100644 --- a/spec/controllers/people_controller_spec.rb +++ b/spec/controllers/people_controller_spec.rb @@ -39,7 +39,7 @@ describe PeopleController do :profile => Factory.build(:profile, :first_name => "Eugene", :last_name => "w")) get :index, :q => "Eug" - assigns[:people].should =~ [@eugene, eugene2] + assigns[:people].map{|x| x.id}.should =~ [@eugene.id, eugene2.id] end it "excludes people that are not searchable" do @@ -55,7 +55,7 @@ describe PeopleController do :profile => Factory.build(:profile, :first_name => "Eugene", :last_name => "w", :searchable => false)) get :index, :q => "eugene@example.org" - assigns[:people].should =~ [eugene2] + assigns[:people][0].id.should == eugene2.id end it "does not redirect to person page if there is exactly one match" do