diff --git a/app/models/answer.rb b/app/models/answer.rb index 94b795190..61c7c765d 100644 --- a/app/models/answer.rb +++ b/app/models/answer.rb @@ -53,9 +53,11 @@ def on_add_vote(v, voter) def on_remove_vote(v, voter) if v > 0 - self.user.upvote!(self.group, -1) + self.user.update_reputation(:answer_undo_up_vote, self.group) + voter.on_activity(:undo_vote_up_answer, self.group) else - self.user.downvote!(self.group, -1) + self.user.update_reputation(:answer_undo_down_vote, self.group) + voter.on_activity(:undo_vote_down_answer, self.group) end end diff --git a/app/models/group.rb b/app/models/group.rb index 9c9fd5ac8..3a6394a70 100644 --- a/app/models/group.rb +++ b/app/models/group.rb @@ -224,19 +224,40 @@ def self.humanize_reputation_rewards(key) end def check_reputation_configs - self.reputation_constrains.each do |k,v| - self.reputation_constrains[k] = v.to_i - if !REPUTATION_CONSTRAINS.has_key?(k) - self.errors.add(:reputation_constrains, "Invalid key") - return false + if self.reputation_constrains_changed? + self.reputation_constrains.each do |k,v| + self.reputation_constrains[k] = v.to_i + if !REPUTATION_CONSTRAINS.has_key?(k) + self.errors.add(:reputation_constrains, "Invalid key") + return false + end end end - self.reputation_rewards.each do |k,v| - self.reputation_rewards[k] = v.to_i - if !REPUTATION_REWARDS.has_key?(k) - self.errors.add(:reputation_rewards, "Invalid key") - return false + if self.reputation_rewards_changed? + valid = true + [["vote_up_question", "undo_vote_up_question"], + ["vote_down_question", "undo_vote_down_question"], + ["question_receives_up_vote", "question_undo_up_vote"], + ["question_receives_down_vote", "question_undo_down_vote"], + ["vote_up_answer", "undo_vote_up_answer"], + ["vote_down_answer", "undo_vote_down_answer"], + ["answer_receives_up_vote", "answer_undo_up_vote"], + ["answer_receives_down_vote", "answer_undo_down_vote"], + ["answer_picked_as_solution", "answer_unpicked_as_solution"]].each do |action, undo| + if self.reputation_rewards[action].to_i > (self.reputation_rewards[undo].to_i*-1) + valid = false + self.errors.add(undo, "should be less than #{(self.reputation_rewards[action].to_i)*-1}") + end + end + return false unless valid + + self.reputation_rewards.each do |k,v| + self.reputation_rewards[k] = v.to_i + if !REPUTATION_REWARDS.has_key?(k) + self.errors.add(:reputation_rewards, "Invalid key") + return false + end end end diff --git a/app/models/question.rb b/app/models/question.rb index 7692ba5f7..83169ef86 100644 --- a/app/models/question.rb +++ b/app/models/question.rb @@ -146,10 +146,10 @@ def on_add_vote(v, voter) def on_remove_vote(v, voter) if v > 0 self.user.update_reputation(:question_undo_up_vote, self.group) - voter.on_activity(:undo_vote_up_question, self.group) + voter.on_activity(:vote_up_question, self.group) else self.user.update_reputation(:question_undo_down_vote, self.group) - voter.on_activity(:undo_vote_down_question, self.group) + voter.on_activity(:vote_down_question, self.group) end on_activity(false) end diff --git a/app/models/user.rb b/app/models/user.rb index c21d010ed..b9b3fcf4e 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -284,9 +284,7 @@ def on_activity(activity, group) if activity == :login self.last_logged_at ||= Time.now if !self.last_logged_at.today? - self.collection.update({:_id => self._id}, - {:$set => {:last_logged_at => Time.zone.now.utc}}, - {:upsert => true}) + self.set( {:last_logged_at => Time.zone.now.utc} ) end else self.update_reputation(activity, group) if activity != :login @@ -299,14 +297,10 @@ def activity_on(group, date) last_day = config_for(group).last_activity_at if last_day != day - collection.update({:_id => self.id}, - {:$set => {"membership_list.#{group.id}.last_activity_at" => day}}, - {:upsert => true}) + self.set({"membership_list.#{group.id}.last_activity_at" => day}) if last_day if last_day.utc.between?(day.yesterday - 12.hours, day.tomorrow) - collection.update({:_id => self.id}, - {:$inc => {"membership_list.#{group.id}.activity_days" => 1}}, - {:upsert => true}) + self.increment({"membership_list.#{group.id}.activity_days" => 1}) Magent.push("actors.judge", :on_activity, group.id, self.id) elsif !last_day.utc.today? && (last_day.utc != Time.now.utc.yesterday) Rails.logger.info ">> Resetting act days!! last known day: #{last_day}" @@ -317,17 +311,15 @@ def activity_on(group, date) end def reset_activity_days!(group) - self.collection.update({:_id => self._id}, - {:$set => {"membership_list.#{group.id}.activity_days" => 0}}, - :upsert => true) + self.set({"membership_list.#{group.id}.activity_days" => 0}) end def upvote!(group, v = 1.0) - collection.update({:_id => self.id}, {:$inc => {"membership_list.#{group.id}.votes_up" => v.to_f}}, {:upsert => true}) + self.increment({"membership_list.#{group.id}.votes_up" => v.to_f}) end def downvote!(group, v = 1.0) - collection.update({:_id => self.id}, {:$inc => {"membership_list.#{group.id}.votes_down" => v.to_f}}, {:upsert => true}) + self.increment({"membership_list.#{group.id}.votes_down" => v.to_f}) end def update_reputation(key, group) @@ -337,7 +329,7 @@ def update_reputation(key, group) current_reputation = config_for(group).reputation if value - collection.update({:_id => self.id}, {:$inc => {"membership_list.#{group.id}.reputation" => value}}, {:upsert => true}) + self.increment({"membership_list.#{group.id}.reputation" => value}) end stats = self.reputation_stats(group, { :select => [:_id] }) diff --git a/config/environment.rb b/config/environment.rb index 7d3a4e27d..0e5447903 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -35,8 +35,8 @@ config.gem "magent", :version => "0.4" config.gem "differ", :version => "0.1.1" config.gem 'super_exception_notifier', :version => '~> 2.0.0', :lib => 'exception_notifier' - config.gem "warden", :version => "0.10.3" - config.gem "devise", :version => "1.0.7" + config.gem "warden", :version => "0.10.7" + config.gem "dcu-devise", :version => "1.0.7", :lib => "devise" config.gem "twitter-text", :version => "1.1.1" config.gem "oauth2", :version => "0.0.8" config.gem "twitter_oauth", :version => "0.3.6" diff --git a/config/initializers/01_locales.rb b/config/initializers/01_locales.rb index d16af0241..14d2afd1d 100644 --- a/config/initializers/01_locales.rb +++ b/config/initializers/01_locales.rb @@ -2,11 +2,15 @@ I18n.backend.store_translations 'en', {} I18n.backend.store_translations 'fr', {} I18n.backend.store_translations 'pt-PT', {} +I18n.backend.store_translations 'pt-BR', {} I18n.backend.store_translations 'ja', {} I18n.backend.store_translations 'el', {} +I18n.backend.store_translations 'ar', {} I18n.backend.store_translations 'be-TARASK', {} I18n.backend.store_translations 'br', {} +I18n.backend.store_translations 'bs', {} I18n.backend.store_translations 'de', {} +I18n.backend.store_translations 'eo', {} I18n.backend.store_translations 'fi', {} I18n.backend.store_translations 'gl', {} I18n.backend.store_translations 'ia', {} @@ -15,7 +19,9 @@ I18n.backend.store_translations 'mk', {} I18n.backend.store_translations 'nl', {} I18n.backend.store_translations 'nb', {} +I18n.backend.store_translations 'pl', {} I18n.backend.store_translations 'pms', {} +I18n.backend.store_translations 'ps', {} I18n.backend.store_translations 'ru', {} I18n.backend.store_translations 'te', {} I18n.backend.store_translations 'tl', {} @@ -25,11 +31,11 @@ # You need to "force-initialize" loaded locales I18n.backend.send(:init_translations) -AVAILABLE_LOCALES = ["be-TARASK", "br", "de", "el", "en", "es-419", "fi", "fr", "gl", "ia", "ja", "ko", "lb", "mk", "nb", "nl", "pms", "pt-PT", "ru", "te", "tl"] #I18n.backend.available_locales.map { |l| l.to_s } +AVAILABLE_LOCALES = ["ar", "be-TARASK", "br", "bs", "de", "eo", "el", "en", "es-419", "fi", "fr", "gl", "ia", "ja", "ko", "lb", "mk", "nb", "nl", "pms", "ps", "pl", "pt-BR", "pt-PT", "ru", "te", "tl"] #I18n.backend.available_locales.map { |l| l.to_s } AVAILABLE_LANGUAGES = I18n.backend.available_locales.map { |l| l.to_s.split("-").first}.uniq ## this is only for the user settings, not related to translatewiki -DEFAULT_USER_LANGUAGES = ['en', 'es-419', 'fr', 'pt-PT', 'ja', 'el', 'de', 'ko', 'nl', 'ru', 'tl', 'it'] +DEFAULT_USER_LANGUAGES = ['en', 'es-419', 'fr', 'pl', 'pt-BR', 'pt-PT', 'ja', 'el', 'de', 'ko', 'nl', 'ru', 'tl', 'it'] RAILS_DEFAULT_LOGGER.debug "* Loaded locales: #{AVAILABLE_LOCALES.inspect}" diff --git a/config/locales/ads/ar.yml b/config/locales/ads/ar.yml new file mode 100644 index 000000000..ceff4776f --- /dev/null +++ b/config/locales/ads/ar.yml @@ -0,0 +1,15 @@ +# Messages for Arabic (العربية) +# Exported from translatewiki.net +# Export driver: syck +# Author: عمرو +ar: + ads: + ad_links: أضف إعلان {{type}} جديد + create: + success: تم إنشاء الإعلان بنجاح + index: + add_adsense: أضف إعلان Google جديد + title: إعلانات + name: "الاسم:" + position: "الموضع:" + title: أضف إعلان {{type}} جديد diff --git a/config/locales/ads/pl.yml b/config/locales/ads/pl.yml new file mode 100644 index 000000000..0cfa2a203 --- /dev/null +++ b/config/locales/ads/pl.yml @@ -0,0 +1,16 @@ +# Messages for Polish (Polski) +# Exported from translatewiki.net +# Export driver: syck +# Author: Sp5uhe +pl: + ads: + ad_links: Dodaj nową {{type}} reklamę + create: + success: Reklama została utworzona. + index: + add_adbard: Dodaj nowy billboard reklamowy + add_adsense: Dodaj nową reklamę kontekstową google + title: Reklamy + name: Nazwa + position: Pozycja + title: Dodaj nową {{type}} reklamę diff --git a/config/locales/ads/pt-PT.yml b/config/locales/ads/pt-PT.yml index d3ed4ea49..65a9dee16 100644 --- a/config/locales/ads/pt-PT.yml +++ b/config/locales/ads/pt-PT.yml @@ -6,13 +6,13 @@ # Author: McDutchie pt-PT: ads: - ad_links: Adicionar um novo anúncio {{type}} + ad_links: Adicionar um anúncio {{type}} novo create: - success: O anúncio foi criado com êxito. + success: O anúncio foi criado. index: add_adbard: Adicionar um anúncio Ad Bard novo - add_adsense: Adicionar um novo anúncio do Google AdSense + add_adsense: Adicionar um anúncio do Google AdSense novo title: Anúncios name: "Nome:" position: "Posição:" - title: Adicionar um novo anúncio {{type}} + title: Adicionar um anúncio {{type}} novo diff --git a/config/locales/announcements/ar.yml b/config/locales/announcements/ar.yml new file mode 100644 index 000000000..e3a9d414c --- /dev/null +++ b/config/locales/announcements/ar.yml @@ -0,0 +1,20 @@ +# Messages for Arabic (العربية) +# Exported from translatewiki.net +# Export driver: syck +# Author: عمرو +ar: + activerecord: + attributes: + announcement: + ends_at: تنتهي في + message: رسالة + only_anonymous: فقط للمستخدمين المجهولين + starts_at: تبدأ في + announcements: + actions: + delete: إزالة + title: الإجراءات + create: + success: تم إنشاء البلاغ بنجاح + index: + title: البلاغات diff --git a/config/locales/announcements/nl.yml b/config/locales/announcements/nl.yml index 78f940199..a492cef6d 100644 --- a/config/locales/announcements/nl.yml +++ b/config/locales/announcements/nl.yml @@ -15,6 +15,6 @@ nl: delete: verwijderen title: Handelingen create: - success: de aankondiging is aangemaakt. + success: De aankondiging is aangemaakt. index: - title: aankondigingen + title: Aankondigingen diff --git a/config/locales/announcements/pl.yml b/config/locales/announcements/pl.yml new file mode 100644 index 000000000..4cc911d8a --- /dev/null +++ b/config/locales/announcements/pl.yml @@ -0,0 +1,20 @@ +# Messages for Polish (Polski) +# Exported from translatewiki.net +# Export driver: syck +# Author: Sp5uhe +pl: + activerecord: + attributes: + announcement: + ends_at: Zakończ + message: Komunikat + only_anonymous: Tylko dla anonimowych użytkowników + starts_at: Rozpocznij + announcements: + actions: + delete: Usuń + title: Działania + create: + success: Ogłoszenie zostało utworzone. + index: + title: Ogłoszenia diff --git a/config/locales/announcements/pt-PT.yml b/config/locales/announcements/pt-PT.yml index ab50e81a7..8bbe73f95 100644 --- a/config/locales/announcements/pt-PT.yml +++ b/config/locales/announcements/pt-PT.yml @@ -1,19 +1,20 @@ # Messages for Portuguese (Português) # Exported from translatewiki.net # Export driver: syck +# Author: Hamilton Abreu pt-PT: activerecord: attributes: announcement: ends_at: ends at - message: message - only_anonymous: only for anonymous users + message: Mensagem + only_anonymous: Só para utilizadores anónimos starts_at: starts at announcements: actions: - delete: remove - title: actions + delete: Remover + title: Acções create: - success: announcement was successfully created. + success: A notificação do site foi criada. index: - title: announcements + title: Notificações do site diff --git a/config/locales/answers/ar.yml b/config/locales/answers/ar.yml new file mode 100644 index 000000000..9227eeeee --- /dev/null +++ b/config/locales/answers/ar.yml @@ -0,0 +1,25 @@ +# Messages for Arabic (العربية) +# Exported from translatewiki.net +# Export driver: syck +# Author: عمرو +ar: + activerecord: + attributes: + answer: + body: نص الرسالة + created_at: مجاب + link: الرابط + models: + answer: إجابة + answers: إجابات + answers: + create: + flash_error: "حدث شيئا ما أثناء إضافة جوابك.\nتذكر أن:\n- الأجوبة الفارغة والمكررة غير مسموحة\n- يجب عليك الانتظار 20 ثانية قبل إضافة إجابة أخرى.\n- لا يمكنك إضافة أكثر من إجابة واحدة لنفس السؤال." + flash_notice: شكرا لك! + form: + answer_label: أجب على السؤال + comment_label: عّلق على هذه الإجابة + comment_submit: عّلق + submit: إجابة + revert: + title: أعد الجواب diff --git a/config/locales/answers/de.yml b/config/locales/answers/de.yml index d934e0a10..6601a5fe2 100644 --- a/config/locales/answers/de.yml +++ b/config/locales/answers/de.yml @@ -22,7 +22,7 @@ de: form: answer_label: Frage beantworten comment_label: Antwort kommentieren - comment_submit: Kommentar + comment_submit: Kommentieren submit: Antwort revert: title: Antwort entfernen diff --git a/config/locales/answers/en.yml b/config/locales/answers/en.yml index 6eb07a691..956a16608 100644 --- a/config/locales/answers/en.yml +++ b/config/locales/answers/en.yml @@ -12,8 +12,8 @@ en: flash_error: "Something went wrong adding your answer. \n Remember that: \n - Empty and repeated answers are not allowed - \n - You need to wait 20 senconds before posting another answer. - \n - You can only post one answer by question." + \n - You need to wait 20 seconds before posting another answer. + \n - You can only post one answer per question." update: flash_notice: "Answer was successfully updated." revert: diff --git a/config/locales/answers/eo.yml b/config/locales/answers/eo.yml new file mode 100644 index 000000000..1e493534d --- /dev/null +++ b/config/locales/answers/eo.yml @@ -0,0 +1,25 @@ +# Messages for Esperanto (Esperanto) +# Exported from translatewiki.net +# Export driver: syck +# Author: ArnoLagrange +eo: + activerecord: + attributes: + answer: + created_at: Respondita + link: Ligilo + answers: + create: + flash_error: "Io malĝuste funkciis dum aldono de via respondo. \n Memoru tion: \n - Malplenaj kaj ripetitaj respondoj ne estas permesitaj \n - Vi devas atendi 20 sekundojn antaŭ ol sendi alian respondon. \n - Vi povas sendi po nur unu respondon por ĉiu demando." + flash_notice: Dankon! + edit: + title: Redakti respondon + form: + answer_label: Respondi la demandon + comment_label: Rimarko pri ĉi tiu respondo + comment_submit: Komento + submit: Respondo + revert: + title: Malfari respondon + update: + flash_notice: Respondo estis sukcese ĝisdatigita. diff --git a/config/locales/answers/nb.yml b/config/locales/answers/nb.yml index 7a0f51b54..00f2f38c7 100644 --- a/config/locales/answers/nb.yml +++ b/config/locales/answers/nb.yml @@ -2,7 +2,7 @@ # Exported from translatewiki.net # Export driver: syck # Author: Nghtwlkr -"no": +nb: activerecord: models: answer: Svar diff --git a/config/locales/answers/pl.yml b/config/locales/answers/pl.yml new file mode 100644 index 000000000..d22f45a5b --- /dev/null +++ b/config/locales/answers/pl.yml @@ -0,0 +1,29 @@ +# Messages for Polish (Polski) +# Exported from translatewiki.net +# Export driver: syck +# Author: Sp5uhe +pl: + activerecord: + attributes: + answer: + body: Treść + created_at: Z odpowiedziami + link: Link + models: + answer: Odpowiedź + answers: Odpowiedzi + answers: + create: + flash_error: "Coś poszło nie tak z dodaniem odpowiedzi. \nPamiętaj, że: \n– puste i powtarzające się odpowiedzi nie są akceptowane\n– trzeba odczekać 20 sekund przed opublikowaniem kolejnej odpowiedzi\n– można tylko raz odpowiedzieć na pytanie" + flash_notice: Dziękujemy! + edit: + title: Redagowanie odpowiedzi + form: + answer_label: Odpowiedź na pytanie + comment_label: Skomentuj tę odpowiedź + comment_submit: Komentarz + submit: Odpowiedź + revert: + title: Przywróć odpowiedź + update: + flash_notice: Odpowiedź została zaktualizowana. diff --git a/config/locales/answers/ps.yml b/config/locales/answers/ps.yml new file mode 100644 index 000000000..442a5bb6e --- /dev/null +++ b/config/locales/answers/ps.yml @@ -0,0 +1,19 @@ +# Messages for Pashto (پښتو) +# Exported from translatewiki.net +# Export driver: syck +# Author: Ahmed-Najib-Biabani-Ibrahimkhel +ps: + activerecord: + attributes: + answer: + created_at: ځوب شوي + link: تړنه + models: + answer: ځواب + answers: ځوابونه + answers: + create: + flash_notice: مننه! + form: + comment_submit: تبصره + submit: ځواب diff --git a/config/locales/answers/pt-PT.yml b/config/locales/answers/pt-PT.yml index 410acb0de..47617273c 100644 --- a/config/locales/answers/pt-PT.yml +++ b/config/locales/answers/pt-PT.yml @@ -1,28 +1,29 @@ # Messages for Portuguese (Português) # Exported from translatewiki.net # Export driver: syck +# Author: Hamilton Abreu pt-PT: activerecord: attributes: answer: - body: conteúdo - created_at: answered - link: ligação + body: Conteúdo + created_at: Respondida + link: Link models: - answer: resposta - answers: respostas + answer: Resposta + answers: Respostas answers: create: - flash_error: "algo correu mal ao adicionar a sua resposta. \n lembre-se que: \n - respostas vazias e repetidas não são permitidas \n - tem que esperar 20 segundos para colocar uma nova resposta. \n - só pode colocar uma resposta por pergunta." - flash_notice: obrigado! + flash_error: "Algo correu mal ao adicionar a sua resposta.\n Lembre-se que:\n - Respostas vazias e repetidas não são permitidas.\n - Tem que esperar 20 segundos para colocar outra resposta.\n - Só pode colocar uma resposta por pergunta." + flash_notice: Obrigado! edit: - title: editar resposta + title: A editar a resposta form: - answer_label: responde à pergunta - comment_label: comenta sobre esta resposta - comment_submit: comentar - submit: submeter + answer_label: Responder à pergunta + comment_label: Comentar esta resposta + comment_submit: Comentar + submit: Responder revert: - title: revert answer + title: Reverter a resposta update: - flash_notice: resposta foi actualizada com sucesso. + flash_notice: A resposta foi actualizada. diff --git a/config/locales/answers/te.yml b/config/locales/answers/te.yml index 7e03d6b72..3c90becd2 100644 --- a/config/locales/answers/te.yml +++ b/config/locales/answers/te.yml @@ -1,12 +1,14 @@ # Messages for Telugu (తెలుగు) # Exported from translatewiki.net # Export driver: syck +# Author: Ravichandra # Author: Veeven te: activerecord: attributes: answer: body: వివరణ + created_at: పరిష్కరించబడినది link: లంకె models: answer: జవాబు @@ -14,6 +16,12 @@ te: answers: create: flash_notice: ధన్యవాదాలు! + edit: + title: జవాబును సరిచేస్తున్నారు form: + answer_label: ప్రశ్నకు జవాబివ్వండి comment_label: ఈ జవాబుపై వ్యాఖ్యానించండి comment_submit: వ్యాఖ్యానించండి + submit: జవాబు + update: + flash_notice: జవాబు విజయవంతంగా సమర్పించబడింది. diff --git a/config/locales/badges/en.yml b/config/locales/badges/en.yml index a8fb41cfc..4f50956cd 100644 --- a/config/locales/badges/en.yml +++ b/config/locales/badges/en.yml @@ -2,10 +2,10 @@ en: badges: index: title: badges - description: "All badges that you can earn. share your knowledge earn badges." + description: "All badges that you can earn. Share your knowledge earn badges." show: title: Badge %{type} - description: "Users who earned this badge. recently awarded to:" + description: "Users who earned this badge. Recently awarded to:" for_tag_bronze: 200 votes in tag %{tag} for_tag_silver: 400 votes in tag %{tag} for_tag_gold: 1000 votes in tag %{tag} @@ -28,7 +28,7 @@ en: popular_person: description: Your profile is visited 10000 times guru: - description: Gave a solution to a question with an average of more than 40 votes + description: Gave a solution to a question with an average of more than 40 votes favorite_question: description: Question favorited by 25 users tutor: @@ -40,7 +40,7 @@ en: good_answer: description: Having an answer that reaches an average of more than 25 votes pioneer: - description: Be one of the first user to register + description: Be one of the first users to register supporter: description: Voted positively for the first time critic: @@ -121,7 +121,6 @@ en: organizer: name: Organizer description: First retag - activerecord: models: badge: Badge diff --git a/config/locales/badges/pt-PT.yml b/config/locales/badges/pt-PT.yml index d25434618..532987754 100644 --- a/config/locales/badges/pt-PT.yml +++ b/config/locales/badges/pt-PT.yml @@ -5,125 +5,125 @@ pt-PT: activerecord: models: - badge: distintivo - badges: distintivos + badge: Distintivo + badges: Distintivos badges: index: - description: todos os distintivos que conseguir ganhar; partilhe o seu conhecimento e ganhe distintivos. + description: Todos os distintivos que conseguir ganhar. Partilhe o seu conhecimento e ganhe distintivos. title: distintivos shared: addict: - description: visitou o site em 20 dias consecutivos + description: Visitou o site em 20 dias consecutivos autobiographer: - description: preencheu todos os campos do perfil de utilizador - name: autobiógrafo + description: Preencheu todos os campos do perfil de utilizador + name: Autobiógrafo celebrity: - description: obter mais de 100 seguidores - name: celebridade + description: Obter mais de 100 seguidores + name: Celebridade citizen_patrol: - description: primeira publicação reportada - name: patrulha do cidadão + description: Primeira publicação reportada + name: Patrulha do cidadão civic_duty: - description: votou 300 vezes - name: dever cívico + description: Votou 300 vezes + name: Dever cívico cleanup: - description: primeira reversão - name: limpeza + description: Primeira reversão + name: Limpeza commentator: - description: deixou 10 comentários + description: Fez 10 comentários critic: - description: votar negativamente pela primeira vez + description: Votou negativamente pela primeira vez disciplined: - description: eliminou publicação própria com pontuação de 3 ou superior - name: disciplinado + description: Eliminou publicação própria com pontuação de 3 ou superior + name: Disciplinado editor: - description: primeira publicação editada + description: Primeira publicação editada effort_medal: - description: obter 100 votos positivos + description: Obteve 100 votos positivos enlightened: - description: primeira resposta foi aceite com pelo menos 10 votos positivos - name: esclarecido + description: Primeira resposta foi aceite com pelo menos 10 votos positivos + name: Esclarecido famous_question: - description: fez uma pergunta com 10 000 visitas + description: Fez uma pergunta com 10 000 visitas fanatic: - description: visitou o site em 100 dias consecutivos + description: Visitou o site em 100 dias consecutivos favorite_question: - description: pergunta adicionada aos favoritos por 25 utilizadores + description: Pergunta adicionada aos favoritos por 25 utilizadores friendly: - description: seguir alguém pela primeira vez - name: amistoso + description: Seguir alguém pela primeira vez + name: Amistoso good_answer: - description: ter dado uma resposta que atinge uma média de mais de 25 votos + description: Ter dado uma resposta que atinge uma média de mais de 25 votos good_question: - description: ter feito uma pergunta que atinge uma média de mais de 25 votos + description: Ter feito uma pergunta que atinge uma média de mais de 25 votos great_answer: - description: resposta com 100 votos positivos - name: óptima resposta + description: Resposta com 100 votos positivos + name: Óptima resposta great_question: - description: pergunta com 100 votos positivos - name: óptima pergunta + description: Pergunta com 100 votos positivos + name: Óptima pergunta guru: - description: dar uma solução a uma pergunta com uma média de mais de 40 votos + description: Deu uma solução a uma pergunta com uma média de mais de 40 votos inquirer: - description: perguntar pela primeira vez + description: Fez a sua primeira pergunta interesting_person: - description: obter mais de 10 seguidores - name: pessoa interessante + description: Obter mais de 10 seguidores + name: Pessoa interessante merit_medal: - description: obter 200 votos positivos + description: Obter 200 votos positivos necromancer: - description: respondeu a uma pergunta mais de 60 dias depois, com pelo menos 5 votos - name: necromante + description: Respondeu a uma pergunta mais de 60 dias depois, com pelo menos 5 votos + name: Necromante nice_answer: - description: resposta com 10 votos positivos - name: boa resposta + description: Resposta com 10 votos positivos + name: Boa resposta nice_question: - description: pergunta votada positivamente 10 vezes - name: boa pergunta + description: Pergunta votada positivamente 10 vezes + name: Boa pergunta notable_question: - description: fez uma pergunta com 2 500 visitas + description: Fez uma pergunta com 2500 visitas organizer: - description: primeira recategorização - name: organizador + description: Primeira recategorização + name: Organizador peer_pressure: - description: eliminou publicação própria com pontuação de -3 ou inferior - name: pressão dos pares + description: Eliminou publicação própria com pontuação de -3 ou inferior + name: Pressão dos pares pioneer: - description: ser um dos primeiros utilizadores a registar-se + description: Ser um dos primeiros utilizadores a registar-se popstar: description: 500 votos positivos, máximo de 10 votos negativos popular_person: - description: tem mais de 50 seguidores - name: pessoa popular + description: Tem mais de 50 seguidores + name: Pessoa popular popular_question: - description: fez uma pergunta com 1000 visitas + description: Fez uma pergunta com 1000 visitas rockstar: description: 1000 votos positivos, máximo de 10 votos negativos scholar: - description: primeira resposta aceite, numa pergunta do próprio - name: académico + description: Primeira resposta aceite, numa pergunta do próprio + name: Académico self-learner: - description: respondeu à sua própria pergunta, com pelo menos 3 votos positivos - name: autodidata + description: Respondeu à sua própria pergunta, com pelo menos 3 votos positivos + name: Autodidata service_medal: description: 300 votos positivos shapado: - description: visitou o site em 8 dias consecutivos + description: Visitou o site em 8 dias consecutivos stellar_question: - description: pergunta adicionada aos favoritos por 100 utilizadores - name: pergunta extraordinária + description: Pergunta adicionada aos favoritos por 100 utilizadores + name: Pergunta extraordinária student: - description: fez a primeira pergunta com pelo menos um voto positivo + description: Fez a primeira pergunta com pelo menos um voto positivo supporter: - description: votar positivamente pela primeira vez + description: Votou positivamente pela primeira vez troubleshooter: - description: responder pela primeira vez + description: Deu a sua primeira resposta tutor: - description: dar uma solução a uma pergunta com uma média de mais de 2 votos + description: Deu uma solução a uma pergunta com uma média de mais de 2 votos show: - description: "utilizadores que ganharam este distintivo; recentemente atribuído a:" + description: "Utilizadores que receberam este distintivo. Recentemente atribuído a:" earned: recebeu for_tag_bronze: 200 votos na categoria %{tag} - for_tag_gold: 1000 votos na categoria %{tag} - for_tag_silver: 400 votos na categoria %{tag} - title: distintivo %{type} + for_tag_gold: 1000 votos na categoria {{tag}} + for_tag_silver: 400 votos na categoria {{tag}} + title: Distintivo {{type}} diff --git a/config/locales/close_requests/pt-PT.yml b/config/locales/close_requests/pt-PT.yml index 9bd03b816..8c7d6c6eb 100644 --- a/config/locales/close_requests/pt-PT.yml +++ b/config/locales/close_requests/pt-PT.yml @@ -5,27 +5,27 @@ pt-PT: close_requests: create: - flash_notice: pedido de fecho criado com sucesso + flash_notice: Pedido de fecho foi criado destroy: - flash_notice: pedido de fecho foi eliminado + flash_notice: O pedido de fecho foi eliminado form: - close_with_reason: fechar esta pergunta usando este motivo - dupe: duplicada - no_question: não é uma pergunta - not_relevant: não é relevante - ot: está fora do tema - request_closing_details: pedir para fechar esta pergunta + close_with_reason: Fechar esta pergunta usando este motivo + dupe: Duplicada + no_question: Não é uma pergunta + not_relevant: Não é relevante + ot: Está fora do tema + request_closing_details: Pedir para fechar esta pergunta spam: spam index: - title: lista de pedidos de fecho + title: Lista de pedidos de fecho model: attributes: - comment: comentário + comment: Comentário reason: motivo - user: utilizador + user: Utilizador messages: - already_requested: já pediu para fechar esta pergunta - name: pedido de fecho - prural_name: pedidos de fecho + already_requested: Já pediu para fechar esta pergunta + name: Pedido de fecho + prural_name: Pedidos de fecho update: - flash_notice: pedido de fecho foi actualizado + flash_notice: O pedido de fecho foi actualizado diff --git a/config/locales/comments/br.yml b/config/locales/comments/br.yml new file mode 100644 index 000000000..4672fcd2d --- /dev/null +++ b/config/locales/comments/br.yml @@ -0,0 +1,20 @@ +# Messages for Breton (Brezhoneg) +# Exported from translatewiki.net +# Export driver: syck +# Author: Y-M D +br: + comments: + create: + flash_notice: Trugarez evit ho evezhiadenn + edit: + title: Kemmañ an evezhiadenn + shared: + add_comment: Ouzhpennañ un evezhiadenn... + comment_submit: Postañ un evezhiadenn + reply: Respont + said: en deus lavaret + update: + flash_notice: Hizivaet-mat eo bet an evezhiadenn + models: + comment: Evezhiadenn + comments: Evezhiadennoù diff --git a/config/locales/comments/ps.yml b/config/locales/comments/ps.yml new file mode 100644 index 000000000..3e931ecde --- /dev/null +++ b/config/locales/comments/ps.yml @@ -0,0 +1,17 @@ +# Messages for Pashto (پښتو) +# Exported from translatewiki.net +# Export driver: syck +# Author: Ahmed-Najib-Biabani-Ibrahimkhel +ps: + comments: + create: + flash_notice: ستاسې له تبصرې نه مننه + edit: + title: تبصره سمول + shared: + add_comment: تبصره ورګډول... + comment_submit: تبصره + reply: ځوابول + models: + comment: تبصره + comments: تبصرې diff --git a/config/locales/comments/pt-PT.yml b/config/locales/comments/pt-PT.yml index 1a41b6fef..9d8f6cddb 100644 --- a/config/locales/comments/pt-PT.yml +++ b/config/locales/comments/pt-PT.yml @@ -5,16 +5,16 @@ pt-PT: comments: create: - flash_notice: thanks for your comment + flash_notice: Obrigado pelo seu comentário edit: - title: Edit comment + title: Editar comentário shared: - add_comment: add comment... + add_comment: Adicionar comentário... comment_submit: Comentar - reply: reply - said: said + reply: Resposta + said: disse update: - flash_notice: comment was successfully updated. + flash_notice: O comentário foi actualizado. models: - comment: comment - comments: comments + comment: Comentário + comments: Comentários diff --git a/config/locales/doc/es-419.yml b/config/locales/doc/es-419.yml index 57b1a9dbe..867bc39d5 100644 --- a/config/locales/doc/es-419.yml +++ b/config/locales/doc/es-419.yml @@ -2,6 +2,7 @@ # Exported from translatewiki.net # Export driver: syck # Author: McDutchie +# Author: Patcito es-419: doc: chat: @@ -24,7 +25,7 @@ es-419: getting_popular: sitios populares huge_sites: sitios enormes month: mes - page_views: paginas vistas/mes + page_views: Para sitios privados/pequeños plans: planes private_site: Activar acceso privado/publico small_private: sitios chicos/privados diff --git a/config/locales/doc/pt-PT.yml b/config/locales/doc/pt-PT.yml index d956ccee1..10ae8e432 100644 --- a/config/locales/doc/pt-PT.yml +++ b/config/locales/doc/pt-PT.yml @@ -2,36 +2,38 @@ # Exported from translatewiki.net # Export driver: syck # Author: Giro720 +# Author: Hamilton Abreu +# Author: Luckas Blade pt-PT: doc: chat: - title: Chat Support + title: Supporte por Conversação plans: - 15millions: 15 millions page views/month - 1million: 1 million page views/month - 247_all_support: web based, email, chat and phone 24/7 support - 5millions: 5 millions page views/month - all_support: web based, email, chat and phone support - basic_restrictions: no custom ads and no fully customizable UI - beta_info: For now all sites are free and all sites benefit from the same options as the Optimum plan, except for the support which is only web based, email and chat. - big_sites: big traffic sites - custom_ads: Use your own ads - custom_analytics: Traffic stats - custom_domain: Custom domain - custom_themes: make use of our pre-made custom themes - custom_ui: Fully customizable UI - free_plan: free plan - getting_popular: getting popular - huge_sites: huge traffic sites - month: month + 15millions: 15 milhões de visitas/mês + 1million: 1 milhão de visitas/mês + 247_all_support: Suporte baseado na internet, correio electrónico, canais de conversação e telefone de disponibilidade permanentemente + 5millions: 5 milhões de visitas/mês + all_support: Suporte baseado na internet, correio electrónico, canais de conversação e telefone + basic_restrictions: Sem anúncios personalizados e sem interface totalmente personalizável + beta_info: Por enquanto todos os sites são gratuitos e disfrutam das opções do plano Óptimo, excepto no que concerne os serviços de suporte, que são baseados na internet, no correio electrónico e em canais de conversação. + big_sites: Sites de Alto Tráfego + custom_ads: Usar anúncios próprios + custom_analytics: Estatísticas de tráfego + custom_domain: Domínio próprio + custom_themes: Use os nossos temas personalizados predefinidos + custom_ui: Interface totalmente personalizável + free_plan: Plano Grátis + getting_popular: A Tornar-se Popular + huge_sites: Sites de Tráfego Enorme + month: mês page_views: Para Sites Pequenos/Particulares - plans: plans - private_site: Private site - small_private: Enable private/public access - start_monetizing: start monetizing - support: Support - title: Plans and pricing - unlimited: Unlimited traffic each month - we_offer: we also offer a - web_support: web based support - with_unlimited: with unlimited traffic with no custom ads and no custom domain. + plans: Planos + private_site: Permitir acesso público/privado + small_private: Sites Pequenos/Particulares + start_monetizing: começe a ganhar dinheiro + support: Suporte + title: Planos e preços + unlimited: Tráfego ilimitado a cada mês + we_offer: Também oferecemos + web_support: Suporte baseado na internet + with_unlimited: com tráfego ilimitado, sem anúncios personalizados e sem domínio próprio. diff --git a/config/locales/errors/pt-PT.yml b/config/locales/errors/pt-PT.yml index ebe0df847..27800cd36 100644 --- a/config/locales/errors/pt-PT.yml +++ b/config/locales/errors/pt-PT.yml @@ -5,18 +5,18 @@ pt-PT: errors: forbidden: - explanation: não tem as permissões necessárias para aceder a esta página. - title: acesso negado - go_to: ir para a página %{link} - help_us_answer: ajude-nos a responder a %{link} + explanation: Não tem as permissões necessárias para aceder a esta página. + title: Acesso negado + go_to: Ir para a página %{link} + help_us_answer: Ajude-nos a responder a %{link} internal_error: - explanation: fomos notificados sobre este problema e vamos averiguá-lo em breve. - title: pedimos desculpa, mas ocorreu um erro. + explanation: Fomos notificados sobre este problema e vamos averiguá-lo em breve. + title: Pedimos desculpa, mas ocorreu um erro. not_found: - explanation: pode ter escrito mal o endereço ou a página pode ter sido movida. - title: página não encontrada. - options_label: "outras coisas que pode tentar:" - search: pesquisar + explanation: Pode ter escrito mal o endereço ou a página pode ter sido movida. + title: A página não foi encontrada. + options_label: "Outras coisas que pode tentar:" + search: Pesquisar unprocessable_entity: - explanation: se calhar tentou modificar algo para o qual não tinha permissões. - title: a alteração que pretendia foi rejeitada. + explanation: Talvez tenha tentado modificar algo a que não tinha acesso. + title: A alteração que pretendia foi rejeitada. diff --git a/config/locales/favorites/nb.yml b/config/locales/favorites/nb.yml index 76bd14896..844f05895 100644 --- a/config/locales/favorites/nb.yml +++ b/config/locales/favorites/nb.yml @@ -2,7 +2,7 @@ # Exported from translatewiki.net # Export driver: syck # Author: Nghtwlkr -"no": +nb: activerecord: models: favorite: Favoritt diff --git a/config/locales/favorites/pt-PT.yml b/config/locales/favorites/pt-PT.yml index 85a61eb3f..51181da08 100644 --- a/config/locales/favorites/pt-PT.yml +++ b/config/locales/favorites/pt-PT.yml @@ -1,12 +1,13 @@ # Messages for Portuguese (Português) # Exported from translatewiki.net # Export driver: syck +# Author: Hamilton Abreu pt-PT: activerecord: models: - favorite: favorite - favorites: favorites + favorite: Favorita + favorites: Favoritas favorites: create: - success: the question has been added to your favorities - unauthenticated: you need an account to add favorites + success: A pergunta foi adicionada às suas favoritas + unauthenticated: Precisa de ter uma conta para adicionar favoritas diff --git a/config/locales/flags/pt-PT.yml b/config/locales/flags/pt-PT.yml index 992bcb6f7..02d2f06a4 100644 --- a/config/locales/flags/pt-PT.yml +++ b/config/locales/flags/pt-PT.yml @@ -1,20 +1,21 @@ # Messages for Portuguese (Português) # Exported from translatewiki.net # Export driver: syck +# Author: Hamilton Abreu pt-PT: activerecord: attributes: flag: - type: motivo + type: Motivo models: - flag: reporte - flags: reportes + flag: Reportada + flags: Reportadas flags: create: - flash_error: não pode reportar isto - flash_notice: obrigado por ter reportado + flash_error: Não pode reportar isto + flash_notice: Obrigado por ter reportado form: - attention: requer atenção do moderador - label: por favor reporte com cuidado - offensive: ofensivo, abusivo ou insultuoso - spam: spam + attention: Requer a atenção do moderador + label: Reporte com cuidado, por favor + offensive: Conteúdo ofensivo, abusivo ou insultuoso + spam: Spam diff --git a/config/locales/global/br.yml b/config/locales/global/br.yml index 2cdfb54c2..8431f5635 100644 --- a/config/locales/global/br.yml +++ b/config/locales/global/br.yml @@ -8,6 +8,9 @@ br: created: krouet deleted: diverket updated: hizivaet + feeds: + share_on_twitter: twitter, facebook ha muioc'h... + user: En em enskrivit da goulennoù an implijer global: by: gant current: Red @@ -41,6 +44,7 @@ br: save: Enrollañ send: Kas show: Diskouez + sure: Ha sur oc'h hoc'h eus c'hoant da zilemel ar %{model}-mañ ? update: Hizivaat time: ago: "%{time} zo" diff --git a/config/locales/global/de.yml b/config/locales/global/de.yml new file mode 100644 index 000000000..a996092d1 --- /dev/null +++ b/config/locales/global/de.yml @@ -0,0 +1,60 @@ +# Messages for German (Deutsch) +# Exported from translatewiki.net +# Export driver: syck +# Author: Kghbln +de: + actions: + closed: beendet + created: erstellt + deleted: gelöscht + updated: aktualisiert + feeds: + feed: Feed + post_new_questions: Erstelle neue Fragen zu + question: Abonniere diese Frage + questions: Abonniere alle Fragen + share_on_twitter: Twitter, Facebook und mehr … + tag: Abonniere das Stichwort + user: Abonniere die Fragen des Nutzers + global: + by: von + current: Aktuell + from: von {{site}} + group_not_found: Die Seite {{url}} existiert nicht + or: oder + permission_denied: Zugriff verweigert + please_login: Bitte melde Dich an + preview: Vorschau betrachten + previous: Vorherige + share: freigeben + languages: + any: Alle + user: Meine bevorzugten Sprachen + messages: + success: "{{model}} wurde erfolgreich {{action}}." + models: + question: Die Frage + number: + x_time: + one: "{{count}}-mal" + other: "{{count}}-mal" + zero: Nie + scaffold: + add: Hinzufügen + back: Zurück + cancel: Abbrechen + close: Schließen + create: Erstellen + destroy: Löschen + details: Einzelheiten + edit: Bearbeiten + more: Mehr … + new: Neue {{model}} hinzufügen + save: Speichern + send: Senden + show: Zeigen + sure: Bist Du sicher, dass Du diese {{model}} löschen möchtest? + update: Aktualisieren + time: + ago: vor {{time}} + today: heute diff --git a/config/locales/global/ps.yml b/config/locales/global/ps.yml new file mode 100644 index 000000000..77c84c516 --- /dev/null +++ b/config/locales/global/ps.yml @@ -0,0 +1,35 @@ +# Messages for Pashto (پښتو) +# Exported from translatewiki.net +# Export driver: syck +# Author: Ahmed-Najib-Biabani-Ibrahimkhel +ps: + actions: + closed: تړل شوی + created: جوړ شو + deleted: ړنګ شو + updated: اوسمهاله شو + global: + current: تازه + or: يا + previous: پخوانی + share: شريکول + languages: + any: هر يو + user: زما د خوښې ژبې + number: + x_time: + zero: هېڅکله + scaffold: + add: ورګډول + cancel: ناګارل + close: تړل + create: جوړول + destroy: ړنګول + edit: سمول + more: نور ... + save: خوندي کول + send: لېږل + show: ښکاره کول + update: اوسمهالول + time: + today: نن diff --git a/config/locales/global/pt-PT.yml b/config/locales/global/pt-PT.yml index b2d32c22e..c25a027a2 100644 --- a/config/locales/global/pt-PT.yml +++ b/config/locales/global/pt-PT.yml @@ -4,57 +4,57 @@ # Author: Hamilton Abreu pt-PT: actions: - closed: fechado - created: criado - deleted: apagado - updated: actualizado + closed: fechada + created: criada + deleted: apagada + updated: actualizada feeds: feed: Feed - post_new_questions: publicar perguntas novas - question: subscrever esta pergunta - questions: subscrever todas as perguntas + post_new_questions: Publicar perguntas novas + question: Subscrever esta pergunta + questions: Subscrever todas as perguntas share_on_twitter: no twitter, facebook e outros... - tag: subscrever a categoria - user: subscrever as perguntas do utilizador + tag: Subscrever a categoria + user: Subscrever as perguntas do utilizador global: by: por - current: actual + current: Actual from: de %{site} - group_not_found: a página %{url} não existe + group_not_found: A página %{url} não existe or: ou - permission_denied: permissão negada - please_login: por favor inicie sessão - preview: antevisão - previous: anterior - share: partilhar + permission_denied: Permissão negada + please_login: Inicie uma sessão, por favor + preview: Antevisão + previous: Anterior + share: Partilhar languages: - any: qualquer - user: as minhas línguas preferidas + any: Qualquer + user: As Minhas Línguas Preferidas messages: - success: "%{model} foi %{action} com sucesso." + success: "%{model} foi %{action}." models: - question: a pergunta + question: A pergunta number: x_time: one: "%{count} vez" other: "%{count} vezes" - zero: nunca + zero: Nunca scaffold: - add: adicionar - back: voltar - cancel: cancelar - close: fechar - create: criar - destroy: eliminar - details: detalhes - edit: editar - more: mais ... - new: adicionar %{model} novo - save: gravar - send: enviar - show: mostrar - sure: tem a certeza que pretende apagar este %{model} ? - update: actualizar + add: Adicionar + back: Voltar + cancel: Cancelar + close: Fechar + create: Criar + destroy: Eliminar + details: Detalhes + edit: Editar + more: Mais ... + new: Adicionar %{model} novo + save: Gravar + send: Enviar + show: Mostrar + sure: Tem a certeza de que pretende apagar este %{model}? + update: Actualizar time: ago: "%{time} atrás" today: hoje diff --git a/config/locales/global/te.yml b/config/locales/global/te.yml new file mode 100644 index 000000000..66e394e23 --- /dev/null +++ b/config/locales/global/te.yml @@ -0,0 +1,43 @@ +# Messages for Telugu (తెలుగు) +# Exported from translatewiki.net +# Export driver: syck +# Author: Ravichandra +# Author: Veeven +te: + actions: + closed: మూసివేయబడింది + created: సృష్టించబడినది + deleted: తొలిగించబడినది + updated: తాజాకరించబడినది + global: + by: చే + current: ప్రస్తుత + from: "{{site}} నుంచి" + or: లేదా + please_login: దయచేసి ప్రవేశించండి + preview: మునుజూపు + previous: మునుపటి + share: పంచుకో + languages: + any: ఏదయినా + user: నా ప్రాధాన్యతా భాషలు + models: + question: ప్రశ్న + number: + x_time: + zero: ఎప్పటికీ వద్దు + scaffold: + add: చేర్చు + back: వెనక్కి + cancel: రద్దుచేయి + close: మూసివేయి + destroy: తొలగించు + details: వివరాలు + edit: సరిదిద్దు + more: ఇంకా... + save: భద్రపరుచు + show: చూపించు + update: తాజాకరించు + time: + ago: "{{time}} క్రితం" + today: ఈరోజు diff --git a/config/locales/groups/de.yml b/config/locales/groups/de.yml new file mode 100644 index 000000000..a739fbceb --- /dev/null +++ b/config/locales/groups/de.yml @@ -0,0 +1,73 @@ +# Messages for German (Deutsch) +# Exported from translatewiki.net +# Export driver: syck +# Author: Kghbln +# Author: Ookami +de: + activerecord: + attributes: + group: + default_tags: Standard-Stichwörter + description: Beschreibung + domain: Domain + fb_button: Aktiviere eine Schaltfläche, ähnlich wie bei Facebook (nicht privatsphärenfreundlich) + forum: Mehr als eine Antwort pro Nutzer zulassen + group_created_by: erstellt von + language: Sprache + legend: Legende + logo: Logo + may_contain_adult_content: Diese Website enthält möglicherweise jugendgefährdende Inhalte + name: Name + openid_only: Nur Personen, die OpenID nutzen, können auf die Website zugreifen + owner: Diese Gruppe wurde erstellt von {{login}} + registered_only: Diese Website ist nur für registrierte Nutzer zugänglich + state: Land + subdomain: URL + wysiwyg_editor: Nutzerfreundlichen Editor aktivieren + models: + default_tags_message: Du kannst nicht mehr als 10 Standard-Stichwörter verwenden + group: Gruppe + groups: Gruppen + groups: + create: + flash_notice: Deine Gruppe wurde erfolgreich erstellt. Du kannst jetzt beginnen, sie zu konfigurieren. + form: + access: Zugangs-Einstellungen + analytics_engine: Webanalytik-System + analytics_legend: Die Gruppe wird ihren eigenen Tracking-Code zu verwenden können + any_language: Alle + custom_analytics: Nutzerdefinierte Webanalytik erlauben + custom_html: Erlaube nutzerdefiniertes HTML + custom_js: Erlaube nutzerdefiniertes JavaScript + default_tags_legend: Stichwörter durch Kommas trennen. Es sind nur 10 Standard-Stichwörter zulässig. + description_legend: Beschreibe deine Gruppe mit max. 400 Zeichen. + isolate_group: Diese Gruppe von anderen Gruppen isolieren + legend_legend: Es wird in der Kopfzeile verwendet werden. Sie haben 40 Zeichen. + logo_legend: Du kannst ein Gruppenlogo hochladen. Die maximale Dateigröße beträgt 2 MB. + members_only: Nur Gruppenmitglieder haben Zugriff auf diese Gruppe. + website_analytics_id: Webanalytik-ID der Website + group: + about: Über + accept_group: Diese Gruppe akzeptieren + allow_ads: Werbung erlauben + close: Schließen + close_group: Diese Gruppe schließen + disallow_ads: Werbung verbieten + index: + actives: Aktiv + filter: Nach Gruppen suchen + most_active: Aktivste + name: Name + pendings: Ausstehend + request_group: Neue Gruppe beantragen + title: Gruppen + new: + title: Gruppe erstellen + show: + accept_group: Diese Gruppe akzeptieren + accept_group_with_custom_ads: Gruppe akzeptieren sowie nutzerdefinierte Anzeigen erlauben + close_group: Diese Gruppe schließen + group_awaiting_acceptance: Diese Gruppe wartet auf Freigabe durch einen Moderator. + group_closed: Diese Gruppe wurde geschlossen. + title: Über {{name}} + visit_group: Diese Gruppe besuchen diff --git a/config/locales/groups/en.yml b/config/locales/groups/en.yml index da78bd94a..3f410e069 100644 --- a/config/locales/groups/en.yml +++ b/config/locales/groups/en.yml @@ -26,18 +26,18 @@ en: new: title: Create your group create: - flash_notice: Your group was successfully created, you can now start to configure it. + flash_notice: Your group was successfully created. You can now start configuring it. form: description_legend: You have 400 characters to describe the group. - legend_legend: "It will be used in the header, you have 40 characters" - default_tags_legend: "Separate tags by commas. only 10 default tags allowed." - logo_legend: "You can upload the group logo. the maximum file size is 2mb." + legend_legend: "It will be used in the header. You have 40 characters." + default_tags_legend: "Separate tags by commas. Only 10 default tags allowed." + logo_legend: "You can upload the group logo. The maximum file size is 2MB." any_language: Any access: Access Settings - isolate_group: Isolate the group form other groups + isolate_group: Isolate the group from other groups members_only: "Only the group's members will be able to access this group" - custom_html: Allow custom html - custom_js: Allow custom javascript + custom_html: Allow custom HTML + custom_js: Allow custom JavaScript custom_analytics: Allow Custom Analytics analytics_engine: Analytics Engine website_analytics_id: Website Analytics ID @@ -46,11 +46,11 @@ en: models: groups: Groups group: Group - default_tags_message: "You can't have more than 10 default tags" + default_tags_message: "You cannot have more than 10 default tags" attributes: group: name: Name - subdomain: Url + subdomain: URL domain: Domain legend: Legend description: Description @@ -61,7 +61,7 @@ en: default_tags: "Default tags" logo: Logo forum: Allow more than one answer by user - openid_only: Only people using openid can access the site + openid_only: Only people using OpenID can access the site registered_only: Only registered people can access the site may_contain_adult_content: This site may contain adult content wysiwyg_editor: Enable user-friendly editor diff --git a/config/locales/groups/es-419.yml b/config/locales/groups/es-419.yml index dfe9e9b26..0fed0fd96 100644 --- a/config/locales/groups/es-419.yml +++ b/config/locales/groups/es-419.yml @@ -2,6 +2,7 @@ # Exported from translatewiki.net # Export driver: syck # Author: Crazymadlover +# Author: Patcito es-419: activerecord: attributes: @@ -33,12 +34,14 @@ es-419: form: access: Configuración de Acceso analytics_engine: Motor de análisis + analytics_legend: El grupo podra utilizar su propio codigo de seguimiento any_language: cualquiera custom_analytics: Permitir análisis personalizados custom_html: Permitir HTML personalizado custom_js: Permitir javascript personalizado default_tags_legend: separate tags by commas. only 10 default tags allowed. description_legend: tiene 4000 caracteres para describir el grupo. + isolate_group: Aislar el grupo de otros legend_legend: esto será usado en el titulo de la web, tienes 40 caracteres logo_legend: you can upload the group logo. the maximum file size is 2mb. members_only: Solamente los miembros del grupo serán capaces de acceder a este grupo diff --git a/config/locales/groups/ko.yml b/config/locales/groups/ko.yml index e35234e39..6b0a12923 100644 --- a/config/locales/groups/ko.yml +++ b/config/locales/groups/ko.yml @@ -32,11 +32,19 @@ ko: flash_notice: 그룹이 만들었습니다. 구성을 시작하세요. form: access: 액세스 설정 + analytics_engine: Analytics Engine + analytics_legend: 그룹은 자체 Tracking Code를 사용할 수 있습니다. any_language: 모두 + custom_analytics: Custom Analytics를 허용 + custom_html: Custom HTML을 허용 + custom_js: Custom Javascript를 허용 default_tags_legend: 쉼표로 태그를 분리하세요. 기본 태그는 10개만 허용. description_legend: " 400 자 이내로 그룹을 설명하세요." + isolate_group: 이 그룹을 다른 그룹들로부터 분리 legend_legend: 40 자 이내로 제목을 입력하세요 logo_legend: 그룹 로고를 업로드할 수 있습니다. 파일의 최대 크기는 2 메가바이트입니다. + members_only: 이 그룹은 회원 전용입니다. + website_analytics_id: 웹사이트 분석 ID group: about: about accept_group: 이 그룹을 수락 diff --git a/config/locales/groups/pt-BR.yml b/config/locales/groups/pt-BR.yml new file mode 100644 index 000000000..6f6f7c1ca --- /dev/null +++ b/config/locales/groups/pt-BR.yml @@ -0,0 +1,47 @@ +# Messages for Brazilian Portuguese (Português do Brasil) +# Exported from translatewiki.net +# Export driver: syck +# Author: Luckas Blade +pt-BR: + activerecord: + attributes: + group: + description: Descrição + forum: Permitir mais do que uma resposta por usuário + language: Língua + logo: Logotipo + name: Nome + registered_only: Somente pessoas registradas podem acessar o site + state: Estado + subdomain: Url + models: + group: Grupo + groups: Grupos + groups: + create: + flash_notice: O seu grupo foi criado, pode agora começar a configurá-lo. + form: + custom_html: Permitir HTML personalizado + custom_js: Permitir javascript personalizado + description_legend: Você pode usar 400 caracteres para descrever o grupo. + isolate_group: Isolar o grupo de outros grupos + group: + about: Sobre + accept_group: Aceitar este grupo + allow_ads: Permitir anúncios + close: Fechar + close_group: Fechar este grupo + disallow_ads: Não permitir anúncios + index: + filter: Pesquisar grupos + name: Nome + title: Grupos + new: + title: Criar seu grupo + show: + accept_group: Aceitar este grupo + accept_group_with_custom_ads: Aceitar grupo e permitir anúncios personalizados + close_group: Fechar este grupo + group_awaiting_acceptance: Este grupo está aguardando a aceitação de um moderador. + group_closed: Este grupo foi fechado. + visit_group: Visitar este grupo diff --git a/config/locales/groups/pt-PT.yml b/config/locales/groups/pt-PT.yml index 60be4a375..624a07609 100644 --- a/config/locales/groups/pt-PT.yml +++ b/config/locales/groups/pt-PT.yml @@ -6,67 +6,67 @@ pt-PT: activerecord: attributes: group: - default_tags: categorias predefinidas - description: descrição - domain: domínio - fb_button: Activar botão estilo Facebook (não respeita privacidade) - forum: permitir mais do que uma resposta por utilizador + default_tags: Categorias predefinidas + description: Descrição + domain: Domínio + fb_button: Activar botão de estilo Facebook (não respeita privacidade) + forum: Permitir mais do que uma resposta por utilizador group_created_by: criado por - language: língua - legend: legenda - logo: logótipo - may_contain_adult_content: este site pode ter conteúdo para adultos - name: nome - openid_only: só pessoas que usam openid podem aceder ao site - owner: este grupo foi criado por %{login} - registered_only: só pessoas registadas podem aceder ao site - state: estado - subdomain: url - wysiwyg_editor: Activar o editor de fácil utilização + language: Língua + legend: Legenda + logo: Logótipo + may_contain_adult_content: Este site pode ter conteúdo para adultos + name: Nome + openid_only: Só pessoas que usam OpenID podem aceder ao site + owner: Este grupo foi criado por %{login} + registered_only: Só pessoas registadas podem aceder ao site + state: Estado + subdomain: URL + wysiwyg_editor: Activar o editor de utilização fácil models: - default_tags_message: não pode ter mais do que 10 categorias predefinidas - group: grupo - groups: grupos + default_tags_message: Não pode ter mais do que 10 categorias predefinidas + group: Grupo + groups: Grupos groups: create: - flash_notice: O seu grupo foi criado; pode agora começar a configurá-lo. + flash_notice: O seu grupo foi criado. Agora pode começar a configurá-lo. form: access: Definições de Acesso analytics_engine: Motor de Análise analytics_legend: O grupo poderá usar o seu próprio código de monitorização - any_language: qualquer + any_language: Qualquer custom_analytics: Permitir Análises Personalizadas custom_html: Permitir HTML personalizado custom_js: Permitir JavaScript personalizado - default_tags_legend: separe as categorias por vírgulas; só são permitidas 10 categorias predefinidas. - description_legend: tem 400 caracteres para descrever o grupo. + default_tags_legend: Separe as categorias por vírgulas. Só são permitidas 10 categorias predefinidas. + description_legend: Tem 400 caracteres para descrever o grupo. isolate_group: Isolar o grupo de outros grupos - legend_legend: será usado no cabeçalho; tem disponíveis 40 caracteres - logo_legend: pode fazer upload do logótipo do grupo; o tamanho máximo do ficheiro é 2MB. + legend_legend: Será usado no cabeçalho. Dispõe de 40 caracteres. + logo_legend: Pode fazer upload do logótipo do grupo. O tamanho máximo do ficheiro é 2MB. members_only: Só os membros do grupo poderão aceder a este grupo - website_analytics_id: ID da Análise de Site na Internet + website_analytics_id: ID da Análise do Site group: - about: sobre - accept_group: aceitar este grupo - allow_ads: permitir anúncios - close: fechar - close_group: fechar este grupo - disallow_ads: não permitir anúncios + about: Sobre + accept_group: Aceitar este grupo + allow_ads: Permitir anúncios + close: Fechar + close_group: Fechar este grupo + disallow_ads: Não permitir anúncios index: - actives: activos - filter: pesquisar grupos - most_active: mais activos - name: nome - pendings: pendentes - request_group: pedir um grupo novo - title: grupos + actives: Activos + filter: Pesquisar grupos + most_active: Mais activos + name: Nome + pendings: Pendentes + request_group: Pedir um grupo novo + title: Grupos new: - title: crie o seu grupo + title: Crie o seu grupo show: - accept_group: aceitar este grupo - accept_group_with_custom_ads: aceitar grupo e permitir anúncios personalizados - close_group: fechar este grupo - group_awaiting_acceptance: este grupo aguarda a aceitação de um moderador. - group_closed: este grupo foi fechado. - title: sobre %{name} - visit_group: visitar este grupo + accept_group: Aceitar este grupo + accept_group_with_custom_ads: Aceitar o grupo e permitir anúncios personalizados + close_group: Fechar este grupo + group_awaiting_acceptance: Este grupo aguarda a aceitação de um moderador. + group_closed: Este grupo foi fechado. + title: Sobre %{name} + visit_group: Visitar este grupo diff --git a/config/locales/imports/bs.yml b/config/locales/imports/bs.yml new file mode 100644 index 000000000..909726c67 --- /dev/null +++ b/config/locales/imports/bs.yml @@ -0,0 +1,10 @@ +# Messages for Bosnian (Bosanski) +# Exported from translatewiki.net +# Export driver: syck +# Author: Palapa +bs: + imports: + subtabs: + need_confirmation: + name: Potrebna potvrda + title: Pošalji potvrdne e-mail poruke diff --git a/config/locales/imports/pt-PT.yml b/config/locales/imports/pt-PT.yml index 8f683adcc..402f772ce 100644 --- a/config/locales/imports/pt-PT.yml +++ b/config/locales/imports/pt-PT.yml @@ -1,9 +1,10 @@ # Messages for Portuguese (Português) # Exported from translatewiki.net # Export driver: syck +# Author: Hamilton Abreu pt-PT: imports: subtabs: need_confirmation: - name: need confirmation - title: send confirmation emails + name: Necessitam de confirmação + title: Enviar mensagens electrónicas de confirmação diff --git a/config/locales/layouts/de.yml b/config/locales/layouts/de.yml new file mode 100644 index 000000000..6dbf4bac5 --- /dev/null +++ b/config/locales/layouts/de.yml @@ -0,0 +1,51 @@ +# Messages for German (Deutsch) +# Exported from translatewiki.net +# Export driver: syck +# Author: Kghbln +de: + layouts: + application: + ask_question: Frage stellen + badges: Abzeichen + forgot: Vergessen? + home: Startseite + languages: Sprachen + log_in: Anmeldung + logged: Als %{login} angemeldet + logout: Abmelden + manage_ads: Anzeigen verwalten + moderate: Moderieren + now: jetzt! + openid: + explaination: "Sofern Du Dich nicht registrieren oder anmelden möchtest, kannst Du auch Deinen OpenID-Anbieter auswählen:" + pages: Seiten + questions: Fragen + questions_in: Fragen in + questions_tagged: mit folgenden Stichwörtern versehen + search: Suchen + settings: Einstellungen + signup: Registrieren + subscribe: Abonnieren + tags: Stichwörter + title: Fragen und Antworten + unanswered: Unbeantwortet + users: Nutzer + welcome_from: Herzlich Willkommen! Du kannst + manage: + actions: Aktionen + announcements: Ankündigungen + constrains: Voraussetzungen + content: Inhalt + dashboard: Übersichtsseite + domain: Domain + general: Allgemein + members: Mitglieder + pages: Seiten + properties: Eigenschaften + reputation: Reputation + rewards: Auszeichnungen + stats: Statistiken + theme: Theme + widgets: Widgets + notifications: + message: Sofern Du keine automatischen Benachrichtigungen mehr von %{domain} erhalten möchtest, musst Du Deine Einstellungen auf der Benachrichtigungsseite ändern. diff --git a/config/locales/layouts/en.yml b/config/locales/layouts/en.yml index 3db7bfdce..d0146b9a3 100644 --- a/config/locales/layouts/en.yml +++ b/config/locales/layouts/en.yml @@ -26,7 +26,7 @@ en: welcome_from: Welcome! You can now: now! openid: - explaination: "If you'd like to register or just log in, please select your openid provider:" + explaination: "If you would like to register or just log in, please select your OpenID provider:" manage: dashboard: Dashboard properties: Properties @@ -39,7 +39,7 @@ en: theme: Theme domain: Domain pages: Pages - constrains: Constrains + constrains: Requirements rewards: Rewards general: General announcements: Announcements diff --git a/config/locales/layouts/es-419.yml b/config/locales/layouts/es-419.yml index 1135519b1..122d79bdd 100644 --- a/config/locales/layouts/es-419.yml +++ b/config/locales/layouts/es-419.yml @@ -1,6 +1,7 @@ # Messages for Latin American Spanish (espanol de America Latina) # Exported from translatewiki.net # Export driver: syck +# Author: Patcito es-419: layouts: application: @@ -46,3 +47,5 @@ es-419: stats: stats theme: tema widgets: widgets + notifications: + message: Si ya no quieres recibir notificaciones automáticas de %{domain}, cambie sus preferencias en las opciones de notificaciones. diff --git a/config/locales/layouts/es.yml b/config/locales/layouts/es.yml index 0fa06674b..c0df23bd0 100644 --- a/config/locales/layouts/es.yml +++ b/config/locales/layouts/es.yml @@ -1,6 +1,7 @@ # Messages for Spanish (Español) # Exported from translatewiki.net # Export driver: syck +# Author: Crazymadlover es: layouts: application: @@ -46,3 +47,5 @@ es: stats: stats theme: tema widgets: widgets + notifications: + message: Si no deseas recibir notificaciones automáticas de %{domain} otra vez, cambia tus preferencias en la pantalla de notificaciones. diff --git a/config/locales/layouts/fr.yml b/config/locales/layouts/fr.yml index dc4f08e53..bef97c38d 100644 --- a/config/locales/layouts/fr.yml +++ b/config/locales/layouts/fr.yml @@ -1,6 +1,7 @@ # Messages for French (Français) # Exported from translatewiki.net # Export driver: syck +# Author: Patcito fr: layouts: application: @@ -46,3 +47,5 @@ fr: stats: États theme: thème widgets: widgets + notifications: + message: Si vous ne souhaitez plus recevoir de notifications automatiques de %{domain}, vous pouvez changer votre configuration de notifications. diff --git a/config/locales/layouts/gl.yml b/config/locales/layouts/gl.yml index 8d221d71b..7b2bc6a27 100644 --- a/config/locales/layouts/gl.yml +++ b/config/locales/layouts/gl.yml @@ -47,3 +47,5 @@ gl: stats: Estatísticas theme: Tema visual widgets: Widgets + notifications: + message: Se non quere recibir máis notificacións automáticas de %{domain}, cambie as súas preferencias de notificación. diff --git a/config/locales/layouts/ko.yml b/config/locales/layouts/ko.yml index 507681c5d..57e229e02 100644 --- a/config/locales/layouts/ko.yml +++ b/config/locales/layouts/ko.yml @@ -47,3 +47,5 @@ ko: stats: 통계 theme: 테마 widgets: 위젯 + notifications: + message: " %{domain}로부터 자동 공지를 받지 않으려면, 공지 화면에서 설정을 변경하세요." diff --git a/config/locales/layouts/mk.yml b/config/locales/layouts/mk.yml index 1a24022fa..756cc0ae1 100644 --- a/config/locales/layouts/mk.yml +++ b/config/locales/layouts/mk.yml @@ -47,3 +47,5 @@ mk: stats: статистики theme: мотив widgets: елементи + notifications: + message: Ако повеќе не сакате да добивате автоматски известувања од %{domain} , изменете си ги нагодувањата во екранот за известувања. diff --git a/config/locales/layouts/pt-PT.yml b/config/locales/layouts/pt-PT.yml index 559fe085c..404a93cb7 100644 --- a/config/locales/layouts/pt-PT.yml +++ b/config/locales/layouts/pt-PT.yml @@ -1,48 +1,52 @@ # Messages for Portuguese (Português) # Exported from translatewiki.net # Export driver: syck +# Author: Hamilton Abreu +# Author: Luckas Blade pt-PT: layouts: application: - ask_question: fazer pergunta - badges: badges - forgot: esqueceu-se? - home: início - languages: idiomas - log_in: ligar - logged: ligado como %{login} - logout: desligar sessão - manage_ads: gerir as propaganda - moderate: moderar - now: now! + ask_question: Fazer pergunta + badges: Distintivos + forgot: Esqueceu-se? + home: Início + languages: Línguas + log_in: Entrar + logged: Autenticado como %{login} + logout: Sair + manage_ads: Gerir anúncios + moderate: Moderar + now: agora! openid: - explaination: "se quiser registar-se ou apenas ligar-se, por favor seleccione o seu fornecedor de openid:" - pages: pages - questions: perguntas - questions_in: perguntas em - questions_tagged: tagged with - search: search - settings: preferências - signup: registar-se - subscribe: subscribe - tags: tags - title: perguntas & respostas - unanswered: sem resposta - users: utilizadores - welcome_from: welcome! you can + explaination: "Se pretende registar-se ou entrar, seleccione o seu fornecedor de OpenID, por favor:" + pages: Páginas + questions: Perguntas + questions_in: Perguntas em + questions_tagged: categorizada em + search: Pesquisar + settings: Definições + signup: Registar-se + subscribe: Subscrever + tags: Categorias + title: Perguntas e Respostas + unanswered: Sem resposta + users: Utilizadores + welcome_from: Bem-vindo(a)! Pode manage: - actions: actions - announcements: announcements - constrains: constrains - content: content - dashboard: dashboard - domain: domain - general: general - members: members - pages: pages - properties: properties - reputation: reputation - rewards: rewards - stats: stats - theme: theme - widgets: widgets + actions: Acções + announcements: Notificações do site + constrains: Requisitos + content: Conteúdo + dashboard: Painel + domain: Domínio + general: Geral + members: Membros + pages: Páginas + properties: Propriedades + reputation: Reputação + rewards: Prémios + stats: Estatísticas + theme: Tema + widgets: Widgets + notifications: + message: Se não pretende voltar a receber notificações automáticas de %{domain}, altere as suas preferências na página das notificações. diff --git a/config/locales/layouts/ru.yml b/config/locales/layouts/ru.yml index 1c51ed72d..251b1f908 100644 --- a/config/locales/layouts/ru.yml +++ b/config/locales/layouts/ru.yml @@ -3,6 +3,7 @@ # Export driver: syck # Author: Eleferen # Author: Lockal +# Author: Александр Сигачёв ru: layouts: application: @@ -48,3 +49,5 @@ ru: stats: Статистика theme: Оформление widgets: Виджеты + notifications: + message: Если вы не хотите больше получать автоматические уведомления от %{domain}, измените настройки в окне уведомлений. diff --git a/config/locales/mailers/en.yml b/config/locales/mailers/en.yml index d981d031f..dbe5366ab 100644 --- a/config/locales/mailers/en.yml +++ b/config/locales/mailers/en.yml @@ -18,6 +18,3 @@ en: subject: "%{login} added your question as a favorite!" report: subject: "Report for the group %{group} of %{app}" - - - diff --git a/config/locales/mailers/pt-PT.yml b/config/locales/mailers/pt-PT.yml index 12d4208e5..926e273b0 100644 --- a/config/locales/mailers/pt-PT.yml +++ b/config/locales/mailers/pt-PT.yml @@ -1,23 +1,24 @@ # Messages for Portuguese (Português) # Exported from translatewiki.net # Export driver: syck +# Author: Hamilton Abreu pt-PT: mailers: notifications: earned_badge: - subject: You have earned a badge on %{group}! + subject: Recebeu um distintivo do grupo %{group}! favorited: - subject: "%{login} added your question as a favorite!" + subject: "%{login} adicionou a sua pergunta às favoritas!" follow: - subject: "%{login} is now following you on %{app}" + subject: "%{login} está agora a segui-lo na aplicação %{app}" give_advice: - friend_subject: "your friend needs help: %{question_title}" - subject: "we need your advice: %{question_title}" + friend_subject: "O seu amigo precisa de ajuda: %{question_title}" + subject: "Precisamos da sua ajuda: %{question_title}" new_answer: - subject_friend: your friend %{login} answered the question %{title} + subject_friend: O seu amigo %{login} respondeu à pergunta %{title} subject_other: "%{login} respondeu à pergunta %{title}" subject_owner: "%{login} respondeu à sua pergunta %{title}" new_comment: - subject: "%{login} commented on %{group}" + subject: "%{login} comentou no grupo %{group}" report: - subject: report for the group %{group} of %{app} + subject: Relatório do grupo %{group}, da aplicação %{app} diff --git a/config/locales/manage/de.yml b/config/locales/manage/de.yml index a51cff75b..12e70378c 100644 --- a/config/locales/manage/de.yml +++ b/config/locales/manage/de.yml @@ -16,8 +16,8 @@ de: properties: constrains: reputation_constrains_description: Mit diesem Formular kannst Du festlegen, wieviele Reputationspunkte ein Nutzer benötigt, um bestimmte Aktionen ausführen zu können - reputation_constrains_subtitle: Liste der Einschränkungen nach Reputation für die einzelnen Aktionen - title: Einschränkungen + reputation_constrains_subtitle: Liste der Mindestreputation, die für jede Aktion benötigt wird + title: Voraussetzungen domain: description: "Du kannst Deine Website katalogisieren, so dass sie über Deine eigene Domain aufgerufen werden kann. So wird es gemacht:" instruction1: Hierzu musst Du Dich zunächst bei Deinem Hoster anmelden. Dies ist die Seite bei der Deine Domain wie bspw. {{subdomain}}.de gehostet wird. diff --git a/config/locales/manage/en.yml b/config/locales/manage/en.yml index 2d32cbf30..ded46c4c4 100644 --- a/config/locales/manage/en.yml +++ b/config/locales/manage/en.yml @@ -15,8 +15,8 @@ en: share: title: Share constrains: - title: Constrains - reputation_constrains_subtitle: List of reputations constrains for each action + title: Requirements + reputation_constrains_subtitle: List of reputation requirements for each action reputation_constrains_description: This form allows you to configure how many reputation points users need to do a given action rewards: title: Rewards @@ -24,14 +24,14 @@ en: reputation_rewards_description: This form allows you to configure how users can win and lose reputation points for a given action theme: title: Set the group's theme - logo_legend: Upload a logo for your group, it must be smaller than 2mb. + logo_legend: Upload a logo for your group. It must be smaller than 2MB. domain: title: Set your domain - description: "You can map your site so it can be accessed through your own custom domain, this is how you do it:" - instruction1: "To do so you first need to log on to your domain provider (the site where you bought your domain such as %{subdomain}.com)." + description: "You can map your site so it can be accessed through your own custom domain. This is how you do it:" + instruction1: "To do so you first need to log on to your domain provider. That is the site where you bought your domain such as %{subdomain}.com." instruction2: There you need to go to the DNS section and create something called a CNAME. instruction3: "Pick 'www' or anything else as the name of your CNAME." - instruction4: "Then in the host or destination field, put your current shapado domain: %{domain}." + instruction4: "Then in the host or destination field, put your current Shapado domain: %{domain}." instruction5: "Once this is done, after an hour or so, your domain www.%{subdomain} should point to %{appdomain}." - instruction6: "When this is the case, come back here and put your domain name www.%{subdomain} in the field below and press the button 'update'. If you have questions, ask us in the %{chat_url} or on our support forum" + instruction6: "When this is the case, come back here and put your domain name www.%{subdomain} in the field below and press the button 'update'. If you have questions, ask us in the %{chat_url} or on our support forum." warning: Are you sure you want to change your domain? diff --git a/config/locales/manage/es-419.yml b/config/locales/manage/es-419.yml index 8c0e7a530..a9562812d 100644 --- a/config/locales/manage/es-419.yml +++ b/config/locales/manage/es-419.yml @@ -2,6 +2,7 @@ # Exported from translatewiki.net # Export driver: syck # Author: Crazymadlover +# Author: Patcito es-419: admin: manage: @@ -15,7 +16,7 @@ es-419: top_bar_tip: entre un vinculo por linea properties: constrains: - reputation_constrains_description: este formulario permite configurar cuantos puntos de reputación se necesitan para efectuar cada acción + reputation_constrains_description: Este formulario permite configurar cuantos puntos de reputación se necesitan para efectuar cada acción reputation_constrains_subtitle: lista de las restricciónes de repotación por acción title: restricciónes domain: diff --git a/config/locales/manage/ko.yml b/config/locales/manage/ko.yml index 27bcc924a..8d53ccc97 100644 --- a/config/locales/manage/ko.yml +++ b/config/locales/manage/ko.yml @@ -15,7 +15,7 @@ ko: top_bar_tip: 한 줄에 하나의 링크를 입력하십시오 properties: constrains: - reputation_constrains_description: 이 공식으로 명성 포인트 부여 방식을 구성할 수 있습니다 + reputation_constrains_description: 어떤 액션을 수행할 권한을 얻는데 필요한 Reputation 포인트를 설정하는 양식입니다. reputation_constrains_subtitle: 각 액션에 대한 명성 제약 항목 리스트 title: 제약 domain: @@ -37,4 +37,5 @@ ko: share: title: 공유 theme: + logo_legend: 2MB 이하의 로고 이미지를 업로드하세요. title: 그룹의 테마 설정 diff --git a/config/locales/manage/pt-PT.yml b/config/locales/manage/pt-PT.yml index a5c17a26a..e298cef05 100644 --- a/config/locales/manage/pt-PT.yml +++ b/config/locales/manage/pt-PT.yml @@ -6,36 +6,36 @@ pt-PT: admin: manage: content: - footer: footer - head: cabeçalho - question_help: question help - question_prompt: question prompt - title: custom content - top_bar: top bar + footer: Rodapé + head: Cabeçalho + question_help: Ajuda de perguntas + question_prompt: Linha da pergunta + title: Conteúdo personalizado + top_bar: Barra do topo top_bar_tip: Introduza um link por linha properties: constrains: - reputation_constrains_description: Este formulário permite-lhe configurar quantos pontos de reputação os utilizadores necessitam para poderem executar uma determinada operação - reputation_constrains_subtitle: list of reputations constrains for each action - title: constrains + reputation_constrains_description: Este formulário permite-lhe configurar quantos pontos de reputação os utilizadores necessitam para executar uma determinada acção + reputation_constrains_subtitle: Lista de requisitos de reputação para cada acção + title: Requisitos domain: - description: "You can map your site so it can be accessed through your own custom domain, this is how you do it:" - instruction1: To do so you first need to log on to your domain provider (the site where you bought your domain such as %{subdomain}.com). - instruction2: There you need to go to the DNS section and create something called a CNAME. - instruction3: Pick 'www' or anything else as the name of your CNAME. - instruction4: "Then in the host or destination field, put your current shapado domain: %{domain}." - instruction5: Once this is done, after an hour or so, your domain www.%{subdomain} should point to %{appdomain}. - instruction6: When this is the case, come back here and put your domain name www.%{subdomain} in the field below and press the button 'update'. If you have questions, ask us in the %{chat_url} or on our support forum - title: setup your domain - warning: Are you sure you want to change your domain? + description: "Pode mapear o seu site de forma a ser acessível através do seu domínio próprio. Faça-o assim:" + instruction1: Para fazê-lo, antes autentique-se no fornecedor do seu domínio. É o site onde comprou o seu domínio, do tipo %{subdomain}.com. + instruction2: Lá, vá à secção de DNS e crie uma coisa chamada um CNAME. + instruction3: Escolha 'www' ou outra coisa para o seu CNAME. + instruction4: "Depois, no campo do host ou de destino, coloque o seu domínio Shapado actual: %{domain}." + instruction5: Cerca de uma hora depois de o fazer, o seu domínio www.%{subdomain} deverá apontar para %{appdomain}. + instruction6: Quando for este o caso, volte cá, coloque o nome do seu domínio www.%{subdomain} no campo abaixo e clique 'Actualizar'. Se tem questões, coloque-as em %{chat_url} ou no nosso fórum de suporte. + title: Defina o seu domínio + warning: Tem a certeza de que quer alterar o seu domínio? general: - title: group properties + title: Propriedades do grupo rewards: - reputation_rewards_description: this formular allows you to configure how users can win and lose reputation points for a given action - reputation_rewards_subtitle: list of reputations rewards - title: rewards + reputation_rewards_description: Este formulário permite-lhe configurar de que forma os utilizadores podem ganhar e perder pontos de reputação por uma dada acção + reputation_rewards_subtitle: Lista de prémios de reputação + title: Prémios share: - title: share + title: Partilhar theme: logo_legend: Faça o upload de um logótipo para o seu grupo; tem de ser inferior a 2 MB. - title: setup the group's theme + title: Defina o tema do grupo diff --git a/config/locales/members/pt-PT.yml b/config/locales/members/pt-PT.yml index db404c099..01ab0635a 100644 --- a/config/locales/members/pt-PT.yml +++ b/config/locales/members/pt-PT.yml @@ -1,15 +1,16 @@ # Messages for Portuguese (Português) # Exported from translatewiki.net # Export driver: syck +# Author: Hamilton Abreu pt-PT: activerecord: attributes: member: - role: role + role: Função members: form: - login_tip: search as you type + login_tip: Procurar enquanto escreve index: - manage_members_title: manage members - title: members of %{name}'s group - title_isolate: members of %{name} + manage_members_title: Administrar membros + title: Membros do grupo de %{name} + title_isolate: Membros de %{name} diff --git a/config/locales/moderate/#fr.yml# b/config/locales/moderate/#fr.yml# deleted file mode 100644 index 1f38110a3..000000000 --- a/config/locales/moderate/#fr.yml# +++ /dev/null @@ -1,11 +0,0 @@ -fr: - admin: - moderate: - index: - title: modérer - ban: ban - content: contenu - item_title: titre - all: tous - flagged: questions reportées - banned: questions banées diff --git a/config/locales/moderate/de.yml b/config/locales/moderate/de.yml index dd36793fc..d0830f538 100644 --- a/config/locales/moderate/de.yml +++ b/config/locales/moderate/de.yml @@ -12,5 +12,5 @@ de: content: Inhalt flagged: gekennzeichnete Fragen item_title: Titel - need_tags: Schlagwort ändern + need_tags: Stichwörter ändern title: moderieren diff --git a/config/locales/moderate/ps.yml b/config/locales/moderate/ps.yml new file mode 100644 index 000000000..ee847d58d --- /dev/null +++ b/config/locales/moderate/ps.yml @@ -0,0 +1,12 @@ +# Messages for Pashto (پښتو) +# Exported from translatewiki.net +# Export driver: syck +# Author: Ahmed-Najib-Biabani-Ibrahimkhel +ps: + admin: + moderate: + index: + all: ټول + ban: بنديز لګول + content: مينځپانګه + item_title: سرليک diff --git a/config/locales/moderate/pt-PT.yml b/config/locales/moderate/pt-PT.yml index 0c72a9f52..1d0d6d638 100644 --- a/config/locales/moderate/pt-PT.yml +++ b/config/locales/moderate/pt-PT.yml @@ -1,15 +1,16 @@ # Messages for Portuguese (Português) # Exported from translatewiki.net # Export driver: syck +# Author: Hamilton Abreu pt-PT: admin: moderate: index: - all: todas - ban: banir - banned: banned questions - content: conteúdo - flagged: flagged questions - item_title: título - need_tags: retag - title: moderar + all: Todas + ban: Banir + banned: Perguntas banidas + content: Conteúdo + flagged: Perguntas reportadas + item_title: Título + need_tags: Recategorizar + title: Moderar diff --git a/config/locales/notifier/de.yml b/config/locales/notifier/de.yml new file mode 100644 index 000000000..0032a1a7e --- /dev/null +++ b/config/locales/notifier/de.yml @@ -0,0 +1,43 @@ +# Messages for German (Deutsch) +# Exported from translatewiki.net +# Export driver: syck +# Author: Kghbln +de: + notifier: + earned_badge: + message1: Du hast ein %{badge}-Abzeichen auf %{app} erhalten + message2: "Beschreibung zum Abzeichen:" + message3: Du kannst alle Deine Abzeichen auf Deiner %{user_page} sehen + favorited: + message1: "%{user} hat Deine Frage als Favorit in %{group} hinzugefügt" + message2: "Der Text Deiner Frage:" + message3: "Du kannst es hier sehen:" + follow: + message1: "%{user} beachtet nun Deine Fragen und Antworten auf %{app}" + message2: Du kannst ihn beachten, indem Du auf die Schaltfläche „Beachten“ auf seiner %{user_page} klickst + give_advice: + message1: "%{user} hat gerade eine Frage gestellt, die Du vielleicht beantworten kannst:" + message2: "Um zu Antworten, erwidere die Nachricht hier:" + message3: "Oder, wenn Du jemanden kennst, der die Frage beantworten könnte, schicke ihm diesen Link:" + message4: Sofern wir von Dir nicht bald eine Antwort erhalten, werden wir jemand anderen fragen. Dennoch kannst Du antworten, wann immer Du möchtest. + global: + hi: Hallo %{user}, + user_page: Nutzerseite + new_answer: + message: "%{user} hat %{new_answer} zu Frage %{question} verfasst" + new_comment: + message: "%{user} hat %{new_comment} zu Frage %{question} verfasst" + new_feedback: + message1: Der Nutzer %{user} <%{email}> hat eine Rückmeldung gegeben + message2: Ein anonymer Nutzer mit der IP-Adresse %{ip} hat eine Rückmeldung gegeben + message3: "E-Mail-Adresse: %{email}" + message4: "Betreff: %{subject}" + report: + message1: Bericht für Gruppe %{group.name} + message2: Seit %{since} + message3: "%{questions} Fragen wurden gestellt" + message4: "%{answers} Antworten wurden verfasst" + message5: "%{votes} Bewertungen wurden abgegeben" + message6: "%{badges} Abzeichen wurden vergeben" + message7: Das Konto hat %{users} Nutzer. + message8: Besuche Deine Gruppe unter %{link} diff --git a/config/locales/notifier/el.yml b/config/locales/notifier/el.yml index 87da896a8..b2114baea 100644 --- a/config/locales/notifier/el.yml +++ b/config/locales/notifier/el.yml @@ -1,6 +1,7 @@ # Messages for Greek (Ελληνικά) # Exported from translatewiki.net # Export driver: syck +# Author: Discon # Author: Patcito el: notifier: @@ -11,6 +12,7 @@ el: favorited: message1: Ο/η %{user} προσέθεσε την ερώτησή σας ως αγαπημένη στο %{group} message2: "Το κείμενο της ερώτησής σας:" + message3: "Μπορείτε να το δείτε εδώ:" follow: message1: Ο/η %{user} παρακολουθεί τις ερωτήσεις και απαντήσεις σας στο %{app} message2: Μπορείτε να τον ακολουθήσετε κι εσείς πατώντας στο κουμπί "ακολουθήστε" στην %{user_page} @@ -26,12 +28,17 @@ el: message: Ο/η %{user} αποδέχτηκε την απάντηση %{new_answer} στην ερώτηση %{question} new_comment: message: Ο/η %{user} σχολίασε %{new_comment} στην ερώτηση %{question} + new_feedback: + message1: Ο χρήστης %{user} <%{email}> έστειλε σχόλια + message2: Ένας ανώνυμος χρήστης έστειλε σχόλια από την IP διεύθυνση %{ip} + message3: "Ηλεκτρονική διεύθυνση: %{email}" + message4: "Θέμα: %{subject}" report: message1: αναφορά για την ομάδα %{group.name} message2: από %{since} message3: ερωτήθηκαν %{questions} ερωτήσεις message4: δόθηκαν %{answers} απαντήσεις - message5: "δόθηκαν #%{votes} ψήφοι" + message5: δόθηκαν %{votes} ψήφοι message6: χορηγήθηκαν %{badges} τίτλοι message7: Η ομάδα έχει %{users} χρήστες. message8: Επισκεφθείτε την ομάδα στο %{link} diff --git a/config/locales/notifier/en.yml b/config/locales/notifier/en.yml index aeb63c53d..0736ab95b 100644 --- a/config/locales/notifier/en.yml +++ b/config/locales/notifier/en.yml @@ -20,7 +20,7 @@ en: message3: "Or, if you know someone who might be able to answer, send them this referral link:" message4: "If we do not get an answer from you soon, we will ask someone else. You can still answer it whenever you want." new_answer: - message: "%{user} accepted %{new_answer} to the question %{question}" + message: "%{user} answered %{new_answer} to the question %{question}" new_comment: message: "%{user} commented %{new_comment} on the question %{question}" new_feedback: diff --git a/config/locales/notifier/es.yml b/config/locales/notifier/es.yml new file mode 100644 index 000000000..84bbc511c --- /dev/null +++ b/config/locales/notifier/es.yml @@ -0,0 +1,44 @@ +# Messages for Spanish (Español) +# Exported from translatewiki.net +# Export driver: syck +# Author: Crazymadlover +# Author: Patcito +es: + notifier: + earned_badge: + message1: Has ganado una insigna %{badge} en %{app} + message2: "La descripcion de la insigna:" + message3: Puedes ver todas tus insignas en tu %{user_page} + favorited: + message1: "%{user} agregó tu pregunta como un favorito en %{group}" + message2: "El texto de tu pregunta:" + message3: "Puedes verlo aquí:" + follow: + message1: "%{user} está ahora siguiendo tus preguntas y respuestas en %{app}" + message2: Puedes seguirlo haciendo click en el botón "seguir" en su %{user_page} + give_advice: + message1: "%{user} acaba de hacer una pregunta que usted podria contestar:" + message2: "Para contestar, responde a este mensaje en el siguiente enlace:" + message3: "O, si conoces a alguien que pueda contestar, enviale este enlace:" + message4: Si no tenemos respuesta de ti pronto, le preguntaremos a otra persona; puedes contestar la pregunta cuando quieras. + global: + hi: Hola %{user}, + user_page: página de usuario + new_answer: + message: "%{user} respondió %{new_answer} a la pregunta %{question}" + new_comment: + message: "%{user} comento %{new_comment} en la pregunta %{question}" + new_feedback: + message1: El usuario %{user} <%{email}> mando un feedback + message2: Un usuario anónimo mando un feedback desde la dirección IP %{ip} + message3: "Dirección de correo: %{email}" + message4: "Objeto: %{subject}" + report: + message1: Reporte para el groupo %{group.name} + message2: Desde el %{since} + message3: "%{questions} preguntas han sido creadas" + message4: "%{answers} respuestas han sido creadas" + message5: "%{votes} votos has sido efectuados" + message6: "%{badges} insignas han sido otorgadas" + message7: La cuenta tiene %{users} usuarios. + message8: Visita el grupo en %{link} diff --git a/config/locales/notifier/fr.yml b/config/locales/notifier/fr.yml index 4774bf8a9..d79040778 100644 --- a/config/locales/notifier/fr.yml +++ b/config/locales/notifier/fr.yml @@ -1,6 +1,7 @@ # Messages for French (Français) # Exported from translatewiki.net # Export driver: syck +# Author: IAlex # Author: Jean-Frédéric # Author: Peter17 fr: @@ -25,7 +26,7 @@ fr: hi: Bonjour %{user}, user_page: page utilisateur new_answer: - message: "%{user} a accepté %{new_answer} à la question %{question}" + message: "%{user} a répondu %{new_answer} à la question %{question}" new_comment: message: "%{user} a commenté %{new_comment} à la question %{question}" new_feedback: diff --git a/config/locales/notifier/ko.yml b/config/locales/notifier/ko.yml new file mode 100644 index 000000000..7fce8e76c --- /dev/null +++ b/config/locales/notifier/ko.yml @@ -0,0 +1,43 @@ +# Messages for Korean (한국어) +# Exported from translatewiki.net +# Export driver: syck +# Author: Linkr +ko: + notifier: + earned_badge: + message1: " %{app}에 대해 %{badge} 뱃지를 획득하셨습니다." + message2: "뱃지 설명:" + message3: " %{user_page}에서 귀하의 뱃지들을 보실 수 있습니다." + favorited: + message1: "%{user}님이 귀하의 질문을 %{group}에 관한 Favorite로 추가했습니다." + message2: "질문 내용:" + message3: "여기를 보세요:" + follow: + message1: "%{user}님은 %{app}에 관한 귀하의 질문과 답변을 Follow하지 않습니다." + message2: "%{user_page}님을 Follow하려면, \"Follow\" 버튼을 클릭하세요." + give_advice: + message1: 귀하가 아실 만한 질문을 %{user}님이 올리셨습니다. + message2: "이 메시지에 대한 답변을 적으세요:" + message3: 아실만한 분이 있으면, 이 링크를 전달해 주세요. + message4: 귀하로부터 답변이 없으면, 다른 분들게 여쭤 보겠습니다. 언제라도 답변을 주세요. + global: + hi: Hi %{user}, + user_page: 사용자 페이지 + new_answer: + message: "%{user}님이 %{question} 질문에 %{new_answer} 답변을 다셨습니다." + new_comment: + message: "%{user}님이 %{question} 질문에 %{new_comment} 코멘트를 다셨습니다." + new_feedback: + message1: "%{user} <%{email}>님이 피드백을 보냈습니다." + message2: IP address %{ip}인 익명 사용자가 피드백을 보냈습니다. + message3: 이메일 %{email} + message4: 주제 %{subject} + report: + message1: " %{group.name} 그룹을 보고" + message2: Since %{since} + message3: "%{questions} 질문이 작성되었습니다." + message4: "%{answers} 답변이 있습니다." + message5: "%{votes} votes가 있습니다." + message6: "%{badges} 뱃지가 수여되었습니다." + message7: 이 계정에는 %{users} 사용자가 있습니다. + message8: " 귀하의 그룹 %{link}을 방문하세요." diff --git a/config/locales/notifier/mk.yml b/config/locales/notifier/mk.yml index 29b34968f..7b938a737 100644 --- a/config/locales/notifier/mk.yml +++ b/config/locales/notifier/mk.yml @@ -24,7 +24,7 @@ mk: hi: Здраво %{user}, user_page: корисничка страница new_answer: - message: "%{user} го прифати %{new_answer} на прашањето %{question}" + message: "%{user} одговори %{new_answer} на прашањето %{question}" new_comment: message: "%{user} коментираше %{new_comment} на прашањето %{question}" new_feedback: diff --git a/config/locales/notifier/nl.yml b/config/locales/notifier/nl.yml index edbe9ea13..244e0ad90 100644 --- a/config/locales/notifier/nl.yml +++ b/config/locales/notifier/nl.yml @@ -24,7 +24,7 @@ nl: hi: Hallo %{user}, user_page: gebruikerspagina new_answer: - message: "%{user} heeft %{new_answer} geaccepteerd als antwoord op de vraag %{question}" + message: "%{user} heeft %{new_answer} geantwoord op de vraag %{question}" new_comment: message: "%{user} heeft de reactie %{new_comment} op de vraag %{question} gegeven" new_feedback: diff --git a/config/locales/notifier/pt-PT.yml b/config/locales/notifier/pt-PT.yml index b4a58c64a..79e27fac2 100644 --- a/config/locales/notifier/pt-PT.yml +++ b/config/locales/notifier/pt-PT.yml @@ -13,20 +13,20 @@ pt-PT: message2: "O texto da sua pergunta:" message3: "Pode ver aqui:" follow: - message1: "%{user} está agora a seguir as suas perguntas e respostas na %{app}" + message1: "%{user} está agora a seguir as suas perguntas e respostas na aplicação %{app}" message2: Pode seguir o utilizador clicando o botão "Seguir" na %{user_page} do próprio give_advice: message1: "%{user} acaba de fazer uma pergunta a que talvez saiba responder:" - message2: "Para dar uma resposta, responda a esta mensagem aqui: \\" + message2: "Para dar uma resposta, responda a esta mensagem aqui:" message3: "Ou, se conhece alguém que talvez possa responder, envie-lhe este link:" message4: Se não recebermos uma resposta sua rapidamente, perguntaremos a outra pessoa. Continuará a poder responder quando quiser. global: hi: Olá %{user}, user_page: página de utilizador new_answer: - message: "%{user} aceitou %{new_answer} à pergunta %{question}" + message: "%{user} deu a resposta %{new_answer} à pergunta %{question}" new_comment: - message: "%{user} comentou %{new_comment} na pergunta %{question}" + message: "%{user} fes o comentário %{new_comment} na pergunta %{question}" new_feedback: message1: O utilizador %{user} <%{email}> enviou um comentário message2: Utilizador anónimo enviou um comentário do endereço IP %{ip} @@ -40,4 +40,4 @@ pt-PT: message5: Foram atribuídos %{votes} votos message6: Foram atribuídos %{badges} distintivos message7: A conta tem %{users} utilizadores. - message8: Visite o nosso grupo em %{link} + message8: Visite o seu grupo em %{link} diff --git a/config/locales/notifier/ru.yml b/config/locales/notifier/ru.yml new file mode 100644 index 000000000..a9cd4c627 --- /dev/null +++ b/config/locales/notifier/ru.yml @@ -0,0 +1,35 @@ +# Messages for Russian (Русский) +# Exported from translatewiki.net +# Export driver: syck +# Author: Lockal +ru: + notifier: + earned_badge: + message2: "Описание беджа:" + message3: Вы можете просмотреть все ваши беджи на вашей %{user_page} + favorited: + message2: "Текст вашего вопроса:" + follow: + message2: Вы можете начать следить за ним снова, нажав на кнопку «Следить» на его %{user_page} + give_advice: + message1: "%{user} недавно задал вопрос, на который вы могли бы ответить:" + message2: "Для обратной связи просто ответьте здесь на это сообщение:" + message4: Если мы не получим от вас ответа в ближайшее время, мы спросим кого-нибудь ещё. Вы по прежнему сможете ответить, когда захотите. + global: + hi: Здравствуйте, %{user}, + user_page: странице пользователя + new_answer: + message: "%{user} добавил ответ %{new_answer} на вопрос %{question}" + new_feedback: + message1: Пользователь %{user} <%{email}> отправил отзыв + message2: Анонимный пользователь отправил отзыв с IP-адреса %{ip} + message3: "Адрес электронной почты: %{email}" + message4: "Тема: %{subject}" + report: + message2: С %{since} + message3: "Задано вопросов: %{questions}" + message4: "Создано ответов: %{answers}" + message5: "Отдано голосов: %{votes}" + message6: "Вручено беджей: %{badges}" + message7: Учётная запись включает %{users} пользователя/пользователей. + message8: Перейдите в свою группу по ссылке %{link} diff --git a/config/locales/pages/en.yml b/config/locales/pages/en.yml index 756b7a601..0fb3c148e 100644 --- a/config/locales/pages/en.yml +++ b/config/locales/pages/en.yml @@ -14,7 +14,7 @@ en: new: title: New page form: - title_tip: "Page title, use this to reference the page. for example: [[FAQ|check out the faq]]" + title_tip: "Page title. Use this to reference the page. For example: [[FAQ|check out the faq]]" language_tip: Page language actions: title: Actions @@ -27,5 +27,5 @@ en: pages: Pages attributes: page: - js: Javascript + js: JavaScript css: Stylesheets diff --git a/config/locales/pages/pt-BR.yml b/config/locales/pages/pt-BR.yml new file mode 100644 index 000000000..1887db392 --- /dev/null +++ b/config/locales/pages/pt-BR.yml @@ -0,0 +1,28 @@ +# Messages for Brazilian Portuguese (Português do Brasil) +# Exported from translatewiki.net +# Export driver: syck +# Author: Luckas Blade +pt-BR: + activerecord: + attributes: + page: + js: Javascript + models: + page: Página + pages: Páginas + pages: + actions: + create_page: Criar nova página + edit_page: Editar página + create: + success: A página foi criada com sucesso. + edit: + title: Editando página + form: + language_tip: Língua da página + index: + title: Lista de páginas + new: + title: Nova página + update: + success: A página foi atualizada com sucesso. diff --git a/config/locales/pages/pt-PT.yml b/config/locales/pages/pt-PT.yml index 608c53789..63872b542 100644 --- a/config/locales/pages/pt-PT.yml +++ b/config/locales/pages/pt-PT.yml @@ -1,33 +1,35 @@ # Messages for Portuguese (Português) # Exported from translatewiki.net # Export driver: syck +# Author: Hamilton Abreu +# Author: Luckas Blade pt-PT: activerecord: attributes: page: - css: stylesheets - js: javascript + css: Stylesheets + js: JavaScript models: - page: page - pages: pages + page: Página + pages: Páginas pages: actions: - create_page: Create new page - edit_page: Edit page - title: Actions + create_page: Criar página nova + edit_page: Editar página + title: Acções create: - success: Page was successfully created. + success: A página foi criada. edit: - title: Editing page + title: A editar página form: - language_tip: page language - title_tip: "Page title, use this to reference the page. for example: [[FAQ|check out the faq]]" + language_tip: Língua da página + title_tip: "Título da página, usado para referi-la. Por exemplo: [[FAQ|veja a FAQ]]" index: - create_page: create new page - title: List of pages - written_in: written in %{language} + create_page: Criar página nova + title: Lista de páginas + written_in: Escrita em %{language} new: - title: new page - title: fixme + title: Página nova + title: Corrigir update: - success: Page was successfully updated. + success: A página foi actualizada. diff --git a/config/locales/questions/de.yml b/config/locales/questions/de.yml new file mode 100644 index 000000000..396e3a974 --- /dev/null +++ b/config/locales/questions/de.yml @@ -0,0 +1,136 @@ +# Messages for German (Deutsch) +# Exported from translatewiki.net +# Export driver: syck +# Author: Kghbln +de: + activerecord: + attributes: + question: + answers: Antworten + asked_by: Gefragt von + body: Text + closed: Beendet + created_at: Gefragt + language: Sprache + tags: Stichwörter + title: Titel + updated_at: aktualisiert + updated_by: aktualisiert von + views: Aufrufe + votes: Bewertungen + models: + question: Frage + questions: Fragen + questions: + answer: + add_comment: Kommentar hinzufügen … + flag: Kennzeichnen + pick_answer: Als Lösung auswählen + unset_answer: Antwort in Frage stellen? + create: + flash_notice: Die Frage wurde erfolgreich erstellt. + edit: + title: Bearbeiten der Frage + flag: + title: Kennzeichnen der Frage + form: + adult_content: Diese Frage enthält jugendgefährdende Angaben. + body_tip: Wie lautet Deine Frage? Sei aussagekräftig. + language_tip: Wähle die Sprache der Frage. + tags_tip: Verwende Stichwörter, um weitere Informationen zu Deiner Frage anzugeben. + index: + active: Aktiv + active_tooltip: Fragen die vor kurzem aktualisiert wurden + ask_question: Frage stellen + empty: Bislang hat noch niemand eine Frage gestellt. Sei der Erste! + help_to_answer: Helfe uns beim Antworten + hot: Heiß + hot_tooltip: Fragen mit den meisten Aktivitäten während der letzten 5 Tage + newest: Neueste + newest_tooltip: Die zuletzt gestellten Fragen + oldest: Älteste + title: Alle Fragen + unanswered_questions: Offene Fragen + votes: Bewertungen + votes_tooltip: Fragen mit den meisten Bewertungen + model: + messages: + empty_tags: Du musst mindestens ein Stichwort verwenden. + title_too_long: Der Titel ist zu lang. Er darf aus nicht mehr als 100 Zeichen bestehen. + too_many_tags: Du kannst maximal neun Stichwörter verwenden. + too_short: Scheint zu kurz zu sein. Bitte verwende mehr als %{count} Wörter. + move: + group_label: "Verschiebe zur Gruppe:" + submit: Verschieben! + title: "Verschiebe Frage: %{title}" + move_to: + group_dont_exists: Die Gruppe %{group} existiert nicht + success: Frage wurde nach %{group} verschoben + new: + how_to_ask: Wie fragen + title: Frage stellen + question: + accepted_tooltip: Zu dieser Frage gibt es eine Antwort, die akzeptiert wurde + retag: + title: Stichwörter ändern + retag_form: + cancel: Abbrechen + submit: Stichwörter aktualisieren! + title: Stichwörter aktualisieren + retag_to: + failure: Leider konnten die Stichwörter nicht aktualisiert werden. + success: Die Stichwörter wurden erfolgreich aktualisiert. + revert: + title: Frage zurücksetzen + shared: + flag: Kennzeichnen + show: + accepted_tooltip: Eine der Antworten wurde als richtig akzeptiert + another_answers: Andere Antworten + answers: Antworten + answers_title: + one: "%{count} Antwort" + other: "%{count} Antworten" + asked_on: gefragt bei + ban: Verbieten + close: Beendet + close_reason: "Die Frage wurde aus folgenden Gründen beendet:" + favorite_tooltip: Diese Frage zur Favoritenliste hinzufügen + flag: Kennzeichen + flagged_as: Gekennzeichnet als + flags: Gemeldet als + last_activity: Letzte Aktivität + related_questions: Ähnliche Frage + request_closing: Beendigung beantragen + request_closing_details: Beantrage diese Frage zu beenden + retag: Stichwörter ändern + retract_request: Du hast bereits einen Antrag gestellt. Möchtest Du ihn zurückziehen? + share: Auf diese Frage aufmerksam machen bei + share_on: Auf diese Frage bei %{site} aufmerksam machen + solution: Lösung + to_answer_question: Frage beantworten + unauthenticated_retag: Du brauchst ein Nutzerkonto, um die Stichwörter ändern zu können + unfavorite_tooltip: Diese Frage aus der Favoritenliste entfernen + unwatch_tooltip: Diese Frage nicht mehr beobachten + viewed: Gesehen + watch_tooltip: Diese Frage beobachten + solve: + flash_notice: Die Frage wurde beantwortet. + tags: + filter: Suche nach Stichwörtern + title: Stichwörter + tooltip: Alle Fragen mit dem Stichwort %{tag} anzeigen + unanswered: + empty: Diese Gruppe beinhaltet keine offenen Fragen. + expert: Experten + my_tags: Meine Stichwörter + tags: Offene Stichwörter + title: Offene Fragen + unsolve: + flash_notice: Die Frage wird nicht mehr beantwortet. + unwatch: + success: Du erhältst nun keine E-Mail-Benachrichtigungen mehr zu jeder neuen Antwort auf diese Frage + update: + flash_notice: Die Frage wurde erfolgreich aktualisiert. + watch: + success: Du erhältst nun E-Mail-Benachrichtigungen zu jeder neuen Antwort auf diese Frage diff --git a/config/locales/questions/en.yml b/config/locales/questions/en.yml index 5bb14a302..612f42024 100644 --- a/config/locales/questions/en.yml +++ b/config/locales/questions/en.yml @@ -8,7 +8,7 @@ en: newest: Newest oldest: Oldest ask_question: Ask question - empty: "No one has asked any questions yet, be the first!" + empty: "No one has asked any questions yet. Be the first!" help_to_answer: Help us answer unanswered_questions: Unanswered questions hot_tooltip: Questions with the most activity over the last 5 days @@ -28,7 +28,7 @@ en: viewed: viewed to_answer_question: to answer this question watch_tooltip: "Watch this question" - accepted_tooltip: "One of the answers was accepted as the correct answer" + accepted_tooltip: "One of the answers was accepted as the correct answer." unwatch_tooltip: "Stop watching this question" favorite_tooltip: "Add this question to your favorites" unfavorite_tooltip: "Remove this question from your favorites" @@ -40,7 +40,7 @@ en: request_closing_details: Request to close this question close: Close ban: Ban - retract_request: You have already made a request, would you line to retract it? + retract_request: You have already made a request. Would you like to retract it? close_reason: "The question has been closed for the following reason:" answers_title: one: "%{count} answer" @@ -55,8 +55,8 @@ en: question: accepted_tooltip: This question has an answer that has been accepted form: - body_tip: What's your question? be descriptive. - language_tip: Select the language's question. + body_tip: What is your question? Be descriptive. + language_tip: Select the language the question is asked in. tags_tip: Use tags to add more information about your question. adult_content: This question contains adult material. flag: @@ -66,7 +66,7 @@ en: unanswered: title: Unanswered questions tags: Unanswered tags - empty: "This group doesn't have any unanswered questions." + empty: "This group does not have any unanswered questions." my_tags: My tags expert: Experts tags: @@ -85,9 +85,9 @@ en: unsolve: flash_notice: "The question is not solved anymore." watch: - success: "You will now receive notifications by mail for every new answer to this question" + success: "You will now receive notifications by email for every new answer to this question." unwatch: - success: "You will not receive notifications by mail for every new answer to this question anymore" + success: "You will not receive notifications by email for every new answer to this question anymore." revert: title: "Revert question" move: @@ -96,7 +96,7 @@ en: submit: "Move!" move_to: success: "Question moved to %{group}" - group_dont_exists: "The group %{group} doesn't exist" + group_dont_exists: "The group %{group} does not exist" shared: flag: Flag retag_form: @@ -111,7 +111,7 @@ en: too_short: "Seems too short. Please use more words than %{count} to be more specific." too_many_tags: Sorry, you can only enter 9 tags maximum. empty_tags: Sorry, you need to use at least one tag. - title_too_long: "The title is too long. it should not contain more than 100 characters" + title_too_long: "The title is too long. It should not contain more than 100 characters." activerecord: models: diff --git a/config/locales/questions/pt-PT.yml b/config/locales/questions/pt-PT.yml index 02f55338b..6a7ed9b2a 100644 --- a/config/locales/questions/pt-PT.yml +++ b/config/locales/questions/pt-PT.yml @@ -6,131 +6,131 @@ pt-PT: activerecord: attributes: question: - answers: respostas - asked_by: perguntada por - body: conteúdo - closed: fechada - created_at: perguntada - language: língua - tags: categorias - title: título + answers: Respostas + asked_by: Feita por + body: Conteúdo + closed: Fechada + created_at: Feita + language: Língua + tags: Categorias + title: Título updated_at: actualizada updated_by: actualizada por - views: visitas - votes: votos + views: Visitas + votes: Votos models: - question: pergunta - questions: perguntas + question: Pergunta + questions: Perguntas questions: answer: - add_comment: adicionar comentário... - flag: reportar - pick_answer: escolher como solução - unset_answer: retirar como solução? + add_comment: Adicionar comentário... + flag: Reportar + pick_answer: Escolher como solução + unset_answer: Retirar como solução? create: - flash_notice: pergunta foi criada com sucesso. + flash_notice: A pergunta foi criada. edit: - title: editar pergunta + title: A editar pergunta flag: - title: reportar pergunta + title: Reportar pergunta form: - adult_content: esta pergunta envolve conteúdo para adultos. - body_tip: qual é a sua pergunta? seja descritivo. - language_tip: seleccione a língua da pergunta. - tags_tip: use categorias para fornecer mais informação sobre a sua pergunta. + adult_content: Esta pergunta envolve conteúdo para adultos. + body_tip: Qual é a sua pergunta? Seja descritivo. + language_tip: Seleccione a língua da pergunta. + tags_tip: Use categorias para fornecer mais informação sobre a sua pergunta. index: - active: activas - active_tooltip: perguntas actualizadas recentemente - ask_question: fazer pergunta - empty: ainda ninguém fez nenhuma pergunta, seja o primeiro! - help_to_answer: ajude-nos a responder - hot: populares - hot_tooltip: perguntas com mais actividade nos últimos 5 dias - newest: mais recentes - newest_tooltip: perguntas mais recentes - oldest: mais antigas - title: todas as perguntas - unanswered_questions: perguntas sem resposta - votes: votos - votes_tooltip: perguntas com mais votos + active: Activas + active_tooltip: Perguntas actualizadas recentemente + ask_question: Fazer pergunta + empty: Ainda ninguém fez nenhuma pergunta. Seja o primeiro! + help_to_answer: Ajude-nos a responder + hot: Populares + hot_tooltip: Perguntas com maior actividade dos últimos 5 dias + newest: Mais recentes + newest_tooltip: Perguntas mais recentes + oldest: Mais antigas + title: Todas as perguntas + unanswered_questions: Perguntas sem resposta + votes: Votos + votes_tooltip: Perguntas com mais votos model: messages: empty_tags: Desculpe, tem de usar pelo menos uma categoria. - title_too_long: O título é demasiado longo; não pode conter mais do que 100 caracteres + title_too_long: O título é demasiado longo. Não pode conter mais do que 100 caracteres. too_many_tags: Desculpe, mas só pode introduzir até 9 categorias. - too_short: parece demasiado curta. Use mais do que %{count} palavras para ser mais específico. + too_short: Parece demasiado curta. Use mais do que %{count} palavras para ser mais específico. move: - group_label: "mover para o grupo com o slug:" - submit: mover! - title: "mover a pergunta: %{title}" + group_label: "Mover para o grupo:" + submit: Mover! + title: "Mover a pergunta: %{title}" move_to: - group_dont_exists: o grupo %{group} não existe - success: pergunta movida para o grupo %{group} + group_dont_exists: O grupo %{group} não existe + success: Pergunta movida para o grupo %{group} new: - how_to_ask: como perguntar - title: fazer pergunta + how_to_ask: Como perguntar + title: Fazer pergunta question: accepted_tooltip: Esta pergunta tem uma resposta que foi aceite retag: - title: recategorizar + title: Recategorizar retag_form: - cancel: cancelar - submit: actualizar categorias! + cancel: Cancelar + submit: Actualizar categorias! title: Actualizar categorias retag_to: failure: Desculpe, não foi possível actualizar as categorias. - success: As categorias foram actualizadas com sucesso. + success: As categorias foram actualizadas. revert: - title: reverter a pergunta + title: Reverter a pergunta shared: - flag: reportar + flag: Reportar show: - accepted_tooltip: uma das respostas foi aceite como sendo a resposta correcta - another_answers: outras respostas - answers: respostas + accepted_tooltip: Uma das respostas foi aceite como sendo a resposta correcta. + another_answers: Outras respostas + answers: Respostas answers_title: one: "%{count} resposta" other: "%{count} respostas" asked_on: colocada a - ban: banir - close: fechar - close_reason: "a pergunta foi fechada pelo seguinte motivo:" - favorite_tooltip: adicionar esta pergunta às suas favoritas - flag: reportar - flagged_as: reportada como - flags: reportada como - last_activity: última actividade - related_questions: perguntas relacionadas - request_closing: pedir encerramento - request_closing_details: pedido para fechar esta pergunta - retag: recategorizar - retract_request: já colocou um pedido; deseja retirá-lo? - share: partilhar esta pergunta em - share_on: partilhar esta pergunta em %{site} - solution: solução + ban: Banir + close: Fechar + close_reason: "A pergunta foi fechada pelo seguinte motivo:" + favorite_tooltip: Adicionar esta pergunta às suas favoritas + flag: Reportar + flagged_as: Reportada como + flags: Reportada como + last_activity: Actividade mais recente + related_questions: Perguntas relacionadas + request_closing: Pedir encerramento + request_closing_details: Pedir para fechar esta pergunta + retag: Recategorizar + retract_request: Já colocou um pedido. Quer retirá-lo? + share: Partilhar esta pergunta em + share_on: Partilhar esta pergunta em %{site} + solution: Solução to_answer_question: para responder a esta pergunta - unauthenticated_retag: precisa de ter uma conta para recategorizar perguntas - unfavorite_tooltip: remover esta pergunta das suas favoritas - unwatch_tooltip: deixar de vigiar esta pergunta + unauthenticated_retag: Precisa de uma conta para recategorizar perguntas + unfavorite_tooltip: Remover esta pergunta das suas favoritas + unwatch_tooltip: Deixar de vigiar esta pergunta viewed: visitada - watch_tooltip: vigiar esta pergunta + watch_tooltip: Vigiar esta pergunta solve: - flash_notice: pergunta foi resolvida. + flash_notice: A pergunta foi resolvida. tags: - filter: pesquisar categorias - title: categorias - tooltip: mostrar perguntas na categoria %{tag} + filter: Pesquisar categorias + title: Categorias + tooltip: Mostrar perguntas na categoria %{tag} unanswered: - empty: este grupo não contém perguntas sem resposta. - expert: peritos - my_tags: as minhas categorias - tags: categorias sem resposta - title: perguntas sem resposta + empty: Este grupo não contém perguntas sem resposta. + expert: Peritos + my_tags: As minhas categorias + tags: Categorias sem respostas + title: Perguntas sem resposta unsolve: - flash_notice: pergunta agora não está resolvida. + flash_notice: A pergunta deixou de estar resolvida. unwatch: - success: deixará de receber notificações por correio por cada nova resposta a esta pergunta + success: Deixará de receber notificações por correio electrónico por cada nova resposta a esta pergunta. update: - flash_notice: pergunta foi actualizada com sucesso. + flash_notice: A pergunta foi actualizada. watch: - success: a partir de agora receberá notificações por correio a cada nova resposta a esta pergunta + success: Passará a receber notificações por correio electrónico a cada nova resposta a esta pergunta. diff --git a/config/locales/searches/pt-PT.yml b/config/locales/searches/pt-PT.yml index e847e305c..2f335f362 100644 --- a/config/locales/searches/pt-PT.yml +++ b/config/locales/searches/pt-PT.yml @@ -1,13 +1,14 @@ # Messages for Portuguese (Português) # Exported from translatewiki.net # Export driver: syck +# Author: Hamilton Abreu pt-PT: searches: form: - clear: clear - search_box_title: Check whether your question already have asked - tags_tip: use [tag] to specify tags. + clear: Limpar + search_box_title: Verifique se a sua pergunta já foi feita + tags_tip: Use [tag] para especificar categorias. index: - empty: your search returned no matches. - search_text: questions containing - tags: within these tags + empty: A sua pesquisa não produziu resultados. + search_text: Perguntas que contêm + tags: com estas categorias diff --git a/config/locales/sessions/br.yml b/config/locales/sessions/br.yml index e6cd50b9a..280e9b1a3 100644 --- a/config/locales/sessions/br.yml +++ b/config/locales/sessions/br.yml @@ -13,5 +13,8 @@ br: not_registered: N'oc'h ket enrollet c'hoazh ? registered: Enrollet oc'h dija ? remember_me: Derc'hel soñj ac'hanon + sign_in: Kevreañ signup: En em enskrivañ + with_facebook: Kevreañ gant Facebook with_openid: Kevreañ gant openid + with_twitter: Kevreañ gant Twitter diff --git a/config/locales/sessions/en.yml b/config/locales/sessions/en.yml index d0dd5262c..7a9f6069a 100644 --- a/config/locales/sessions/en.yml +++ b/config/locales/sessions/en.yml @@ -2,17 +2,17 @@ en: sessions: create: flash_notice: "Logged in successfully" - flash_error: "Couldn't log you in as '%{login}'" + flash_error: "Could not log you in as '%{login}'" destroy: flash_notice: "You have been logged out." new: - with_openid: Log in with openid - with_facebook: "Sign in with facebook" - with_twitter: "Sign in with twitter" + with_openid: Log in with OpenID + with_facebook: "Sign in with Facebook" + with_twitter: "Sign in with Twitter" with_authentication: Log in with our authentication system registered: "Already registered?" not_registered: "Not registered yet?" log_in: Login signup: Sign up sign_in: Sign in - remember_me: Remember me \ No newline at end of file + remember_me: Remember me diff --git a/config/locales/sessions/ko.yml b/config/locales/sessions/ko.yml index a5d53da5e..4c5b575a7 100644 --- a/config/locales/sessions/ko.yml +++ b/config/locales/sessions/ko.yml @@ -13,6 +13,8 @@ ko: log_in: 로그인 not_registered: 아직 등록하지 않았나요? registered: 이미 등록하셨나요? + remember_me: 자동 로그인 + sign_in: 로그인 signup: 가입 with_authentication: 우리의 인증 시스템으로 로그인 with_facebook: 페이스북으로 로그인 diff --git a/config/locales/sessions/pt-PT.yml b/config/locales/sessions/pt-PT.yml index 63892c223..4515554bf 100644 --- a/config/locales/sessions/pt-PT.yml +++ b/config/locales/sessions/pt-PT.yml @@ -5,18 +5,18 @@ pt-PT: sessions: create: - flash_error: não foi possível entrar com '%{login}' - flash_notice: inicio de sessão efectuado com sucesso + flash_error: Não foi possível iniciar sessão como '%{login}' + flash_notice: Sessão iniciada destroy: - flash_notice: a sua sessão foi terminada. + flash_notice: A sua sessão foi terminada. new: - log_in: entrar - not_registered: ainda não se registou? - registered: já registado? + log_in: Entrar + not_registered: Ainda não se registou? + registered: Já está registado? remember_me: Recordar os meus dados sign_in: Entrar - signup: registar - with_authentication: entrar com o nosso sistema de autenticação - with_facebook: sign in with facebook - with_openid: entrar com openid - with_twitter: sign in with twitter + signup: Registar + with_authentication: Entrar com o nosso sistema de autenticação + with_facebook: Entrar com conta do Facebook + with_openid: Entrar com OpenID + with_twitter: Entrar com conta do Twitter diff --git a/config/locales/shared/br.yml b/config/locales/shared/br.yml new file mode 100644 index 000000000..b39ae7796 --- /dev/null +++ b/config/locales/shared/br.yml @@ -0,0 +1,9 @@ +# Messages for Breton (Brezhoneg) +# Exported from translatewiki.net +# Export driver: syck +# Author: Y-M D +br: + shared: + topbar: + logged_as: Kevreet evel %{login} + user_page: Ma zammig pajenn diff --git a/config/locales/shared/nb.yml b/config/locales/shared/nb.yml index 248abd9ba..e02f1952b 100644 --- a/config/locales/shared/nb.yml +++ b/config/locales/shared/nb.yml @@ -2,7 +2,7 @@ # Exported from translatewiki.net # Export driver: syck # Author: Nghtwlkr -"no": +nb: shared: current_tags: title: Valgte merker diff --git a/config/locales/shared/ps.yml b/config/locales/shared/ps.yml new file mode 100644 index 000000000..60254318f --- /dev/null +++ b/config/locales/shared/ps.yml @@ -0,0 +1,9 @@ +# Messages for Pashto (پښتو) +# Exported from translatewiki.net +# Export driver: syck +# Author: Ahmed-Najib-Biabani-Ibrahimkhel +ps: + shared: + topbar: + admin: پازوال + user_page: زما پاڼه diff --git a/config/locales/shared/pt-PT.yml b/config/locales/shared/pt-PT.yml index 6910696c2..38700d80a 100644 --- a/config/locales/shared/pt-PT.yml +++ b/config/locales/shared/pt-PT.yml @@ -1,11 +1,12 @@ # Messages for Portuguese (Português) # Exported from translatewiki.net # Export driver: syck +# Author: Hamilton Abreu pt-PT: shared: current_tags: - title: selected tags + title: Categorias seleccionadas topbar: - admin: gerir - logged_as: logged in as %{login} - user_page: my page + admin: Administrar + logged_as: Iniciou sessão como %{login} + user_page: A minha página diff --git a/config/locales/unfavorites/br.yml b/config/locales/unfavorites/br.yml new file mode 100644 index 000000000..7814362a8 --- /dev/null +++ b/config/locales/unfavorites/br.yml @@ -0,0 +1,12 @@ +# Messages for Breton (Brezhoneg) +# Exported from translatewiki.net +# Export driver: syck +# Author: Y-M D +br: + activerecord: + models: + favorite: Pennroll + favorites: Pennrolloù + unfavorites: + create: + success: Tennet eo bet ar goulenn d'ho pennrolloù diff --git a/config/locales/unfavorites/en.yml b/config/locales/unfavorites/en.yml index fb5d44c27..81f112145 100644 --- a/config/locales/unfavorites/en.yml +++ b/config/locales/unfavorites/en.yml @@ -7,4 +7,4 @@ en: activerecord: models: favorites: Favorites - favorite: Favorite \ No newline at end of file + favorite: Favorite diff --git a/config/locales/unfavorites/nb.yml b/config/locales/unfavorites/nb.yml index 76bd14896..844f05895 100644 --- a/config/locales/unfavorites/nb.yml +++ b/config/locales/unfavorites/nb.yml @@ -2,7 +2,7 @@ # Exported from translatewiki.net # Export driver: syck # Author: Nghtwlkr -"no": +nb: activerecord: models: favorite: Favoritt diff --git a/config/locales/unfavorites/pt-PT.yml b/config/locales/unfavorites/pt-PT.yml index 55cae2421..2f3079484 100644 --- a/config/locales/unfavorites/pt-PT.yml +++ b/config/locales/unfavorites/pt-PT.yml @@ -1,12 +1,13 @@ # Messages for Portuguese (Português) # Exported from translatewiki.net # Export driver: syck +# Author: Hamilton Abreu pt-PT: activerecord: models: - favorite: favorite - favorites: favorites + favorite: Favorita + favorites: Favoritas unfavorites: create: - success: the question has been removed from your favorities - unauthenticated: you need an account to remove a favorite + success: A pergunta foi removida das suas favoritas + unauthenticated: Precisa de uma conta para remover uma favorita diff --git a/config/locales/users/de.yml b/config/locales/users/de.yml index 76d2d4730..31f36ee9d 100644 --- a/config/locales/users/de.yml +++ b/config/locales/users/de.yml @@ -39,7 +39,7 @@ de: edit_others_posts: Bearbeite Beiträge anderer edit_wiki_post: Beiträge im Wiki bearbeiten flag: Kennzeichnen - retag_others_questions: Markiere die Fragen anderer + retag_others_questions: Ändere die Stichwörter von Fragen anderer vote_down: Abwerten vote_to_close_any_question: Beantrage die Beendigung einer beliebigen Frage vote_to_close_own_question: Beantrage die Beendigung einer eigenen Frage @@ -81,9 +81,9 @@ de: submit: Anmeldung title: Anmeldung als Nutzer show: - follow: Folgen + follow: Beachten title: Nutzer %{user} - unfollow: Nicht mehr folgen + unfollow: Nicht mehr beachten views: Ansichten unfollow: flash_notice: Nutzer %{Nutzer} , die nicht mehr zu Ihren Freunden gehören diff --git a/config/locales/users/en.yml b/config/locales/users/en.yml index fd6995413..a8e382cb3 100644 --- a/config/locales/users/en.yml +++ b/config/locales/users/en.yml @@ -2,7 +2,7 @@ en: users: index: title: All users - empty: "This group doesn't have any members, participate to join this group." + empty: "This group does not have any members. Participate by joining this group." filter: "Search for users" reputation: Reputation newest: Newest @@ -18,7 +18,7 @@ en: edit: title: Settings submit: Save - enable_twitter: Enable your facebook or twitter accounts + enable_twitter: Enable your Facebook or Twitter accounts show: title: "User %{user}" follow: Follow @@ -31,15 +31,15 @@ en: form: information: Information notifications: Notifications - new_answer_notification: Get mail notifications for new answers + new_answer_notification: Get email notifications for new answers give_advice_notification: Receive email notifications about questions in your field of expertise activities_notification: Receive email notifications about system activities such as earned badges, new followers, etc. reports_notification: Receive a report with latest group activity (only for group admins) - avatar_tip: "Change your profile image using gravatar" + avatar_tip: "Change your profile image using Gravatar" show_more_lang: "Show more languages" create: flash_notice: "Thanks for signing up!" - flash_error: "We couldn't set up that account, sorry. please try again, or contact an admin (link is above)." + flash_error: "Sorry, we could not set up that account. Please try again, or contact an administrator (link is above)." messages: errors: reputation_needed: "You need a reputation of %{min_reputation} to %{action}" diff --git a/config/locales/users/es-419.yml b/config/locales/users/es-419.yml index 164407034..1eb89cd27 100644 --- a/config/locales/users/es-419.yml +++ b/config/locales/users/es-419.yml @@ -2,6 +2,7 @@ # Exported from translatewiki.net # Export driver: syck # Author: Crazymadlover +# Author: Patcito es-419: activerecord: attributes: @@ -60,6 +61,7 @@ es-419: new_answer_notification: obtener notificaciones via correo electrónico de nuevas respuestas notifications: notificaciones reports_notification: recibir un reporte con las ultimas actividades del grupo (solo para administradores de grupo) + show_more_lang: Mostrar más idiomas index: empty: este grupo no tiene miembros, participe para unirse a este grupo. filter: Busca usuarios diff --git a/config/locales/users/es.yml b/config/locales/users/es.yml index 0aa020f65..209bd9fd0 100644 --- a/config/locales/users/es.yml +++ b/config/locales/users/es.yml @@ -2,6 +2,7 @@ # Exported from translatewiki.net # Export driver: syck # Author: Crazymadlover +# Author: Patcito es: activerecord: attributes: @@ -60,6 +61,7 @@ es: new_answer_notification: obtener notificaciones via correo electrónico de nuevas respuestas notifications: notificaciones reports_notification: recibir un reporte con las ultimas actividades del grupo (solo para administradores de grupo) + show_more_lang: Mostrar más idiomas index: empty: este grupo no tiene miembros, participe para unirse a este grupo. filter: Busca usuarios diff --git a/config/locales/users/fr.yml b/config/locales/users/fr.yml index dbfa6e052..8e0c17eec 100644 --- a/config/locales/users/fr.yml +++ b/config/locales/users/fr.yml @@ -1,6 +1,7 @@ # Messages for French (Français) # Exported from translatewiki.net # Export driver: syck +# Author: Patcito # Author: Peter17 fr: activerecord: @@ -60,6 +61,7 @@ fr: new_answer_notification: obtenir des notifications via email de nouvelles réponses notifications: notifications reports_notification: recevoir un rapport avec les dernières activités du groupes (juste pour l'admin du groupe) + show_more_lang: Afficher plus de langues index: empty: ce groupe n'a pas de membres pour l'instant, participer pour en devenir un. filter: Recherchez des utilisateurs diff --git a/config/locales/users/gl.yml b/config/locales/users/gl.yml index 72e97dc73..62166e4de 100644 --- a/config/locales/users/gl.yml +++ b/config/locales/users/gl.yml @@ -60,6 +60,7 @@ gl: new_answer_notification: Recibir notificacións por correo electrónico sobre novas respostas notifications: Notificacións reports_notification: Recibir un informe coas últimas actividades do grupo (soamente para o administrador do grupo) + show_more_lang: Mostrar máis linguas index: empty: Este grupo aínda non conta con ningún membro. Únase a el. filter: Procurar usuarios diff --git a/config/locales/users/ko.yml b/config/locales/users/ko.yml index a0e29f7df..2fab02fd3 100644 --- a/config/locales/users/ko.yml +++ b/config/locales/users/ko.yml @@ -8,6 +8,7 @@ ko: user: activated_at: activated at activation_code: activation code + age: 나이 asked_by: 질문자 avatar: 프로필 이미지 birthday: 생일 @@ -59,6 +60,7 @@ ko: new_answer_notification: 새로운 답변을 메일로 받음 notifications: 알림 reports_notification: 최신 그룹 활동 보고서를 받음 (그룹 관리자만) + show_more_lang: 다른 언어 index: empty: 이 그룹은 회원이 없습니다. 이 그룹에 가입하세요. filter: 사용자 검색 @@ -81,5 +83,6 @@ ko: follow: follow title: 사용자 %{user} unfollow: unfollow + views: 보기 unfollow: flash_notice: 사용자  %{user}를 벗에서 삭제하였습니다 diff --git a/config/locales/users/mk.yml b/config/locales/users/mk.yml index 0651b0e28..432a86895 100644 --- a/config/locales/users/mk.yml +++ b/config/locales/users/mk.yml @@ -60,6 +60,7 @@ mk: new_answer_notification: добивање на соопштенија по е-пошта за нови одговори notifications: соопштенија reports_notification: добивање на извештај за најновите активности во групата (само за администратори на групи) + show_more_lang: Покажи повеќе јазици index: empty: оваа група нема членови. Учествувајте за да се зачлените во групава. filter: пребарај корисници diff --git a/config/locales/users/pt-PT.yml b/config/locales/users/pt-PT.yml index ec9efc9d0..16604677a 100644 --- a/config/locales/users/pt-PT.yml +++ b/config/locales/users/pt-PT.yml @@ -7,81 +7,82 @@ pt-PT: attributes: user: activated_at: activado em - activation_code: código de activação + activation_code: Código de activação age: Idade - asked_by: perguntado por - avatar: Profile image - birthday: Birthday + asked_by: feita por + avatar: Imagem do perfil + birthday: Data de nascimento created_at: registado - current_password: palavra-passe actual - email: endereço de e-mail - fullname: nome completo - hide_country: Do not display my country - language: língua - language_filter: filter by language + current_password: Palavra-chave actual + email: Correio electrónico + fullname: Nome completo + hide_country: Não mostrar o meu país + language: Língua + language_filter: Filtrar por língua last_logged_at: visto - login: nome de utilizador - name: nome real - password: palavra-passe - password_confirmation: confirmação da palavra-passe - preferred_languages: seleccione os idiomas que conhece - preferred_tags: etiquetas preferidas - reputation: reputação - timezone: localização + login: Nome de utilizador + name: Nome verdadeiro + password: Palavra-chave + password_confirmation: Confirmação da palavra-chave + preferred_languages: Seleccione as línguas que conhece + preferred_tags: Categorias preferidas + reputation: Reputação + timezone: Localização updated_at: actualizado em - website: Website + website: Site na internet models: - user: utilizador - users: utilizadores + user: Utilizador + users: Utilizadores users: actions: - edit_others_posts: edit other's posts - edit_wiki_post: edit wiki posts - flag: flag - retag_others_questions: retag others questions - vote_down: vote down + edit_others_posts: Editar publicações de outros + edit_wiki_post: Editar publicações wiki + flag: Reportar + retag_others_questions: Recategorizar perguntas de outros + vote_down: Voto negativo vote_to_close_any_question: request closing any question - vote_to_close_own_question: request closing own question - vote_up: vote up + vote_to_close_own_question: Pedir encerramento de uma pergunta própria + vote_up: Voto positivo create: - flash_error: pedimos desculpa mas não pudemos criar essa conta. por favor tente novamente ou contacte um administrador (a ligação está acima). - flash_notice: obrigado por registar-se! + flash_error: Desculpe, não foi possível criar essa conta. Tente novamente ou contacte um administrador (link está acima), por favor. + flash_notice: Obrigado por se registar! edit: - enable_twitter: Enable your facebook or twitter accounts - submit: gravar - title: preferências + enable_twitter: Activar as suas contas no Facebook ou no Twitter + submit: Gravar + title: Definições follow: - flash_notice: The user %{user} was added to your friends + flash_notice: O utilizador %{user} foi adicionado aos seus amigos form: - activities_notification: receive email notifications about system activities such as earned badges, new followers, etc. - avatar_tip: change your profile image using gravatar - give_advice_notification: receive email notifications about questions in your field of expertise - information: informação - new_answer_notification: receber notificações via email de novas respostas - notifications: notificações - reports_notification: receive a report with latest group activity (only for group admins) + activities_notification: Receber notificações por correio electrónico de actividades como atribuições de distintivos, novos seguidores, etc. + avatar_tip: Alterar a imagem do perfil usando o Gravatar + give_advice_notification: Receber notificações por correio electrónico de perguntas na sua área de especialidade + information: Informação + new_answer_notification: Receber notificações por correio electrónico das novas respostas + notifications: Notificações + reports_notification: Receber um relatório das actividades mais recentes do grupo (só para administradores de grupos) + show_more_lang: Mostrar mais línguas index: - empty: este grupo não tem nenhum membro, participa para te juntares a este grupo. - filter: search for users - name: name - name_tooltip: users sorted alphabetically - newest: newest - newest_tooltip: users who just joined - oldest: oldest - oldest_tooltip: users who were the first to join - reputation: reputation - reputation_tooltip: users sorted by higher reputation - title: todos os utilizadores + empty: Este grupo não tem membros. Participe, aderindo a este grupo. + filter: Pesquisar utilizadores + name: Nome + name_tooltip: Utilizadores por ordem alfabética + newest: Mais recentes + newest_tooltip: Utilizadores que acabam de aderir + oldest: Mais antigos + oldest_tooltip: Utilizadores que foram os primeiros a aderir + reputation: Reputação + reputation_tooltip: Utilizadores por ordem decrescente de reputação + title: Todos os utilizadores messages: errors: - reputation_needed: you need a reputation of %{min_reputation} to %{action} + reputation_needed: Precisa de ter uma reputação mínima de %{min_reputation} para %{action} new: - submit: registar - title: registar-se como novo utlizador + submit: Registar + title: Registar-se como novo utilizador show: - follow: follow - title: User %{user} - unfollow: unfollow + follow: Seguir + title: Utilizador %{user} + unfollow: Deixar de seguir views: visitas unfollow: - flash_notice: The user %{user} was removed from your friends + flash_notice: O utilizador %{user} foi removido dos seus amigos diff --git a/config/locales/users/ru.yml b/config/locales/users/ru.yml index 4258c452c..6eab1ead3 100644 --- a/config/locales/users/ru.yml +++ b/config/locales/users/ru.yml @@ -3,6 +3,7 @@ # Export driver: syck # Author: Eleferen # Author: Lockal +# Author: Александр Сигачёв ru: activerecord: attributes: @@ -61,6 +62,7 @@ ru: new_answer_notification: Получать почтовые уведомления о новых ответах notifications: Уведомления reports_notification: Получать отчёт о последних действиях в группе (только для администраторов групп) + show_more_lang: Другие языки index: empty: Эта группа пуста, примите участие для присоединения к ней. filter: Поиск пользователей diff --git a/config/locales/votes/en.yml b/config/locales/votes/en.yml index cc8e30fb8..2fab955be 100644 --- a/config/locales/votes/en.yml +++ b/config/locales/votes/en.yml @@ -1,9 +1,9 @@ en: votes: create: - flash_notice: "Thanks voting!" + flash_notice: "Thanks for voting!" flash_error: "You cannot vote this" - unauthenticated: "Anonymous users can't vote" + unauthenticated: "Anonymous users cannot vote" destroy: flash_notice: "Your vote has been revoked successfully." control: diff --git a/config/locales/votes/pt-PT.yml b/config/locales/votes/pt-PT.yml index 007d00569..b41c5ea6f 100644 --- a/config/locales/votes/pt-PT.yml +++ b/config/locales/votes/pt-PT.yml @@ -1,24 +1,25 @@ # Messages for Portuguese (Português) # Exported from translatewiki.net # Export driver: syck +# Author: Hamilton Abreu pt-PT: activerecord: models: - vote: voto - votes: votos + vote: Voto + votes: Votos votes: control: - have_voted_down: click to undo your down vote - have_voted_up: click to undo your up vote - to_vote_down: click to vote down - to_vote_up: click to vote up + have_voted_down: Clique para desfazer o voto negativo + have_voted_up: Clique para desfazer o voto positivo + to_vote_down: Clique para votar negativamente + to_vote_up: Clique para votar positivamente create: - flash_error: não pode votar isto - flash_notice: obrigado pelo seu voto! - unauthenticated: utilizadores anónimos não podem votar + flash_error: Não pode votar aqui + flash_notice: Obrigado pelo seu voto! + unauthenticated: Utilizadores anónimos não podem votar destroy: - flash_notice: your vote has been revoked successfully. + flash_notice: O seu voto foi revogado. model: messages: - closed_question: you cannot vote on any posts belonging to a closed question - vote_down_comment: comments cannot be voted down + closed_question: Não pode votar as mensagens que pertencem a uma pergunta fechada + vote_down_comment: Não pode votar negativamente um comentário diff --git a/config/locales/welcome/en.yml b/config/locales/welcome/en.yml index af346d9ab..00eeb2982 100644 --- a/config/locales/welcome/en.yml +++ b/config/locales/welcome/en.yml @@ -37,7 +37,7 @@ en: title: Send your feedback feedback_title: Title feedback_description: Description - email_description: Please, provide your email address so we can answer your message + email_description: Please provide your email address so we can answer your message captcha_error: Please, solve a simple math operation index: hot: Hot diff --git a/config/locales/welcome/pt-PT.yml b/config/locales/welcome/pt-PT.yml index 50c58f39a..39e86f225 100644 --- a/config/locales/welcome/pt-PT.yml +++ b/config/locales/welcome/pt-PT.yml @@ -5,16 +5,16 @@ pt-PT: welcome: confirm_age: - notice: You may only enter this Website if you are at least 18 years of age, or at least the age of majority in the jurisdiction where you reside or from which you access this page. - over_18: I am over 18 - under_18: I am under 18 - warning: "WARNING: This page may contain explicit adult material." + notice: Só pode entrar neste site se tiver pelo menos 18 anos de idade, ou se tiver atingido a maioridade na jurisdição onde reside ou de onde está a aceder a esta página. + over_18: Tenho mais de 18 anos + under_18: Tenho menos de 18 anos + warning: "AVISO: Esta página pode ter conteúdo explícito, para adultos." facts: features: cols: adaptable: adaptável foss: livre/código aberto - joel: farei joel mais rico? + joel: vou tornar o joel mais rico? multilanguage: multilínguas multitopic: multi-tópicos shapado: @@ -31,26 +31,26 @@ pt-PT: multitopic: não prices: cols: - onsite: no seu sítio web + onsite: no seu site shapado: large: aproximadamente $500 - medium: <=== igual - onsite: $0 no seu servidor duh - small: aproximadamente $50 to $100/mês na maioria dos provedores de alojamento + medium: <=== concordo + onsite: aproximadamente $0 no seu servidor + small: aproximadamente de $50 a $100/mês na maior parte dos servidores de alojamento stackexchange: large: $1299/mês medium: $999/mês onsite: $2500/mês small: $129/mês feedback: - captcha_error: please, solve a simple math operation - email_description: please, provie your email so we can answer your message - feedback_description: description - feedback_title: title - title: send your feedback + captcha_error: Resolva um cálculo matemático simples, por favor + email_description: Forneça o seu endereço de correio electrónico para podermos responder à sua mensagem + feedback_description: Descrição + feedback_title: Título + title: Enviar o seu comentário index: - active: activo - create_own_site: Create your own Q&A site in 8 seconds for free - hot: popular - quick_question: ask a question, we will find someone to answer - recent_questions: perguntas recentes + active: Activo + create_own_site: Crie o seu próprio site de perguntas e respostas em 8 segundos, grátis + hot: Popular + quick_question: Faça uma pergunta, encontraremos quem a responda + recent_questions: Perguntas recentes diff --git a/config/locales/widgets/en.yml b/config/locales/widgets/en.yml index 10a4c4324..c39fa074f 100644 --- a/config/locales/widgets/en.yml +++ b/config/locales/widgets/en.yml @@ -5,7 +5,7 @@ en: description: Use the arrows to move your widgets badges: title: Recent badges - description: "This widget display recent badges earned by users or questions" + description: "This widget displays recent badges earned by users or questions" groups: title: Recent groups description: "This widget displays the latest groups" @@ -14,10 +14,10 @@ en: description: "This widget displays the top five groups" top_users: title: Top 5 users - description: "This widget displays top five users" + description: "This widget displays the top five users" users: title: Recent users - description: "This widget displays new registered members" + description: "This widget displays newly registered members" tag_cloud: title: Tag cloud description: "This widget displays a tag cloud" diff --git a/config/locales/wiki/be-TARASK.yml b/config/locales/wiki/be-TARASK.yml index dc92eb09c..b146d3d53 100644 --- a/config/locales/wiki/be-TARASK.yml +++ b/config/locales/wiki/be-TARASK.yml @@ -2,7 +2,7 @@ # Exported from translatewiki.net # Export driver: syck # Author: Wizardist -be-tarask: +be-TARASK: wiki: actions: all_history: Назад да гісторыі diff --git a/config/locales/wiki/br.yml b/config/locales/wiki/br.yml new file mode 100644 index 000000000..55997d538 --- /dev/null +++ b/config/locales/wiki/br.yml @@ -0,0 +1,18 @@ +# Messages for Breton (Brezhoneg) +# Exported from translatewiki.net +# Export driver: syck +# Author: Y-M D +br: + wiki: + actions: + all_history: Distreiñ d'an istor + back_to_question: distreiñ d'ar goulenn + show_diff: keñveriañ ar stummoù diuzet + history: + current_version: Stumm red + previous_versions: Stummoù kent + title: istor ({{count}}) + version: stumm + model: + attributes: + message: Diverradur diff --git a/config/locales/wiki/en.yml b/config/locales/wiki/en.yml index 2a1d382f6..5b6f2fc92 100644 --- a/config/locales/wiki/en.yml +++ b/config/locales/wiki/en.yml @@ -12,7 +12,7 @@ en: revert: Revert to this version show_diff: Compare selected versions all_history: Back to history - back_to_question: Back to question + back_to_question: Back to the question model: attributes: message: Summary diff --git a/config/locales/wiki/pl.yml b/config/locales/wiki/pl.yml new file mode 100644 index 000000000..1b30a2111 --- /dev/null +++ b/config/locales/wiki/pl.yml @@ -0,0 +1,22 @@ +# Messages for Polish (Polski) +# Exported from translatewiki.net +# Export driver: syck +# Author: Sp5uhe +pl: + wiki: + actions: + all_history: Powrót do historii + back_to_question: Wróć do pytania + revert: Przywróć tę wersję + show_diff: Porównaj wybrane wersje + diff: + title: Różnice pomiędzy %{prev} i %{curr} + history: + current_version: Aktualna wersja + previous_versions: Poprzednie wersje + title: Historia (%{count}) + version: Wersja + version_summary: Podsumowanie wersji + model: + attributes: + message: Podsumowanie diff --git a/lib/support/voteable.rb b/lib/support/voteable.rb index 20bc8c89f..382707098 100644 --- a/lib/support/voteable.rb +++ b/lib/support/voteable.rb @@ -12,10 +12,7 @@ def self.included(klass) module InstanceMethods def add_vote!(v, voter) - self.collection.update({:_id => self._id}, {:$inc => {:votes_count => 1, - :votes_average => v.to_i}}, - :upsert => true, - :safe => true) + self.increment({:votes_count => 1, :votes_average => v.to_i}) if v > 0 self.user.upvote!(self.group) else @@ -25,10 +22,7 @@ def add_vote!(v, voter) end def remove_vote!(v, voter) - self.collection.update({:_id => self._id}, {:$inc => {:votes_count => -1, - :votes_average => (-v)}}, - :upsert => true) - + self.increment({:votes_count => -1, :votes_average => (-v)}) if v > 0 self.user.upvote!(self.group, -1) else diff --git a/lib/tasks/fixdb.rake b/lib/tasks/fixdb.rake index f7921e177..9f0834a8d 100644 --- a/lib/tasks/fixdb.rake +++ b/lib/tasks/fixdb.rake @@ -87,5 +87,24 @@ namespace :fixdb do "authentication_token" => UUIDTools::UUID.random_create.hexdigest}) end end + + task :reputation_rewards => :environment do + Group.find_each do |g| + [["vote_up_question", "undo_vote_up_question"], + ["vote_down_question", "undo_vote_down_question"], + ["question_receives_up_vote", "question_undo_up_vote"], + ["question_receives_down_vote", "question_undo_down_vote"], + ["vote_up_answer", "undo_vote_up_answer"], + ["vote_down_answer", "undo_vote_down_answer"], + ["answer_receives_up_vote", "answer_undo_up_vote"], + ["answer_receives_down_vote", "answer_undo_down_vote"], + ["answer_picked_as_solution", "answer_unpicked_as_solution"]].each do |action, undo| + if g.reputation_rewards[action] > (g.reputation_rewards[undo]*-1) + print "fixing #{g.name} #{undo} reputation rewards\n" + g.set("reputation_rewards.#{undo}" => g.reputation_rewards[action]*-1) + end + end + end + end end diff --git a/vendor/gems/devise-1.0.7/.gitignore b/vendor/gems/devise-1.0.7/.gitignore deleted file mode 100644 index 0937f9db0..000000000 --- a/vendor/gems/devise-1.0.7/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -**/*/log/* -**/*/tmp/* -*~ -coverage/* -*.sqlite3 -rdoc/* -pkg diff --git a/vendor/gems/devise-1.0.7/.specification b/vendor/gems/devise-1.0.7/.specification deleted file mode 100644 index e69de29bb..000000000 diff --git a/vendor/gems/devise-1.0.7/CHANGELOG.rdoc b/vendor/gems/devise-1.0.7/CHANGELOG.rdoc deleted file mode 100644 index e1a9df614..000000000 --- a/vendor/gems/devise-1.0.7/CHANGELOG.rdoc +++ /dev/null @@ -1,378 +0,0 @@ -== 1.0.7 - -* bug fix - * Ensure password confirmation is always required - -* deprecations - * authenticatable was deprecated and renamed to database_authenticatable - * confirmable is not included by default on generation - -== 1.0.6 - -* bug fix - * Do not allow unlockable strategies based on time to access a controller. - * Do not send unlockable email several times. - * Allow controller to upstram custom! failures to Warden. - -== 1.0.5 - -* bug fix - * Use prepend_before_filter in require_no_authentication. - * require_no_authentication on unlockable. - * Fix a bug when giving an association proxy to devise. - * Do not use lock! on lockable since it's part of ActiveRecord API. - -== 1.0.4 - -* bug fix - * Fixed a bug when deleting an account with rememberable - * Fixed a bug with custom controllers - -== 1.0.3 - -* enhancements - * HTML e-mails now have proper formatting - * Do not remove MongoMapper options in find - -== 1.0.2 - -* enhancements - * Allows you set mailer content type (by github.com/glennr) - -* bug fix - * Uses the same content type as request on http authenticatable 401 responses - -== 1.0.1 - -* enhancements - * HttpAuthenticatable is not added by default automatically. - * Avoid mass assignment error messages with current password. - -* bug fix - * Fixed encryptors autoload - -== 1.0.0 - -* deprecation - * :old_password in update_with_password is deprecated, use :current_password instead - -* enhancements - * Added Registerable - * Added Http Basic Authentication support - * Allow scoped_views to be customized per controller/mailer class - * [#99] Allow authenticatable to used in change_table statements - * Add mailer_content_type configuration parameter (by github.com/glennr) - -== 0.9.2 - -* bug fix - * Ensure inactive user cannot sign in - * Ensure redirect to proper url after sign up - -* enhancements - * Added gemspec to repo - * Added token authenticatable (by github.com/grimen) - -== 0.9.1 - -* bug fix - * Allow bigger salt size (by github.com/jgeiger) - * Fix relative url root - -== 0.9.0 - -* deprecation - * devise :all is deprecated - * :success and :failure flash messages are now :notice and :alert - -* enhancements - * Added devise lockable (by github.com/mhfs) - * Warden 0.9.0 compatibility - * Mongomapper 0.6.10 compatibility - * Added Devise.add_module as hooks for extensions (by github.com/grimen) - * Ruby 1.9.1 compatibility (by github.com/grimen) - -* bug fix - * Accept path prefix not starting with slash - * url helpers should rely on find_scope! - -== 0.8.2 - -* enhancements - * Allow Devise.mailer_sender to be a proc (by github.com/grimen) - -* bug fix - * Fix bug with passenger, update is required to anyone deploying on passenger (by github.com/dvdpalm) - -== 0.8.1 - -* enhancements - * Move salt to encryptors - * Devise::Lockable - * Moved view links into partial and I18n'ed them - -* bug fix - * Bcrypt generator was not being loaded neither setting the proper salt - -== 0.8.0 - -* enhancements - * Warden 0.8.0 compatibility - * Add an easy for map.connect "sign_in", :controller => "sessions", :action => "new" to work - * Added :bcrypt encryptor (by github.com/capotej) - -* bug fix - * sign_in_count is also increased when user signs in via password change, confirmation, etc.. - * More DataMapper compatibility (by github.com/lancecarlson) - -* deprecation - * Removed DeviseMailer.sender - -== 0.7.5 - -* enhancements - * Set a default value for mailer to avoid find_template issues - * Add models configuration to MongoMapper::EmbeddedDocument as well - -== 0.7.4 - -* enhancements - * Extract Activatable from Confirmable - * Decouple Serializers from Devise modules - -== 0.7.3 - -* bug fix - * Give scope to the proper model validation - -* enhancements - * Mail views are scoped as well - * Added update_with_password for authenticatable - * Allow render_with_scope to accept :controller option - -== 0.7.2 - -* deprecation - * Renamed reset_confirmation! to resend_confirmation! - * Copying locale is part of the installation process - -* bug fix - * Fixed render_with_scope to work with all controllers - * Allow sign in with two different users in Devise::TestHelpers - -== 0.7.1 - -* enhancements - * Small enhancements for other plugins compatibility (by github.com/grimen) - -== 0.7.0 - -* deprecations - * :authenticatable is not included by default anymore - -* enhancements - * Improve loading process - * Extract SessionSerializer from Authenticatable - -== 0.6.3 - -* bug fix - * Added trackable to migrations - * Allow inflections to work - -== 0.6.2 - -* enhancements - * More DataMapper compatibility - * Devise::Trackable - track sign in count, timestamps and ips - -== 0.6.1 - -* enhancements - * Devise::Timeoutable - timeout sessions without activity - * DataMapper now accepts conditions - -== 0.6.0 - -* deprecations - * :authenticatable is still included by default, but yields a deprecation warning - -* enhancements - * Added DataMapper support - * Remove store_location from authenticatable strategy and add it to failure app - * Allow a strategy to be placed after authenticatable - * [#45] Do not rely attribute? methods, since they are not added on Datamapper - -== 0.5.6 - -* enhancements - * [#42] Do not send nil to build (DataMapper compatibility) - * [#44] Allow to have scoped views - -== 0.5.5 - -* enhancements - * Allow overwriting find for authentication method - * [#38] Remove Ruby 1.8.7 dependency - -== 0.5.4 - -* deprecations - * Deprecate :singular in devise_for and use :scope instead - -* enhancements - * [#37] Create after_sign_in_path_for and after_sign_out_path_for hooks to be - overwriten in ApplicationController - * Create sign_in_and_redirect and sign_out_and_redirect helpers - * Warden::Manager.default_scope is automatically configured to the first given scope - -== 0.5.3 - -* bug fix - * MongoMapper now converts DateTime to Time - * Ensure all controllers are unloadable - -* enhancements - * [#35] Moved friendly_token to Devise - * Added Devise.all, so you can freeze your app strategies - * Added Devise.apply_schema, so you can turn it to false in Datamapper or MongoMapper - in cases you don't want it be handlded automatically - -== 0.5.2 - -* enhancements - * [#28] Improved sign_in and sign_out helpers to accepts resources - * [#28] Added stored_location_for as a helper - * [#20] Added test helpers - -== 0.5.1 - -* enhancements - * Added serializers based on Warden ones - * Allow authentication keys to be set - -== 0.5.0 - -* bug fix - * Fixed a bug where remember me module was not working properly - -* enhancements - * Moved encryption strategy into the Encryptors module to allow several algorithms (by github.com/mhfs) - * Implemented encryptors for Clearance, Authlogic and Restful-Authentication (by github.com/mhfs) - * Added support for MongoMapper (by github.com/shingara) - -== 0.4.3 - -* bug fix - * [#29] Authentication just fails if user cannot be serialized from session, without raising errors; - * Default configuration values should not overwrite user values; - -== 0.4.2 - -* deprecations - * Renamed mail_sender to mailer_sender - -* enhancements - * skip_before_filter added in Devise controllers - * Use home_or_root_path on require_no_authentication as well - * Added devise_controller?, useful to select or reject filters in ApplicationController - * Allow :path_prefix to be given to devise_for - * Allow default_url_options to be configured through devise (:path_prefix => "/:locale" is now supported) - -== 0.4.1 - -* bug fix - * [#21] Ensure options can be set even if models were not loaded - -== 0.4.0 - -* deprecations - * Notifier is deprecated, use DeviseMailer instead. Remember to rename - app/views/notifier to app/views/devise_mailer and I18n key from - devise.notifier to devise.mailer - * :authenticable calls are deprecated, use :authenticatable instead - -* enhancements - * [#16] Allow devise to be more agnostic and do not require ActiveRecord to be loaded - * Allow Warden::Manager to be configured through Devise - * Created a generator which creates an initializer - -== 0.3.0 - -* bug fix - * [#15] Allow yml messages to be configured by not using engine locales - -* deprecations - * Renamed confirm_in to confirm_within - * [#14] Do not send confirmation messages when user changes his e-mail - * [#13] Renamed authenticable to authenticatable and added deprecation warnings - -== 0.2.3 - -* enhancements - * Ensure fail! works inside strategies - * [#12] Make unauthenticated message (when you haven't signed in) different from invalid message - -* bug fix - * Do not redirect on invalid authenticate - * Allow model configuration to be set to nil - -== 0.2.2 - -* bug fix - * [#9] Fix a bug when using customized resources - -== 0.2.1 - -* refactor - * Clean devise_views generator to use devise existing views - -* enhancements - * [#7] Create instance variables (like @user) for each devise controller - * Use Devise::Controller::Helpers only internally - -* bug fix - * [#6] Fix a bug with Mongrel and Ruby 1.8.6 - -== 0.2.0 - -* enhancements - * [#4] Allow option :null => true in authenticable migration - * [#3] Remove attr_accessible calls from devise modules - * Customizable time frame for rememberable with :remember_for config - * Customizable time frame for confirmable with :confirm_in config - * Generators for creating a resource and copy views - -* optimize - * Do not load hooks or strategies if they are not used - -* bug fixes - * [#2] Fixed requiring devise strategies - -== 0.1.1 - -* bug fixes - * [#1] Fixed requiring devise mapping - -== 0.1.0 - -* Devise::Authenticable -* Devise::Confirmable -* Devise::Recoverable -* Devise::Validatable -* Devise::Migratable -* Devise::Rememberable - -* SessionsController -* PasswordsController -* ConfirmationsController - -* Create an example app -* devise :all, :except => :rememberable -* Use sign_in and sign_out in SessionsController - -* Mailer subjects namespaced by model -* Allow stretches and pepper per model - -* Store session[:return_to] in session -* Sign user in automatically after confirming or changing it's password diff --git a/vendor/gems/devise-1.0.7/MIT-LICENSE b/vendor/gems/devise-1.0.7/MIT-LICENSE deleted file mode 100644 index 6c8f9b3cf..000000000 --- a/vendor/gems/devise-1.0.7/MIT-LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright 2009 Plataforma Tecnologia. http://blog.plataformatec.com.br - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/vendor/gems/devise-1.0.7/README.rdoc b/vendor/gems/devise-1.0.7/README.rdoc deleted file mode 100644 index 0171b664f..000000000 --- a/vendor/gems/devise-1.0.7/README.rdoc +++ /dev/null @@ -1,260 +0,0 @@ -== Devise - -Devise is a flexible authentication solution for Rails based on Warden. It: - -* Is Rack based; -* Is a complete MVC solution based on Rails engines; -* Allows you to have multiple roles (or models/scopes) signed in at the same time; -* Is based on a modularity concept: use just what you really need. - -Right now it's composed of 12 modules: - -* Database Authenticatable: responsible for encrypting password and validating authenticity of a user while signing in. -* Token Authenticatable: validates authenticity of a user while signing in using an authentication token (also known as "single access token"). -* HttpAuthenticatable: sign in users using basic HTTP authentication. -* Confirmable: responsible for verifying whether an account is already confirmed to sign in, and to send emails with confirmation instructions. -* Recoverable: takes care of reseting the user password and send reset instructions. -* Registerable: handles signing up users through a registration process. -* Rememberable: manages generating and clearing token for remember the user from a saved cookie. -* Trackable: tracks sign in count, timestamps and ip. -* Timeoutable: expires sessions without activity in a certain period of time. -* Validatable: creates all needed validations for email and password. It's totally optional, so you're able to to customize validations by yourself. -* Lockable: takes care of locking an account based on the number of failed sign in attempts. Handles unlock via expire and email. -* Activatable: if you need to activate accounts by other means, which are not through confirmation, use this module. - -There's an example application using Devise at http://github.com/plataformatec/devise_example . - -== Dependencies - -Devise is based on Warden (http://github.com/hassox/warden), a Rack Authentication Framework so you need to install it as a gem. Please ensure you have it installed in order to use devise (see installation below). - -== Installation - -Install warden gem if you don't have it installed: - - sudo gem install warden - -Install devise gem: - - sudo gem install devise --version=1.0.6 - -Configure warden and devise gems inside your app: - - config.gem 'warden' - config.gem 'devise' - -Run the generator: - - ruby script/generate devise_install - -And you're ready to go. The generator will install an initializer which describes ALL Devise's configuration options, so be sure to take a look at it and the documentation as well: - - http://rdoc.info/projects/plataformatec/devise - -If you want to use Devise with bundler on Rails 2.3, you need to follow the instructions here: - - http://github.com/carlhuda/bundler/issues/issue/83 - -== Basic Usage - -This is a walkthrough with all steps you need to setup a devise resource, including model, migration, route files, and optional configuration. You MUST also check out the *Generators* section below to help you start. - -Devise must be set up within the model (or models) you want to use, and devise routes must be created inside your config/routes.rb file. - -We're assuming here you want a User model with some modules, as outlined below: - - class User < ActiveRecord::Base - devise :database_authenticatable, :confirmable, :recoverable, :rememberable, :trackable, :validatable - end - -After you choose which modules to use, you need to setup your migrations. Luckily, devise has some helpers to save you from this boring work: - - create_table :users do |t| - t.database_authenticatable - t.confirmable - t.recoverable - t.rememberable - t.trackable - t.timestamps - end - -Remember that Devise don't rely on _attr_accessible_ or _attr_protected_ inside its modules, so be sure to setup what attributes are accessible or protected in your model. - -The next setup after setting up your model is to configure your routes. You do this by opening up your config/routes.rb and adding: - - map.devise_for :users - -This is going to look inside you User model and create a set of needed routes (you can see them by running `rake routes`). - -There are also some options available for configuring your routes, as :class_name (to set the class for that route), :path_prefix, :as and :path_names, where the last two have the same meaning as in common routes. The available :path_names are: - - map.devise_for :users, :as => "usuarios", :path_names => { :sign_in => 'login', :sign_out => 'logout', :password => 'secret', :confirmation => 'verification', :unlock => 'unblock' } - -Be sure to check devise_for documentation for detailed description. - -After this steps, run your migrations, and you are ready to go! But don't finish reading, we still have a lot to tell you: - -== Controller filters and helpers - -Devise is gonna create some helpers to use inside your controllers and views. To setup a controller that needs user authentication, just add this before_filter: - - before_filter :authenticate_user! - -To verify if a user is signed in, you have the following helper: - - user_signed_in? - -And to get the current signed in user this helper is available: - - current_user - -You have also access to the session for this scope: - - user_session - -After signing in a user, confirming it's account or updating it's password, devise will look for a scoped root path to redirect. Example: For a :user resource, it will use user_root_path if it exists, otherwise default root_path will be used. This means that you need to set the root inside your routes: - - map.root :controller => 'home' - -You can also overwrite after_sign_in_path_for and after_sign_out_path_for to customize better your redirect hooks. - -Finally, you also need to setup default url options for the mailer in each environment. Here's is the configuration for config/environments/development.rb: - - config.action_mailer.default_url_options = { :host => 'localhost:3000' } - -== Tidying up - -Devise let's you setup as many roles as you want, so let's say you already have this User model and also want an Admin model with just authentication, trackable, lockable and timeoutable stuff and none of confirmation or password recovery. Just follow the same steps: - - # Create a migration with the required fields - create_table :admins do |t| - t.database_authenticatable - t.lockable - t.trackable - end - - # Inside your Admin model - devise :database_authenticatable, :trackable, :timeoutable, :lockable - - # Inside your routes - map.devise_for :admin - - # Inside your protected controller - before_filter :authenticate_admin! - - # Inside your controllers and views - admin_signed_in? - current_admin - admin_session - -== Generators - -Devise comes with some generators to help you start: - - ruby script/generate devise_install - -This will generate an initializer, with a description of all configuration values. You can also generate models through: - - ruby script/generate devise Model - -A model configured with all devise modules and attr_accessible for default fields will be created. The generator will also create the migration and configure your routes for devise. - -== Model configuration - -The devise method in your models also accept some options to configure its modules. For example, you can chose which encryptor to use in database_authenticatable: - - devise :database_authenticatable, :confirmable, :recoverable, :encryptor => :bcrypt - -Besides :encryptor, you can provide :pepper, :stretches, :confirm_within, :remember_for, :timeout_in, :unlock_in and others. All those are describer in the initializer created when you invoke the devise_install generator describer above. - -== Views - -Since devise is an engine, it has all default views inside the gem. They are good to get you started, but you will want to customize them at some point. And Devise has a generator to make copy them all to your application: - - ruby script/generate devise_views - -By default Devise will use the same views for all roles you have. But what if you need so different views to each of them? Devise also has an easy way to accomplish it: just setup config.scoped_views to true inside "config/initializers/devise.rb". - -After doing so you will be able to have views based on the scope like 'sessions/users/new' and 'sessions/admin/new'. If no view is found within the scope, Devise will fallback to the default view. - -Devise uses flash messages to let users know if their login is successful or not. Devise expects your application to call 'flash[:notice]' and 'flash[:alert]' as appropriate. - -== I18n - -Devise uses flash messages with I18n with the flash keys :success and :failure. To customize your app, you can setup your locale file this way: - - en: - devise: - sessions: - signed_in: 'Signed in successfully.' - -You can also create distinct messages based on the resource you've configured using the singular name given in routes: - - en: - devise: - sessions: - user: - signed_in: 'Welcome user, you are signed in.' - admin: - signed_in: 'Hello admin!' - -Devise mailer uses the same pattern to create subject messages: - - en: - devise: - mailer: - confirmation_instructions: 'Hello everybody!' - user: - confirmation_instructions: 'Hello User! Please confirm your email' - reset_password_instructions: 'Reset instructions' - -Take a look at our locale file to check all available messages. - -== Test helpers - -Devise includes some tests helpers for functional specs. To use them, you just need to include Devise::TestHelpers in your test class and use the sign_in and sign_out method. Such methods have the same signature as in controllers: - - sign_in :user, @user # sign_in(scope, resource) - sign_in @user # sign_in(resource) - - sign_out :user # sign_out(scope) - sign_out @user # sign_out(resource) - -You can include the Devise Test Helpers in all of your tests by adding the following to the bottom of your test/test_helper.rb or spec/spec_helper.rb file: - - class ActionController::TestCase - include Devise::TestHelpers - end - -Do not use such helpers for integration tests like Cucumber, Webrat... Just fill in the form or explicitly set the user in session. For more tips, check the wiki (http://wiki.github.com/plataformatec/devise). - -== Migrating from other solutions - -Devise implements encryption strategies for Clearance, Authlogic and Restful-Authentication. To make use of it set the desired encryptor in the encryptor initializer config option. You might also need to rename your encrypted password and salt columns to match Devises's one (encrypted_password and password_salt). - -== Other ORMs - -Devise supports both ActiveRecord (default) and MongoMapper, and has experimental Datamapper supports (in a sense that Devise test suite does not run completely with Datamapper). To choose other ORM, you just need to configure it in the initializer file. - -== TODO - -Please refer to TODO file. - -== Maintainers - -* José Valim (http://github.com/josevalim) -* Carlos Antônio da Silva (http://github.com/carlosantoniodasilva) - -== Contributors - -We have a long running list of contributors. Check them in the CHANGELOG or do `git shortlog -s -n` in the cloned repository. - -== Bugs and Feedback - -If you discover any bugs or want to drop a line, feel free to create an issue on -GitHub or send an e-mail to the mailing list. - -http://github.com/plataformatec/devise/issues -http://groups.google.com/group/plataformatec-devise - -MIT License. Copyright 2009 Plataforma Tecnologia. http://blog.plataformatec.com.br diff --git a/vendor/gems/devise-1.0.7/Rakefile b/vendor/gems/devise-1.0.7/Rakefile deleted file mode 100644 index 6f69b32e5..000000000 --- a/vendor/gems/devise-1.0.7/Rakefile +++ /dev/null @@ -1,53 +0,0 @@ -# encoding: UTF-8 - -require 'rake' -require 'rake/testtask' -require 'rake/rdoctask' -require File.join(File.dirname(__FILE__), 'lib', 'devise', 'version') - -desc 'Default: run tests for all ORMs.' -task :default => :pre_commit - -desc 'Run Devise tests for all ORMs.' -task :pre_commit do - Dir[File.join(File.dirname(__FILE__), 'test', 'orm', '*.rb')].each do |file| - orm = File.basename(file).split(".").first - system "rake test DEVISE_ORM=#{orm}" - end -end - -desc 'Run Devise unit tests.' -Rake::TestTask.new(:test) do |t| - t.libs << 'lib' - t.libs << 'test' - t.pattern = 'test/**/*_test.rb' - t.verbose = true -end - -desc 'Generate documentation for Devise.' -Rake::RDocTask.new(:rdoc) do |rdoc| - rdoc.rdoc_dir = 'rdoc' - rdoc.title = 'Devise' - rdoc.options << '--line-numbers' << '--inline-source' - rdoc.rdoc_files.include('README.rdoc') - rdoc.rdoc_files.include('lib/**/*.rb') -end - -begin - require 'jeweler' - Jeweler::Tasks.new do |s| - s.name = "devise" - s.version = Devise::VERSION - s.summary = "Flexible authentication solution for Rails with Warden" - s.email = "contact@plataformatec.com.br" - s.homepage = "http://github.com/plataformatec/devise" - s.description = "Flexible authentication solution for Rails with Warden" - s.authors = ['José Valim', 'Carlos Antônio'] - s.files = FileList["[A-Z]*", "{app,config,generators,lib}/**/*", "rails/init.rb"] - s.add_dependency("warden", "~> 0.10.3") - end - - Jeweler::GemcutterTasks.new -rescue LoadError - puts "Jeweler, or one of its dependencies, is not available. Install it with: gem install jeweler" -end diff --git a/vendor/gems/devise-1.0.7/TODO b/vendor/gems/devise-1.0.7/TODO deleted file mode 100644 index b3b0488db..000000000 --- a/vendor/gems/devise-1.0.7/TODO +++ /dev/null @@ -1,2 +0,0 @@ -* Make test run with DataMapper -* Extract Activatable tests from Confirmable diff --git a/vendor/gems/devise-1.0.7/app/controllers/confirmations_controller.rb b/vendor/gems/devise-1.0.7/app/controllers/confirmations_controller.rb deleted file mode 100644 index e78ad5f7f..000000000 --- a/vendor/gems/devise-1.0.7/app/controllers/confirmations_controller.rb +++ /dev/null @@ -1,33 +0,0 @@ -class ConfirmationsController < ApplicationController - include Devise::Controllers::InternalHelpers - - # GET /resource/confirmation/new - def new - build_resource - render_with_scope :new - end - - # POST /resource/confirmation - def create - self.resource = resource_class.send_confirmation_instructions(params[resource_name]) - - if resource.errors.empty? - set_flash_message :notice, :send_instructions - redirect_to new_session_path(resource_name) - else - render_with_scope :new - end - end - - # GET /resource/confirmation?confirmation_token=abcdef - def show - self.resource = resource_class.confirm_by_token(params[:confirmation_token]) - - if resource.errors.empty? - set_flash_message :notice, :confirmed - sign_in_and_redirect(resource_name, resource) - else - render_with_scope :new - end - end -end diff --git a/vendor/gems/devise-1.0.7/app/controllers/passwords_controller.rb b/vendor/gems/devise-1.0.7/app/controllers/passwords_controller.rb deleted file mode 100644 index ea05d3993..000000000 --- a/vendor/gems/devise-1.0.7/app/controllers/passwords_controller.rb +++ /dev/null @@ -1,41 +0,0 @@ -class PasswordsController < ApplicationController - prepend_before_filter :require_no_authentication - include Devise::Controllers::InternalHelpers - - # GET /resource/password/new - def new - build_resource - render_with_scope :new - end - - # POST /resource/password - def create - self.resource = resource_class.send_reset_password_instructions(params[resource_name]) - - if resource.errors.empty? - set_flash_message :notice, :send_instructions - redirect_to new_session_path(resource_name) - else - render_with_scope :new - end - end - - # GET /resource/password/edit?reset_password_token=abcdef - def edit - self.resource = resource_class.new - resource.reset_password_token = params[:reset_password_token] - render_with_scope :edit - end - - # PUT /resource/password - def update - self.resource = resource_class.reset_password_by_token(params[resource_name]) - - if resource.errors.empty? - set_flash_message :notice, :updated - sign_in_and_redirect(resource_name, resource) - else - render_with_scope :edit - end - end -end diff --git a/vendor/gems/devise-1.0.7/app/controllers/registrations_controller.rb b/vendor/gems/devise-1.0.7/app/controllers/registrations_controller.rb deleted file mode 100644 index ad78f03cc..000000000 --- a/vendor/gems/devise-1.0.7/app/controllers/registrations_controller.rb +++ /dev/null @@ -1,53 +0,0 @@ -class RegistrationsController < ApplicationController - prepend_before_filter :require_no_authentication, :only => [ :new, :create ] - prepend_before_filter :authenticate_scope!, :only => [:edit, :update, :destroy] - include Devise::Controllers::InternalHelpers - - # GET /resource/sign_in - def new - build_resource - render_with_scope :new - end - - # POST /resource/sign_up - def create - build_resource - - if resource.save - set_flash_message :notice, :signed_up - sign_in_and_redirect(resource_name, resource) - else - render_with_scope :new - end - end - - # GET /resource/edit - def edit - render_with_scope :edit - end - - # PUT /resource - def update - if self.resource.update_with_password(params[resource_name]) - set_flash_message :notice, :updated - redirect_to after_sign_in_path_for(self.resource) - else - render_with_scope :edit - end - end - - # DELETE /resource - def destroy - self.resource.destroy - set_flash_message :notice, :destroyed - sign_out_and_redirect(self.resource) - end - - protected - - # Authenticates the current scope and dup the resource - def authenticate_scope! - send(:"authenticate_#{resource_name}!") - self.resource = send(:"current_#{resource_name}").dup - end -end \ No newline at end of file diff --git a/vendor/gems/devise-1.0.7/app/controllers/sessions_controller.rb b/vendor/gems/devise-1.0.7/app/controllers/sessions_controller.rb deleted file mode 100644 index 273540580..000000000 --- a/vendor/gems/devise-1.0.7/app/controllers/sessions_controller.rb +++ /dev/null @@ -1,44 +0,0 @@ -class SessionsController < ApplicationController - prepend_before_filter :require_no_authentication, :only => [ :new, :create ] - include Devise::Controllers::InternalHelpers - - # GET /resource/sign_in - def new - unless flash[:notice].present? - Devise::FLASH_MESSAGES.each do |message| - set_now_flash_message :alert, message if params.try(:[], message) == "true" - end - end - - build_resource - render_with_scope :new - end - - # POST /resource/sign_in - def create - if resource = authenticate(resource_name) - if !performed? - set_flash_message :notice, :signed_in - sign_in_and_redirect(resource_name, resource, true) - end - elsif [:custom, :redirect].include?(warden.result) - throw :warden, :scope => resource_name - elsif !performed? - set_now_flash_message :alert, (warden.message || :invalid) - clean_up_passwords(build_resource) - render_with_scope :new unless performed? - end - end - - # GET /resource/sign_out - def destroy - set_flash_message :notice, :signed_out if signed_in?(resource_name) - sign_out_and_redirect(resource_name) - end - - protected - - def clean_up_passwords(object) - object.clean_up_passwords if object.respond_to?(:clean_up_passwords) - end -end diff --git a/vendor/gems/devise-1.0.7/app/controllers/unlocks_controller.rb b/vendor/gems/devise-1.0.7/app/controllers/unlocks_controller.rb deleted file mode 100644 index c88b6e0f8..000000000 --- a/vendor/gems/devise-1.0.7/app/controllers/unlocks_controller.rb +++ /dev/null @@ -1,41 +0,0 @@ -class UnlocksController < ApplicationController - prepend_before_filter :ensure_email_as_unlock_strategy - prepend_before_filter :require_no_authentication - include Devise::Controllers::InternalHelpers - - # GET /resource/unlock/new - def new - build_resource - render_with_scope :new - end - - # POST /resource/unlock - def create - self.resource = resource_class.send_unlock_instructions(params[resource_name]) - - if resource.errors.empty? - set_flash_message :notice, :send_instructions - redirect_to new_session_path(resource_name) - else - render_with_scope :new - end - end - - # GET /resource/unlock?unlock_token=abcdef - def show - self.resource = resource_class.unlock_access_by_token(params[:unlock_token]) - - if resource.errors.empty? - set_flash_message :notice, :unlocked - sign_in_and_redirect(resource_name, resource) - else - render_with_scope :new - end - end - - protected - - def ensure_email_as_unlock_strategy - raise ActionController::UnknownAction unless resource_class.unlock_strategy_enabled?(:email) - end -end diff --git a/vendor/gems/devise-1.0.7/app/models/devise_mailer.rb b/vendor/gems/devise-1.0.7/app/models/devise_mailer.rb deleted file mode 100644 index d91a16af6..000000000 --- a/vendor/gems/devise-1.0.7/app/models/devise_mailer.rb +++ /dev/null @@ -1,68 +0,0 @@ -class DeviseMailer < ::ActionMailer::Base - extend Devise::Controllers::InternalHelpers::ScopedViews - - # Deliver confirmation instructions when the user is created or its email is - # updated, and also when confirmation is manually requested - def confirmation_instructions(record) - setup_mail(record, :confirmation_instructions) - end - - # Deliver reset password instructions when manually requested - def reset_password_instructions(record) - setup_mail(record, :reset_password_instructions) - end - - def unlock_instructions(record) - setup_mail(record, :unlock_instructions) - end - - private - - # Configure default email options - def setup_mail(record, key) - scope_name = Devise::Mapping.find_scope!(record) - mapping = Devise.mappings[scope_name] - - subject translate(mapping, key) - from mailer_sender(mapping) - recipients record.email - sent_on Time.now - content_type Devise.mailer_content_type - body render_with_scope(key, mapping, mapping.name => record, :resource => record) - end - - def render_with_scope(key, mapping, assigns) - if self.class.scoped_views - begin - render :file => "devise_mailer/#{mapping.as}/#{key}", :body => assigns - rescue ActionView::MissingTemplate - render :file => "devise_mailer/#{key}", :body => assigns - end - else - render :file => "devise_mailer/#{key}", :body => assigns - end - end - - def mailer_sender(mapping) - if Devise.mailer_sender.is_a?(Proc) - block_args = mapping.name if Devise.mailer_sender.arity > 0 - Devise.mailer_sender.call(block_args) - else - Devise.mailer_sender - end - end - - # Setup subject namespaced by model. It means you're able to setup your - # messages using specific resource scope, or provide a default one. - # Example (i18n locale file): - # - # en: - # devise: - # mailer: - # confirmation_instructions: '...' - # user: - # confirmation_instructions: '...' - def translate(mapping, key) - I18n.t(:"#{mapping.name}.#{key}", :scope => [:devise, :mailer], :default => key) - end -end diff --git a/vendor/gems/devise-1.0.7/app/views/confirmations/new.html.erb b/vendor/gems/devise-1.0.7/app/views/confirmations/new.html.erb deleted file mode 100644 index 80670d87c..000000000 --- a/vendor/gems/devise-1.0.7/app/views/confirmations/new.html.erb +++ /dev/null @@ -1,12 +0,0 @@ -

Resend confirmation instructions

- -<% form_for resource_name, resource, :url => confirmation_path(resource_name) do |f| %> - <%= f.error_messages %> - -

<%= f.label :email %>

-

<%= f.text_field :email %>

- -

<%= f.submit "Resend confirmation instructions" %>

-<% end %> - -<%= render :partial => "shared/devise_links" %> \ No newline at end of file diff --git a/vendor/gems/devise-1.0.7/app/views/devise_mailer/confirmation_instructions.html.erb b/vendor/gems/devise-1.0.7/app/views/devise_mailer/confirmation_instructions.html.erb deleted file mode 100644 index a6ea8ca17..000000000 --- a/vendor/gems/devise-1.0.7/app/views/devise_mailer/confirmation_instructions.html.erb +++ /dev/null @@ -1,5 +0,0 @@ -

Welcome <%= @resource.email %>!

- -

You can confirm your account through the link below:

- -

<%= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @resource.confirmation_token) %>

diff --git a/vendor/gems/devise-1.0.7/app/views/devise_mailer/reset_password_instructions.html.erb b/vendor/gems/devise-1.0.7/app/views/devise_mailer/reset_password_instructions.html.erb deleted file mode 100644 index ae9e888ab..000000000 --- a/vendor/gems/devise-1.0.7/app/views/devise_mailer/reset_password_instructions.html.erb +++ /dev/null @@ -1,8 +0,0 @@ -

Hello <%= @resource.email %>!

- -

Someone has requested a link to change your password, and you can do this through the link below.

- -

<%= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @resource.reset_password_token) %>

- -

If you didn't request this, please ignore this email.

-

Your password won't change until you access the link above and create a new one.

diff --git a/vendor/gems/devise-1.0.7/app/views/devise_mailer/unlock_instructions.html.erb b/vendor/gems/devise-1.0.7/app/views/devise_mailer/unlock_instructions.html.erb deleted file mode 100644 index 2263c2195..000000000 --- a/vendor/gems/devise-1.0.7/app/views/devise_mailer/unlock_instructions.html.erb +++ /dev/null @@ -1,7 +0,0 @@ -

Hello <%= @resource.email %>!

- -

Your account has been locked due to an excessive amount of unsuccessful sign in attempts.

- -

Click the link below to unlock your account:

- -

<%= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @resource.unlock_token) %>

diff --git a/vendor/gems/devise-1.0.7/app/views/passwords/edit.html.erb b/vendor/gems/devise-1.0.7/app/views/passwords/edit.html.erb deleted file mode 100644 index 968701f63..000000000 --- a/vendor/gems/devise-1.0.7/app/views/passwords/edit.html.erb +++ /dev/null @@ -1,16 +0,0 @@ -

Change your password

- -<% form_for resource_name, resource, :url => password_path(resource_name), :html => { :method => :put } do |f| %> - <%= f.error_messages %> - <%= f.hidden_field :reset_password_token %> - -

<%= f.label :password %>

-

<%= f.password_field :password %>

- -

<%= f.label :password_confirmation %>

-

<%= f.password_field :password_confirmation %>

- -

<%= f.submit "Change my password" %>

-<% end %> - -<%= render :partial => "shared/devise_links" %> \ No newline at end of file diff --git a/vendor/gems/devise-1.0.7/app/views/passwords/new.html.erb b/vendor/gems/devise-1.0.7/app/views/passwords/new.html.erb deleted file mode 100644 index 055e7ce39..000000000 --- a/vendor/gems/devise-1.0.7/app/views/passwords/new.html.erb +++ /dev/null @@ -1,12 +0,0 @@ -

Forgot your password?

- -<% form_for resource_name, resource, :url => password_path(resource_name) do |f| %> - <%= f.error_messages %> - -

<%= f.label :email %>

-

<%= f.text_field :email %>

- -

<%= f.submit "Send me reset password instructions" %>

-<% end %> - -<%= render :partial => "shared/devise_links" %> \ No newline at end of file diff --git a/vendor/gems/devise-1.0.7/app/views/registrations/edit.html.erb b/vendor/gems/devise-1.0.7/app/views/registrations/edit.html.erb deleted file mode 100644 index 1fd0b4524..000000000 --- a/vendor/gems/devise-1.0.7/app/views/registrations/edit.html.erb +++ /dev/null @@ -1,25 +0,0 @@ -

Edit <%= resource_name.to_s.humanize %>

- -<% form_for resource_name, resource, :url => registration_path(resource_name), :html => { :method => :put } do |f| -%> - <%= f.error_messages %> - -

<%= f.label :email %>

-

<%= f.text_field :email %>

- -

<%= f.label :password %> (leave blank if you don't want to change it)

-

<%= f.password_field :password %>

- -

<%= f.label :password_confirmation %>

-

<%= f.password_field :password_confirmation %>

- -

<%= f.label :current_password %> (we need your current password to confirm your changes)

-

<%= f.password_field :current_password %>

- -

<%= f.submit "Update" %>

-<% end -%> - -

Cancel my account

- -

Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), :confirm => "Are you sure?", :method => :delete %>.

- -<%= render :partial => "shared/devise_links" %> diff --git a/vendor/gems/devise-1.0.7/app/views/registrations/new.html.erb b/vendor/gems/devise-1.0.7/app/views/registrations/new.html.erb deleted file mode 100644 index 423edd354..000000000 --- a/vendor/gems/devise-1.0.7/app/views/registrations/new.html.erb +++ /dev/null @@ -1,17 +0,0 @@ -

Sign up

- -<% form_for resource_name, resource, :url => registration_path(resource_name) do |f| -%> - <%= f.error_messages %> -

<%= f.label :email %>

-

<%= f.text_field :email %>

- -

<%= f.label :password %>

-

<%= f.password_field :password %>

- -

<%= f.label :password_confirmation %>

-

<%= f.password_field :password_confirmation %>

- -

<%= f.submit "Sign up" %>

-<% end -%> - -<%= render :partial => "shared/devise_links" %> diff --git a/vendor/gems/devise-1.0.7/app/views/sessions/new.html.erb b/vendor/gems/devise-1.0.7/app/views/sessions/new.html.erb deleted file mode 100644 index 04e88e81f..000000000 --- a/vendor/gems/devise-1.0.7/app/views/sessions/new.html.erb +++ /dev/null @@ -1,17 +0,0 @@ -

Sign in

- -<% form_for resource_name, resource, :url => session_path(resource_name) do |f| -%> -

<%= f.label :email %>

-

<%= f.text_field :email %>

- -

<%= f.label :password %>

-

<%= f.password_field :password %>

- - <% if devise_mapping.rememberable? -%> -

<%= f.check_box :remember_me %> <%= f.label :remember_me %>

- <% end -%> - -

<%= f.submit "Sign in" %>

-<% end -%> - -<%= render :partial => "shared/devise_links" %> \ No newline at end of file diff --git a/vendor/gems/devise-1.0.7/app/views/shared/_devise_links.erb b/vendor/gems/devise-1.0.7/app/views/shared/_devise_links.erb deleted file mode 100644 index 664b7dc20..000000000 --- a/vendor/gems/devise-1.0.7/app/views/shared/_devise_links.erb +++ /dev/null @@ -1,19 +0,0 @@ -<%- if controller_name != 'sessions' %> - <%= link_to t('devise.sessions.link'), new_session_path(resource_name) %>
-<% end -%> - -<%- if devise_mapping.registerable? && controller_name != 'registrations' %> - <%= link_to t('devise.registrations.link'), new_registration_path(resource_name) %>
-<% end -%> - -<%- if devise_mapping.recoverable? && controller_name != 'passwords' %> - <%= link_to t('devise.passwords.link'), new_password_path(resource_name) %>
-<% end -%> - -<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %> - <%= link_to t('devise.confirmations.link'), new_confirmation_path(resource_name) %>
-<% end -%> - -<%- if devise_mapping.lockable? && controller_name != 'unlocks' %> - <%= link_to t('devise.unlocks.link'), new_unlock_path(resource_name) %>
-<% end -%> diff --git a/vendor/gems/devise-1.0.7/app/views/unlocks/new.html.erb b/vendor/gems/devise-1.0.7/app/views/unlocks/new.html.erb deleted file mode 100644 index 60314e7c0..000000000 --- a/vendor/gems/devise-1.0.7/app/views/unlocks/new.html.erb +++ /dev/null @@ -1,12 +0,0 @@ -

Resend unlock instructions

- -<% form_for resource_name, resource, :url => unlock_path(resource_name) do |f| %> - <%= f.error_messages %> - -

<%= f.label :email %>

-

<%= f.text_field :email %>

- -

<%= f.submit "Resend unlock instructions" %>

-<% end %> - -<%= render :partial => "shared/devise_links" %> \ No newline at end of file diff --git a/vendor/gems/devise-1.0.7/devise.gemspec b/vendor/gems/devise-1.0.7/devise.gemspec deleted file mode 100644 index 7f6b643da..000000000 --- a/vendor/gems/devise-1.0.7/devise.gemspec +++ /dev/null @@ -1,180 +0,0 @@ -# Generated by jeweler -# DO NOT EDIT THIS FILE DIRECTLY -# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command -# -*- encoding: utf-8 -*- - -Gem::Specification.new do |s| - s.name = %q{devise} - s.version = "1.0.7" - - s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= - s.authors = ["Jos\303\251 Valim", "Carlos Ant\303\264nio"] - s.date = %q{2010-05-03} - s.description = %q{Flexible authentication solution for Rails with Warden} - s.email = %q{contact@plataformatec.com.br} - s.extra_rdoc_files = [ - "README.rdoc", - "TODO" - ] - s.files = [ - "CHANGELOG.rdoc", - "MIT-LICENSE", - "README.rdoc", - "Rakefile", - "TODO", - "app/controllers/confirmations_controller.rb", - "app/controllers/passwords_controller.rb", - "app/controllers/registrations_controller.rb", - "app/controllers/sessions_controller.rb", - "app/controllers/unlocks_controller.rb", - "app/models/devise_mailer.rb", - "app/views/confirmations/new.html.erb", - "app/views/devise_mailer/confirmation_instructions.html.erb", - "app/views/devise_mailer/reset_password_instructions.html.erb", - "app/views/devise_mailer/unlock_instructions.html.erb", - "app/views/passwords/edit.html.erb", - "app/views/passwords/new.html.erb", - "app/views/registrations/edit.html.erb", - "app/views/registrations/new.html.erb", - "app/views/sessions/new.html.erb", - "app/views/shared/_devise_links.erb", - "app/views/unlocks/new.html.erb", - "generators/devise/USAGE", - "generators/devise/devise_generator.rb", - "generators/devise/lib/route_devise.rb", - "generators/devise/templates/migration.rb", - "generators/devise/templates/model.rb", - "generators/devise_install/USAGE", - "generators/devise_install/devise_install_generator.rb", - "generators/devise_install/templates/README", - "generators/devise_install/templates/devise.rb", - "generators/devise_views/USAGE", - "generators/devise_views/devise_views_generator.rb", - "lib/devise.rb", - "lib/devise/controllers/helpers.rb", - "lib/devise/controllers/internal_helpers.rb", - "lib/devise/controllers/url_helpers.rb", - "lib/devise/encryptors/authlogic_sha512.rb", - "lib/devise/encryptors/base.rb", - "lib/devise/encryptors/bcrypt.rb", - "lib/devise/encryptors/clearance_sha1.rb", - "lib/devise/encryptors/restful_authentication_sha1.rb", - "lib/devise/encryptors/sha1.rb", - "lib/devise/encryptors/sha512.rb", - "lib/devise/failure_app.rb", - "lib/devise/hooks/activatable.rb", - "lib/devise/hooks/rememberable.rb", - "lib/devise/hooks/timeoutable.rb", - "lib/devise/hooks/trackable.rb", - "lib/devise/locales/en.yml", - "lib/devise/mapping.rb", - "lib/devise/models.rb", - "lib/devise/models/activatable.rb", - "lib/devise/models/confirmable.rb", - "lib/devise/models/database_authenticatable.rb", - "lib/devise/models/http_authenticatable.rb", - "lib/devise/models/lockable.rb", - "lib/devise/models/recoverable.rb", - "lib/devise/models/registerable.rb", - "lib/devise/models/rememberable.rb", - "lib/devise/models/timeoutable.rb", - "lib/devise/models/token_authenticatable.rb", - "lib/devise/models/trackable.rb", - "lib/devise/models/validatable.rb", - "lib/devise/orm/active_record.rb", - "lib/devise/orm/data_mapper.rb", - "lib/devise/orm/mongo_mapper.rb", - "lib/devise/rails.rb", - "lib/devise/rails/routes.rb", - "lib/devise/rails/warden_compat.rb", - "lib/devise/schema.rb", - "lib/devise/strategies/base.rb", - "lib/devise/strategies/database_authenticatable.rb", - "lib/devise/strategies/http_authenticatable.rb", - "lib/devise/strategies/rememberable.rb", - "lib/devise/strategies/token_authenticatable.rb", - "lib/devise/test_helpers.rb", - "lib/devise/version.rb", - "rails/init.rb" - ] - s.homepage = %q{http://github.com/plataformatec/devise} - s.rdoc_options = ["--charset=UTF-8"] - s.require_paths = ["lib"] - s.rubygems_version = %q{1.3.6} - s.summary = %q{Flexible authentication solution for Rails with Warden} - s.test_files = [ - "test/controllers/helpers_test.rb", - "test/controllers/internal_helpers_test.rb", - "test/controllers/url_helpers_test.rb", - "test/devise_test.rb", - "test/encryptors_test.rb", - "test/failure_app_test.rb", - "test/integration/authenticatable_test.rb", - "test/integration/confirmable_test.rb", - "test/integration/http_authenticatable_test.rb", - "test/integration/lockable_test.rb", - "test/integration/rack_middleware_test.rb", - "test/integration/recoverable_test.rb", - "test/integration/registerable_test.rb", - "test/integration/rememberable_test.rb", - "test/integration/timeoutable_test.rb", - "test/integration/token_authenticatable_test.rb", - "test/integration/trackable_test.rb", - "test/mailers/confirmation_instructions_test.rb", - "test/mailers/reset_password_instructions_test.rb", - "test/mailers/unlock_instructions_test.rb", - "test/mapping_test.rb", - "test/models/authenticatable_test.rb", - "test/models/confirmable_test.rb", - "test/models/lockable_test.rb", - "test/models/recoverable_test.rb", - "test/models/rememberable_test.rb", - "test/models/timeoutable_test.rb", - "test/models/token_authenticatable_test.rb", - "test/models/trackable_test.rb", - "test/models/validatable_test.rb", - "test/models_test.rb", - "test/orm/active_record.rb", - "test/orm/mongo_mapper.rb", - "test/rails_app/app/active_record/admin.rb", - "test/rails_app/app/active_record/user.rb", - "test/rails_app/app/controllers/admins_controller.rb", - "test/rails_app/app/controllers/application_controller.rb", - "test/rails_app/app/controllers/home_controller.rb", - "test/rails_app/app/controllers/users_controller.rb", - "test/rails_app/app/helpers/application_helper.rb", - "test/rails_app/app/mongo_mapper/admin.rb", - "test/rails_app/app/mongo_mapper/user.rb", - "test/rails_app/config/boot.rb", - "test/rails_app/config/environment.rb", - "test/rails_app/config/environments/development.rb", - "test/rails_app/config/environments/production.rb", - "test/rails_app/config/environments/test.rb", - "test/rails_app/config/initializers/devise.rb", - "test/rails_app/config/initializers/inflections.rb", - "test/rails_app/config/initializers/new_rails_defaults.rb", - "test/rails_app/config/initializers/session_store.rb", - "test/rails_app/config/routes.rb", - "test/routes_test.rb", - "test/support/assertions_helper.rb", - "test/support/integration_tests_helper.rb", - "test/support/test_silencer.rb", - "test/support/tests_helper.rb", - "test/test_helper.rb", - "test/test_helpers_test.rb" - ] - - if s.respond_to? :specification_version then - current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION - s.specification_version = 3 - - if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then - s.add_runtime_dependency(%q, ["~> 0.10.3"]) - else - s.add_dependency(%q, ["~> 0.10.3"]) - end - else - s.add_dependency(%q, ["~> 0.10.3"]) - end -end - diff --git a/vendor/gems/devise-1.0.7/generators/devise/USAGE b/vendor/gems/devise-1.0.7/generators/devise/USAGE deleted file mode 100644 index 766ee18de..000000000 --- a/vendor/gems/devise-1.0.7/generators/devise/USAGE +++ /dev/null @@ -1,5 +0,0 @@ -To create a devise resource user: - - script/generate devise User - -This will generate a model named User, a route map for devise called :users, and a migration file for table :users with all devise modules. diff --git a/vendor/gems/devise-1.0.7/generators/devise/devise_generator.rb b/vendor/gems/devise-1.0.7/generators/devise/devise_generator.rb deleted file mode 100644 index 31cc74349..000000000 --- a/vendor/gems/devise-1.0.7/generators/devise/devise_generator.rb +++ /dev/null @@ -1,15 +0,0 @@ -require File.expand_path(File.dirname(__FILE__) + "/lib/route_devise.rb") - -class DeviseGenerator < Rails::Generator::NamedBase - - def manifest - record do |m| - m.directory(File.join('app', 'models', class_path)) - m.template 'model.rb', File.join('app', 'models', "#{file_path}.rb") - - m.migration_template 'migration.rb', 'db/migrate', :migration_file_name => "devise_create_#{table_name}" - m.route_devise table_name - end - end - -end diff --git a/vendor/gems/devise-1.0.7/generators/devise/lib/route_devise.rb b/vendor/gems/devise-1.0.7/generators/devise/lib/route_devise.rb deleted file mode 100644 index be4add3a7..000000000 --- a/vendor/gems/devise-1.0.7/generators/devise/lib/route_devise.rb +++ /dev/null @@ -1,32 +0,0 @@ -module Rails - module Generator - module Commands - class Create < Base - - # Create devise route. Based on route_resources - def route_devise(*resources) - resource_list = resources.map { |r| r.to_sym.inspect }.join(', ') - sentinel = 'ActionController::Routing::Routes.draw do |map|' - - logger.route "map.devise_for #{resource_list}" - unless options[:pretend] - gsub_file 'config/routes.rb', /(#{Regexp.escape(sentinel)})/mi do |match| - "#{match}\n map.devise_for #{resource_list}\n" - end - end - end - end - - class Destroy < RewindBase - - # Destroy devise route. Based on route_resources - def route_devise(*resources) - resource_list = resources.map { |r| r.to_sym.inspect }.join(', ') - look_for = "\n map.devise_for #{resource_list}\n" - logger.route "map.devise_for #{resource_list}" - gsub_file 'config/routes.rb', /(#{look_for})/mi, '' - end - end - end - end -end diff --git a/vendor/gems/devise-1.0.7/generators/devise/templates/migration.rb b/vendor/gems/devise-1.0.7/generators/devise/templates/migration.rb deleted file mode 100644 index 6c762f1b6..000000000 --- a/vendor/gems/devise-1.0.7/generators/devise/templates/migration.rb +++ /dev/null @@ -1,23 +0,0 @@ -class DeviseCreate<%= table_name.camelize %> < ActiveRecord::Migration - def self.up - create_table(:<%= table_name %>) do |t| - t.database_authenticatable :null => false - t.confirmable - t.recoverable - t.rememberable - t.trackable - # t.lockable - - t.timestamps - end - - add_index :<%= table_name %>, :email, :unique => true - add_index :<%= table_name %>, :confirmation_token, :unique => true - add_index :<%= table_name %>, :reset_password_token, :unique => true - # add_index :<%= table_name %>, :unlock_token, :unique => true - end - - def self.down - drop_table :<%= table_name %> - end -end diff --git a/vendor/gems/devise-1.0.7/generators/devise/templates/model.rb b/vendor/gems/devise-1.0.7/generators/devise/templates/model.rb deleted file mode 100644 index 524ec2593..000000000 --- a/vendor/gems/devise-1.0.7/generators/devise/templates/model.rb +++ /dev/null @@ -1,9 +0,0 @@ -class <%= class_name %> < ActiveRecord::Base - # Include default devise modules. Others available are: - # :http_authenticatable, :token_authenticatable, :confirmable, :lockable, :timeoutable and :activatable - devise :registerable, :authenticatable, :recoverable, - :rememberable, :trackable, :validatable - - # Setup accessible (or protected) attributes for your model - attr_accessible :email, :password, :password_confirmation -end diff --git a/vendor/gems/devise-1.0.7/generators/devise_install/USAGE b/vendor/gems/devise-1.0.7/generators/devise_install/USAGE deleted file mode 100644 index 608539040..000000000 --- a/vendor/gems/devise-1.0.7/generators/devise_install/USAGE +++ /dev/null @@ -1,3 +0,0 @@ -To copy a Devise initializer to your Rails App, with some configuration values, just do: - - script/generate devise_install diff --git a/vendor/gems/devise-1.0.7/generators/devise_install/devise_install_generator.rb b/vendor/gems/devise-1.0.7/generators/devise_install/devise_install_generator.rb deleted file mode 100644 index 27b669c76..000000000 --- a/vendor/gems/devise-1.0.7/generators/devise_install/devise_install_generator.rb +++ /dev/null @@ -1,15 +0,0 @@ -class DeviseInstallGenerator < Rails::Generator::Base - - def manifest - record do |m| - m.directory "config/initializers" - m.template "devise.rb", "config/initializers/devise.rb" - - m.directory "config/locales" - m.file "../../../lib/devise/locales/en.yml", "config/locales/devise.en.yml" - - m.readme "README" - end - end - -end diff --git a/vendor/gems/devise-1.0.7/generators/devise_install/templates/README b/vendor/gems/devise-1.0.7/generators/devise_install/templates/README deleted file mode 100644 index 09ec19d0d..000000000 --- a/vendor/gems/devise-1.0.7/generators/devise_install/templates/README +++ /dev/null @@ -1,23 +0,0 @@ -=============================================================================== - -Some setup you must do manually if you haven't yet: - - 1. Setup default url options for your specific environment. Here is an - example of development environment: - - config.action_mailer.default_url_options = { :host => 'localhost:3000' } - - This is a required Rails configuration. In production is must be the - actual host of your application - - 2. Ensure you have defined root_url to *something* in your config/routes.rb: - - map.root :controller => 'home' - - 3. Ensure you have a default layout in app/views/layouts and it shows - flash messages. For example: - -

<%= flash[:notice] %>

-

<%= flash[:alert] %>

- -=============================================================================== diff --git a/vendor/gems/devise-1.0.7/generators/devise_install/templates/devise.rb b/vendor/gems/devise-1.0.7/generators/devise_install/templates/devise.rb deleted file mode 100644 index a7c5f006c..000000000 --- a/vendor/gems/devise-1.0.7/generators/devise_install/templates/devise.rb +++ /dev/null @@ -1,105 +0,0 @@ -# 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| - # Configure the e-mail address which will be shown in DeviseMailer. - config.mailer_sender = "please-change-me@config-initializers-devise.com" - - # Configure the content type of DeviseMailer mails (defaults to text/html") - # config.mailer_content_type = "text/plain" - - # ==> Configuration for :authenticatable - # Invoke `rake secret` and use the printed value to setup a pepper to generate - # the encrypted password. By default no pepper is used. - # config.pepper = "rake secret output" - - # Configure how many times you want the password is reencrypted. Default is 10. - # config.stretches = 10 - - # Define which will be the encryption algorithm. Supported algorithms are :sha1 - # (default), :sha512 and :bcrypt. Devise also supports encryptors from others - # authentication tools as :clearance_sha1, :authlogic_sha512 (then you should set - # stretches above to 20 for default behavior) and :restful_authentication_sha1 - # (then you should set stretches to 10, and copy REST_AUTH_SITE_KEY to pepper) - # config.encryptor = :sha1 - - # Configure which keys are used when authenticating an user. By default is - # just :email. You can configure it to use [:username, :subdomain], so for - # authenticating an user, both parameters are required. Remember that those - # parameters are used only when authenticating and not when retrieving from - # session. If you need permissions, you should implement that in a before filter. - # config.authentication_keys = [ :email ] - - # The realm used in Http Basic Authentication - # config.http_authentication_realm = "Application" - - # ==> Configuration for :confirmable - # The time you want give to your user to confirm his account. During this time - # he will be able to access your application without confirming. Default is nil. - # config.confirm_within = 2.days - - # ==> Configuration for :rememberable - # The time the user will be remembered without asking for credentials again. - # config.remember_for = 2.weeks - - # ==> Configuration for :timeoutable - # The time you want to timeout the user session without activity. After this - # time the user will be asked for credentials again. - # config.timeout_in = 10.minutes - - # ==> Configuration for :lockable - # Number of authentication tries before locking an account. - # config.maximum_attempts = 20 - - # Defines which strategy will be used to unlock an account. - # :email = Sends an unlock link to the user email - # :time = Reanables login after a certain ammount of time (see :unlock_in below) - # :both = enables both strategies - # config.unlock_strategy = :both - - # Time interval to unlock the account if :time is enabled as unlock_strategy. - # config.unlock_in = 1.hour - - # ==> Configuration for :token_authenticatable - # Defines name of the authentication token params key - # config.token_authentication_key = :auth_token - - # ==> General configuration - # Load and configure the ORM. Supports :active_record (default), :mongo_mapper - # (requires mongo_ext installed) and :data_mapper (experimental). - # require 'devise/orm/mongo_mapper' - # config.orm = :mongo_mapper - - # Turn scoped views on. Before rendering "sessions/new", it will first check for - # "sessions/users/new". It's turned off by default because it's slower if you - # are using only default views. - # config.scoped_views = true - - # By default, devise detects the role accessed based on the url. So whenever - # accessing "/users/sign_in", it knows you are accessing an User. This makes - # routes as "/sign_in" not possible, unless you tell Devise to use the default - # scope, setting true below. - # config.use_default_scope = true - - # Configure the default scope used by Devise. By default it's the first devise - # role declared in your routes. - # config.default_scope = :user - - # If you want to use other strategies, that are not (yet) supported by Devise, - # you can configure them inside the config.warden block. The example below - # allows you to setup OAuth, using http://github.com/roman/warden_oauth - # - # config.warden do |manager| - # manager.oauth(:twitter) do |twitter| - # twitter.consumer_secret = - # twitter.consumer_key = - # twitter.options :site => 'http://twitter.com' - # end - # manager.default_strategies.unshift :twitter_oauth - # end - - # Configure default_url_options if you are using dynamic segments in :path_prefix - # for devise_for. - # config.default_url_options do - # { :locale => I18n.locale } - # end -end diff --git a/vendor/gems/devise-1.0.7/generators/devise_views/USAGE b/vendor/gems/devise-1.0.7/generators/devise_views/USAGE deleted file mode 100644 index c90f2e7cb..000000000 --- a/vendor/gems/devise-1.0.7/generators/devise_views/USAGE +++ /dev/null @@ -1,3 +0,0 @@ -To copy all session, password, confirmation and mailer views from devise to your app just run the following command: - - script/generate devise_views diff --git a/vendor/gems/devise-1.0.7/generators/devise_views/devise_views_generator.rb b/vendor/gems/devise-1.0.7/generators/devise_views/devise_views_generator.rb deleted file mode 100644 index 5a9b85d9b..000000000 --- a/vendor/gems/devise-1.0.7/generators/devise_views/devise_views_generator.rb +++ /dev/null @@ -1,21 +0,0 @@ -class DeviseViewsGenerator < Rails::Generator::Base - - def initialize(*args) - super - @source_root = options[:source] || File.join(spec.path, '..', '..') - end - - def manifest - record do |m| - m.directory "app/views" - - Dir[File.join(@source_root, "app", "views", "**/*.erb")].each do |file| - file = file.gsub(@source_root, "")[1..-1] - - m.directory File.dirname(file) - m.file file, file - end - end - end - -end diff --git a/vendor/gems/devise-1.0.7/lib/devise.rb b/vendor/gems/devise-1.0.7/lib/devise.rb deleted file mode 100644 index e7d52fc2c..000000000 --- a/vendor/gems/devise-1.0.7/lib/devise.rb +++ /dev/null @@ -1,264 +0,0 @@ -module Devise - autoload :FailureApp, 'devise/failure_app' - autoload :Models, 'devise/models' - autoload :Schema, 'devise/schema' - autoload :TestHelpers, 'devise/test_helpers' - - module Controllers - autoload :Helpers, 'devise/controllers/helpers' - autoload :InternalHelpers, 'devise/controllers/internal_helpers' - autoload :UrlHelpers, 'devise/controllers/url_helpers' - end - - module Encryptors - autoload :Base, 'devise/encryptors/base' - autoload :Bcrypt, 'devise/encryptors/bcrypt' - autoload :AuthlogicSha512, 'devise/encryptors/authlogic_sha512' - autoload :ClearanceSha1, 'devise/encryptors/clearance_sha1' - autoload :RestfulAuthenticationSha1, 'devise/encryptors/restful_authentication_sha1' - autoload :Sha512, 'devise/encryptors/sha512' - autoload :Sha1, 'devise/encryptors/sha1' - end - - module Orm - autoload :ActiveRecord, 'devise/orm/active_record' - autoload :DataMapper, 'devise/orm/data_mapper' - autoload :MongoMapper, 'devise/orm/mongo_mapper' - end - - ALL = [] - - # Authentication ones first - ALL.push :database_authenticatable, :http_authenticatable, :token_authenticatable, :rememberable - - # Misc after - ALL.push :recoverable, :registerable, :validatable - - # The ones which can sign out after - ALL.push :activatable, :confirmable, :lockable, :timeoutable - - # Stats for last, so we make sure the user is really signed in - ALL.push :trackable - - # Maps controller names to devise modules. - CONTROLLERS = { - :sessions => [:database_authenticatable, :token_authenticatable], - :passwords => [:recoverable], - :confirmations => [:confirmable], - :registrations => [:registerable], - :unlocks => [:lockable] - } - - # Routes for generating url helpers. - ROUTES = [:session, :password, :confirmation, :registration, :unlock] - - STRATEGIES = [:rememberable, :http_authenticatable, :token_authenticatable, :database_authenticatable] - - TRUE_VALUES = [true, 1, '1', 't', 'T', 'true', 'TRUE'] - - # Maps the messages types that are used in flash message. - FLASH_MESSAGES = [:unauthenticated, :unconfirmed, :invalid, :invalid_token, :timeout, :inactive, :locked] - - # Declare encryptors length which are used in migrations. - ENCRYPTORS_LENGTH = { - :sha1 => 40, - :sha512 => 128, - :clearance_sha1 => 40, - :restful_authentication_sha1 => 40, - :authlogic_sha512 => 128, - :bcrypt => 60 - } - - # Email regex used to validate email formats. Adapted from authlogic. - EMAIL_REGEX = /^([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})$/i - - # Used to encrypt password. Please generate one with rake secret. - mattr_accessor :pepper - @@pepper = nil - - # The number of times to encrypt password. - mattr_accessor :stretches - @@stretches = 10 - - # Keys used when authenticating an user. - mattr_accessor :authentication_keys - @@authentication_keys = [ :email ] - - # Time interval where the remember me token is valid. - mattr_accessor :remember_for - @@remember_for = 2.weeks - - # Time interval you can access your account before confirming your account. - mattr_accessor :confirm_within - @@confirm_within = 0.days - - # Time interval to timeout the user session without activity. - mattr_accessor :timeout_in - @@timeout_in = 30.minutes - - # Used to define the password encryption algorithm. - mattr_accessor :encryptor - @@encryptor = :sha1 - - # Store scopes mappings. - mattr_accessor :mappings - @@mappings = ActiveSupport::OrderedHash.new - - # Stores the chosen ORM. - mattr_accessor :orm - @@orm = :active_record - - # TODO Remove - mattr_accessor :all - @@all = [] - - # Tells if devise should apply the schema in ORMs where devise declaration - # and schema belongs to the same class (as Datamapper and MongoMapper). - mattr_accessor :apply_schema - @@apply_schema = true - - # Scoped views. Since it relies on fallbacks to render default views, it's - # turned off by default. - mattr_accessor :scoped_views - @@scoped_views = false - - # Number of authentication tries before locking an account - mattr_accessor :maximum_attempts - @@maximum_attempts = 20 - - # Defines which strategy can be used to unlock an account. - # Values: :email, :time, :both - mattr_accessor :unlock_strategy - @@unlock_strategy = :both - - # Time interval to unlock the account if :time is defined as unlock_strategy. - mattr_accessor :unlock_in - @@unlock_in = 1.hour - - # Tell when to use the default scope, if one cannot be found from routes. - mattr_accessor :use_default_scope - @@use_default_scope = false - - # The default scope which is used by warden. - mattr_accessor :default_scope - @@default_scope = nil - - # Address which sends Devise e-mails. - mattr_accessor :mailer_sender - @@mailer_sender = nil - - # Content Type of Devise e-mails. - mattr_accessor :mailer_content_type - @@mailer_content_type = 'text/html' - - # Authentication token params key name of choice. E.g. /users/sign_in?some_key=... - mattr_accessor :token_authentication_key - @@token_authentication_key = :auth_token - - # The realm used in Http Basic Authentication - mattr_accessor :http_authentication_realm - @@http_authentication_realm = "Application" - - class << self - # Default way to setup Devise. Run script/generate devise_install to create - # a fresh initializer with all configuration values. - def setup - yield self - end - - # Sets warden configuration using a block that will be invoked on warden - # initialization. - # - # Devise.initialize do |config| - # config.confirm_within = 2.days - # - # config.warden do |manager| - # # Configure warden to use other strategies, like oauth. - # manager.oauth(:twitter) - # end - # end - def warden(&block) - @warden_config = block - end - - # Configure default url options to be used within Devise and ActionController. - def default_url_options(&block) - Devise::Mapping.metaclass.send :define_method, :default_url_options, &block - end - - # A method used internally to setup warden manager from the Rails initialize - # block. - def configure_warden(config) #:nodoc: - config.default_strategies *Devise::STRATEGIES - config.failure_app = Devise::FailureApp - config.silence_missing_strategies! - config.default_scope = Devise.default_scope - - # If the user provided a warden hook, call it now. - @warden_config.try :call, config - end - - # The class of the configured ORM - def orm_class - Devise::Orm.const_get(@@orm.to_s.camelize.to_sym) - end - - # Generate a friendly string randomically to be used as token. - def friendly_token - ActiveSupport::SecureRandom.base64(15).tr('+/=', '-_ ').strip.delete("\n") - end - - # Make Devise aware of an 3rd party Devise-module. For convenience. - # - # == Options: - # - # +strategy+ - Boolean value representing if this module got a custom *strategy*. - # Default is +false+. Note: Devise will auto-detect this in such case if this is true. - # +model+ - String representing a load path to a custom *model* for this module (to autoload). - # Default is +nil+ (i.e. +false+). - # +controller+ - Symbol representing a name of an exisiting or custom *controller* for this module. - # Default is +nil+ (i.e. +false+). - # +route+ - Symbol representing the name of a *route* related to this module which a set of - # route view helpers should be created for. - # Default is +nil+ (i.e. +false+). - # - # == Examples: - # - # Devise.add_module(:party_module) - # Devise.add_module(:party_module, :strategy => true, :controller => :sessions) - # Devise.add_module(:party_module, :model => 'party_module/model') - # - def add_module(module_name, options = {}) - Devise::ALL << module_name unless Devise::ALL.include?(module_name) - Devise::STRATEGIES.unshift module_name if options[:strategy] && !Devise::STRATEGIES.include?(module_name) - - if options[:controller] - controller = options[:controller].to_sym - Devise::CONTROLLERS[controller] ||= [] - Devise::CONTROLLERS[controller].unshift module_name unless Devise::CONTROLLERS[controller].include?(module_name) - end - - if options[:route] - Devise::ROUTES.unshift options[:route] unless Devise::ROUTES.include?(options[:route]) - end - - if options[:model] - Devise::Models.module_eval do - autoload :"#{module_name.to_s.classify}", options[:model] - end - end - - Devise::Mapping.register module_name - end - end -end - -begin - require 'warden' -rescue - gem 'warden' - require 'warden' -end - -require 'devise/mapping' -require 'devise/rails' diff --git a/vendor/gems/devise-1.0.7/lib/devise/controllers/helpers.rb b/vendor/gems/devise-1.0.7/lib/devise/controllers/helpers.rb deleted file mode 100644 index e314447fc..000000000 --- a/vendor/gems/devise-1.0.7/lib/devise/controllers/helpers.rb +++ /dev/null @@ -1,200 +0,0 @@ -module Devise - module Controllers - # Those helpers are convenience methods added to ApplicationController. - module Helpers - - def self.included(base) - base.class_eval do - helper_method :warden, :signed_in?, :devise_controller?, - *Devise.mappings.keys.map { |m| [:"current_#{m}", :"#{m}_signed_in?", :"#{m}_session"] }.flatten - - # Use devise default_url_options. We have to declare it here to overwrite - # default definitions. - def default_url_options(options=nil) - Devise::Mapping.default_url_options - end - end - end - - # The main accessor for the warden proxy instance - def warden - request.env['warden'] - end - - # Return true if it's a devise_controller. false to all controllers unless - # the controllers defined inside devise. Useful if you want to apply a before - # filter to all controller, except the ones in devise: - # - # before_filter :my_filter, :unless => { |c| c.devise_controller? } - def devise_controller? - false - end - - # Attempts to authenticate the given scope by running authentication hooks, - # but does not redirect in case of failures. - def authenticate(scope) - warden.authenticate(:scope => scope) - end - - # Attempts to authenticate the given scope by running authentication hooks, - # redirecting in case of failures. - def authenticate!(scope) - warden.authenticate!(:scope => scope) - end - - # Check if the given scope is signed in session, without running - # authentication hooks. - def signed_in?(scope) - warden.authenticate?(:scope => scope) - end - - # Sign in an user that already was authenticated. This helper is useful for logging - # users in after sign up. - # - # Examples: - # - # sign_in :user, @user # sign_in(scope, resource) - # sign_in @user # sign_in(resource) - # - def sign_in(resource_or_scope, resource=nil) - scope = Devise::Mapping.find_scope!(resource_or_scope) - resource ||= resource_or_scope - warden.set_user(resource, :scope => scope) - end - - # Sign out a given user or scope. This helper is useful for signing out an user - # after deleting accounts. - # - # Examples: - # - # sign_out :user # sign_out(scope) - # sign_out @user # sign_out(resource) - # - def sign_out(resource_or_scope) - scope = Devise::Mapping.find_scope!(resource_or_scope) - warden.user(scope) # Without loading user here, before_logout hook is not called - warden.raw_session.inspect # Without this inspect here. The session does not clear. - warden.logout(scope) - end - - # Returns and delete the url stored in the session for the given scope. Useful - # for giving redirect backs after sign up: - # - # Example: - # - # redirect_to stored_location_for(:user) || root_path - # - def stored_location_for(resource_or_scope) - scope = Devise::Mapping.find_scope!(resource_or_scope) - session.delete(:"#{scope}.return_to") - end - - # The default url to be used after signing in. This is used by all Devise - # controllers and you can overwrite it in your ApplicationController to - # provide a custom hook for a custom resource. - # - # By default, it first tries to find a resource_root_path, otherwise it - # uses the root path. For a user scope, you can define the default url in - # the following way: - # - # map.user_root '/users', :controller => 'users' # creates user_root_path - # - # map.resources :users do |users| - # users.root # creates user_root_path - # end - # - # - # If none of these are defined, root_path is used. However, if this default - # is not enough, you can customize it, for example: - # - # def after_sign_in_path_for(resource) - # if resource.is_a?(User) && resource.can_publish? - # publisher_url - # else - # super - # end - # end - # - def after_sign_in_path_for(resource_or_scope) - scope = Devise::Mapping.find_scope!(resource_or_scope) - home_path = :"#{scope}_root_path" - respond_to?(home_path, true) ? send(home_path) : root_path - end - - # Method used by sessions controller to sign out an user. You can overwrite - # it in your ApplicationController to provide a custom hook for a custom - # scope. Notice that differently from +after_sign_in_path_for+ this method - # receives a symbol with the scope, and not the resource. - # - # By default is the root_path. - def after_sign_out_path_for(resource_or_scope) - root_path - end - - # Sign in an user and tries to redirect first to the stored location and - # then to the url specified by after_sign_in_path_for. - # - # If just a symbol is given, consider that the user was already signed in - # through other means and just perform the redirection. - def sign_in_and_redirect(resource_or_scope, resource=nil, skip=false) - scope = Devise::Mapping.find_scope!(resource_or_scope) - resource ||= resource_or_scope - sign_in(scope, resource) unless skip - redirect_to stored_location_for(scope) || after_sign_in_path_for(resource) - end - - # Sign out an user and tries to redirect to the url specified by - # after_sign_out_path_for. - def sign_out_and_redirect(resource_or_scope) - scope = Devise::Mapping.find_scope!(resource_or_scope) - sign_out(scope) - redirect_to after_sign_out_path_for(scope) - end - - # Define authentication filters and accessor helpers based on mappings. - # These filters should be used inside the controllers as before_filters, - # so you can control the scope of the user who should be signed in to - # access that specific controller/action. - # Example: - # - # Maps: - # User => :authenticatable - # Admin => :authenticatable - # - # Generated methods: - # authenticate_user! # Signs user in or redirect - # authenticate_admin! # Signs admin in or redirect - # user_signed_in? # Checks whether there is an user signed in or not - # admin_signed_in? # Checks whether there is an admin signed in or not - # current_user # Current signed in user - # current_admin # Currend signed in admin - # user_session # Session data available only to the user scope - # admin_session # Session data available only to the admin scope - # - # Use: - # before_filter :authenticate_user! # Tell devise to use :user map - # before_filter :authenticate_admin! # Tell devise to use :admin map - # - Devise.mappings.each_key do |mapping| - class_eval <<-METHODS, __FILE__, __LINE__ + 1 - def authenticate_#{mapping}! - warden.authenticate!(:scope => :#{mapping}) - end - - def #{mapping}_signed_in? - warden.authenticate?(:scope => :#{mapping}) - end - - def current_#{mapping} - @current_#{mapping} ||= warden.authenticate(:scope => :#{mapping}) - end - - def #{mapping}_session - current_#{mapping} && warden.session(:#{mapping}) - end - METHODS - end - - end - end -end diff --git a/vendor/gems/devise-1.0.7/lib/devise/controllers/internal_helpers.rb b/vendor/gems/devise-1.0.7/lib/devise/controllers/internal_helpers.rb deleted file mode 100644 index 2a909f213..000000000 --- a/vendor/gems/devise-1.0.7/lib/devise/controllers/internal_helpers.rb +++ /dev/null @@ -1,129 +0,0 @@ -module Devise - module Controllers - # Those helpers are used only inside Devise controllers and should not be - # included in ApplicationController since they all depend on the url being - # accessed. - module InternalHelpers #:nodoc: - - def self.included(base) - base.class_eval do - extend ScopedViews - unloadable - - helper_method :resource, :scope_name, :resource_name, :resource_class, :devise_mapping, :devise_controller? - hide_action :resource, :scope_name, :resource_name, :resource_class, :devise_mapping, :devise_controller? - - skip_before_filter *Devise.mappings.keys.map { |m| :"authenticate_#{m}!" } - prepend_before_filter :is_devise_resource? - end - end - - module ScopedViews - def scoped_views - defined?(@scoped_views) ? @scoped_views : Devise.scoped_views - end - - def scoped_views=(value) - @scoped_views = value - end - end - - # Gets the actual resource stored in the instance variable - def resource - instance_variable_get(:"@#{resource_name}") - end - - # Proxy to devise map name - def resource_name - devise_mapping.name - end - alias :scope_name :resource_name - - # Proxy to devise map class - def resource_class - devise_mapping.to - end - - # Attempt to find the mapped route for devise based on request path - def devise_mapping - @devise_mapping ||= begin - mapping = Devise::Mapping.find_by_path(request.path) - mapping ||= Devise.mappings[Devise.default_scope] if Devise.use_default_scope - mapping - end - end - - # Overwrites devise_controller? to return true - def devise_controller? - true - end - - protected - - # Checks whether it's a devise mapped resource or not. - def is_devise_resource? #:nodoc: - raise ActionController::UnknownAction unless devise_mapping && devise_mapping.allows?(controller_name) - end - - # Sets the resource creating an instance variable - def resource=(new_resource) - instance_variable_set(:"@#{resource_name}", new_resource) - end - - # Build a devise resource. - def build_resource - self.resource ||= resource_class.new(params[resource_name] || {}) - end - - # Helper for use in before_filters where no authentication is required. - # - # Example: - # before_filter :require_no_authentication, :only => :new - def require_no_authentication - redirect_to after_sign_in_path_for(resource_name) if warden.authenticated?(resource_name) - end - - # Sets the flash message with :key, using I18n. By default you are able - # to setup your messages using specific resource scope, and if no one is - # found we look to default scope. - # Example (i18n locale file): - # - # en: - # devise: - # passwords: - # #default_scope_messages - only if resource_scope is not found - # user: - # #resource_scope_messages - # - # Please refer to README or en.yml locale file to check what messages are - # available. - def set_flash_message(key, kind, now=false) - flash_hash = now ? flash.now : flash - flash_hash[key] = I18n.t(:"#{resource_name}.#{kind}", - :scope => [:devise, controller_name.to_sym], :default => kind) - end - - # Shortcut to set flash.now message. Same rules applied from set_flash_message - def set_now_flash_message(key, kind) - set_flash_message(key, kind, true) - end - - # Render a view for the specified scope. Turned off by default. - # Accepts just :controller as option. - def render_with_scope(action, options={}) - controller_name = options.delete(:controller) || self.controller_name - - if self.class.scoped_views - begin - render :template => "#{controller_name}/#{devise_mapping.as}/#{action}" - rescue ActionView::MissingTemplate - render action, :controller => controller_name - end - else - render action, :controller => controller_name - end - end - - end - end -end diff --git a/vendor/gems/devise-1.0.7/lib/devise/controllers/url_helpers.rb b/vendor/gems/devise-1.0.7/lib/devise/controllers/url_helpers.rb deleted file mode 100644 index eb01e7b59..000000000 --- a/vendor/gems/devise-1.0.7/lib/devise/controllers/url_helpers.rb +++ /dev/null @@ -1,41 +0,0 @@ -module Devise - module Controllers - # Create url helpers to be used with resource/scope configuration. Acts as - # proxies to the generated routes created by devise. - # Resource param can be a string or symbol, a class, or an instance object. - # Example using a :user resource: - # - # new_session_path(:user) => new_user_session_path - # session_path(:user) => user_session_path - # destroy_session_path(:user) => destroy_user_session_path - # - # new_password_path(:user) => new_user_password_path - # password_path(:user) => user_password_path - # edit_password_path(:user) => edit_user_password_path - # - # new_confirmation_path(:user) => new_user_confirmation_path - # confirmation_path(:user) => user_confirmation_path - # - # Those helpers are added to your ApplicationController. - module UrlHelpers - - Devise::ROUTES.each do |module_name| - [:path, :url].each do |path_or_url| - actions = [ nil, :new_ ] - actions << :edit_ if [:password, :registration].include?(module_name) - actions << :destroy_ if [:session].include?(module_name) - - actions.each do |action| - class_eval <<-URL_HELPERS, __FILE__, __LINE__ + 1 - def #{action}#{module_name}_#{path_or_url}(resource_or_scope, *args) - scope = Devise::Mapping.find_scope!(resource_or_scope) - send("#{action}\#{scope}_#{module_name}_#{path_or_url}", *args) - end - URL_HELPERS - end - end - end - - end - end -end diff --git a/vendor/gems/devise-1.0.7/lib/devise/encryptors/authlogic_sha512.rb b/vendor/gems/devise-1.0.7/lib/devise/encryptors/authlogic_sha512.rb deleted file mode 100644 index 9c4be984e..000000000 --- a/vendor/gems/devise-1.0.7/lib/devise/encryptors/authlogic_sha512.rb +++ /dev/null @@ -1,21 +0,0 @@ -require "digest/sha2" - -module Devise - module Encryptors - # = AuthlogicSha512 - # Simulates Authlogic's default encryption mechanism. - # Warning: it uses Devise's stretches configuration to port Authlogic's one. Should be set to 20 in the initializer to silumate - # the default behavior. - class AuthlogicSha512 < Base - - # Gererates a default password digest based on salt, pepper and the - # incoming password. - def self.digest(password, stretches, salt, pepper) - digest = [password, salt].flatten.join('') - stretches.times { digest = Digest::SHA512.hexdigest(digest) } - digest - end - - end - end -end \ No newline at end of file diff --git a/vendor/gems/devise-1.0.7/lib/devise/encryptors/base.rb b/vendor/gems/devise-1.0.7/lib/devise/encryptors/base.rb deleted file mode 100644 index 7b25f3123..000000000 --- a/vendor/gems/devise-1.0.7/lib/devise/encryptors/base.rb +++ /dev/null @@ -1,20 +0,0 @@ -module Devise - # Implements a way of adding different encryptions. - # The class should implement a self.digest method that taks the following params: - # - password - # - stretches: the number of times the encryption will be applied - # - salt: the password salt as defined by devise - # - pepper: Devise config option - # - module Encryptors - class Base - def self.digest - raise NotImplemented - end - - def self.salt - Devise.friendly_token - end - end - end -end \ No newline at end of file diff --git a/vendor/gems/devise-1.0.7/lib/devise/encryptors/bcrypt.rb b/vendor/gems/devise-1.0.7/lib/devise/encryptors/bcrypt.rb deleted file mode 100644 index b8a9a1012..000000000 --- a/vendor/gems/devise-1.0.7/lib/devise/encryptors/bcrypt.rb +++ /dev/null @@ -1,21 +0,0 @@ -require "bcrypt" - -module Devise - module Encryptors - # = BCrypt - # Uses the BCrypt hash algorithm to encrypt passwords. - class Bcrypt < Base - - # Gererates a default password digest based on stretches, salt, pepper and the - # incoming password. We don't strech it ourselves since BCrypt does so internally. - def self.digest(password, stretches, salt, pepper) - ::BCrypt::Engine.hash_secret([password, pepper].join, salt, stretches) - end - - def self.salt - ::BCrypt::Engine.generate_salt - end - - end - end -end diff --git a/vendor/gems/devise-1.0.7/lib/devise/encryptors/clearance_sha1.rb b/vendor/gems/devise-1.0.7/lib/devise/encryptors/clearance_sha1.rb deleted file mode 100644 index dbe396b9c..000000000 --- a/vendor/gems/devise-1.0.7/lib/devise/encryptors/clearance_sha1.rb +++ /dev/null @@ -1,19 +0,0 @@ -require "digest/sha1" - -module Devise - module Encryptors - # = ClearanceSha1 - # Simulates Clearance's default encryption mechanism. - # Warning: it uses Devise's pepper to port the concept of REST_AUTH_SITE_KEY - # Warning: it uses Devise's stretches configuration to port the concept of REST_AUTH_DIGEST_STRETCHES - class ClearanceSha1 < Base - - # Gererates a default password digest based on salt, pepper and the - # incoming password. - def self.digest(password, stretches, salt, pepper) - Digest::SHA1.hexdigest("--#{salt}--#{password}--") - end - - end - end -end \ No newline at end of file diff --git a/vendor/gems/devise-1.0.7/lib/devise/encryptors/restful_authentication_sha1.rb b/vendor/gems/devise-1.0.7/lib/devise/encryptors/restful_authentication_sha1.rb deleted file mode 100644 index 38f9cd742..000000000 --- a/vendor/gems/devise-1.0.7/lib/devise/encryptors/restful_authentication_sha1.rb +++ /dev/null @@ -1,22 +0,0 @@ -require "digest/sha1" - -module Devise - module Encryptors - # = RestfulAuthenticationSha1 - # Simulates Restful Authentication's default encryption mechanism. - # Warning: it uses Devise's pepper to port the concept of REST_AUTH_SITE_KEY - # Warning: it uses Devise's stretches configuration to port the concept of REST_AUTH_DIGEST_STRETCHES. Should be set to 10 in - # the initializer to silumate the default behavior. - class RestfulAuthenticationSha1 < Base - - # Gererates a default password digest based on salt, pepper and the - # incoming password. - def self.digest(password, stretches, salt, pepper) - digest = pepper - stretches.times { digest = Digest::SHA1.hexdigest([digest, salt, password, pepper].flatten.join('--')) } - digest - end - - end - end -end \ No newline at end of file diff --git a/vendor/gems/devise-1.0.7/lib/devise/encryptors/sha1.rb b/vendor/gems/devise-1.0.7/lib/devise/encryptors/sha1.rb deleted file mode 100644 index ecc0968fd..000000000 --- a/vendor/gems/devise-1.0.7/lib/devise/encryptors/sha1.rb +++ /dev/null @@ -1,27 +0,0 @@ -require "digest/sha1" - -module Devise - module Encryptors - # = Sha1 - # Uses the Sha1 hash algorithm to encrypt passwords. - class Sha1 < Base - - # Gererates a default password digest based on stretches, salt, pepper and the - # incoming password. - def self.digest(password, stretches, salt, pepper) - digest = pepper - stretches.times { digest = self.secure_digest(salt, digest, password, pepper) } - digest - end - - private - - # Generate a SHA1 digest joining args. Generated token is something like - # --arg1--arg2--arg3--argN-- - def self.secure_digest(*tokens) - ::Digest::SHA1.hexdigest('--' << tokens.flatten.join('--') << '--') - end - - end - end -end \ No newline at end of file diff --git a/vendor/gems/devise-1.0.7/lib/devise/encryptors/sha512.rb b/vendor/gems/devise-1.0.7/lib/devise/encryptors/sha512.rb deleted file mode 100644 index 769389b94..000000000 --- a/vendor/gems/devise-1.0.7/lib/devise/encryptors/sha512.rb +++ /dev/null @@ -1,27 +0,0 @@ -require "digest/sha2" - -module Devise - module Encryptors - # = Sha512 - # Uses the Sha512 hash algorithm to encrypt passwords. - class Sha512 < Base - - # Gererates a default password digest based on salt, pepper and the - # incoming password. - def self.digest(password, stretches, salt, pepper) - digest = pepper - stretches.times { digest = self.secure_digest(salt, digest, password, pepper) } - digest - end - - private - - # Generate a Sha512 digest joining args. Generated token is something like - # --arg1--arg2--arg3--argN-- - def self.secure_digest(*tokens) - ::Digest::SHA512.hexdigest('--' << tokens.flatten.join('--') << '--') - end - - end - end -end \ No newline at end of file diff --git a/vendor/gems/devise-1.0.7/lib/devise/failure_app.rb b/vendor/gems/devise-1.0.7/lib/devise/failure_app.rb deleted file mode 100644 index 6da47c755..000000000 --- a/vendor/gems/devise-1.0.7/lib/devise/failure_app.rb +++ /dev/null @@ -1,65 +0,0 @@ -module Devise - # Failure application that will be called every time :warden is thrown from - # any strategy or hook. Responsible for redirect the user to the sign in - # page based on current scope and mapping. If no scope is given, redirect - # to the default_url. - class FailureApp - attr_reader :env - include Warden::Mixins::Common - - cattr_accessor :default_url, :default_message, :instance_writer => false - @@default_message = :unauthenticated - - def self.call(env) - new(env).respond! - end - - def initialize(env) - @env = env - end - - def respond! - options = @env['warden.options'] - scope = options[:scope] - - redirect_path = if mapping = Devise.mappings[scope] - "#{mapping.parsed_path}/#{mapping.path_names[:sign_in]}" - else - "/#{default_url}" - end - query_string = query_string_for(options) - store_location!(scope) - - headers = {} - headers["Location"] = redirect_path - headers["Location"] << "?" << query_string unless query_string.empty? - headers["Content-Type"] = 'text/plain' - - [302, headers, ["You are being redirected to #{redirect_path}"]] - end - - # Build the proper query string based on the given message. - def query_string_for(options) - message = @env['warden'].try(:message) || options[:message] || default_message - - params = case message - when Symbol - { message => true } - when String - { :message => message } - else - {} - end - - Rack::Utils.build_query(params) - end - - # Stores requested uri to redirect the user after signing in. We cannot use - # scoped session provided by warden here, since the user is not authenticated - # yet, but we still need to store the uri based on scope, so different scopes - # would never use the same uri to redirect. - def store_location!(scope) - session[:"#{scope}.return_to"] = request.request_uri if request && request.get? - end - end -end diff --git a/vendor/gems/devise-1.0.7/lib/devise/hooks/activatable.rb b/vendor/gems/devise-1.0.7/lib/devise/hooks/activatable.rb deleted file mode 100644 index 11fc31c28..000000000 --- a/vendor/gems/devise-1.0.7/lib/devise/hooks/activatable.rb +++ /dev/null @@ -1,15 +0,0 @@ -# Deny user access whenever his account is not active yet. -Warden::Manager.after_set_user do |record, warden, options| - if record && record.respond_to?(:active?) && !record.active? - scope = options[:scope] - warden.logout(scope) - - # If winning strategy was set, this is being called after authenticate and - # there is no need to force a redirect. - if warden.winning_strategy - warden.winning_strategy.fail!(record.inactive_message) - else - throw :warden, :scope => scope, :message => record.inactive_message - end - end -end diff --git a/vendor/gems/devise-1.0.7/lib/devise/hooks/rememberable.rb b/vendor/gems/devise-1.0.7/lib/devise/hooks/rememberable.rb deleted file mode 100644 index 82c65478c..000000000 --- a/vendor/gems/devise-1.0.7/lib/devise/hooks/rememberable.rb +++ /dev/null @@ -1,32 +0,0 @@ -# After authenticate hook to verify if the user in the given scope asked to be -# remembered while he does not sign out. Generates a new remember token for -# that specific user and adds a cookie with this user info to sign in this user -# automatically without asking for credentials. Refer to rememberable strategy -# for more info. -Warden::Manager.prepend_after_authentication do |record, warden, options| - scope = options[:scope] - remember_me = warden.params[scope].try(:fetch, :remember_me, nil) - - if Devise::TRUE_VALUES.include?(remember_me) && - warden.authenticated?(scope) && record.respond_to?(:remember_me!) - record.remember_me! - - warden.response.set_cookie "remember_#{scope}_token", { - :value => record.class.serialize_into_cookie(record), - :expires => record.remember_expires_at, - :path => "/" - } - end -end - -# Before logout hook to forget the user in the given scope, only if rememberable -# is activated for this scope. Also clear remember token to ensure the user -# won't be remembered again. -# Notice that we forget the user if the record is frozen. This usually means the -# user was just deleted. -Warden::Manager.before_logout do |record, warden, scope| - if record.respond_to?(:forget_me!) - record.forget_me! unless record.frozen? - warden.response.delete_cookie "remember_#{scope}_token" - end -end \ No newline at end of file diff --git a/vendor/gems/devise-1.0.7/lib/devise/hooks/timeoutable.rb b/vendor/gems/devise-1.0.7/lib/devise/hooks/timeoutable.rb deleted file mode 100644 index 656b27f7b..000000000 --- a/vendor/gems/devise-1.0.7/lib/devise/hooks/timeoutable.rb +++ /dev/null @@ -1,18 +0,0 @@ -# Each time a record is set we check whether it's session has already timed out -# or not, based on last request time. If so, the record is logged out and -# redirected to the sign in page. Also, each time the request comes and the -# record is set, we set the last request time inside it's scoped session to -# verify timeout in the following request. -Warden::Manager.after_set_user do |record, warden, options| - scope = options[:scope] - if record && record.respond_to?(:timedout?) && warden.authenticated?(scope) - last_request_at = warden.session(scope)['last_request_at'] - - if record.timedout?(last_request_at) - warden.logout(scope) - throw :warden, :scope => scope, :message => :timeout - end - - warden.session(scope)['last_request_at'] = Time.now.utc - end -end diff --git a/vendor/gems/devise-1.0.7/lib/devise/hooks/trackable.rb b/vendor/gems/devise-1.0.7/lib/devise/hooks/trackable.rb deleted file mode 100644 index 1648537e6..000000000 --- a/vendor/gems/devise-1.0.7/lib/devise/hooks/trackable.rb +++ /dev/null @@ -1,18 +0,0 @@ -# After each sign in, update sign in time, sign in count and sign in IP. -Warden::Manager.after_set_user :except => :fetch do |record, warden, options| - scope = options[:scope] - if Devise.mappings[scope].try(:trackable?) && warden.authenticated?(scope) - old_current, new_current = record.current_sign_in_at, Time.now - record.last_sign_in_at = old_current || new_current - record.current_sign_in_at = new_current - - old_current, new_current = record.current_sign_in_ip, warden.request.remote_ip - record.last_sign_in_ip = old_current || new_current - record.current_sign_in_ip = new_current - - record.sign_in_count ||= 0 - record.sign_in_count += 1 - - record.save(false) - end -end diff --git a/vendor/gems/devise-1.0.7/lib/devise/locales/en.yml b/vendor/gems/devise-1.0.7/lib/devise/locales/en.yml deleted file mode 100644 index 4cef37bb6..000000000 --- a/vendor/gems/devise-1.0.7/lib/devise/locales/en.yml +++ /dev/null @@ -1,35 +0,0 @@ -en: - devise: - sessions: - link: 'Sign in' - signed_in: 'Signed in successfully.' - signed_out: 'Signed out successfully.' - unauthenticated: 'You need to sign in or sign up before continuing.' - unconfirmed: 'You have to confirm your account before continuing.' - locked: 'Your account is locked.' - invalid: 'Invalid email or password.' - invalid_token: 'Invalid authentication token.' - timeout: 'Your session expired, please sign in again to continue.' - inactive: 'Your account was not activated yet.' - passwords: - link: 'Forgot password?' - send_instructions: 'You will receive an email with instructions about how to reset your password in a few minutes.' - updated: 'Your password was changed successfully. You are now signed in.' - confirmations: - link: "Didn't receive confirmation instructions?" - send_instructions: 'You will receive an email with instructions about how to confirm your account in a few minutes.' - confirmed: 'Your account was successfully confirmed. You are now signed in.' - registrations: - link: 'Sign up' - signed_up: 'You have signed up successfully. If enabled, a confirmation was sent to your e-mail.' - updated: 'You updated your account successfully.' - destroyed: 'Bye! Your account was successfully cancelled. We hope to see you again soon.' - unlocks: - link: "Didn't receive unlock instructions?" - send_instructions: 'You will receive an email with instructions about how to unlock your account in a few minutes.' - unlocked: 'Your account was successfully unlocked. You are now signed in.' - mailer: - confirmation_instructions: 'Confirmation instructions' - reset_password_instructions: 'Reset password instructions' - unlock_instructions: 'Unlock Instructions' - diff --git a/vendor/gems/devise-1.0.7/lib/devise/mapping.rb b/vendor/gems/devise-1.0.7/lib/devise/mapping.rb deleted file mode 100644 index d1f464af3..000000000 --- a/vendor/gems/devise-1.0.7/lib/devise/mapping.rb +++ /dev/null @@ -1,128 +0,0 @@ -module Devise - # Responsible for handling devise mappings and routes configuration. Each - # resource configured by devise_for in routes is actually creating a mapping - # object. You can refer to devise_for in routes for usage options. - # - # The required value in devise_for is actually not used internally, but it's - # inflected to find all other values. - # - # map.devise_for :users - # mapping = Devise.mappings[:user] - # - # mapping.name #=> :user - # # is the scope used in controllers and warden, given in the route as :singular. - # - # mapping.as #=> "users" - # # how the mapping should be search in the path, given in the route as :as. - # - # mapping.to #=> User - # # is the class to be loaded from routes, given in the route as :class_name. - # - # mapping.for #=> [:authenticatable] - # # is the modules included in the class - # - class Mapping #:nodoc: - attr_reader :name, :as, :path_names, :path_prefix, :route_options - - # Loop through all mappings looking for a map that matches with the requested - # path (ie /users/sign_in). If a path prefix is given, it's taken into account. - def self.find_by_path(path) - Devise.mappings.each_value do |mapping| - route = path.split("/")[mapping.as_position] - return mapping if route && mapping.as == route.to_sym - end - nil - end - - # Receives an object and find a scope for it. If a scope cannot be found, - # raises an error. If a symbol is given, it's considered to be the scope. - def self.find_scope!(duck) - case duck - when String, Symbol - return duck - when Class - Devise.mappings.each_value { |m| return m.name if duck <= m.to } - else - Devise.mappings.each_value { |m| return m.name if duck.is_a?(m.to) } - end - - raise "Could not find a valid mapping for #{duck}" - end - - # Default url options which can be used as prefix. - def self.default_url_options - {} - end - - def initialize(name, options) #:nodoc: - @as = (options.delete(:as) || name).to_sym - @klass = (options.delete(:class_name) || name.to_s.classify).to_s - @name = (options.delete(:scope) || name.to_s.singularize).to_sym - - @path_prefix = "/#{options.delete(:path_prefix)}/".squeeze("/") - @route_options = options || {} - - @path_names = Hash.new { |h,k| h[k] = k.to_s } - @path_names.merge!(options.delete(:path_names) || {}) - end - - # Return modules for the mapping. - def for - @for ||= to.devise_modules - end - - # Reload mapped class each time when cache_classes is false. - def to - return @to if @to - klass = @klass.constantize - @to = klass if Rails.configuration.cache_classes - klass - end - - # Check if the respective controller has a module in the mapping class. - def allows?(controller) - (self.for & CONTROLLERS[controller.to_sym]).present? - end - - # Return in which position in the path prefix devise should find the as mapping. - def as_position - self.path_prefix.count("/") - end - - # Returns the raw path using path_prefix and as. - def raw_path - path_prefix + as.to_s - end - - # Returns the parsed path taking into account the relative url root and raw path. - def parsed_path - returning (ActionController::Base.relative_url_root.to_s + raw_path) do |path| - self.class.default_url_options.each do |key, value| - path.gsub!(key.inspect, value.to_param) - end - end - end - - def authenticatable? - @authenticatable ||= self.for.any? { |m| m.to_s =~ /authenticatable/ } - end - - # Create magic predicates for verifying what module is activated by this map. - # Example: - # - # def confirmable? - # self.for.include?(:confirmable) - # end - # - def self.register(*modules) - modules.each do |m| - class_eval <<-METHOD, __FILE__, __LINE__ + 1 - def #{m}? - self.for.include?(:#{m}) - end - METHOD - end - end - Devise::Mapping.register *ALL - end -end diff --git a/vendor/gems/devise-1.0.7/lib/devise/models.rb b/vendor/gems/devise-1.0.7/lib/devise/models.rb deleted file mode 100644 index 0676e6f15..000000000 --- a/vendor/gems/devise-1.0.7/lib/devise/models.rb +++ /dev/null @@ -1,117 +0,0 @@ -module Devise - module Models - autoload :Activatable, 'devise/models/activatable' - autoload :DatabaseAuthenticatable, 'devise/models/database_authenticatable' - autoload :Confirmable, 'devise/models/confirmable' - autoload :Lockable, 'devise/models/lockable' - autoload :Recoverable, 'devise/models/recoverable' - autoload :Rememberable, 'devise/models/rememberable' - autoload :Registerable, 'devise/models/registerable' - autoload :Timeoutable, 'devise/models/timeoutable' - autoload :Trackable, 'devise/models/trackable' - autoload :Validatable, 'devise/models/validatable' - - # Creates configuration values for Devise and for the given module. - # - # Devise::Models.config(Devise::Authenticable, :stretches, 10) - # - # The line above creates: - # - # 1) An accessor called Devise.stretches, which value is used by default; - # - # 2) Some class methods for your model Model.stretches and Model.stretches= - # which have higher priority than Devise.stretches; - # - # 3) And an instance method stretches. - # - # To add the class methods you need to have a module ClassMethods defined - # inside the given class. - # - def self.config(mod, *accessors) #:nodoc: - accessors.each do |accessor| - mod.class_eval <<-METHOD, __FILE__, __LINE__ + 1 - def #{accessor} - if defined?(@#{accessor}) - @#{accessor} - elsif superclass.respond_to?(:#{accessor}) - superclass.#{accessor} - else - Devise.#{accessor} - end - end - - def #{accessor}=(value) - @#{accessor} = value - end - METHOD - end - end - - # Include the chosen devise modules in your model: - # - # devise :authenticatable, :confirmable, :recoverable - # - # You can also give any of the devise configuration values in form of a hash, - # with specific values for this model. Please check your Devise initializer - # for a complete description on those values. - # - def devise(*modules) - raise "You need to give at least one Devise module" if modules.empty? - options = modules.extract_options! - - if modules.delete(:authenticatable) - ActiveSupport::Deprecation.warn ":authenticatable as module is deprecated. Please give :database_authenticatable instead.", caller - modules << :database_authenticatable - end - - @devise_modules = Devise::ALL & modules.map(&:to_sym).uniq - - Devise.orm_class.included_modules_hook(self) do - devise_modules.each do |m| - include Devise::Models.const_get(m.to_s.classify) - end - - options.each { |key, value| send(:"#{key}=", value) } - end - end - - # Stores all modules included inside the model, so we are able to verify - # which routes are needed. - def devise_modules - @devise_modules ||= [] - end - - # Find an initialize a record setting an error if it can't be found. - def find_or_initialize_with_error_by(attribute, value, error=:invalid) - if value.present? - conditions = { attribute => value } - record = find(:first, :conditions => conditions) - end - - unless record - record = new - - if value.present? - record.send(:"#{attribute}=", value) - else - error, skip_default = :blank, true - end - - add_error_on(record, attribute, error, !skip_default) - end - - record - end - - # Wraps add error logic in a method that works for different frameworks. - def add_error_on(record, attribute, error, add_default=true) - options = add_default ? { :default => error.to_s.gsub("_", " ") } : {} - - begin - record.errors.add(attribute, error, options) - rescue ArgumentError - record.errors.add(attribute, error.to_s.gsub("_", " ")) - end - end - end -end diff --git a/vendor/gems/devise-1.0.7/lib/devise/models/activatable.rb b/vendor/gems/devise-1.0.7/lib/devise/models/activatable.rb deleted file mode 100644 index efc5040e4..000000000 --- a/vendor/gems/devise-1.0.7/lib/devise/models/activatable.rb +++ /dev/null @@ -1,16 +0,0 @@ -require 'devise/hooks/activatable' - -module Devise - module Models - # This module implements the default API required in activatable hook. - module Activatable - def active? - true - end - - def inactive_message - :inactive - end - end - end -end \ No newline at end of file diff --git a/vendor/gems/devise-1.0.7/lib/devise/models/confirmable.rb b/vendor/gems/devise-1.0.7/lib/devise/models/confirmable.rb deleted file mode 100644 index fe5b2aa75..000000000 --- a/vendor/gems/devise-1.0.7/lib/devise/models/confirmable.rb +++ /dev/null @@ -1,162 +0,0 @@ -require 'devise/models/activatable' - -module Devise - module Models - - # Confirmable is responsible to verify if an account is already confirmed to - # sign in, and to send emails with confirmation instructions. - # Confirmation instructions are sent to the user email after creating a - # record, after updating it's email and also when manually requested by - # a new confirmation instruction request. - # Whenever the user update it's email, his account is automatically unconfirmed, - # it means it won't be able to sign in again without confirming the account - # again through the email that was sent. - # - # Configuration: - # - # confirm_within: the time you want the user will have to confirm it's account - # without blocking his access. When confirm_within is zero, the - # user won't be able to sign in without confirming. You can - # use this to let your user access some features of your - # application without confirming the account, but blocking it - # after a certain period (ie 7 days). By default confirm_within is - # zero, it means users always have to confirm to sign in. - # - # Examples: - # - # User.find(1).confirm! # returns true unless it's already confirmed - # User.find(1).confirmed? # true/false - # User.find(1).send_confirmation_instructions # manually send instructions - # User.find(1).resend_confirmation! # generates a new token and resent it - module Confirmable - include Devise::Models::Activatable - - def self.included(base) - base.class_eval do - extend ClassMethods - - before_create :generate_confirmation_token, :if => :confirmation_required? - after_create :send_confirmation_instructions, :if => :confirmation_required? - end - end - - # Confirm a user by setting it's confirmed_at to actual time. If the user - # is already confirmed, add en error to email field - def confirm! - unless_confirmed do - self.confirmation_token = nil - self.confirmed_at = Time.now - save(false) - end - end - - # Verifies whether a user is confirmed or not - def confirmed? - !new_record? && !confirmed_at.nil? - end - - # Send confirmation instructions by email - def send_confirmation_instructions - ::DeviseMailer.deliver_confirmation_instructions(self) - end - - # Resend confirmation token. This method does not need to generate a new token. - def resend_confirmation_token - unless_confirmed { send_confirmation_instructions } - end - - # Overwrites active? from Devise::Models::Activatable for confirmation - # by verifying whether an user is active to sign in or not. If the user - # is already confirmed, it should never be blocked. Otherwise we need to - # calculate if the confirm time has not expired for this user. - def active? - super && (confirmed? || confirmation_period_valid?) - end - - # The message to be shown if the account is inactive. - def inactive_message - !confirmed? ? :unconfirmed : super - end - - # If you don't want confirmation to be sent on create, neither a code - # to be generated, call skip_confirmation! - def skip_confirmation! - self.confirmed_at = Time.now - @skip_confirmation = true - end - - protected - - # Callback to overwrite if confirmation is required or not. - def confirmation_required? - !@skip_confirmation - end - - # Checks if the confirmation for the user is within the limit time. - # We do this by calculating if the difference between today and the - # confirmation sent date does not exceed the confirm in time configured. - # Confirm_in is a model configuration, must always be an integer value. - # - # Example: - # - # # confirm_within = 1.day and confirmation_sent_at = today - # confirmation_period_valid? # returns true - # - # # confirm_within = 5.days and confirmation_sent_at = 4.days.ago - # confirmation_period_valid? # returns true - # - # # confirm_within = 5.days and confirmation_sent_at = 5.days.ago - # confirmation_period_valid? # returns false - # - # # confirm_within = 0.days - # confirmation_period_valid? # will always return false - # - def confirmation_period_valid? - confirmation_sent_at && confirmation_sent_at.utc >= self.class.confirm_within.ago - end - - # Checks whether the record is confirmed or not, yielding to the block - # if it's already confirmed, otherwise adds an error to email. - def unless_confirmed - unless confirmed? - yield - else - self.class.add_error_on(self, :email, :already_confirmed) - false - end - end - - # Generates a new random token for confirmation, and stores the time - # this token is being generated - def generate_confirmation_token - self.confirmed_at = nil - self.confirmation_token = Devise.friendly_token - self.confirmation_sent_at = Time.now.utc - end - - module ClassMethods - # Attempt to find a user by it's email. If a record is found, send new - # confirmation instructions to it. If not user is found, returns a new user - # with an email not found error. - # Options must contain the user email - def send_confirmation_instructions(attributes={}) - confirmable = find_or_initialize_with_error_by(:email, attributes[:email], :not_found) - confirmable.resend_confirmation_token unless confirmable.new_record? - confirmable - end - - # Find a user by it's confirmation token and try to confirm it. - # If no user is found, returns a new user with an error. - # If the user is already confirmed, create an error for the user - # Options must have the confirmation_token - def confirm_by_token(confirmation_token) - confirmable = find_or_initialize_with_error_by(:confirmation_token, confirmation_token) - confirmable.confirm! unless confirmable.new_record? - confirmable - end - - Devise::Models.config(self, :confirm_within) - end - end - end -end diff --git a/vendor/gems/devise-1.0.7/lib/devise/models/database_authenticatable.rb b/vendor/gems/devise-1.0.7/lib/devise/models/database_authenticatable.rb deleted file mode 100644 index 9c6d52baa..000000000 --- a/vendor/gems/devise-1.0.7/lib/devise/models/database_authenticatable.rb +++ /dev/null @@ -1,144 +0,0 @@ -require 'devise/strategies/database_authenticatable' - -module Devise - module Models - # Authenticable Module, responsible for encrypting password and validating - # authenticity of a user while signing in. - # - # Configuration: - # - # You can overwrite configuration values by setting in globally in Devise, - # using devise method or overwriting the respective instance method. - # - # pepper: encryption key used for creating encrypted password. Each time - # password changes, it's gonna be encrypted again, and this key - # is added to the password and salt to create a secure hash. - # Always use `rake secret' to generate a new key. - # - # stretches: defines how many times the password will be encrypted. - # - # encryptor: the encryptor going to be used. By default :sha1. - # - # authentication_keys: parameters used for authentication. By default [:email] - # - # Examples: - # - # User.authenticate('email@test.com', 'password123') # returns authenticated user or nil - # User.find(1).valid_password?('password123') # returns true/false - # - module DatabaseAuthenticatable - def self.included(base) - base.class_eval do - extend ClassMethods - - attr_reader :password, :current_password - attr_accessor :password_confirmation - end - end - - # TODO Remove me in next release - def old_password - ActiveSupport::Deprecation.warn "old_password is deprecated, please use current_password instead", caller - @old_password - end - - # Regenerates password salt and encrypted password each time password is set, - # and then trigger any "after_changed_password"-callbacks. - def password=(new_password) - @password = new_password - - if @password.present? - self.password_salt = self.class.encryptor_class.salt - self.encrypted_password = password_digest(@password) - end - end - - # Verifies whether an incoming_password (ie from sign in) is the user password. - def valid_password?(incoming_password) - password_digest(incoming_password) == self.encrypted_password - end - - # Checks if a resource is valid upon authentication. - def valid_for_authentication?(attributes) - valid_password?(attributes[:password]) - end - - # Set password and password confirmation to nil - def clean_up_passwords - self.password = self.password_confirmation = nil - end - - # Update record attributes when :current_password matches, otherwise returns - # error on :current_password. It also automatically rejects :password and - # :password_confirmation if they are blank. - def update_with_password(params={}) - current_password = params.delete(:current_password) - - if params[:password].blank? - params.delete(:password) - params.delete(:password_confirmation) if params[:password_confirmation].blank? - end - - result = if valid_password?(current_password) - update_attributes(params) - else - message = current_password.blank? ? :blank : :invalid - self.class.add_error_on(self, :current_password, message, false) - self.attributes = params - false - end - - clean_up_passwords unless result - result - end - - protected - - # Checks whether a password is needed or not. For validations only. - # Passwords are always required if it's a new record, or if the password - # or confirmation are being set somewhere. - def password_required? - new_record? || !password.nil? || !password_confirmation.nil? - end - - # Digests the password using the configured encryptor. - def password_digest(password) - self.class.encryptor_class.digest(password, self.class.stretches, self.password_salt, self.class.pepper) - end - - module ClassMethods - Devise::Models.config(self, :pepper, :stretches, :encryptor, :authentication_keys) - - # Authenticate a user based on configured attribute keys. Returns the - # authenticated user if it's valid or nil. - def authenticate(attributes={}) - return unless authentication_keys.all? { |k| attributes[k].present? } - conditions = attributes.slice(*authentication_keys) - resource = find_for_authentication(conditions) - resource if resource.try(:valid_for_authentication?, attributes) - end - - # Returns the class for the configured encryptor. - def encryptor_class - @encryptor_class ||= ::Devise::Encryptors.const_get(encryptor.to_s.classify) - end - - protected - - # Find first record based on conditions given (ie by the sign in form). - # Overwrite to add customized conditions, create a join, or maybe use a - # namedscope to filter records while authenticating. - # Example: - # - # def self.find_for_authentication(conditions={}) - # conditions[:active] = true - # find(:first, :conditions => conditions) - # end - # - def find_for_authentication(conditions) - find(:first, :conditions => conditions) - end - end - end - end -end diff --git a/vendor/gems/devise-1.0.7/lib/devise/models/http_authenticatable.rb b/vendor/gems/devise-1.0.7/lib/devise/models/http_authenticatable.rb deleted file mode 100644 index 9d7f967cf..000000000 --- a/vendor/gems/devise-1.0.7/lib/devise/models/http_authenticatable.rb +++ /dev/null @@ -1,21 +0,0 @@ -require 'devise/strategies/http_authenticatable' - -module Devise - module Models - # Adds HttpAuthenticatable behavior to your model. It expects that your - # model class responds to authenticate and authentication_keys methods - # (which for example are defined in authenticatable). - module HttpAuthenticatable - def self.included(base) - base.extend ClassMethods - end - - module ClassMethods - # Authenticate an user using http. - def authenticate_with_http(username, password) - authenticate(authentication_keys.first => username, :password => password) - end - end - end - end -end diff --git a/vendor/gems/devise-1.0.7/lib/devise/models/lockable.rb b/vendor/gems/devise-1.0.7/lib/devise/models/lockable.rb deleted file mode 100644 index 5db6c6ed4..000000000 --- a/vendor/gems/devise-1.0.7/lib/devise/models/lockable.rb +++ /dev/null @@ -1,150 +0,0 @@ -require 'devise/models/activatable' - -module Devise - module Models - - # Handles blocking a user access after a certain number of attempts. - # Lockable accepts two different strategies to unlock a user after it's - # blocked: email and time. The former will send an email to the user when - # the lock happens, containing a link to unlock it's account. The second - # will unlock the user automatically after some configured time (ie 2.hours). - # It's also possible to setup lockable to use both email and time strategies. - # - # Configuration: - # - # maximum_attempts: how many attempts should be accepted before blocking the user. - # unlock_strategy: unlock the user account by :time, :email or :both. - # unlock_in: the time you want to lock the user after to lock happens. Only - # available when unlock_strategy is :time or :both. - # - module Lockable - include Devise::Models::Activatable - - def self.included(base) - base.class_eval do - extend ClassMethods - end - end - - # Lock an user setting it's locked_at to actual time. - def lock_access! - return true if access_locked? - self.locked_at = Time.now - - if self.class.unlock_strategy_enabled?(:email) - generate_unlock_token - send_unlock_instructions - end - - save(false) - end - - # Unlock an user by cleaning locket_at and failed_attempts. - def unlock_access! - if_access_locked do - self.locked_at = nil - self.failed_attempts = 0 - self.unlock_token = nil - save(false) - end - end - - # Verifies whether a user is locked or not. - def access_locked? - locked_at && !lock_expired? - end - - # Send unlock instructions by email - def send_unlock_instructions - ::DeviseMailer.deliver_unlock_instructions(self) - end - - # Resend the unlock instructions if the user is locked. - def resend_unlock_token - if_access_locked { send_unlock_instructions } - end - - # Overwrites active? from Devise::Models::Activatable for locking purposes - # by verifying whether an user is active to sign in or not based on locked? - def active? - super && !access_locked? - end - - # Overwrites invalid_message from Devise::Models::Authenticatable to define - # the correct reason for blocking the sign in. - def inactive_message - access_locked? ? :locked : super - end - - # Overwrites valid_for_authentication? from Devise::Models::Authenticatable - # for verifying whether an user is allowed to sign in or not. If the user - # is locked, it should never be allowed. - def valid_for_authentication?(attributes) - if result = super - self.failed_attempts = 0 - else - self.failed_attempts += 1 - lock_access! if failed_attempts > self.class.maximum_attempts - end - save(false) if changed? - result - end - - protected - - # Generates unlock token - def generate_unlock_token - self.unlock_token = Devise.friendly_token - end - - # Tells if the lock is expired if :time unlock strategy is active - def lock_expired? - if self.class.unlock_strategy_enabled?(:time) - locked_at && locked_at < self.class.unlock_in.ago - else - false - end - end - - # Checks whether the record is locked or not, yielding to the block - # if it's locked, otherwise adds an error to email. - def if_access_locked - if access_locked? - yield - else - self.class.add_error_on(self, :email, :not_locked) - false - end - end - - module ClassMethods - # Attempt to find a user by it's email. If a record is found, send new - # unlock instructions to it. If not user is found, returns a new user - # with an email not found error. - # Options must contain the user email - def send_unlock_instructions(attributes={}) - lockable = find_or_initialize_with_error_by(:email, attributes[:email], :not_found) - lockable.resend_unlock_token unless lockable.new_record? - lockable - end - - # Find a user by it's unlock token and try to unlock it. - # If no user is found, returns a new user with an error. - # If the user is not locked, creates an error for the user - # Options must have the unlock_token - def unlock_access_by_token(unlock_token) - lockable = find_or_initialize_with_error_by(:unlock_token, unlock_token) - lockable.unlock_access! unless lockable.new_record? - lockable - end - - # Is the unlock enabled for the given unlock strategy? - def unlock_strategy_enabled?(strategy) - [:both, strategy].include?(self.unlock_strategy) - end - - Devise::Models.config(self, :maximum_attempts, :unlock_strategy, :unlock_in) - end - end - end -end diff --git a/vendor/gems/devise-1.0.7/lib/devise/models/recoverable.rb b/vendor/gems/devise-1.0.7/lib/devise/models/recoverable.rb deleted file mode 100644 index 4ac1268e8..000000000 --- a/vendor/gems/devise-1.0.7/lib/devise/models/recoverable.rb +++ /dev/null @@ -1,80 +0,0 @@ -module Devise - module Models - - # Recoverable takes care of reseting the user password and send reset instructions - # Examples: - # - # # resets the user password and save the record, true if valid passwords are given, otherwise false - # User.find(1).reset_password!('password123', 'password123') - # - # # only resets the user password, without saving the record - # user = User.find(1) - # user.reset_password('password123', 'password123') - # - # # creates a new token and send it with instructions about how to reset the password - # User.find(1).send_reset_password_instructions - module Recoverable - def self.included(base) - base.class_eval do - extend ClassMethods - end - end - - # Update password saving the record and clearing token. Returns true if - # the passwords are valid and the record was saved, false otherwise. - def reset_password!(new_password, new_password_confirmation) - self.password = new_password - self.password_confirmation = new_password_confirmation - clear_reset_password_token if valid? - save - end - - # Resets reset password token and send reset password instructions by email - def send_reset_password_instructions - generate_reset_password_token! - ::DeviseMailer.deliver_reset_password_instructions(self) - end - - protected - - # Generates a new random token for reset password - def generate_reset_password_token - self.reset_password_token = Devise.friendly_token - end - - # Resets the reset password token with and save the record without - # validating - def generate_reset_password_token! - generate_reset_password_token && save(false) - end - - # Removes reset_password token - def clear_reset_password_token - self.reset_password_token = nil - end - - module ClassMethods - # Attempt to find a user by it's email. If a record is found, send new - # password instructions to it. If not user is found, returns a new user - # with an email not found error. - # Attributes must contain the user email - def send_reset_password_instructions(attributes={}) - recoverable = find_or_initialize_with_error_by(:email, attributes[:email], :not_found) - recoverable.send_reset_password_instructions unless recoverable.new_record? - recoverable - end - - # Attempt to find a user by it's reset_password_token to reset it's - # password. If a user is found, reset it's password and automatically - # try saving the record. If not user is found, returns a new user - # containing an error in reset_password_token attribute. - # Attributes must contain reset_password_token, password and confirmation - def reset_password_by_token(attributes={}) - recoverable = find_or_initialize_with_error_by(:reset_password_token, attributes[:reset_password_token]) - recoverable.reset_password!(attributes[:password], attributes[:password_confirmation]) unless recoverable.new_record? - recoverable - end - end - end - end -end diff --git a/vendor/gems/devise-1.0.7/lib/devise/models/registerable.rb b/vendor/gems/devise-1.0.7/lib/devise/models/registerable.rb deleted file mode 100644 index 9b51d4aac..000000000 --- a/vendor/gems/devise-1.0.7/lib/devise/models/registerable.rb +++ /dev/null @@ -1,8 +0,0 @@ -module Devise - module Models - # Registerable is responsible for everything related to registering a new - # resource (ie user sign up). - module Registerable - end - end -end diff --git a/vendor/gems/devise-1.0.7/lib/devise/models/rememberable.rb b/vendor/gems/devise-1.0.7/lib/devise/models/rememberable.rb deleted file mode 100644 index cc3bc4bd8..000000000 --- a/vendor/gems/devise-1.0.7/lib/devise/models/rememberable.rb +++ /dev/null @@ -1,92 +0,0 @@ -require 'devise/strategies/rememberable' -require 'devise/hooks/rememberable' - -module Devise - module Models - # Rememberable manages generating and clearing token for remember the user - # from a saved cookie. Rememberable also has utility methods for dealing - # with serializing the user into the cookie and back from the cookie, trying - # to lookup the record based on the saved information. - # You probably wouldn't use rememberable methods directly, they are used - # mostly internally for handling the remember token. - # - # Configuration: - # - # remember_for: the time you want the user will be remembered without - # asking for credentials. After this time the user will be - # blocked and will have to enter his credentials again. - # This configuration is also used to calculate the expires - # time for the cookie created to remember the user. - # By default remember_for is 2.weeks. - # - # Examples: - # - # User.find(1).remember_me! # regenerating the token - # User.find(1).forget_me! # clearing the token - # - # # generating info to put into cookies - # User.serialize_into_cookie(user) - # - # # lookup the user based on the incoming cookie information - # User.serialize_from_cookie(cookie_string) - module Rememberable - - def self.included(base) - base.class_eval do - extend ClassMethods - - # Remember me option available in after_authentication hook. - attr_accessor :remember_me - end - end - - # Generate a new remember token and save the record without validations. - def remember_me! - self.remember_token = Devise.friendly_token - self.remember_created_at = Time.now.utc - save(false) - end - - # Removes the remember token only if it exists, and save the record - # without validations. - def forget_me! - if remember_token - self.remember_token = nil - self.remember_created_at = nil - save(false) - end - end - - # Checks whether the incoming token matches or not with the record token. - def valid_remember_token?(token) - remember_token && !remember_expired? && remember_token == token - end - - # Remember token should be expired if expiration time not overpass now. - def remember_expired? - remember_expires_at <= Time.now.utc - end - - # Remember token expires at created time + remember_for configuration - def remember_expires_at - remember_created_at + self.class.remember_for - end - - module ClassMethods - # Create the cookie key using the record id and remember_token - def serialize_into_cookie(record) - "#{record.id}::#{record.remember_token}" - end - - # Recreate the user based on the stored cookie - def serialize_from_cookie(cookie) - record_id, record_token = cookie.split('::') - record = find(:first, :conditions => { :id => record_id }) if record_id - record if record.try(:valid_remember_token?, record_token) - end - - Devise::Models.config(self, :remember_for) - end - end - end -end diff --git a/vendor/gems/devise-1.0.7/lib/devise/models/timeoutable.rb b/vendor/gems/devise-1.0.7/lib/devise/models/timeoutable.rb deleted file mode 100644 index 764eac2b0..000000000 --- a/vendor/gems/devise-1.0.7/lib/devise/models/timeoutable.rb +++ /dev/null @@ -1,28 +0,0 @@ -require 'devise/hooks/timeoutable' - -module Devise - module Models - # Timeoutable takes care of veryfing whether a user session has already - # expired or not. When a session expires after the configured time, the user - # will be asked for credentials again, it means, he/she will be redirected - # to the sign in page. - # - # Configuration: - # - # timeout_in: the time you want to timeout the user session without activity. - module Timeoutable - def self.included(base) - base.extend ClassMethods - end - - # Checks whether the user session has expired based on configured time. - def timedout?(last_access) - last_access && last_access <= self.class.timeout_in.ago - end - - module ClassMethods - Devise::Models.config(self, :timeout_in) - end - end - end -end diff --git a/vendor/gems/devise-1.0.7/lib/devise/models/token_authenticatable.rb b/vendor/gems/devise-1.0.7/lib/devise/models/token_authenticatable.rb deleted file mode 100644 index 501fef4d3..000000000 --- a/vendor/gems/devise-1.0.7/lib/devise/models/token_authenticatable.rb +++ /dev/null @@ -1,89 +0,0 @@ -require 'devise/strategies/token_authenticatable' - -module Devise - module Models - # Token Authenticatable Module, responsible for generate authentication token and validating - # authenticity of a user while signing in using an authentication token (say follows an URL). - # - # == Configuration: - # - # You can overwrite configuration values by setting in globally in Devise (+Devise.setup+), - # using devise method, or overwriting the respective instance method. - # - # +token_authentication_key+ - Defines name of the authentication token params key. E.g. /users/sign_in?some_key=... - # - # == Examples: - # - # User.authenticate_with_token(:auth_token => '123456789') # returns authenticated user or nil - # User.find(1).valid_authentication_token?('rI1t6PKQ8yP7VetgwdybB') # returns true/false - # - module TokenAuthenticatable - def self.included(base) - base.class_eval do - extend ClassMethods - before_save :ensure_authentication_token - end - end - - # Generate new authentication token (a.k.a. "single access token"). - def reset_authentication_token - self.authentication_token = self.class.authentication_token - end - - # Generate new authentication token and save the record. - def reset_authentication_token! - reset_authentication_token - self.save - end - - # Generate authentication token unless already exists. - def ensure_authentication_token - self.reset_authentication_token if self.authentication_token.blank? - end - - # Generate authentication token unless already exists and save the record. - def ensure_authentication_token! - self.reset_authentication_token! if self.authentication_token.blank? - end - - # Verifies whether an +incoming_authentication_token+ (i.e. from single access URL) - # is the user authentication token. - def valid_authentication_token?(incoming_auth_token) - incoming_auth_token.present? && incoming_auth_token == self.authentication_token - end - - module ClassMethods - ::Devise::Models.config(self, :token_authentication_key) - - # Authenticate a user based on authentication token. - def authenticate_with_token(attributes) - token = attributes[self.token_authentication_key] - resource = self.find_for_token_authentication(token) - resource if resource.try(:valid_authentication_token?, token) - end - - def authentication_token - ::Devise.friendly_token - end - - protected - - # Find first record based on conditions given (ie by the sign in form). - # Overwrite to add customized conditions, create a join, or maybe use a - # namedscope to filter records while authenticating. - # - # == Example: - # - # def self.find_for_token_authentication(token, conditions = {}) - # conditions = {:active => true} - # self.find_by_authentication_token(token, :conditions => conditions) - # end - # - def find_for_token_authentication(token) - self.find(:first, :conditions => { :authentication_token => token}) - end - - end - end - end -end diff --git a/vendor/gems/devise-1.0.7/lib/devise/models/trackable.rb b/vendor/gems/devise-1.0.7/lib/devise/models/trackable.rb deleted file mode 100644 index 660ec44ec..000000000 --- a/vendor/gems/devise-1.0.7/lib/devise/models/trackable.rb +++ /dev/null @@ -1,16 +0,0 @@ -require 'devise/hooks/trackable' - -module Devise - module Models - # Track information about your user sign in. It tracks the following columns: - # - # * sign_in_count - Increased every time a sign in is made (by form, openid, oauth) - # * current_sign_in_at - A tiemstamp updated when the user signs in - # * last_sign_in_at - Holds the timestamp of the previous sign in - # * current_sign_in_ip - The remote ip updated when the user sign in - # * last_sign_in_at - Holds the remote ip of the previous sign in - # - module Trackable - end - end -end diff --git a/vendor/gems/devise-1.0.7/lib/devise/models/validatable.rb b/vendor/gems/devise-1.0.7/lib/devise/models/validatable.rb deleted file mode 100644 index 737ec9a2f..000000000 --- a/vendor/gems/devise-1.0.7/lib/devise/models/validatable.rb +++ /dev/null @@ -1,39 +0,0 @@ -module Devise - module Models - - # Validatable creates all needed validations for a user email and password. - # It's optional, given you may want to create the validations by yourself. - # Automatically validate if the email is present, unique and it's format is - # valid. Also tests presence of password, confirmation and length - module Validatable - # All validations used by this module. - VALIDATIONS = [ :validates_presence_of, :validates_uniqueness_of, :validates_format_of, - :validates_confirmation_of, :validates_length_of ].freeze - - def self.included(base) - assert_validations_api!(base) - - base.class_eval do - validates_presence_of :email - validates_uniqueness_of :email, :scope => authentication_keys[1..-1], :allow_blank => true - validates_format_of :email, :with => EMAIL_REGEX, :allow_blank => true - - with_options :if => :password_required? do |v| - v.validates_presence_of :password - v.validates_confirmation_of :password - v.validates_length_of :password, :within => 6..20, :allow_blank => true - end - end - end - - def self.assert_validations_api!(base) #:nodoc: - unavailable_validations = VALIDATIONS.select { |v| !base.respond_to?(v) } - - unless unavailable_validations.empty? - raise "Could not use :validatable module since #{base} does not respond " << - "to the following methods: #{unavailable_validations.to_sentence}." - end - end - end - end -end diff --git a/vendor/gems/devise-1.0.7/lib/devise/orm/active_record.rb b/vendor/gems/devise-1.0.7/lib/devise/orm/active_record.rb deleted file mode 100644 index 4181b0d9e..000000000 --- a/vendor/gems/devise-1.0.7/lib/devise/orm/active_record.rb +++ /dev/null @@ -1,41 +0,0 @@ -module Devise - module Orm - # This module contains some helpers and handle schema (migrations): - # - # create_table :accounts do |t| - # t.authenticatable - # t.confirmable - # t.recoverable - # t.rememberable - # t.trackable - # t.lockable - # t.timestamps - # end - # - # However this method does not add indexes. If you need them, here is the declaration: - # - # add_index "accounts", ["email"], :name => "email", :unique => true - # add_index "accounts", ["confirmation_token"], :name => "confirmation_token", :unique => true - # add_index "accounts", ["reset_password_token"], :name => "reset_password_token", :unique => true - # - module ActiveRecord - # Required ORM hook. Just yield the given block in ActiveRecord. - def self.included_modules_hook(klass) - yield - end - - include Devise::Schema - - # Tell how to apply schema methods. - def apply_schema(name, type, options={}) - column name, type.to_s.downcase.to_sym, options - end - end - end -end - -if defined?(ActiveRecord) - ActiveRecord::Base.extend Devise::Models - ActiveRecord::ConnectionAdapters::Table.send :include, Devise::Orm::ActiveRecord - ActiveRecord::ConnectionAdapters::TableDefinition.send :include, Devise::Orm::ActiveRecord -end \ No newline at end of file diff --git a/vendor/gems/devise-1.0.7/lib/devise/orm/data_mapper.rb b/vendor/gems/devise-1.0.7/lib/devise/orm/data_mapper.rb deleted file mode 100644 index 8a3a1a75d..000000000 --- a/vendor/gems/devise-1.0.7/lib/devise/orm/data_mapper.rb +++ /dev/null @@ -1,83 +0,0 @@ -module Devise - module Orm - module DataMapper - module InstanceMethods - def save(flag=nil) - if flag == false - save! - else - super() - end - end - end - - def self.included_modules_hook(klass) - klass.send :extend, self - klass.send :include, InstanceMethods - - yield - - klass.devise_modules.each do |mod| - klass.send(mod) if klass.respond_to?(mod) - end - end - - include Devise::Schema - - SCHEMA_OPTIONS = { - :null => :nullable, - :limit => :length - } - - # Hooks for confirmable - def before_create(*args) - wrap_hook(:before, *args) - end - - def after_create(*args) - wrap_hook(:after, *args) - end - - def wrap_hook(action, *args) - options = args.extract_options! - - args.each do |callback| - send action, :create, callback - class_eval <<-METHOD, __FILE__, __LINE__ + 1 - def #{callback} - super if #{options[:if] || true} - end - METHOD - end - end - - # Add ActiveRecord like finder - def find(*args) - options = args.extract_options! - case args.first - when :first - first(options) - when :all - all(options) - else - get(*args) - end - end - - # Tell how to apply schema methods. This automatically maps :limit to - # :length and :null to :nullable. - def apply_schema(name, type, options={}) - return unless Devise.apply_schema - - SCHEMA_OPTIONS.each do |old_key, new_key| - next unless options.key?(old_key) - options[new_key] = options.delete(old_key) - end - - property name, type, options - end - end - end -end - -DataMapper::Model.send(:include, Devise::Models) diff --git a/vendor/gems/devise-1.0.7/lib/devise/orm/mongo_mapper.rb b/vendor/gems/devise-1.0.7/lib/devise/orm/mongo_mapper.rb deleted file mode 100644 index 6e2a81a59..000000000 --- a/vendor/gems/devise-1.0.7/lib/devise/orm/mongo_mapper.rb +++ /dev/null @@ -1,47 +0,0 @@ -module Devise - module Orm - module MongoMapper - module InstanceMethods - def save(options={}) - if options == false - super(:validate => false) - else - super - end - end - end - - def self.included_modules_hook(klass) - klass.send :extend, self - klass.send :include, InstanceMethods - yield - - klass.devise_modules.each do |mod| - klass.send(mod) if klass.respond_to?(mod) - end - end - - def find(*args) - case args.first - when :first, :all - send(args.shift, *args) - else - super - end - end - - include Devise::Schema - - # Tell how to apply schema methods. This automatically converts DateTime - # to Time, since MongoMapper does not recognize the former. - def apply_schema(name, type, options={}) - return unless Devise.apply_schema - type = Time if type == DateTime - key name, type, options - end - end - end -end - -MongoMapper::Document.extra_extensions << Devise::Models -MongoMapper::EmbeddedDocument.extra_extensions << Devise::Models diff --git a/vendor/gems/devise-1.0.7/lib/devise/rails.rb b/vendor/gems/devise-1.0.7/lib/devise/rails.rb deleted file mode 100644 index d572a642d..000000000 --- a/vendor/gems/devise-1.0.7/lib/devise/rails.rb +++ /dev/null @@ -1,14 +0,0 @@ -require 'devise/rails/routes' -require 'devise/rails/warden_compat' - -Rails.configuration.after_initialize do - require "devise/orm/#{Devise.orm}" - - # Adds Warden Manager to Rails middleware stack, configuring default devise - # strategy and also the failure app. - Rails.configuration.middleware.use Warden::Manager do |config| - Devise.configure_warden(config) - end - - I18n.load_path.unshift File.expand_path(File.join(File.dirname(__FILE__), 'locales', 'en.yml')) -end diff --git a/vendor/gems/devise-1.0.7/lib/devise/rails/routes.rb b/vendor/gems/devise-1.0.7/lib/devise/rails/routes.rb deleted file mode 100644 index 192fcf2b8..000000000 --- a/vendor/gems/devise-1.0.7/lib/devise/rails/routes.rb +++ /dev/null @@ -1,125 +0,0 @@ -module ActionController::Routing - class RouteSet #:nodoc: - - # Ensure Devise modules are included only after loading routes, because we - # need devise_for mappings already declared to create magic filters and - # helpers. - def load_routes_with_devise! - load_routes_without_devise! - return if Devise.mappings.empty? - - ActionController::Base.send :include, Devise::Controllers::Helpers - ActionController::Base.send :include, Devise::Controllers::UrlHelpers - - ActionView::Base.send :include, Devise::Controllers::UrlHelpers - end - alias_method_chain :load_routes!, :devise - - class Mapper #:doc: - # Includes devise_for method for routes. This method is responsible to - # generate all needed routes for devise, based on what modules you have - # defined in your model. - # Examples: Let's say you have an User model configured to use - # authenticatable, confirmable and recoverable modules. After creating this - # inside your routes: - # - # map.devise_for :users - # - # this method is going to look inside your User model and create the - # needed routes: - # - # # Session routes for Authenticatable (default) - # new_user_session GET /users/sign_in {:controller=>"sessions", :action=>"new"} - # user_session POST /users/sign_in {:controller=>"sessions", :action=>"create"} - # destroy_user_session GET /users/sign_out {:controller=>"sessions", :action=>"destroy"} - # - # # Password routes for Recoverable, if User model has :recoverable configured - # new_user_password GET /users/password/new(.:format) {:controller=>"passwords", :action=>"new"} - # edit_user_password GET /users/password/edit(.:format) {:controller=>"passwords", :action=>"edit"} - # user_password PUT /users/password(.:format) {:controller=>"passwords", :action=>"update"} - # POST /users/password(.:format) {:controller=>"passwords", :action=>"create"} - # - # # Confirmation routes for Confirmable, if User model has :confirmable configured - # new_user_confirmation GET /users/confirmation/new(.:format) {:controller=>"confirmations", :action=>"new"} - # user_confirmation GET /users/confirmation(.:format) {:controller=>"confirmations", :action=>"show"} - # POST /users/confirmation(.:format) {:controller=>"confirmations", :action=>"create"} - # - # You can configure your routes with some options: - # - # * :class_name => setup a different class to be looked up by devise, if it cannot be correctly find by the route name. - # - # map.devise_for :users, :class_name => 'Account' - # - # * :as => allows you to setup path name that will be used, as rails routes does. The following route configuration would setup your route as /accounts instead of /users: - # - # map.devise_for :users, :as => 'accounts' - # - # * :scope => setup the scope name. This is used as the instance variable name in controller, as the name in routes and the scope given to warden. Defaults to the singular of the given name: - # - # map.devise_for :users, :scope => :account - # - # * :path_names => configure different path names to overwrite defaults :sign_in, :sign_out, :password and :confirmation. - # - # map.devise_for :users, :path_names => { :sign_in => 'login', :sign_out => 'logout', :password => 'secret', :confirmation => 'verification' } - # - # * :path_prefix => the path prefix to be used in all routes. - # - # map.devise_for :users, :path_prefix => "/:locale" - # - # Any other options will be passed to route definition. If you need conditions for your routes, just map: - # - # map.devise_for :users, :conditions => { :subdomain => /.+/ } - # - # If you are using a dynamic prefix, like :locale above, you need to configure default_url_options through Devise. You can do that in config/initializers/devise.rb or setting a Devise.default_url_options: - # - # Devise.default_url_options do - # { :locale => I18n.locale } - # end - # - def devise_for(*resources) - options = resources.extract_options! - - resources.map!(&:to_sym) - resources.each do |resource| - mapping = Devise::Mapping.new(resource, options.dup) - Devise.default_scope ||= mapping.name - Devise.mappings[mapping.name] = mapping - - route_options = mapping.route_options.merge(:path_prefix => mapping.raw_path, :name_prefix => "#{mapping.name}_") - - with_options(route_options) do |routes| - mapping.for.each do |mod| - send(mod, routes, mapping) if self.respond_to?(mod, true) - end - end - end - end - - protected - - def database_authenticatable(routes, mapping) - routes.with_options(:controller => 'sessions', :name_prefix => nil) do |session| - session.send(:"new_#{mapping.name}_session", mapping.path_names[:sign_in], :action => 'new', :conditions => { :method => :get }) - session.send(:"#{mapping.name}_session", mapping.path_names[:sign_in], :action => 'create', :conditions => { :method => :post }) - session.send(:"destroy_#{mapping.name}_session", mapping.path_names[:sign_out], :action => 'destroy', :conditions => { :method => :get }) - end - end - - def confirmable(routes, mapping) - routes.resource :confirmation, :only => [:new, :create, :show], :as => mapping.path_names[:confirmation] - end - - def lockable(routes, mapping) - routes.resource :unlock, :only => [:new, :create, :show], :as => mapping.path_names[:unlock] - end - - def recoverable(routes, mapping) - routes.resource :password, :only => [:new, :create, :edit, :update], :as => mapping.path_names[:password] - end - - def registerable(routes, mapping) - routes.resource :registration, :only => [:new, :create, :edit, :update, :destroy], :as => mapping.raw_path[1..-1], :path_prefix => nil, :path_names => { :new => mapping.path_names[:sign_up] } - end - end - end -end diff --git a/vendor/gems/devise-1.0.7/lib/devise/rails/warden_compat.rb b/vendor/gems/devise-1.0.7/lib/devise/rails/warden_compat.rb deleted file mode 100644 index 5d947ad89..000000000 --- a/vendor/gems/devise-1.0.7/lib/devise/rails/warden_compat.rb +++ /dev/null @@ -1,25 +0,0 @@ -module Warden::Mixins::Common - def request - @request ||= env['action_controller.rescue.request'] - end - - def reset_session! - raw_session.inspect # why do I have to inspect it to get it to clear? - raw_session.clear - end - - def response - @response ||= env['action_controller.rescue.response'] - end -end - -class Warden::SessionSerializer - def serialize(record) - [record.class, record.id] - end - - def deserialize(keys) - klass, id = keys - klass.find(:first, :conditions => { :id => id }) - end -end \ No newline at end of file diff --git a/vendor/gems/devise-1.0.7/lib/devise/schema.rb b/vendor/gems/devise-1.0.7/lib/devise/schema.rb deleted file mode 100644 index 38abb612e..000000000 --- a/vendor/gems/devise-1.0.7/lib/devise/schema.rb +++ /dev/null @@ -1,73 +0,0 @@ -module Devise - # Holds devise schema information. To use it, just include its methods - # and overwrite the apply_schema method. - module Schema - - def authenticatable(*args) - ActiveSupport::Deprecation.warn "t.authenticatable in migrations is deprecated. Please use t.database_authenticatable instead.", caller - database_authenticatable(*args) - end - - # Creates email, encrypted_password and password_salt. - # - # == Options - # * :null - When true, allow columns to be null. - def database_authenticatable(options={}) - null = options[:null] || false - default = options[:default] || "" - - if options.delete(:encryptor) - ActiveSupport::Deprecation.warn ":encryptor as option is deprecated, simply remove it." - end - - apply_schema :email, String, :null => null, :default => default - apply_schema :encrypted_password, String, :null => null, :default => default, :limit => 128 - apply_schema :password_salt, String, :null => null, :default => default - end - - # Creates authentication_token. - def token_authenticatable - apply_schema :authentication_token, String - end - - # Creates confirmation_token, confirmed_at and confirmation_sent_at. - def confirmable - apply_schema :confirmation_token, String - apply_schema :confirmed_at, DateTime - apply_schema :confirmation_sent_at, DateTime - end - - # Creates reset_password_token. - def recoverable - apply_schema :reset_password_token, String - end - - # Creates remember_token and remember_created_at. - def rememberable - apply_schema :remember_token, String - apply_schema :remember_created_at, DateTime - end - - # Creates sign_in_count, current_sign_in_at, last_sign_in_at, - # current_sign_in_ip, last_sign_in_ip. - def trackable - apply_schema :sign_in_count, Integer, :default => 0 - apply_schema :current_sign_in_at, DateTime - apply_schema :last_sign_in_at, DateTime - apply_schema :current_sign_in_ip, String - apply_schema :last_sign_in_ip, String - end - - # Creates failed_attempts, unlock_token and locked_at - def lockable - apply_schema :failed_attempts, Integer, :default => 0 - apply_schema :unlock_token, String - apply_schema :locked_at, DateTime - end - - # Overwrite with specific modification to create your own schema. - def apply_schema(name, type, options={}) - raise NotImplementedError - end - end -end diff --git a/vendor/gems/devise-1.0.7/lib/devise/strategies/base.rb b/vendor/gems/devise-1.0.7/lib/devise/strategies/base.rb deleted file mode 100644 index 43885d519..000000000 --- a/vendor/gems/devise-1.0.7/lib/devise/strategies/base.rb +++ /dev/null @@ -1,16 +0,0 @@ -module Devise - module Strategies - # Base strategy for Devise. Responsible for verifying correct scope and mapping. - class Base < ::Warden::Strategies::Base - # Checks if a valid scope was given for devise and find mapping based on - # this scope. - def mapping - @mapping ||= begin - mapping = Devise.mappings[scope] - raise "Could not find mapping for #{scope}" unless mapping - mapping - end - end - end - end -end diff --git a/vendor/gems/devise-1.0.7/lib/devise/strategies/database_authenticatable.rb b/vendor/gems/devise-1.0.7/lib/devise/strategies/database_authenticatable.rb deleted file mode 100644 index 2a78bf762..000000000 --- a/vendor/gems/devise-1.0.7/lib/devise/strategies/database_authenticatable.rb +++ /dev/null @@ -1,36 +0,0 @@ -require 'devise/strategies/base' - -module Devise - module Strategies - # Default strategy for signing in a user, based on his email and password. - # Redirects to sign_in page if it's not authenticated - class DatabaseAuthenticatable < Base - def valid? - valid_controller? && valid_params? && mapping.to.respond_to?(:authenticate) - end - - # Authenticate a user based on email and password params, returning to warden - # success and the authenticated user if everything is okay. Otherwise redirect - # to sign in page. - def authenticate! - if resource = mapping.to.authenticate(params[scope]) - success!(resource) - else - fail(:invalid) - end - end - - protected - - def valid_controller? - params[:controller] =~ /sessions$/ - end - - def valid_params? - params[scope] && params[scope][:password].present? - end - end - end -end - -Warden::Strategies.add(:database_authenticatable, Devise::Strategies::DatabaseAuthenticatable) diff --git a/vendor/gems/devise-1.0.7/lib/devise/strategies/http_authenticatable.rb b/vendor/gems/devise-1.0.7/lib/devise/strategies/http_authenticatable.rb deleted file mode 100644 index a93a6cd4e..000000000 --- a/vendor/gems/devise-1.0.7/lib/devise/strategies/http_authenticatable.rb +++ /dev/null @@ -1,59 +0,0 @@ -require 'devise/strategies/base' - -module Devise - module Strategies - # Sign in an user using HTTP authentication. - class HttpAuthenticatable < Base - def valid? - http_authentication? && mapping.to.respond_to?(:authenticate_with_http) - end - - def authenticate! - username, password = username_and_password - - if resource = mapping.to.authenticate_with_http(username, password) - success!(resource) - else - custom!([401, custom_headers, [response_body]]) - end - end - - private - - def username_and_password - decode_credentials(request).split(/:/, 2) - end - - def response_body - body = "HTTP Basic: Access denied." - method = :"to_#{request_format.to_sym}" - {}.respond_to?(method) ? { :error => body }.send(method) : body - end - - def http_authentication - request.env['HTTP_AUTHORIZATION'] || - request.env['X-HTTP_AUTHORIZATION'] || - request.env['X_HTTP_AUTHORIZATION'] || - request.env['REDIRECT_X_HTTP_AUTHORIZATION'] - end - alias :http_authentication? :http_authentication - - def decode_credentials(request) - ActiveSupport::Base64.decode64(http_authentication.split(' ', 2).last || '') - end - - def custom_headers - { - "Content-Type" => request_format.to_s, - "WWW-Authenticate" => %(Basic realm="#{Devise.http_authentication_realm.gsub(/"/, "")}") - } - end - - def request_format - @request_format ||= Mime::Type.lookup_by_extension(request.template_format.to_s) - end - end - end -end - -Warden::Strategies.add(:http_authenticatable, Devise::Strategies::HttpAuthenticatable) diff --git a/vendor/gems/devise-1.0.7/lib/devise/strategies/rememberable.rb b/vendor/gems/devise-1.0.7/lib/devise/strategies/rememberable.rb deleted file mode 100644 index 9b3a53828..000000000 --- a/vendor/gems/devise-1.0.7/lib/devise/strategies/rememberable.rb +++ /dev/null @@ -1,37 +0,0 @@ -require 'devise/strategies/base' - -module Devise - module Strategies - # Remember the user through the remember token. This strategy is responsible - # to verify whether there is a cookie with the remember token, and to - # recreate the user from this cookie if it exists. Must be called *before* - # authenticatable. - class Rememberable < Devise::Strategies::Base - - # A valid strategy for rememberable needs a remember token in the cookies. - def valid? - remember_me_cookie.present? && mapping.to.respond_to?(:serialize_from_cookie) - end - - # To authenticate a user we deserialize the cookie and attempt finding - # the record in the database. If the attempt fails, we pass to another - # strategy handle the authentication. - def authenticate! - if resource = mapping.to.serialize_from_cookie(remember_me_cookie) - success!(resource) - else - pass - end - end - - private - - # Accessor for remember cookie - def remember_me_cookie - @remember_me_cookie ||= request.cookies["remember_#{mapping.name}_token"] - end - end - end -end - -Warden::Strategies.add(:rememberable, Devise::Strategies::Rememberable) \ No newline at end of file diff --git a/vendor/gems/devise-1.0.7/lib/devise/strategies/token_authenticatable.rb b/vendor/gems/devise-1.0.7/lib/devise/strategies/token_authenticatable.rb deleted file mode 100644 index d8baf5456..000000000 --- a/vendor/gems/devise-1.0.7/lib/devise/strategies/token_authenticatable.rb +++ /dev/null @@ -1,37 +0,0 @@ -require 'devise/strategies/base' - -module Devise - module Strategies - # Strategy for signing in a user, based on a authenticatable token. - # Redirects to sign_in page if it's not authenticated. - class TokenAuthenticatable < Base - def valid? - mapping.to.respond_to?(:authenticate_with_token) && authentication_token(scope).present? - end - - # Authenticate a user based on authenticatable token params, returning to warden - # success and the authenticated user if everything is okay. Otherwise redirect - # to sign in page. - def authenticate! - if resource = mapping.to.authenticate_with_token(params[scope] || params) - success!(resource) - else - fail!(:invalid_token) - end - end - - private - - # Detect authentication token in params: scoped or not. - def authentication_token(scope) - if params[scope] - params[scope][mapping.to.token_authentication_key] - else - params[mapping.to.token_authentication_key] - end - end - end - end -end - -Warden::Strategies.add(:token_authenticatable, Devise::Strategies::TokenAuthenticatable) diff --git a/vendor/gems/devise-1.0.7/lib/devise/test_helpers.rb b/vendor/gems/devise-1.0.7/lib/devise/test_helpers.rb deleted file mode 100644 index 0e49cd3de..000000000 --- a/vendor/gems/devise-1.0.7/lib/devise/test_helpers.rb +++ /dev/null @@ -1,90 +0,0 @@ -module Devise - module TestHelpers - def self.included(base) - base.class_eval do - setup :setup_controller_for_warden, :warden if respond_to?(:setup) - end - end - - # This is a Warden::Proxy customized for functional tests. It's meant to - # some of Warden::Manager responsibilities, as retrieving configuration - # options and calling the FailureApp. - class TestWarden < Warden::Proxy #:nodoc: - attr_reader :controller - - def initialize(controller) - @controller = controller - manager = Warden::Manager.new(nil) do |config| - Devise.configure_warden(config) - end - super(controller.request.env, manager) - end - - def authenticate!(*args) - catch_with_redirect { super } - end - - def user(*args) - catch_with_redirect { super } - end - - def catch_with_redirect(&block) - result = catch(:warden, &block) - - if result.is_a?(Hash) && !custom_failure? && !@controller.send(:performed?) - result[:action] ||= :unauthenticated - - env = @controller.request.env - env["PATH_INFO"] = "/#{result[:action]}" - env["warden.options"] = result - Warden::Manager._before_failure.each{ |hook| hook.call(env, result) } - - status, headers, body = Devise::FailureApp.call(env).to_a - @controller.send :redirect_to, headers["Location"] - else - result - end - end - end - - # We need to setup the environment variables and the response in the controller. - def setup_controller_for_warden #:nodoc: - @request.env['action_controller.rescue.request'] = @request - @request.env['action_controller.rescue.response'] = @response - @request.env['rack.session'] = session - @controller.response = @response - end - - # Quick access to Warden::Proxy. - def warden #:nodoc: - @warden ||= (@request.env['warden'] = TestWarden.new(@controller)) - end - - # sign_in a given resource by storing its keys in the session. - # - # Examples: - # - # sign_in :user, @user # sign_in(scope, resource) - # sign_in @user # sign_in(resource) - # - def sign_in(resource_or_scope, resource=nil) - scope ||= Devise::Mapping.find_scope!(resource_or_scope) - resource ||= resource_or_scope - warden.session_serializer.store(resource, scope) - end - - # Sign out a given resource or scope by calling logout on Warden. - # - # Examples: - # - # sign_out :user # sign_out(scope) - # sign_out @user # sign_out(resource) - # - def sign_out(resource_or_scope) - scope = Devise::Mapping.find_scope!(resource_or_scope) - @controller.instance_variable_set(:"@current_#{scope}", nil) - warden.logout(scope) - end - - end -end diff --git a/vendor/gems/devise-1.0.7/lib/devise/version.rb b/vendor/gems/devise-1.0.7/lib/devise/version.rb deleted file mode 100644 index 983ec8424..000000000 --- a/vendor/gems/devise-1.0.7/lib/devise/version.rb +++ /dev/null @@ -1,3 +0,0 @@ -module Devise - VERSION = "1.0.7".freeze -end diff --git a/vendor/gems/devise-1.0.7/rails/init.rb b/vendor/gems/devise-1.0.7/rails/init.rb deleted file mode 100644 index 5460b4473..000000000 --- a/vendor/gems/devise-1.0.7/rails/init.rb +++ /dev/null @@ -1,2 +0,0 @@ -# We need to load devise here to ensure routes extensions are loaded. -require 'devise' diff --git a/vendor/gems/devise-1.0.7/test/controllers/helpers_test.rb b/vendor/gems/devise-1.0.7/test/controllers/helpers_test.rb deleted file mode 100644 index 80d397b20..000000000 --- a/vendor/gems/devise-1.0.7/test/controllers/helpers_test.rb +++ /dev/null @@ -1,177 +0,0 @@ -require 'test/test_helper' -require 'ostruct' - -class MockController < ApplicationController - attr_accessor :env - - def request - self - end - - def path - '' - end -end - -class ControllerAuthenticableTest < ActionController::TestCase - tests MockController - - def setup - @controller = MockController.new - @mock_warden = OpenStruct.new - @controller.env = { 'warden' => @mock_warden } - @controller.session = {} - end - - test 'setup warden' do - assert_not_nil @controller.warden - end - - test 'provide access to warden instance' do - assert_equal @controller.warden, @controller.env['warden'] - end - - test 'proxy signed_in? to authenticated' do - @mock_warden.expects(:authenticate?).with(:scope => :my_scope) - @controller.signed_in?(:my_scope) - end - - test 'proxy current_admin to authenticate with admin scope' do - @mock_warden.expects(:authenticate).with(:scope => :admin) - @controller.current_admin - end - - test 'proxy current_user to authenticate with user scope' do - @mock_warden.expects(:authenticate).with(:scope => :user) - @controller.current_user - end - - test 'proxy user_authenticate! to authenticate with user scope' do - @mock_warden.expects(:authenticate!).with(:scope => :user) - @controller.authenticate_user! - end - - test 'proxy admin_authenticate! to authenticate with admin scope' do - @mock_warden.expects(:authenticate!).with(:scope => :admin) - @controller.authenticate_admin! - end - - test 'proxy user_signed_in? to authenticate? with user scope' do - @mock_warden.expects(:authenticate?).with(:scope => :user) - @controller.user_signed_in? - end - - test 'proxy admin_signed_in? to authenticate? with admin scope' do - @mock_warden.expects(:authenticate?).with(:scope => :admin) - @controller.admin_signed_in? - end - - test 'proxy user_session to session scope in warden' do - @mock_warden.expects(:authenticate).with(:scope => :user).returns(true) - @mock_warden.expects(:session).with(:user).returns({}) - @controller.user_session - end - - test 'proxy admin_session to session scope in warden' do - @mock_warden.expects(:authenticate).with(:scope => :admin).returns(true) - @mock_warden.expects(:session).with(:admin).returns({}) - @controller.admin_session - end - - test 'sign in proxy to set_user on warden' do - user = User.new - @mock_warden.expects(:set_user).with(user, :scope => :user).returns(true) - @controller.sign_in(:user, user) - end - - test 'sign in accepts a resource as argument' do - user = User.new - @mock_warden.expects(:set_user).with(user, :scope => :user).returns(true) - @controller.sign_in(user) - end - - test 'sign out proxy to logout on warden' do - @mock_warden.expects(:user).with(:user).returns(true) - @mock_warden.expects(:logout).with(:user).returns(true) - @controller.sign_out(:user) - end - - test 'sign out accepts a resource as argument' do - @mock_warden.expects(:user).with(:user).returns(true) - @mock_warden.expects(:logout).with(:user).returns(true) - @controller.sign_out(User.new) - end - - test 'stored location for returns the location for a given scope' do - assert_nil @controller.stored_location_for(:user) - @controller.session[:"user.return_to"] = "/foo.bar" - assert_equal "/foo.bar", @controller.stored_location_for(:user) - end - - test 'stored location for accepts a resource as argument' do - assert_nil @controller.stored_location_for(:user) - @controller.session[:"user.return_to"] = "/foo.bar" - assert_equal "/foo.bar", @controller.stored_location_for(User.new) - end - - test 'stored location cleans information after reading' do - @controller.session[:"user.return_to"] = "/foo.bar" - assert_equal "/foo.bar", @controller.stored_location_for(:user) - assert_nil @controller.session[:"user.return_to"] - end - - test 'after sign in path defaults to root path if none by was specified for the given scope' do - assert_equal root_path, @controller.after_sign_in_path_for(:user) - end - - test 'after sign in path defaults to the scoped root path' do - assert_equal admin_root_path, @controller.after_sign_in_path_for(:admin) - end - - test 'after sign out path defaults to the root path' do - assert_equal root_path, @controller.after_sign_out_path_for(:admin) - assert_equal root_path, @controller.after_sign_out_path_for(:user) - end - - test 'sign in and redirect uses the stored location' do - user = User.new - @controller.session[:"user.return_to"] = "/foo.bar" - @mock_warden.expects(:set_user).with(user, :scope => :user).returns(true) - @controller.expects(:redirect_to).with("/foo.bar") - @controller.sign_in_and_redirect(user) - end - - test 'sign in and redirect uses the configured after sign in path' do - admin = Admin.new - @mock_warden.expects(:set_user).with(admin, :scope => :admin).returns(true) - @controller.expects(:redirect_to).with(admin_root_path) - @controller.sign_in_and_redirect(admin) - end - - test 'only redirect if skip is given' do - admin = Admin.new - @controller.expects(:redirect_to).with(admin_root_path) - @controller.sign_in_and_redirect(:admin, admin, true) - end - - test 'sign out and redirect uses the configured after sign out path' do - @mock_warden.expects(:user).with(:admin).returns(true) - @mock_warden.expects(:logout).with(:admin).returns(true) - @controller.expects(:redirect_to).with(admin_root_path) - @controller.instance_eval "def after_sign_out_path_for(resource); admin_root_path; end" - @controller.sign_out_and_redirect(:admin) - end - - test 'is not a devise controller' do - assert_not @controller.devise_controller? - end - - test 'default url options are retrieved from devise' do - begin - Devise.default_url_options {{ :locale => I18n.locale }} - assert_equal({ :locale => :en }, @controller.send(:default_url_options)) - ensure - Devise.default_url_options {{ }} - end - end -end diff --git a/vendor/gems/devise-1.0.7/test/controllers/internal_helpers_test.rb b/vendor/gems/devise-1.0.7/test/controllers/internal_helpers_test.rb deleted file mode 100644 index 4c9ec7c4b..000000000 --- a/vendor/gems/devise-1.0.7/test/controllers/internal_helpers_test.rb +++ /dev/null @@ -1,55 +0,0 @@ -require 'test/test_helper' - -class MyController < ApplicationController - include Devise::Controllers::InternalHelpers -end - -class HelpersTest < ActionController::TestCase - tests MyController - - test 'get resource name from request path' do - @request.path = '/users/session' - assert_equal :user, @controller.resource_name - end - - test 'get resource name from specific request path' do - @request.path = '/admin_area/session' - assert_equal :admin, @controller.resource_name - end - - test 'get resource class from request path' do - @request.path = '/users/session' - assert_equal User, @controller.resource_class - end - - test 'get resource instance variable from request path' do - @request.path = '/admin_area/session' - @controller.instance_variable_set(:@admin, admin = Admin.new) - assert_equal admin, @controller.resource - end - - test 'set resource instance variable from request path' do - @request.path = '/admin_area/session' - - admin = @controller.send(:resource_class).new - @controller.send(:resource=, admin) - - assert_equal admin, @controller.send(:resource) - assert_equal admin, @controller.instance_variable_get(:@admin) - end - - test 'resources methods are not controller actions' do - assert @controller.class.action_methods.empty? - end - - test 'require no authentication tests current mapping' do - @controller.expects(:resource_name).returns(:user).twice - @mock_warden.expects(:authenticated?).with(:user).returns(true) - @controller.expects(:redirect_to).with(root_path) - @controller.send :require_no_authentication - end - - test 'is a devise controller' do - assert @controller.devise_controller? - end -end diff --git a/vendor/gems/devise-1.0.7/test/controllers/url_helpers_test.rb b/vendor/gems/devise-1.0.7/test/controllers/url_helpers_test.rb deleted file mode 100644 index 9344c2def..000000000 --- a/vendor/gems/devise-1.0.7/test/controllers/url_helpers_test.rb +++ /dev/null @@ -1,47 +0,0 @@ -require 'test/test_helper' - -class RoutesTest < ActionController::TestCase - tests ApplicationController - - def test_path_and_url(name, prepend_path=nil) - @request.path = '/users/session' - prepend_path = "#{prepend_path}_" if prepend_path - - # Resource param - assert_equal @controller.send(:"#{prepend_path}#{name}_path", :user), - send(:"#{prepend_path}user_#{name}_path") - assert_equal @controller.send(:"#{prepend_path}#{name}_url", :user), - send(:"#{prepend_path}user_#{name}_url") - - # Default url params - assert_equal @controller.send(:"#{prepend_path}#{name}_path", :user, :param => 123), - send(:"#{prepend_path}user_#{name}_path", :param => 123) - assert_equal @controller.send(:"#{prepend_path}#{name}_url", :user, :param => 123), - send(:"#{prepend_path}user_#{name}_url", :param => 123) - - @request.path = nil - # With an AR object - assert_equal @controller.send(:"#{prepend_path}#{name}_path", User.new), - send(:"#{prepend_path}user_#{name}_path") - assert_equal @controller.send(:"#{prepend_path}#{name}_url", User.new), - send(:"#{prepend_path}user_#{name}_url") - end - - - test 'should alias session to mapped user session' do - test_path_and_url :session - test_path_and_url :session, :new - test_path_and_url :session, :destroy - end - - test 'should alias password to mapped user password' do - test_path_and_url :password - test_path_and_url :password, :new - test_path_and_url :password, :edit - end - - test 'should alias confirmation to mapped user confirmation' do - test_path_and_url :confirmation - test_path_and_url :confirmation, :new - end -end diff --git a/vendor/gems/devise-1.0.7/test/devise_test.rb b/vendor/gems/devise-1.0.7/test/devise_test.rb deleted file mode 100644 index cf5115b2e..000000000 --- a/vendor/gems/devise-1.0.7/test/devise_test.rb +++ /dev/null @@ -1,74 +0,0 @@ -require 'test/test_helper' - -module Devise - def self.clean_warden_config! - @warden_config = nil - end -end - -class DeviseTest < ActiveSupport::TestCase - test 'model options can be configured through Devise' do - swap Devise, :confirm_within => 113, :pepper => "foo" do - assert_equal 113, Devise.confirm_within - assert_equal "foo", Devise.pepper - end - end - - test 'setup block yields self' do - Devise.setup do |config| - assert_equal Devise, config - end - end - - test 'warden manager configuration' do - config = Warden::Config.new - Devise.configure_warden(config) - - assert_equal Devise::FailureApp, config.failure_app - assert_equal [:rememberable, :http_authenticatable, :token_authenticatable, :database_authenticatable], config.default_strategies - assert_equal :user, config.default_scope - assert config.silence_missing_strategies? - end - - test 'warden manager user configuration through a block' do - begin - @executed = false - Devise.warden do |config| - @executed = true - assert_kind_of Warden::Config, config - end - - Devise.configure_warden(Warden::Config.new) - assert @executed - ensure - Devise.clean_warden_config! - end - end - - test 'add new module using the helper method' do - assert_nothing_raised(Exception) { Devise.add_module(:coconut) } - assert_equal 1, Devise::ALL.select { |v| v == :coconut }.size - assert_not Devise::STRATEGIES.include?(:coconut) - assert_not defined?(Devise::Models::Coconut) - Devise::ALL.delete(:coconut) - - assert_nothing_raised(Exception) { Devise.add_module(:banana, :strategy => true) } - assert_equal 1, Devise::STRATEGIES.select { |v| v == :banana }.size - Devise::ALL.delete(:banana) - Devise::STRATEGIES.delete(:banana) - - assert_nothing_raised(Exception) { Devise.add_module(:kivi, :controller => :fruits) } - assert_not_nil Devise::CONTROLLERS[:fruits] - assert_equal 1, Devise::CONTROLLERS[:fruits].select { |v| v == :kivi }.size - Devise::ALL.delete(:kivi) - Devise::CONTROLLERS.delete(:fruits) - - assert_nothing_raised(Exception) { Devise.add_module(:carrot, :route => :vegetable) } - assert_equal 1, Devise::ROUTES.select { |v| v == :vegetable }.size - Devise::ALL.delete(:carrot) - Devise::ROUTES.delete(:vegetable) - - assert_nothing_raised(Exception) { Devise.add_module(:authenticatable_again, :model => 'devise/model/authenticatable') } - assert defined?(Devise::Models::AuthenticatableAgain) - end -end diff --git a/vendor/gems/devise-1.0.7/test/encryptors_test.rb b/vendor/gems/devise-1.0.7/test/encryptors_test.rb deleted file mode 100644 index 300ba4ede..000000000 --- a/vendor/gems/devise-1.0.7/test/encryptors_test.rb +++ /dev/null @@ -1,31 +0,0 @@ -gem 'bcrypt-ruby' - -class Encryptors < ActiveSupport::TestCase - - test 'should match a password created by authlogic' do - authlogic = "b623c3bc9c775b0eb8edb218a382453396fec4146422853e66ecc4b6bc32d7162ee42074dcb5f180a770dc38b5df15812f09bbf497a4a1b95fe5e7d2b8eb7eb4" - encryptor = Devise::Encryptors::AuthlogicSha512.digest('123mudar', 20, 'usZK_z_EAaF61Gwkw-ed', '') - assert_equal authlogic, encryptor - end - - test 'should match a password created by restful_authentication' do - restful_authentication = "93110f71309ce91366375ea44e2a6f5cc73fa8d4" - encryptor = Devise::Encryptors::RestfulAuthenticationSha1.digest('123mudar', 10, '48901d2b247a54088acb7f8ea3e695e50fe6791b', 'fee9a51ec0a28d11be380ca6dee6b4b760c1a3bf') - assert_equal restful_authentication, encryptor - end - - test 'should match a password created by clearance' do - clearance = "0f40bbae18ddefd7066276c3ef209d40729b0378" - encryptor = Devise::Encryptors::ClearanceSha1.digest('123mudar', nil, '65c58472c207c829f28c68619d3e3aefed18ab3f', nil) - assert_equal clearance, encryptor - end - - Devise::ENCRYPTORS_LENGTH.each do |key, value| - test "should have length #{value} for #{key.inspect}" do - swap Devise, :encryptor => key do - encryptor = Devise::Encryptors.const_get(key.to_s.classify) - assert_equal value, encryptor.digest('a', 4, encryptor.salt, nil).size - end - end - end -end diff --git a/vendor/gems/devise-1.0.7/test/failure_app_test.rb b/vendor/gems/devise-1.0.7/test/failure_app_test.rb deleted file mode 100644 index 7cbe259b6..000000000 --- a/vendor/gems/devise-1.0.7/test/failure_app_test.rb +++ /dev/null @@ -1,44 +0,0 @@ -require 'test/test_helper' -require 'ostruct' - -class FailureTest < ActiveSupport::TestCase - - def call_failure(env_params={}) - env = {'warden.options' => { :scope => :user }}.merge!(env_params) - Devise::FailureApp.call(env) - end - - test 'return 302 status' do - assert_equal 302, call_failure.first - end - - test 'return to the default redirect location' do - assert_equal '/users/sign_in?unauthenticated=true', call_failure.second['Location'] - end - - test 'uses the proxy failure message' do - warden = OpenStruct.new(:message => :test) - location = call_failure('warden' => warden).second['Location'] - assert_equal '/users/sign_in?test=true', location - end - - test 'uses the given message' do - warden = OpenStruct.new(:message => 'Hello world') - location = call_failure('warden' => warden).second['Location'] - assert_equal '/users/sign_in?message=Hello+world', location - end - - test 'setup default url' do - Devise::FailureApp.default_url = 'test/sign_in' - location = call_failure('warden.options' => { :scope => nil }).second['Location'] - assert_equal '/test/sign_in?unauthenticated=true', location - end - - test 'set content type to default text/plain' do - assert_equal 'text/plain', call_failure.second['Content-Type'] - end - - test 'setup a default message' do - assert_equal ['You are being redirected to /users/sign_in?unauthenticated=true'], call_failure.last - end -end diff --git a/vendor/gems/devise-1.0.7/test/integration/authenticatable_test.rb b/vendor/gems/devise-1.0.7/test/integration/authenticatable_test.rb deleted file mode 100644 index 6b73bd151..000000000 --- a/vendor/gems/devise-1.0.7/test/integration/authenticatable_test.rb +++ /dev/null @@ -1,271 +0,0 @@ -require 'test/test_helper' - -class AuthenticationSanityTest < ActionController::IntegrationTest - test 'home should be accessible without sign in' do - visit '/' - assert_response :success - assert_template 'home/index' - end - - test 'sign in as user should not authenticate admin scope' do - sign_in_as_user - - assert warden.authenticated?(:user) - assert_not warden.authenticated?(:admin) - end - - test 'sign in as admin should not authenticate user scope' do - sign_in_as_admin - - assert warden.authenticated?(:admin) - assert_not warden.authenticated?(:user) - end - - test 'sign in as both user and admin at same time' do - sign_in_as_user - sign_in_as_admin - - assert warden.authenticated?(:user) - assert warden.authenticated?(:admin) - end - - test 'sign out as user should not touch admin authentication' do - sign_in_as_user - sign_in_as_admin - - get destroy_user_session_path - assert_not warden.authenticated?(:user) - assert warden.authenticated?(:admin) - end - - test 'sign out as admin should not touch user authentication' do - sign_in_as_user - sign_in_as_admin - - get destroy_admin_session_path - assert_not warden.authenticated?(:admin) - assert warden.authenticated?(:user) - end - - test 'not signed in as admin should not be able to access admins actions' do - get admins_path - - assert_redirected_to new_admin_session_path(:unauthenticated => true) - assert_not warden.authenticated?(:admin) - end - - test 'signed in as user should not be able to access admins actions' do - sign_in_as_user - assert warden.authenticated?(:user) - assert_not warden.authenticated?(:admin) - - get admins_path - assert_redirected_to new_admin_session_path(:unauthenticated => true) - end - - test 'signed in as admin should be able to access admin actions' do - sign_in_as_admin - assert warden.authenticated?(:admin) - assert_not warden.authenticated?(:user) - - get admins_path - - assert_response :success - assert_template 'admins/index' - assert_contain 'Welcome Admin' - end - - test 'authenticated admin should not be able to sign as admin again' do - sign_in_as_admin - get new_admin_session_path - - assert_response :redirect - assert_redirected_to admin_root_path - assert warden.authenticated?(:admin) - end - - test 'authenticated admin should be able to sign out' do - sign_in_as_admin - assert warden.authenticated?(:admin) - - get destroy_admin_session_path - assert_response :redirect - assert_redirected_to root_path - - get root_path - assert_contain 'Signed out successfully' - assert_not warden.authenticated?(:admin) - end - - test 'unauthenticated admin does not set message on sign out' do - get destroy_admin_session_path - assert_response :redirect - assert_redirected_to root_path - - get root_path - assert_not_contain 'Signed out successfully' - end -end - -class AuthenticationTest < ActionController::IntegrationTest - test 'sign in should not authenticate if not using proper authentication keys' do - swap Devise, :authentication_keys => [:username] do - sign_in_as_user - assert_not warden.authenticated?(:user) - end - end - - test 'sign in with invalid email should return to sign in form with error message' do - sign_in_as_admin do - fill_in 'email', :with => 'wrongemail@test.com' - end - - assert_contain 'Invalid email or password' - assert_not warden.authenticated?(:admin) - end - - test 'sign in with invalid pasword should return to sign in form with error message' do - sign_in_as_admin do - fill_in 'password', :with => 'abcdef' - end - - assert_contain 'Invalid email or password' - assert_not warden.authenticated?(:admin) - end - - test 'error message is configurable by resource name' do - store_translations :en, :devise => { - :sessions => { :admin => { :invalid => "Invalid credentials" } } - } do - sign_in_as_admin do - fill_in 'password', :with => 'abcdef' - end - - assert_contain 'Invalid credentials' - end - end - - test 'redirect from warden shows sign in or sign up message' do - get admins_path - - warden_path = new_admin_session_path(:unauthenticated => true) - assert_redirected_to warden_path - - get warden_path - assert_contain 'You need to sign in or sign up before continuing.' - end - - test 'redirect to default url if no other was configured' do - sign_in_as_user - - assert_template 'home/index' - assert_nil session[:"user.return_to"] - end - - test 'redirect to requested url after sign in' do - get users_path - assert_redirected_to new_user_session_path(:unauthenticated => true) - assert_equal users_path, session[:"user.return_to"] - - follow_redirect! - sign_in_as_user :visit => false - - assert_template 'users/index' - assert_nil session[:"user.return_to"] - end - - test 'redirect to last requested url overwriting the stored return_to option' do - get expire_user_path(create_user) - assert_redirected_to new_user_session_path(:unauthenticated => true) - assert_equal expire_user_path(create_user), session[:"user.return_to"] - - get users_path - assert_redirected_to new_user_session_path(:unauthenticated => true) - assert_equal users_path, session[:"user.return_to"] - - follow_redirect! - sign_in_as_user :visit => false - - assert_template 'users/index' - assert_nil session[:"user.return_to"] - end - - test 'redirect to configured home path for a given scope after sign in' do - sign_in_as_admin - assert_equal "/admin_area/home", @request.path - end - - test 'destroyed account is signed out' do - sign_in_as_user - visit 'users/index' - - User.destroy_all - visit 'users/index' - assert_redirected_to '/users/sign_in?unauthenticated=true' - end - - test 'allows session to be set by a given scope' do - sign_in_as_user - visit 'users/index' - assert_equal "Cart", @controller.user_session[:cart] - end - - test 'renders the scoped view if turned on and view is available' do - swap Devise, :scoped_views => true do - assert_raise Webrat::NotFoundError do - sign_in_as_user - end - assert_match /Special user view/, response.body - end - end - - test 'renders the scoped view if turned on in an specific controller' do - begin - SessionsController.scoped_views = true - assert_raise Webrat::NotFoundError do - sign_in_as_user - end - - assert_match /Special user view/, response.body - assert !PasswordsController.scoped_views - ensure - SessionsController.send :remove_instance_variable, :@scoped_views - end - end - - test 'does not render the scoped view if turned off' do - swap Devise, :scoped_views => false do - assert_nothing_raised do - sign_in_as_user - end - end - end - - test 'does not render the scoped view if not available' do - swap Devise, :scoped_views => true do - assert_nothing_raised do - sign_in_as_admin - end - end - end - - test 'render 404 on roles without permission' do - get 'admin_area/password/new' - assert_response :not_found - assert_not_contain 'Send me reset password instructions' - end - - test 'render 404 on roles without mapping' do - get 'sign_in' - assert_response :not_found - assert_not_contain 'Sign in' - end - - test 'uses the mapping from the default scope if specified' do - swap Devise, :use_default_scope => true do - get 'sign_in' - assert_response :ok - assert_contain 'Sign in' - end - end -end diff --git a/vendor/gems/devise-1.0.7/test/integration/confirmable_test.rb b/vendor/gems/devise-1.0.7/test/integration/confirmable_test.rb deleted file mode 100644 index cccf32d49..000000000 --- a/vendor/gems/devise-1.0.7/test/integration/confirmable_test.rb +++ /dev/null @@ -1,97 +0,0 @@ -require 'test/test_helper' - -class ConfirmationTest < ActionController::IntegrationTest - - def visit_user_confirmation_with_token(confirmation_token) - visit user_confirmation_path(:confirmation_token => confirmation_token) - end - - test 'user should be able to request a new confirmation' do - user = create_user(:confirm => false) - ActionMailer::Base.deliveries.clear - - visit new_user_session_path - click_link 'Didn\'t receive confirmation instructions?' - - fill_in 'email', :with => user.email - click_button 'Resend confirmation instructions' - - assert_template 'sessions/new' - assert_contain 'You will receive an email with instructions about how to confirm your account in a few minutes' - assert_equal 1, ActionMailer::Base.deliveries.size - end - - test 'user with invalid confirmation token should not be able to confirm an account' do - visit_user_confirmation_with_token('invalid_confirmation') - - assert_response :success - assert_template 'confirmations/new' - assert_have_selector '#errorExplanation' - assert_contain /Confirmation token(.*)invalid/ - end - - test 'user with valid confirmation token should be able to confirm an account' do - user = create_user(:confirm => false) - assert_not user.confirmed? - - visit_user_confirmation_with_token(user.confirmation_token) - - assert_template 'home/index' - assert_contain 'Your account was successfully confirmed.' - - assert user.reload.confirmed? - end - - test 'user already confirmed user should not be able to confirm the account again' do - user = create_user(:confirm => false) - user.confirmed_at = Time.now - user.save - visit_user_confirmation_with_token(user.confirmation_token) - - assert_template 'confirmations/new' - assert_have_selector '#errorExplanation' - assert_contain 'already confirmed' - end - - test 'sign in user automatically after confirming it\'s email' do - user = create_user(:confirm => false) - visit_user_confirmation_with_token(user.confirmation_token) - - assert warden.authenticated?(:user) - end - - test 'increases sign count when signed in through confirmation' do - user = create_user(:confirm => false) - visit_user_confirmation_with_token(user.confirmation_token) - - user.reload - assert_equal 1, user.sign_in_count - end - - test 'not confirmed user with setup to block without confirmation should not be able to sign in' do - swap Devise, :confirm_within => 0.days do - sign_in_as_user(:confirm => false) - - assert_contain 'You have to confirm your account before continuing' - assert_not warden.authenticated?(:user) - end - end - - test 'not confirmed user but configured with some days to confirm should be able to sign in' do - swap Devise, :confirm_within => 1.day do - sign_in_as_user(:confirm => false) - - assert_response :success - assert warden.authenticated?(:user) - end - end - - test 'error message is configurable by resource name' do - store_translations :en, :devise => { - :sessions => { :admin => { :unconfirmed => "Not confirmed user" } } - } do - get new_admin_session_path(:unconfirmed => true) - assert_contain 'Not confirmed user' - end - end -end diff --git a/vendor/gems/devise-1.0.7/test/integration/http_authenticatable_test.rb b/vendor/gems/devise-1.0.7/test/integration/http_authenticatable_test.rb deleted file mode 100644 index 521695604..000000000 --- a/vendor/gems/devise-1.0.7/test/integration/http_authenticatable_test.rb +++ /dev/null @@ -1,52 +0,0 @@ -require 'test/test_helper' - -class HttpAuthenticationTest < ActionController::IntegrationTest - - test 'sign in should authenticate with http' do - sign_in_as_new_user_with_http - assert_response :success - assert_template 'users/index' - assert_contain 'Welcome' - assert warden.authenticated?(:user) - end - - test 'returns a custom response with www-authenticate header on failures' do - sign_in_as_new_user_with_http("unknown") - assert_equal 401, status - assert_equal 'Basic realm="Application"', headers["WWW-Authenticate"] - end - - test 'uses the request format as response content type' do - sign_in_as_new_user_with_http("unknown", "123456", :xml) - assert_equal 401, status - assert_equal "application/xml", headers["Content-Type"] - # Cannot assert this due to a bug between integration tests and rack on 2.3 - # assert response.body.include?("HTTP Basic: Access denied.") - end - - test 'returns a custom response with www-authenticate and chosen realm' do - swap Devise, :http_authentication_realm => "MyApp" do - sign_in_as_new_user_with_http("unknown") - assert_equal 401, status - assert_equal 'Basic realm="MyApp"', headers["WWW-Authenticate"] - end - end - - test 'sign in should authenticate with http even with specific authentication keys' do - swap Devise, :authentication_keys => [:username] do - sign_in_as_new_user_with_http "usertest" - assert_response :success - assert_template 'users/index' - assert_contain 'Welcome' - assert warden.authenticated?(:user) - end - end - - private - - def sign_in_as_new_user_with_http(username="user@test.com", password="123456", format=:html) - user = create_user - get users_path(:format => format), {}, :authorization => "Basic #{ActiveSupport::Base64.encode64("#{username}:#{password}")}" - user - end -end \ No newline at end of file diff --git a/vendor/gems/devise-1.0.7/test/integration/lockable_test.rb b/vendor/gems/devise-1.0.7/test/integration/lockable_test.rb deleted file mode 100644 index 27d9d0cc4..000000000 --- a/vendor/gems/devise-1.0.7/test/integration/lockable_test.rb +++ /dev/null @@ -1,102 +0,0 @@ -require 'test/test_helper' - -class LockTest < ActionController::IntegrationTest - - def visit_user_unlock_with_token(unlock_token) - visit user_unlock_path(:unlock_token => unlock_token) - end - - test 'user should be able to request a new unlock token' do - user = create_user(:locked => true) - ActionMailer::Base.deliveries.clear - - visit new_user_session_path - click_link 'Didn\'t receive unlock instructions?' - - fill_in 'email', :with => user.email - click_button 'Resend unlock instructions' - - assert_template 'sessions/new' - assert_contain 'You will receive an email with instructions about how to unlock your account in a few minutes' - assert_equal 1, ActionMailer::Base.deliveries.size - end - - test 'unlocked user should not be able to request a unlock token' do - user = create_user(:locked => false) - ActionMailer::Base.deliveries.clear - - visit new_user_session_path - click_link 'Didn\'t receive unlock instructions?' - - fill_in 'email', :with => user.email - click_button 'Resend unlock instructions' - - assert_template 'unlocks/new' - assert_contain 'not locked' - assert_equal 0, ActionMailer::Base.deliveries.size - end - - test 'unlocked pages should not be available if email strategy is disabled' do - visit new_user_unlock_path - assert_response :success - - swap Devise, :unlock_strategy => :time do - visit new_user_unlock_path - assert_response :not_found - end - end - - test 'user with invalid unlock token should not be able to unlock an account' do - visit_user_unlock_with_token('invalid_token') - - assert_response :success - assert_template 'unlocks/new' - assert_have_selector '#errorExplanation' - assert_contain /Unlock token(.*)invalid/ - end - - test "locked user should be able to unlock account" do - user = create_user(:locked => true) - assert user.access_locked? - - visit_user_unlock_with_token(user.unlock_token) - - assert_template 'home/index' - assert_contain 'Your account was successfully unlocked.' - - assert_not user.reload.access_locked? - end - - test "sign in user automatically after unlocking it's account" do - user = create_user(:locked => true) - visit_user_unlock_with_token(user.unlock_token) - assert warden.authenticated?(:user) - end - - test "user should not be able to sign in when locked" do - user = sign_in_as_user(:locked => true) - assert_template 'sessions/new' - assert_contain 'Your account is locked.' - assert_not warden.authenticated?(:user) - end - - test "user should not send a new e-mail if already locked" do - user = create_user(:locked => true) - user.update_attribute(:failed_attempts, User.maximum_attempts + 1) - ActionMailer::Base.deliveries.clear - - sign_in_as_user(:password => "invalid") - assert_contain 'Invalid email or password.' - assert ActionMailer::Base.deliveries.empty? - end - - test 'error message is configurable by resource name' do - store_translations :en, :devise => { - :sessions => { :admin => { :locked => "You are locked!" } } - } do - get new_admin_session_path(:locked => true) - assert_contain 'You are locked!' - end - end - -end diff --git a/vendor/gems/devise-1.0.7/test/integration/rack_middleware_test.rb b/vendor/gems/devise-1.0.7/test/integration/rack_middleware_test.rb deleted file mode 100644 index 9dd3cb3fb..000000000 --- a/vendor/gems/devise-1.0.7/test/integration/rack_middleware_test.rb +++ /dev/null @@ -1,47 +0,0 @@ -require "test/test_helper" -require "rack/test" - -class RackMiddlewareTest < Test::Unit::TestCase - include Rack::Test::Methods - - def app - ActionController::Dispatcher.new - end - - def warden - last_request.env['warden'] - end - - def with_custom_strategy - get '/' - - Warden::Strategies.add(:custom_test) do - def valid? - true - end - - def authenticate! - custom! [599, { - "X-Custom-Response" => "Custom response test", - "Content-type" => "text/plain" - }, "Custom response test"] - end - end - - #ActionController::Dispatcher.middleware.use CustomStrategyInterceptor - default_strategies = warden.manager.config.default_strategies - warden.manager.config.default_strategies :custom_test - yield - warden.manager.config.default_strategies default_strategies - end - - def test_custom_strategy_response - with_custom_strategy do - post('/users/sign_in') - - assert_equal 599, last_response.status - assert_equal "Custom response test", last_response.body - assert_equal "Custom response test", last_response.headers["X-Custom-Response"] - end - end -end \ No newline at end of file diff --git a/vendor/gems/devise-1.0.7/test/integration/recoverable_test.rb b/vendor/gems/devise-1.0.7/test/integration/recoverable_test.rb deleted file mode 100644 index 47f021e70..000000000 --- a/vendor/gems/devise-1.0.7/test/integration/recoverable_test.rb +++ /dev/null @@ -1,141 +0,0 @@ -require 'test/test_helper' - -class PasswordTest < ActionController::IntegrationTest - - def visit_new_password_path - visit new_user_session_path - click_link 'Forgot password?' - end - - def request_forgot_password(&block) - visit_new_password_path - - assert_response :success - assert_template 'passwords/new' - assert_not warden.authenticated?(:user) - - fill_in 'email', :with => 'user@test.com' - yield if block_given? - click_button 'Send me reset password instructions' - end - - def reset_password(options={}, &block) - unless options[:visit] == false - visit edit_user_password_path(:reset_password_token => options[:reset_password_token]) - end - assert_response :success - assert_template 'passwords/edit' - - fill_in 'Password', :with => '987654321' - fill_in 'Password confirmation', :with => '987654321' - yield if block_given? - click_button 'Change my password' - end - - test 'authenticated user should not be able to visit forgot password page' do - sign_in_as_user - assert warden.authenticated?(:user) - - get new_user_password_path - - assert_response :redirect - assert_redirected_to root_path - end - - test 'not authenticated user should be able to request a forgot password' do - create_user - request_forgot_password - - assert_template 'sessions/new' - assert_contain 'You will receive an email with instructions about how to reset your password in a few minutes.' - end - - test 'not authenticated user with invalid email should receive an error message' do - request_forgot_password do - fill_in 'email', :with => 'invalid.test@test.com' - end - - assert_response :success - assert_template 'passwords/new' - assert_have_selector 'input[type=text][value=\'invalid.test@test.com\']' - assert_contain 'Email not found' - end - - test 'authenticated user should not be able to visit edit password page' do - sign_in_as_user - - get edit_user_password_path - - assert_response :redirect - assert_redirected_to root_path - assert warden.authenticated?(:user) - end - - test 'not authenticated user with invalid reset password token should not be able to change his password' do - user = create_user - reset_password :reset_password_token => 'invalid_reset_password' - - assert_response :success - assert_template 'passwords/edit' - assert_have_selector '#errorExplanation' - assert_contain /Reset password token(.*)invalid/ - assert_not user.reload.valid_password?('987654321') - end - - test 'not authenticated user with valid reset password token but invalid password should not be able to change his password' do - user = create_user - request_forgot_password - reset_password :reset_password_token => user.reload.reset_password_token do - fill_in 'Password confirmation', :with => 'other_password' - end - - assert_response :success - assert_template 'passwords/edit' - assert_have_selector '#errorExplanation' - assert_contain 'Password doesn\'t match confirmation' - assert_not user.reload.valid_password?('987654321') - end - - test 'not authenticated user with valid data should be able to change his password' do - user = create_user - request_forgot_password - reset_password :reset_password_token => user.reload.reset_password_token - - assert_template 'home/index' - assert_contain 'Your password was changed successfully.' - assert user.reload.valid_password?('987654321') - end - - test 'after entering invalid data user should still be able to change his password' do - user = create_user - request_forgot_password - reset_password :reset_password_token => user.reload.reset_password_token do - fill_in 'Password confirmation', :with => 'other_password' - end - assert_response :success - assert_have_selector '#errorExplanation' - assert_not user.reload.valid_password?('987654321') - - reset_password :reset_password_token => user.reload.reset_password_token, :visit => false - assert_contain 'Your password was changed successfully.' - assert user.reload.valid_password?('987654321') - end - - test 'sign in user automatically after changing it\'s password' do - user = create_user - request_forgot_password - reset_password :reset_password_token => user.reload.reset_password_token - - assert warden.authenticated?(:user) - end - - test 'does not sign in user automatically after changing it\'s password if it\'s not active' do - user = create_user(:confirm => false) - request_forgot_password - reset_password :reset_password_token => user.reload.reset_password_token - - assert_redirected_to new_user_session_path(:unconfirmed => true) - assert !warden.authenticated?(:user) - end - -end diff --git a/vendor/gems/devise-1.0.7/test/integration/registerable_test.rb b/vendor/gems/devise-1.0.7/test/integration/registerable_test.rb deleted file mode 100644 index face2669d..000000000 --- a/vendor/gems/devise-1.0.7/test/integration/registerable_test.rb +++ /dev/null @@ -1,144 +0,0 @@ -require 'test/test_helper' - -class RegistrationTest < ActionController::IntegrationTest - - test 'a guest admin should be able to sign in successfully' do - visit new_admin_session_path - click_link 'Sign up' - - assert_template 'registrations/new' - - fill_in 'email', :with => 'new_user@test.com' - fill_in 'password', :with => 'new_user123' - fill_in 'password confirmation', :with => 'new_user123' - click_button 'Sign up' - - assert_contain 'You have signed up successfully.' - assert warden.authenticated?(:admin) - - admin = Admin.last - assert_equal admin.email, 'new_user@test.com' - end - - test 'a guest user should be able to sign up successfully and be blocked by confirmation' do - visit new_user_registration_path - - fill_in 'email', :with => 'new_user@test.com' - fill_in 'password', :with => 'new_user123' - fill_in 'password confirmation', :with => 'new_user123' - click_button 'Sign up' - - assert_equal "You have signed up successfully. If enabled, a confirmation was sent to your e-mail.", @controller.send(:flash)[:notice] - - # For some reason flash is not being set correctly, so instead of getting the - # "signed_up" message we get the unconfirmed one. Seems to be an issue with - # the internal redirect by the hook and the tests. - # follow_redirect! - # assert_contain 'You have signed up successfully.' - # assert_not_contain 'confirm your account' - - follow_redirect! - assert_contain 'Sign in' - assert_not warden.authenticated?(:user) - - user = User.last - assert_equal user.email, 'new_user@test.com' - assert_not user.confirmed? - end - - test 'a guest user cannot sign up with invalid information' do - visit new_user_registration_path - - fill_in 'email', :with => 'invalid_email' - fill_in 'password', :with => 'new_user123' - fill_in 'password confirmation', :with => 'new_user321' - click_button 'Sign up' - - assert_template 'registrations/new' - assert_have_selector '#errorExplanation' - assert_contain "Email is invalid" - assert_contain "Password doesn't match confirmation" - assert_nil User.first - - assert_not warden.authenticated?(:user) - end - - test 'a guest should not sign up with email/password that already exists' do - user = create_user - visit new_user_registration_path - - fill_in 'email', :with => 'user@test.com' - fill_in 'password', :with => '123456' - fill_in 'password confirmation', :with => '123456' - click_button 'Sign up' - - assert_template 'registrations/new' - assert_contain 'Email has already been taken' - - assert_not warden.authenticated?(:user) - end - - test 'a guest should not be able to change account' do - visit edit_user_registration_path - follow_redirect! - assert_template 'sessions/new' - end - - test 'a signed in user should not be able to access sign up' do - sign_in_as_user - visit new_user_registration_path - assert_template 'home/index' - end - - test 'a signed in user should be able to edit his account' do - sign_in_as_user - visit edit_user_registration_path - - fill_in 'email', :with => 'user.new@email.com' - fill_in 'current password', :with => '123456' - click_button 'Update' - - assert_template 'home/index' - assert_contain 'You updated your account successfully.' - - assert_equal "user.new@email.com", User.first.email - end - - test 'a signed in user should be able to edit his password' do - sign_in_as_user - visit edit_user_registration_path - - fill_in 'password', :with => 'pas123' - fill_in 'password confirmation', :with => 'pas123' - fill_in 'current password', :with => '123456' - click_button 'Update' - - assert_template 'home/index' - assert_contain 'You updated your account successfully.' - - assert User.first.valid_password?('pas123') - end - - test 'a signed in user should not be able to edit his password with invalid confirmation' do - sign_in_as_user - get edit_user_registration_path - - fill_in 'password', :with => 'pas123' - fill_in 'password confirmation', :with => '' - fill_in 'current password', :with => '123456' - click_button 'Update' - - assert_contain "Password doesn't match confirmation" - assert_not User.first.valid_password?('pas123') - end - - test 'a signed in user should be able to cancel his account' do - sign_in_as_user - visit edit_user_registration_path - - click_link "Cancel my account" - assert_contain "Bye! Your account was successfully cancelled. We hope to see you again soon." - - assert User.all.empty? - end -end \ No newline at end of file diff --git a/vendor/gems/devise-1.0.7/test/integration/rememberable_test.rb b/vendor/gems/devise-1.0.7/test/integration/rememberable_test.rb deleted file mode 100644 index 6e7a41cf5..000000000 --- a/vendor/gems/devise-1.0.7/test/integration/rememberable_test.rb +++ /dev/null @@ -1,71 +0,0 @@ -require 'test/test_helper' - -class RememberMeTest < ActionController::IntegrationTest - - def create_user_and_remember(add_to_token='') - Devise.remember_for = 1 - user = create_user - user.remember_me! - cookies['remember_user_token'] = User.serialize_into_cookie(user) + add_to_token - user - end - - test 'do not remember the user if he has not checked remember me option' do - user = sign_in_as_user - assert_nil user.reload.remember_token - end - - test 'generate remember token after sign in' do - user = sign_in_as_user :remember_me => true - assert_not_nil user.reload.remember_token - end - - test 'remember the user before sign in' do - user = create_user_and_remember - get users_path - assert_response :success - assert warden.authenticated?(:user) - assert warden.user(:user) == user - end - - test 'does not remember other scopes' do - user = create_user_and_remember - get root_path - assert_response :success - assert warden.authenticated?(:user) - assert_not warden.authenticated?(:admin) - end - - test 'do not remember with invalid token' do - user = create_user_and_remember('add') - get users_path - assert_response :success - assert_not warden.authenticated?(:user) - end - - test 'do not remember with token expired' do - user = create_user_and_remember - Devise.remember_for = 0 - get users_path - assert_response :success - assert_not warden.authenticated?(:user) - end - - test 'forget the user before sign out' do - user = create_user_and_remember - get users_path - assert warden.authenticated?(:user) - get destroy_user_session_path - assert_not warden.authenticated?(:user) - assert_nil user.reload.remember_token - end - - test 'do not remember the user anymore after forget' do - user = create_user_and_remember - get users_path - assert warden.authenticated?(:user) - get destroy_user_session_path - get users_path - assert_not warden.authenticated?(:user) - end -end diff --git a/vendor/gems/devise-1.0.7/test/integration/timeoutable_test.rb b/vendor/gems/devise-1.0.7/test/integration/timeoutable_test.rb deleted file mode 100644 index d274d2f68..000000000 --- a/vendor/gems/devise-1.0.7/test/integration/timeoutable_test.rb +++ /dev/null @@ -1,68 +0,0 @@ -require 'test/test_helper' - -class SessionTimeoutTest < ActionController::IntegrationTest - - def last_request_at - @controller.user_session['last_request_at'] - end - - test 'set last request at in user session after each request' do - sign_in_as_user - old_last_request = last_request_at - assert_not_nil last_request_at - - get users_path - assert_not_nil last_request_at - assert_not_equal old_last_request, last_request_at - end - - test 'not time out user session before default limit time' do - sign_in_as_user - assert_response :success - assert warden.authenticated?(:user) - - get users_path - assert_response :success - assert warden.authenticated?(:user) - end - - test 'time out user session after default limit time' do - user = sign_in_as_user - get expire_user_path(user) - assert_not_nil last_request_at - - get users_path - assert_redirected_to new_user_session_path(:timeout => true) - assert_not warden.authenticated?(:user) - end - - test 'user configured timeout limit' do - swap Devise, :timeout_in => 8.minutes do - user = sign_in_as_user - - get users_path - assert_not_nil last_request_at - assert_response :success - assert warden.authenticated?(:user) - - get expire_user_path(user) - get users_path - assert_redirected_to new_user_session_path(:timeout => true) - assert_not warden.authenticated?(:user) - end - end - - test 'error message with i18n' do - store_translations :en, :devise => { - :sessions => { :user => { :timeout => 'Session expired!' } } - } do - user = sign_in_as_user - - get expire_user_path(user) - get users_path - follow_redirect! - assert_contain 'Session expired!' - end - end - -end diff --git a/vendor/gems/devise-1.0.7/test/integration/token_authenticatable_test.rb b/vendor/gems/devise-1.0.7/test/integration/token_authenticatable_test.rb deleted file mode 100644 index 5189f74d0..000000000 --- a/vendor/gems/devise-1.0.7/test/integration/token_authenticatable_test.rb +++ /dev/null @@ -1,55 +0,0 @@ -require 'test/test_helper' - -class TokenAuthenticationTest < ActionController::IntegrationTest - - test 'sign in should authenticate with valid authentication token and proper authentication token key' do - swap Devise, :token_authentication_key => :secret_token do - sign_in_as_new_user_with_token(:auth_token_key => :secret_token) - - assert_response :success - assert_template 'users/index' - assert_contain 'Welcome' - assert warden.authenticated?(:user) - end - end - - test 'signing in with valid authentication token - but improper authentication token key - return to sign in form with error message' do - swap Devise, :token_authentication_key => :donald_duck_token do - sign_in_as_new_user_with_token(:auth_token_key => :secret_token) - assert_redirected_to new_user_session_path(:unauthenticated => true) - follow_redirect! - - assert_contain 'You need to sign in or sign up before continuing' - assert_contain 'Sign in' - assert_not warden.authenticated?(:user) - end - end - - test 'signing in with invalid authentication token should return to sign in form with error message' do - store_translations :en, :devise => {:sessions => {:invalid_token => 'LOL, that was not a single character correct.'}} do - sign_in_as_new_user_with_token(:auth_token => '*** INVALID TOKEN ***') - assert_redirected_to new_user_session_path(:invalid_token => true) - follow_redirect! - - assert_response :success - assert_contain 'LOL, that was not a single character correct.' - assert_contain 'Sign in' - assert_not warden.authenticated?(:user) - end - end - - private - - def sign_in_as_new_user_with_token(options = {}) - options[:auth_token_key] ||= Devise.token_authentication_key - options[:auth_token] ||= VALID_AUTHENTICATION_TOKEN - - user = create_user(options) - user.authentication_token = VALID_AUTHENTICATION_TOKEN - user.save - - visit users_path(options[:auth_token_key].to_sym => options[:auth_token]) - user - end - -end \ No newline at end of file diff --git a/vendor/gems/devise-1.0.7/test/integration/trackable_test.rb b/vendor/gems/devise-1.0.7/test/integration/trackable_test.rb deleted file mode 100644 index 9df292bce..000000000 --- a/vendor/gems/devise-1.0.7/test/integration/trackable_test.rb +++ /dev/null @@ -1,64 +0,0 @@ -require 'test/test_helper' - -class TrackableHooksTest < ActionController::IntegrationTest - - test "current and last sign in timestamps are updated on each sign in" do - user = create_user - assert_nil user.current_sign_in_at - assert_nil user.last_sign_in_at - - sign_in_as_user - user.reload - - assert_kind_of Time, user.current_sign_in_at - assert_kind_of Time, user.last_sign_in_at - - assert_equal user.current_sign_in_at, user.last_sign_in_at - assert user.current_sign_in_at >= user.created_at - - visit destroy_user_session_path - new_time = 2.seconds.from_now - Time.stubs(:now).returns(new_time) - - sign_in_as_user - user.reload - assert user.current_sign_in_at > user.last_sign_in_at - end - - test "current and last sign in remote ip are updated on each sign in" do - user = create_user - assert_nil user.current_sign_in_ip - assert_nil user.last_sign_in_ip - - sign_in_as_user - user.reload - - assert_equal "127.0.0.1", user.current_sign_in_ip - assert_equal "127.0.0.1", user.last_sign_in_ip - end - - test "increase sign in count" do - user = create_user - assert_equal 0, user.sign_in_count - - sign_in_as_user - user.reload - assert_equal 1, user.sign_in_count - - visit destroy_user_session_path - sign_in_as_user - user.reload - assert_equal 2, user.sign_in_count - end - - test "does not update anything if user has signed out along the way" do - swap Devise, :confirm_within => 0 do - user = create_user(:confirm => false) - sign_in_as_user - - user.reload - assert_nil user.current_sign_in_at - assert_nil user.last_sign_in_at - end - end -end diff --git a/vendor/gems/devise-1.0.7/test/mailers/confirmation_instructions_test.rb b/vendor/gems/devise-1.0.7/test/mailers/confirmation_instructions_test.rb deleted file mode 100644 index 45afee894..000000000 --- a/vendor/gems/devise-1.0.7/test/mailers/confirmation_instructions_test.rb +++ /dev/null @@ -1,86 +0,0 @@ -require 'test/test_helper' - -class ConfirmationInstructionsTest < ActionMailer::TestCase - - def setup - setup_mailer - Devise.mailer_sender = 'test@example.com' - end - - def user - @user ||= create_user - end - - def mail - @mail ||= begin - user - ActionMailer::Base.deliveries.first - end - end - - test 'email sent after creating the user' do - assert_not_nil mail - end - - test 'content type should be set to html' do - assert_equal 'text/html', mail.content_type - end - - test 'send confirmation instructions to the user email' do - mail - assert_equal [user.email], mail.to - end - - test 'setup sender from configuration' do - assert_equal ['test@example.com'], mail.from - end - - test 'setup subject from I18n' do - store_translations :en, :devise => { :mailer => { :confirmation_instructions => 'Account Confirmation' } } do - assert_equal 'Account Confirmation', mail.subject - end - end - - test 'subject namespaced by model' do - store_translations :en, :devise => { :mailer => { :user => { :confirmation_instructions => 'User Account Confirmation' } } } do - assert_equal 'User Account Confirmation', mail.subject - end - end - - test 'body should have user info' do - assert_match /#{user.email}/, mail.body - end - - test 'body should have link to confirm the account' do - host = ActionMailer::Base.default_url_options[:host] - confirmation_url_regexp = %r{} - assert_match confirmation_url_regexp, mail.body - end - - test 'renders a scoped if scoped_views is set to true' do - swap Devise, :scoped_views => true do - assert_equal user.email, mail.body - end - end - - test 'content type should be set to plain when manually configured' do - swap Devise, :mailer_content_type => "text/plain" do - assert_equal "text/plain", mail.content_type - end - end - - test 'renders a scoped if scoped_views is set in the mailer class' do - begin - DeviseMailer.scoped_views = true - assert_equal user.email, mail.body - ensure - DeviseMailer.send :remove_instance_variable, :@scoped_views - end - end - - test 'mailer sender accepts a proc' do - swap Devise, :mailer_sender => lambda { "another@example.com" } do - assert_equal ['another@example.com'], mail.from - end - end -end diff --git a/vendor/gems/devise-1.0.7/test/mailers/reset_password_instructions_test.rb b/vendor/gems/devise-1.0.7/test/mailers/reset_password_instructions_test.rb deleted file mode 100644 index 2b83d45af..000000000 --- a/vendor/gems/devise-1.0.7/test/mailers/reset_password_instructions_test.rb +++ /dev/null @@ -1,68 +0,0 @@ -require 'test/test_helper' - -class ResetPasswordInstructionsTest < ActionMailer::TestCase - - def setup - setup_mailer - Devise.mailer_sender = 'test@example.com' - end - - def user - @user ||= begin - user = create_user - user.send_reset_password_instructions - user - end - end - - def mail - @mail ||= begin - user - ActionMailer::Base.deliveries.last - end - end - - test 'email sent after reseting the user password' do - assert_not_nil mail - end - - test 'content type should be set to html' do - assert_equal 'text/html', mail.content_type - end - - test 'send confirmation instructions to the user email' do - assert_equal [user.email], mail.to - end - - test 'setup sender from configuration' do - assert_equal ['test@example.com'], mail.from - end - - test 'setup subject from I18n' do - store_translations :en, :devise => { :mailer => { :reset_password_instructions => 'Reset instructions' } } do - assert_equal 'Reset instructions', mail.subject - end - end - - test 'subject namespaced by model' do - store_translations :en, :devise => { :mailer => { :user => { :reset_password_instructions => 'User Reset Instructions' } } } do - assert_equal 'User Reset Instructions', mail.subject - end - end - - test 'body should have user info' do - assert_match /#{user.email}/, mail.body - end - - test 'body should have link to confirm the account' do - host = ActionMailer::Base.default_url_options[:host] - reset_url_regexp = %r{} - assert_match reset_url_regexp, mail.body - end - - test 'mailer sender accepts a proc' do - swap Devise, :mailer_sender => lambda { "another@example.com" } do - assert_equal ['another@example.com'], mail.from - end - end -end diff --git a/vendor/gems/devise-1.0.7/test/mailers/unlock_instructions_test.rb b/vendor/gems/devise-1.0.7/test/mailers/unlock_instructions_test.rb deleted file mode 100644 index 1f1d46d7b..000000000 --- a/vendor/gems/devise-1.0.7/test/mailers/unlock_instructions_test.rb +++ /dev/null @@ -1,62 +0,0 @@ -require 'test/test_helper' - -class UnlockInstructionsTest < ActionMailer::TestCase - - def setup - setup_mailer - Devise.mailer_sender = 'test@example.com' - end - - def user - @user ||= begin - user = create_user - user.lock_access! - user - end - end - - def mail - @mail ||= begin - user - ActionMailer::Base.deliveries.last - end - end - - test 'email sent after locking the user' do - assert_not_nil mail - end - - test 'content type should be set to html' do - assert_equal 'text/html', mail.content_type - end - - test 'send unlock instructions to the user email' do - assert_equal [user.email], mail.to - end - - test 'setup sender from configuration' do - assert_equal ['test@example.com'], mail.from - end - - test 'setup subject from I18n' do - store_translations :en, :devise => { :mailer => { :unlock_instructions => 'Unlock instructions' } } do - assert_equal 'Unlock instructions', mail.subject - end - end - - test 'subject namespaced by model' do - store_translations :en, :devise => { :mailer => { :user => { :unlock_instructions => 'User Unlock Instructions' } } } do - assert_equal 'User Unlock Instructions', mail.subject - end - end - - test 'body should have user info' do - assert_match /#{user.email}/, mail.body - end - - test 'body should have link to unlock the account' do - host = ActionMailer::Base.default_url_options[:host] - unlock_url_regexp = %r{} - assert_match unlock_url_regexp, mail.body - end -end diff --git a/vendor/gems/devise-1.0.7/test/mapping_test.rb b/vendor/gems/devise-1.0.7/test/mapping_test.rb deleted file mode 100644 index 4beb5155a..000000000 --- a/vendor/gems/devise-1.0.7/test/mapping_test.rb +++ /dev/null @@ -1,148 +0,0 @@ -require 'test/test_helper' - -class MappingTest < ActiveSupport::TestCase - - test 'store options' do - mapping = Devise.mappings[:user] - - assert_equal User, mapping.to - assert_equal User.devise_modules, mapping.for - assert_equal :users, mapping.as - end - - test 'allows as to be given' do - assert_equal :admin_area, Devise.mappings[:admin].as - end - - test 'allow custom scope to be given' do - assert_equal :accounts, Devise.mappings[:manager].as - end - - test 'allows a controller depending on the mapping' do - mapping = Devise.mappings[:user] - assert mapping.allows?(:sessions) - assert mapping.allows?(:confirmations) - assert mapping.allows?(:passwords) - - mapping = Devise.mappings[:admin] - assert mapping.allows?(:sessions) - assert_not mapping.allows?(:confirmations) - assert_not mapping.allows?(:passwords) - end - - test 'find mapping by path' do - assert_nil Devise::Mapping.find_by_path("/foo/bar") - assert_equal Devise.mappings[:user], Devise::Mapping.find_by_path("/users/session") - end - - test 'find mapping by customized path' do - assert_equal Devise.mappings[:admin], Devise::Mapping.find_by_path("/admin_area/session") - end - - test 'find scope for a given object' do - assert_equal :user, Devise::Mapping.find_scope!(User) - assert_equal :user, Devise::Mapping.find_scope!(:user) - assert_equal :user, Devise::Mapping.find_scope!(User.new) - end - - test 'find scope works with single table inheritance' do - assert_equal :user, Devise::Mapping.find_scope!(Class.new(User)) - assert_equal :user, Devise::Mapping.find_scope!(Class.new(User).new) - end - - test 'find scope raises an error if cannot be found' do - assert_raise RuntimeError do - Devise::Mapping.find_scope!(String) - end - end - - test 'return default path names' do - mapping = Devise.mappings[:user] - assert_equal 'sign_in', mapping.path_names[:sign_in] - assert_equal 'sign_out', mapping.path_names[:sign_out] - assert_equal 'password', mapping.path_names[:password] - assert_equal 'confirmation', mapping.path_names[:confirmation] - assert_equal 'sign_up', mapping.path_names[:sign_up] - assert_equal 'unlock', mapping.path_names[:unlock] - end - - test 'allow custom path names to be given' do - mapping = Devise.mappings[:manager] - assert_equal 'login', mapping.path_names[:sign_in] - assert_equal 'logout', mapping.path_names[:sign_out] - assert_equal 'secret', mapping.path_names[:password] - assert_equal 'verification', mapping.path_names[:confirmation] - assert_equal 'register', mapping.path_names[:sign_up] - assert_equal 'unblock', mapping.path_names[:unlock] - end - - test 'has an empty path as default path prefix' do - mapping = Devise.mappings[:user] - assert_equal '/', mapping.path_prefix - end - - test 'allow path prefix to be configured' do - mapping = Devise.mappings[:manager] - assert_equal '/:locale/', mapping.path_prefix - end - - test 'retrieve as from the proper position' do - assert_equal 1, Devise.mappings[:user].as_position - assert_equal 2, Devise.mappings[:manager].as_position - end - - test 'raw path is returned' do - assert_equal '/users', Devise.mappings[:user].raw_path - assert_equal '/:locale/accounts', Devise.mappings[:manager].raw_path - end - - test 'raw path ignores the relative_url_root' do - swap ActionController::Base, :relative_url_root => "/abc" do - assert_equal '/users', Devise.mappings[:user].raw_path - end - end - - test 'parsed path is returned' do - begin - Devise.default_url_options {{ :locale => I18n.locale }} - assert_equal '/users', Devise.mappings[:user].parsed_path - assert_equal '/en/accounts', Devise.mappings[:manager].parsed_path - ensure - Devise.default_url_options {{ }} - end - end - - test 'parsed path adds in the relative_url_root' do - swap ActionController::Base, :relative_url_root => '/abc' do - assert_equal '/abc/users', Devise.mappings[:user].parsed_path - end - end - - test 'parsed path deals with a nil relative_url_root' do - swap ActionController::Base, :relative_url_root => nil do - assert_equal '/users', Devise.mappings[:user].raw_path - end - end - - test 'should have default route options' do - assert_equal({}, Devise.mappings[:user].route_options) - end - - test 'should allow passing route options to devise routes' do - assert_equal({ :requirements => { :extra => 'value' } }, Devise.mappings[:manager].route_options) - end - - test 'magic predicates' do - mapping = Devise.mappings[:user] - assert mapping.authenticatable? - assert mapping.confirmable? - assert mapping.recoverable? - assert mapping.rememberable? - - mapping = Devise.mappings[:admin] - assert mapping.authenticatable? - assert_not mapping.confirmable? - assert_not mapping.recoverable? - assert_not mapping.rememberable? - end -end diff --git a/vendor/gems/devise-1.0.7/test/models/authenticatable_test.rb b/vendor/gems/devise-1.0.7/test/models/authenticatable_test.rb deleted file mode 100644 index 8ec097283..000000000 --- a/vendor/gems/devise-1.0.7/test/models/authenticatable_test.rb +++ /dev/null @@ -1,180 +0,0 @@ -require 'test/test_helper' -require 'digest/sha1' - -class AuthenticatableTest < ActiveSupport::TestCase - - def encrypt_password(user, pepper=User.pepper, stretches=User.stretches, encryptor=::Devise::Encryptors::Sha1) - encryptor.digest('123456', stretches, user.password_salt, pepper) - end - - test 'should respond to password and password confirmation' do - user = new_user - assert user.respond_to?(:password) - assert user.respond_to?(:password_confirmation) - end - - test 'should generate encrypted password and salt while setting password' do - user = new_user - assert_present user.password_salt - assert_present user.encrypted_password - end - - test 'should not change password salt when updating' do - user = create_user - salt = user.password_salt - user.expects(:password_salt=).never - user.save! - assert_equal salt, user.password_salt - end - - test 'should generate a base64 hash using SecureRandom for password salt' do - ActiveSupport::SecureRandom.expects(:base64).with(15).returns('friendly_token') - assert_equal 'friendly_token', new_user.password_salt - end - - test 'should not generate salt if password is blank' do - assert_blank new_user(:password => nil).password_salt - assert_blank new_user(:password => '').password_salt - end - - test 'should not generate encrypted password if password is blank' do - assert_blank new_user(:password => nil).encrypted_password - assert_blank new_user(:password => '').encrypted_password - end - - test 'should encrypt password again if password has changed' do - user = create_user - encrypted_password = user.encrypted_password - user.password = user.password_confirmation = 'new_password' - user.save! - assert_not_equal encrypted_password, user.encrypted_password - end - - test 'should fallback to sha1 as default encryption' do - user = new_user - assert_equal encrypt_password(user), user.encrypted_password - end - - test 'should fallback to devise pepper default configuration' do - begin - Devise.pepper = '' - user = new_user - assert_equal encrypt_password(user), user.encrypted_password - assert_not_equal encrypt_password(user, 'another_pepper'), user.encrypted_password - - Devise.pepper = 'new_pepper' - user = new_user - assert_equal encrypt_password(user, 'new_pepper'), user.encrypted_password - assert_not_equal encrypt_password(user, 'another_pepper'), user.encrypted_password - ensure - Devise.pepper = nil - end - end - - test 'should fallback to devise stretches default configuration' do - swap Devise, :stretches => 1 do - user = new_user - assert_equal encrypt_password(user, nil, 1), user.encrypted_password - assert_not_equal encrypt_password(user, nil, 2), user.encrypted_password - end - end - - test 'should respect encryptor configuration' do - User.instance_variable_set(:@encryptor_class, nil) - - swap Devise, :encryptor => :sha512 do - begin - user = create_user - assert_equal user.encrypted_password, encrypt_password(user, User.pepper, User.stretches, ::Devise::Encryptors::Sha512) - ensure - User.instance_variable_set(:@encryptor_class, nil) - end - end - end - - test 'should test for a valid password' do - user = create_user - assert user.valid_password?('123456') - assert_not user.valid_password?('654321') - end - - test 'should authenticate a valid user with email and password and return it' do - user = create_user - User.any_instance.stubs(:confirmed?).returns(true) - authenticated_user = User.authenticate(:email => user.email, :password => user.password) - assert_equal authenticated_user, user - end - - test 'should return nil when authenticating an invalid user by email' do - user = create_user - authenticated_user = User.authenticate(:email => 'another.email@email.com', :password => user.password) - assert_nil authenticated_user - end - - test 'should return nil when authenticating an invalid user by password' do - user = create_user - authenticated_user = User.authenticate(:email => user.email, :password => 'another_password') - assert_nil authenticated_user - end - - test 'should use authentication keys to retrieve users' do - swap Devise, :authentication_keys => [:username] do - user = create_user - assert_nil User.authenticate(:email => user.email, :password => user.password) - assert_not_nil User.authenticate(:username => user.username, :password => user.password) - end - end - - test 'should allow overwriting find for authentication conditions' do - admin = Admin.create!(valid_attributes) - assert_not_nil Admin.authenticate(:email => admin.email, :password => admin.password) - end - - test 'should respond to current password' do - assert new_user.respond_to?(:current_password) - end - - test 'should update password with valid current password' do - user = create_user - assert user.update_with_password(:current_password => '123456', - :password => 'pass321', :password_confirmation => 'pass321') - assert user.reload.valid_password?('pass321') - end - - test 'should add an error to current password when it is invalid' do - user = create_user - assert_not user.update_with_password(:current_password => 'other', - :password => 'pass321', :password_confirmation => 'pass321') - assert user.reload.valid_password?('123456') - assert_match /invalid/, user.errors[:current_password] - end - - test 'should add an error to current password when it is blank' do - user = create_user - assert_not user.update_with_password(:password => 'pass321', - :password_confirmation => 'pass321') - assert user.reload.valid_password?('123456') - assert_match /blank/, user.errors[:current_password] - end - - test 'should ignore password and its confirmation if they are blank' do - user = create_user - assert user.update_with_password(:current_password => '123456', :email => "new@email.com") - assert_equal "new@email.com", user.email - end - - test 'should not update password with invalid confirmation' do - user = create_user - assert_not user.update_with_password(:current_password => '123456', - :password => 'pass321', :password_confirmation => 'other') - assert user.reload.valid_password?('123456') - end - - test 'should clean up password fields on failure' do - user = create_user - assert_not user.update_with_password(:current_password => '123456', - :password => 'pass321', :password_confirmation => 'other') - assert user.password.blank? - assert user.password_confirmation.blank? - end -end diff --git a/vendor/gems/devise-1.0.7/test/models/confirmable_test.rb b/vendor/gems/devise-1.0.7/test/models/confirmable_test.rb deleted file mode 100644 index 1c82cb7f3..000000000 --- a/vendor/gems/devise-1.0.7/test/models/confirmable_test.rb +++ /dev/null @@ -1,212 +0,0 @@ -require 'test/test_helper' - -class ConfirmableTest < ActiveSupport::TestCase - - def setup - setup_mailer - end - - test 'should generate confirmation token after creating a record' do - assert_nil new_user.confirmation_token - assert_not_nil create_user.confirmation_token - end - - test 'should never generate the same confirmation token for different users' do - confirmation_tokens = [] - 3.times do - token = create_user.confirmation_token - assert !confirmation_tokens.include?(token) - confirmation_tokens << token - end - end - - test 'should confirm a user by updating confirmed at' do - user = create_user - assert_nil user.confirmed_at - assert user.confirm! - assert_not_nil user.confirmed_at - end - - test 'should clear confirmation token while confirming a user' do - user = create_user - assert_present user.confirmation_token - user.confirm! - assert_nil user.confirmation_token - end - - test 'should verify whether a user is confirmed or not' do - assert_not new_user.confirmed? - user = create_user - assert_not user.confirmed? - user.confirm! - assert user.confirmed? - end - - test 'should not confirm a user already confirmed' do - user = create_user - assert user.confirm! - assert_nil user.errors[:email] - - assert_not user.confirm! - assert_match /already confirmed/, user.errors[:email] - end - - test 'should find and confirm an user automatically' do - user = create_user - confirmed_user = User.confirm_by_token(user.confirmation_token) - assert_equal confirmed_user, user - assert user.reload.confirmed? - end - - test 'should return a new record with errors when a invalid token is given' do - confirmed_user = User.confirm_by_token('invalid_confirmation_token') - assert confirmed_user.new_record? - assert_match /invalid/, confirmed_user.errors[:confirmation_token] - end - - test 'should return a new record with errors when a blank token is given' do - confirmed_user = User.confirm_by_token('') - assert confirmed_user.new_record? - assert_match /blank/, confirmed_user.errors[:confirmation_token] - end - - test 'should generate errors for a user email if user is already confirmed' do - user = create_user - user.confirmed_at = Time.now - user.save - confirmed_user = User.confirm_by_token(user.confirmation_token) - assert confirmed_user.confirmed? - assert confirmed_user.errors[:email] - end - - test 'should authenticate a confirmed user' do - user = create_user - user.confirm! - authenticated_user = User.authenticate(:email => user.email, :password => user.password) - assert_equal authenticated_user, user - end - - test 'should send confirmation instructions by email' do - assert_email_sent do - create_user - end - end - - test 'should not send confirmation when trying to save an invalid user' do - assert_email_not_sent do - user = new_user - user.stubs(:valid?).returns(false) - user.save - end - end - - test 'should not generate a new token neither send e-mail if skip_confirmation! is invoked' do - user = new_user - user.skip_confirmation! - - assert_email_not_sent do - user.save! - assert_nil user.confirmation_token - assert_not_nil user.confirmed_at - end - end - - test 'should find a user to send confirmation instructions' do - user = create_user - confirmation_user = User.send_confirmation_instructions(:email => user.email) - assert_equal confirmation_user, user - end - - test 'should return a new user if no email was found' do - confirmation_user = User.send_confirmation_instructions(:email => "invalid@email.com") - assert confirmation_user.new_record? - end - - test 'should add error to new user email if no email was found' do - confirmation_user = User.send_confirmation_instructions(:email => "invalid@email.com") - assert confirmation_user.errors[:email] - assert_equal 'not found', confirmation_user.errors[:email] - end - - test 'should send email instructions for the user confirm it\'s email' do - user = create_user - assert_email_sent do - User.send_confirmation_instructions(:email => user.email) - end - end - - test 'should not resend email instructions if the user change his email' do - user = create_user - user.email = 'new_test@example.com' - assert_email_not_sent do - user.save! - end - end - - test 'should not reset confirmation status or token when updating email' do - user = create_user - user.confirm! - user.email = 'new_test@example.com' - user.save! - - user.reload - assert user.confirmed? - assert_nil user.confirmation_token - end - - test 'should not be able to send instructions if the user is already confirmed' do - user = create_user - user.confirm! - assert_not user.resend_confirmation_token - assert user.confirmed? - assert_equal 'already confirmed', user.errors[:email] - end - - test 'confirm time should fallback to devise confirm in default configuration' do - swap Devise, :confirm_within => 1.day do - user = new_user - user.confirmation_sent_at = 2.days.ago - assert_not user.active? - - Devise.confirm_within = 3.days - assert user.active? - end - end - - test 'should be active when confirmation sent at is not overpast' do - swap Devise, :confirm_within => 5.days do - Devise.confirm_within = 5.days - user = create_user - - user.confirmation_sent_at = 4.days.ago - assert user.active? - - user.confirmation_sent_at = 5.days.ago - assert_not user.active? - end - end - - test 'should be active when already confirmed' do - user = create_user - assert_not user.confirmed? - assert_not user.active? - - user.confirm! - assert user.confirmed? - assert user.active? - end - - test 'should not be active when confirm in is zero' do - Devise.confirm_within = 0.days - user = create_user - user.confirmation_sent_at = Date.today - assert_not user.reload.active? - end - - test 'should not be active without confirmation' do - user = create_user - user.confirmation_sent_at = nil - user.save - assert_not user.reload.active? - end -end diff --git a/vendor/gems/devise-1.0.7/test/models/lockable_test.rb b/vendor/gems/devise-1.0.7/test/models/lockable_test.rb deleted file mode 100644 index 50200a5b3..000000000 --- a/vendor/gems/devise-1.0.7/test/models/lockable_test.rb +++ /dev/null @@ -1,202 +0,0 @@ -require 'test/test_helper' - -class LockableTest < ActiveSupport::TestCase - - def setup - setup_mailer - end - - test "should increment failed attempts on unsuccessful authentication" do - user = create_user - assert_equal 0, user.failed_attempts - authenticated_user = User.authenticate(:email => user.email, :password => "anotherpassword") - assert_equal 1, user.reload.failed_attempts - end - - test "should lock account base on maximum_attempts" do - user = create_user - attempts = Devise.maximum_attempts + 1 - attempts.times { authenticated_user = User.authenticate(:email => user.email, :password => "anotherpassword") } - assert user.reload.access_locked? - end - - test "should respect maximum attempts configuration" do - user = create_user - swap Devise, :maximum_attempts => 2 do - 3.times { authenticated_user = User.authenticate(:email => user.email, :password => "anotherpassword") } - assert user.reload.access_locked? - end - end - - test "should clear failed_attempts on successfull sign in" do - user = create_user - User.authenticate(:email => user.email, :password => "anotherpassword") - assert_equal 1, user.reload.failed_attempts - User.authenticate(:email => user.email, :password => "123456") - assert_equal 0, user.reload.failed_attempts - end - - test "should verify whether a user is locked or not" do - user = create_user - assert_not user.access_locked? - user.lock_access! - assert user.access_locked? - end - - test "active? should be the opposite of locked?" do - user = create_user - user.confirm! - assert user.active? - user.lock_access! - assert_not user.active? - end - - test "should unlock an user by cleaning locked_at, falied_attempts and unlock_token" do - user = create_user - user.lock_access! - assert_not_nil user.reload.locked_at - assert_not_nil user.reload.unlock_token - - user.unlock_access! - assert_nil user.reload.locked_at - assert_nil user.reload.unlock_token - assert 0, user.reload.failed_attempts - end - - test "should not lock a locked account" do - user = create_user - user.lock_access! - assert_no_difference "ActionMailer::Base.deliveries.size" do - user.lock_access! - end - end - - test 'should not unlock an unlocked user' do - user = create_user - - assert_not user.unlock_access! - assert_match /not locked/, user.errors[:email] - end - - test "new user should not be locked and should have zero failed_attempts" do - assert_not new_user.access_locked? - assert_equal 0, create_user.failed_attempts - end - - test "should unlock user after unlock_in period" do - swap Devise, :unlock_in => 3.hours do - user = new_user - user.locked_at = 2.hours.ago - assert user.access_locked? - - Devise.unlock_in = 1.hour - assert_not user.access_locked? - end - end - - test "should not unlock in 'unlock_in' if :time unlock strategy is not set" do - swap Devise, :unlock_strategy => :email do - user = new_user - user.locked_at = 2.hours.ago - assert user.access_locked? - end - end - - test "should set unlock_token when locking" do - user = create_user - assert_nil user.unlock_token - user.lock_access! - assert_not_nil user.unlock_token - end - - test "should never generate the same unlock token for different users" do - unlock_tokens = [] - 3.times do - user = create_user - user.lock_access! - token = user.unlock_token - assert !unlock_tokens.include?(token) - unlock_tokens << token - end - end - - test "should not generate unlock_token when :email is not an unlock strategy" do - swap Devise, :unlock_strategy => :time do - user = create_user - user.lock_access! - assert_nil user.unlock_token - end - end - - test "should send email with unlock instructions when :email is an unlock strategy" do - swap Devise, :unlock_strategy => :email do - user = create_user - assert_email_sent do - user.lock_access! - end - end - end - - test "should not send email with unlock instructions when :email is not an unlock strategy" do - swap Devise, :unlock_strategy => :time do - user = create_user - assert_email_not_sent do - user.lock_access! - end - end - end - - test 'should find and unlock an user automatically' do - user = create_user - user.lock_access! - locked_user = User.unlock_access_by_token(user.unlock_token) - assert_equal locked_user, user - assert_not user.reload.access_locked? - end - - test 'should return a new record with errors when a invalid token is given' do - locked_user = User.unlock_access_by_token('invalid_token') - assert locked_user.new_record? - assert_match /invalid/, locked_user.errors[:unlock_token] - end - - test 'should return a new record with errors when a blank token is given' do - locked_user = User.unlock_access_by_token('') - assert locked_user.new_record? - assert_match /blank/, locked_user.errors[:unlock_token] - end - - test 'should authenticate a unlocked user' do - user = create_user - user.lock_access! - user.unlock_access! - authenticated_user = User.authenticate(:email => user.email, :password => user.password) - assert_equal authenticated_user, user - end - - test 'should find a user to send unlock instructions' do - user = create_user - user.lock_access! - unlock_user = User.send_unlock_instructions(:email => user.email) - assert_equal unlock_user, user - end - - test 'should return a new user if no email was found' do - unlock_user = User.send_unlock_instructions(:email => "invalid@email.com") - assert unlock_user.new_record? - end - - test 'should add error to new user email if no email was found' do - unlock_user = User.send_unlock_instructions(:email => "invalid@email.com") - assert unlock_user.errors[:email] - assert_equal 'not found', unlock_user.errors[:email] - end - - test 'should not be able to send instructions if the user is not locked' do - user = create_user - assert_not user.resend_unlock_token - assert_not user.access_locked? - assert_equal 'not locked', user.errors[:email] - end - -end diff --git a/vendor/gems/devise-1.0.7/test/models/recoverable_test.rb b/vendor/gems/devise-1.0.7/test/models/recoverable_test.rb deleted file mode 100644 index dd8ca27f4..000000000 --- a/vendor/gems/devise-1.0.7/test/models/recoverable_test.rb +++ /dev/null @@ -1,138 +0,0 @@ -require 'test/test_helper' - -class RecoverableTest < ActiveSupport::TestCase - - def setup - setup_mailer - end - - test 'should not generate reset password token after creating a record' do - assert_nil new_user.reset_password_token - end - - test 'should regenerate reset password token each time' do - user = create_user - 3.times do - token = user.reset_password_token - user.send_reset_password_instructions - assert_not_equal token, user.reset_password_token - end - end - - test 'should never generate the same reset password token for different users' do - reset_password_tokens = [] - 3.times do - user = create_user - user.send_reset_password_instructions - token = user.reset_password_token - assert !reset_password_tokens.include?(token) - reset_password_tokens << token - end - end - - test 'should reset password and password confirmation from params' do - user = create_user - user.reset_password!('123456789', '987654321') - assert_equal '123456789', user.password - assert_equal '987654321', user.password_confirmation - end - - test 'should reset password and save the record' do - assert create_user.reset_password!('123456789', '123456789') - end - - test 'should clear reset password token while reseting the password' do - user = create_user - assert_nil user.reset_password_token - - user.send_reset_password_instructions - assert_present user.reset_password_token - assert user.reset_password!('123456789', '123456789') - assert_nil user.reset_password_token - end - - test 'should not clear reset password token if record is invalid' do - user = create_user - user.send_reset_password_instructions - assert_present user.reset_password_token - assert_not user.reset_password!('123456789', '987654321') - assert_present user.reset_password_token - end - - test 'should not reset password with invalid data' do - user = create_user - user.stubs(:valid?).returns(false) - assert_not user.reset_password!('123456789', '987654321') - end - - test 'should reset reset password token and send instructions by email' do - user = create_user - assert_email_sent do - token = user.reset_password_token - user.send_reset_password_instructions - assert_not_equal token, user.reset_password_token - end - end - - test 'should find a user to send instructions by email' do - user = create_user - reset_password_user = User.send_reset_password_instructions(:email => user.email) - assert_equal reset_password_user, user - end - - test 'should return a new record with errors if user was not found by e-mail' do - reset_password_user = User.send_reset_password_instructions(:email => "invalid@email.com") - assert reset_password_user.new_record? - assert_match /not found/, reset_password_user.errors[:email] - end - - test 'should reset reset_password_token before send the reset instructions email' do - user = create_user - token = user.reset_password_token - reset_password_user = User.send_reset_password_instructions(:email => user.email) - assert_not_equal token, user.reload.reset_password_token - end - - test 'should send email instructions to the user reset his password' do - user = create_user - assert_email_sent do - User.send_reset_password_instructions(:email => user.email) - end - end - - test 'should find a user to reset his password based on reset_password_token' do - user = create_user - user.send :generate_reset_password_token! - - reset_password_user = User.reset_password_by_token(:reset_password_token => user.reset_password_token) - assert_equal reset_password_user, user - end - - test 'should a new record with errors if no reset_password_token is found' do - reset_password_user = User.reset_password_by_token(:reset_password_token => 'invalid_token') - assert reset_password_user.new_record? - assert_match /invalid/, reset_password_user.errors[:reset_password_token] - end - - test 'should a new record with errors if reset_password_token is blank' do - reset_password_user = User.reset_password_by_token(:reset_password_token => '') - assert reset_password_user.new_record? - assert_match /blank/, reset_password_user.errors[:reset_password_token] - end - - test 'should reset successfully user password given the new password and confirmation' do - user = create_user - old_password = user.password - user.send :generate_reset_password_token! - - reset_password_user = User.reset_password_by_token( - :reset_password_token => user.reset_password_token, - :password => 'new_password', - :password_confirmation => 'new_password' - ) - user.reload - - assert_not user.valid_password?(old_password) - assert user.valid_password?('new_password') - end -end diff --git a/vendor/gems/devise-1.0.7/test/models/rememberable_test.rb b/vendor/gems/devise-1.0.7/test/models/rememberable_test.rb deleted file mode 100644 index b4bec3dcf..000000000 --- a/vendor/gems/devise-1.0.7/test/models/rememberable_test.rb +++ /dev/null @@ -1,135 +0,0 @@ -require 'test/test_helper' - -class RememberableTest < ActiveSupport::TestCase - - def setup - Devise.remember_for = 1 - end - - test 'should respond to remember_me attribute' do - user = new_user - assert user.respond_to?(:remember_me) - end - - test 'remember_me should generate a new token and save the record without validating' do - user = create_user - user.expects(:valid?).never - token = user.remember_token - user.remember_me! - assert_not_equal token, user.remember_token - assert_not user.changed? - end - - test 'forget_me should clear remember token and save the record without validating' do - user = create_user - user.remember_me! - assert user.remember_token? - user.expects(:valid?).never - user.forget_me! - assert_not user.remember_token? - assert_not user.changed? - end - - test 'forget_me should clear remember_created_at' do - user = create_user - user.remember_me! - assert user.remember_created_at? - user.forget_me! - assert_not user.remember_created_at? - end - - test 'forget should do nothing if no remember token exists' do - user = create_user - user.expects(:save).never - user.forget_me! - end - - test 'valid remember token' do - user = create_user - assert_not user.valid_remember_token?(user.remember_token) - user.remember_me! - assert user.valid_remember_token?(user.remember_token) - user.forget_me! - assert_not user.valid_remember_token?(user.remember_token) - end - - test 'valid remember token should also verify if remember is not expired' do - user = create_user - user.remember_me! - user.remember_created_at = 3.days.ago - user.save - assert_not user.valid_remember_token?(user.remember_token) - end - - test 'serialize into cookie' do - user = create_user - user.remember_me! - assert_equal "#{user.id}::#{user.remember_token}", User.serialize_into_cookie(user) - end - - test 'serialize from cookie' do - user = create_user - user.remember_me! - assert_equal user, User.serialize_from_cookie("#{user.id}::#{user.remember_token}") - end - - # MongoMapper cries if an invalid ID is given, so this does not need to be tested - unless DEVISE_ORM == :mongo_mapper - test 'serialize should return nil if no user is found' do - assert_nil User.serialize_from_cookie('0::123') - end - end - - test 'remember me return nil if is a valid user with invalid token' do - user = create_user - assert_nil User.serialize_from_cookie("#{user.id}::#{user.remember_token}123") - end - - test 'remember for should fallback to devise remember for default configuration' do - swap Devise, :remember_for => 1.day do - user = create_user - user.remember_me! - assert_not user.remember_expired? - end - end - - test 'remember expires at should sum date of creation with remember for configuration' do - swap Devise, :remember_for => 3.days do - user = create_user - user.remember_me! - assert_equal 3.days.from_now.to_date, user.remember_expires_at.to_date - - Devise.remember_for = 5.days - assert_equal 5.days.from_now.to_date, user.remember_expires_at.to_date - end - end - - test 'remember should be expired if remember_for is zero' do - swap Devise, :remember_for => 0.days do - Devise.remember_for = 0.days - user = create_user - user.remember_me! - assert user.remember_expired? - end - end - - test 'remember should be expired if it was created before limit time' do - swap Devise, :remember_for => 1.day do - user = create_user - user.remember_me! - user.remember_created_at = 2.days.ago - user.save - assert user.remember_expired? - end - end - - test 'remember should not be expired if it was created whitin the limit time' do - swap Devise, :remember_for => 30.days do - user = create_user - user.remember_me! - user.remember_created_at = (30.days.ago + 2.minutes) - user.save - assert_not user.remember_expired? - end - end -end diff --git a/vendor/gems/devise-1.0.7/test/models/timeoutable_test.rb b/vendor/gems/devise-1.0.7/test/models/timeoutable_test.rb deleted file mode 100644 index 4e9221270..000000000 --- a/vendor/gems/devise-1.0.7/test/models/timeoutable_test.rb +++ /dev/null @@ -1,28 +0,0 @@ -require 'test/test_helper' - -class TimeoutableTest < ActiveSupport::TestCase - - test 'should be expired' do - assert new_user.timedout?(31.minutes.ago) - end - - test 'should not be expired' do - assert_not new_user.timedout?(29.minutes.ago) - end - - test 'should not be expired when params is nil' do - assert_not new_user.timedout?(nil) - end - - test 'fallback to Devise config option' do - swap Devise, :timeout_in => 1.minute do - user = new_user - assert user.timedout?(2.minutes.ago) - assert_not user.timedout?(30.seconds.ago) - - Devise.timeout_in = 5.minutes - assert_not user.timedout?(2.minutes.ago) - assert user.timedout?(6.minutes.ago) - end - end -end diff --git a/vendor/gems/devise-1.0.7/test/models/token_authenticatable_test.rb b/vendor/gems/devise-1.0.7/test/models/token_authenticatable_test.rb deleted file mode 100644 index 2c8d75b7d..000000000 --- a/vendor/gems/devise-1.0.7/test/models/token_authenticatable_test.rb +++ /dev/null @@ -1,51 +0,0 @@ -require 'test/test_helper' - -class TokenAuthenticatableTest < ActiveSupport::TestCase - - test 'should generate friendly authentication token on create' do - User.expects(:authentication_token).returns(VALID_AUTHENTICATION_TOKEN) - user = create_user - assert_present user.authentication_token - assert_equal VALID_AUTHENTICATION_TOKEN, user.authentication_token - end - - test 'should reset authentication token' do - user = new_user - user.reset_authentication_token - previous_token = user.authentication_token - user.reset_authentication_token - assert_not_equal previous_token, user.authentication_token - end - - test 'should ensure authentication token' do - user = new_user - user.ensure_authentication_token - previous_token = user.authentication_token - user.ensure_authentication_token - assert_equal previous_token, user.authentication_token - end - - test 'should test for a valid authentication token' do - User.expects(:authentication_token).returns(VALID_AUTHENTICATION_TOKEN) - user = create_user - assert user.valid_authentication_token?(VALID_AUTHENTICATION_TOKEN) - assert_not user.valid_authentication_token?(VALID_AUTHENTICATION_TOKEN.reverse) - end - - test 'should authenticate a valid user with authentication token and return it' do - User.expects(:authentication_token).returns(VALID_AUTHENTICATION_TOKEN) - user = create_user - user.confirm! - authenticated_user = User.authenticate_with_token(:auth_token => user.authentication_token) - assert_equal authenticated_user, user - end - - test 'should return nil when authenticating an invalid user by authentication token' do - User.expects(:authentication_token).returns(VALID_AUTHENTICATION_TOKEN) - user = create_user - user.confirm! - authenticated_user = User.authenticate_with_token(:auth_token => user.authentication_token.reverse) - assert_nil authenticated_user - end - -end \ No newline at end of file diff --git a/vendor/gems/devise-1.0.7/test/models/trackable_test.rb b/vendor/gems/devise-1.0.7/test/models/trackable_test.rb deleted file mode 100644 index 5406b440d..000000000 --- a/vendor/gems/devise-1.0.7/test/models/trackable_test.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'test/test_helper' - -class TrackableTest < ActiveSupport::TestCase - -end diff --git a/vendor/gems/devise-1.0.7/test/models/validatable_test.rb b/vendor/gems/devise-1.0.7/test/models/validatable_test.rb deleted file mode 100644 index 57b9ab7a7..000000000 --- a/vendor/gems/devise-1.0.7/test/models/validatable_test.rb +++ /dev/null @@ -1,106 +0,0 @@ -require 'test/test_helper' - -class ValidatableTest < ActiveSupport::TestCase - extend Devise::TestSilencer if [:mongo_mapper, :data_mapper].include?(DEVISE_ORM) - - test 'should require email to be set' do - user = new_user(:email => nil) - assert user.invalid? - assert user.errors[:email] - assert_equal 'can\'t be blank', user.errors[:email] - end - - test 'should require uniqueness of email, allowing blank' do - existing_user = create_user - user = new_user(:email => '') - assert user.invalid? - assert_not_equal 'has already been taken', user.errors[:email] - user.email = existing_user.email - assert user.invalid? - assert user.errors[:email] - assert_equal 1, [*user.errors[:email]].size - assert_equal 'has already been taken', user.errors[:email] - end - - test 'should require correct email format, allowing blank' do - user = new_user(:email => '') - assert user.invalid? - assert_not_equal 'is invalid', user.errors[:email] - %w(invalid_email_format email@invalid invalid$character@mail.com other@not 123).each do |email| - user.email = email - assert user.invalid?, 'should be invalid with email ' << email - assert user.errors[:email] - assert_equal 1, [*user.errors[:email]].size - assert_equal 'is invalid', user.errors[:email] - end - end - - test 'should accept valid emails' do - %w(a.b.c@example.com test_mail@gmail.com any@any.net email@test.br 123@mail.test).each do |email| - user = new_user(:email => email) - assert user.valid?, 'should be valid with email ' << email - assert_nil user.errors[:email] - end - end - - test 'should require password to be set when creating a new record' do - user = new_user(:password => '', :password_confirmation => '') - assert user.invalid? - assert user.errors[:password] - assert_equal 'can\'t be blank', user.errors[:password] - end - - test 'should require confirmation to be set when creating a new record' do - user = new_user(:password => 'new_password', :password_confirmation => 'blabla') - assert user.invalid? - assert user.errors[:password] - assert_equal 'doesn\'t match confirmation', user.errors[:password] - end - - test 'should require password when updating/reseting password' do - user = create_user - user.password = '' - user.password_confirmation = '' - assert user.invalid? - assert user.errors[:password] - assert_equal 'can\'t be blank', user.errors[:password] - end - - test 'should require confirmation when updating/reseting password' do - user = create_user - user.password_confirmation = 'another_password' - assert user.invalid? - assert user.errors[:password] - assert_equal 'doesn\'t match confirmation', user.errors[:password] - end - - test 'should require a password with minimum of 6 characters' do - user = new_user(:password => '12345', :password_confirmation => '12345') - assert user.invalid? - assert user.errors[:password] - assert_equal 'is too short (minimum is 6 characters)', user.errors[:password] - end - - test 'should require a password with maximum of 20 characters long' do - user = new_user(:password => 'x'*21, :password_confirmation => 'x'*21) - assert user.invalid? - assert user.errors[:password] - assert_equal 'is too long (maximum is 20 characters)', user.errors[:password] - end - - test 'should not require password length when it\'s not changed' do - user = create_user.reload - user.password = user.password_confirmation = nil - assert user.valid? - user.password_confirmation = 'confirmation' - assert user.invalid? - assert user.errors[:password] - assert_not user.errors[:password].to_a.include?('is too short (minimum is 6 characters)') - end - - test 'shuold not be included in objects with invalid API' do - assert_raise RuntimeError do - Class.new.send :include, Devise::Models::Validatable - end - end -end diff --git a/vendor/gems/devise-1.0.7/test/models_test.rb b/vendor/gems/devise-1.0.7/test/models_test.rb deleted file mode 100644 index 811d8014d..000000000 --- a/vendor/gems/devise-1.0.7/test/models_test.rb +++ /dev/null @@ -1,70 +0,0 @@ -require 'test/test_helper' - -class Configurable < User - devise :authenticatable, :confirmable, :rememberable, :timeoutable, :lockable, - :stretches => 15, :pepper => 'abcdef', :confirm_within => 5.days, - :remember_for => 7.days, :timeout_in => 15.minutes, :unlock_in => 10.days -end - -class ActiveRecordTest < ActiveSupport::TestCase - def include_module?(klass, mod) - klass.devise_modules.include?(mod) && - klass.included_modules.include?(Devise::Models::const_get(mod.to_s.classify)) - end - - def assert_include_modules(klass, *modules) - modules.each do |mod| - assert include_module?(klass, mod) - end - - (Devise::ALL - modules).each do |mod| - assert_not include_module?(klass, mod) - end - end - - test 'add modules cherry pick' do - assert_include_modules Admin, :database_authenticatable, :registerable, :timeoutable - end - - test 'order of module inclusion' do - correct_module_order = [:database_authenticatable, :registerable, :timeoutable] - incorrect_module_order = [:database_authenticatable, :timeoutable, :registerable] - - assert_include_modules Admin, *incorrect_module_order - - # get module constants from symbol list - module_constants = correct_module_order.collect { |mod| Devise::Models::const_get(mod.to_s.classify) } - - # confirm that they adhere to the order in ALL - # get included modules, filter out the noise, and reverse the order - assert_equal module_constants, (Admin.included_modules & module_constants).reverse - end - - test 'set a default value for stretches' do - assert_equal 15, Configurable.stretches - end - - test 'set a default value for pepper' do - assert_equal 'abcdef', Configurable.pepper - end - - test 'set a default value for confirm_within' do - assert_equal 5.days, Configurable.confirm_within - end - - test 'set a default value for remember_for' do - assert_equal 7.days, Configurable.remember_for - end - - test 'set a default value for timeout_in' do - assert_equal 15.minutes, Configurable.timeout_in - end - - test 'set a default value for unlock_in' do - assert_equal 10.days, Configurable.unlock_in - end - - test 'set null fields on migrations' do - Admin.create! - end -end diff --git a/vendor/gems/devise-1.0.7/test/orm/active_record.rb b/vendor/gems/devise-1.0.7/test/orm/active_record.rb deleted file mode 100644 index 88e772945..000000000 --- a/vendor/gems/devise-1.0.7/test/orm/active_record.rb +++ /dev/null @@ -1,31 +0,0 @@ -require File.join(File.dirname(__FILE__), '..', 'rails_app', 'config', 'environment') -require 'test_help' - -ActiveRecord::Migration.verbose = false -ActiveRecord::Base.logger = Logger.new(nil) -ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => ":memory:") - -ActiveRecord::Schema.define(:version => 1) do - [:users, :admins, :accounts].each do |table| - create_table table do |t| - t.authenticatable :null => table == :admins - - if table != :admin - t.string :username - t.confirmable - t.recoverable - t.rememberable - t.trackable - t.lockable - t.token_authenticatable - end - - t.timestamps - end - end -end - -class ActiveSupport::TestCase - self.use_transactional_fixtures = true - self.use_instantiated_fixtures = false -end diff --git a/vendor/gems/devise-1.0.7/test/orm/mongo_mapper.rb b/vendor/gems/devise-1.0.7/test/orm/mongo_mapper.rb deleted file mode 100644 index 2401360c8..000000000 --- a/vendor/gems/devise-1.0.7/test/orm/mongo_mapper.rb +++ /dev/null @@ -1,20 +0,0 @@ -require 'mongo_mapper' -MongoMapper.database = "devise-test-suite" -MongoMapper.connection = Mongo::Connection.new('127.0.0.1', 27017) - -require File.join(File.dirname(__FILE__), '..', 'rails_app', 'config', 'environment') -require 'test_help' - -module MongoMapper::Document - # TODO This should not be required - def invalid? - !valid? - end -end - -class ActiveSupport::TestCase - setup do - User.delete_all - Admin.delete_all - end -end \ No newline at end of file diff --git a/vendor/gems/devise-1.0.7/test/rails_app/Rakefile b/vendor/gems/devise-1.0.7/test/rails_app/Rakefile deleted file mode 100644 index 3bb0e8592..000000000 --- a/vendor/gems/devise-1.0.7/test/rails_app/Rakefile +++ /dev/null @@ -1,10 +0,0 @@ -# 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.join(File.dirname(__FILE__), 'config', 'boot')) - -require 'rake' -require 'rake/testtask' -require 'rake/rdoctask' - -require 'tasks/rails' diff --git a/vendor/gems/devise-1.0.7/test/rails_app/app/active_record/admin.rb b/vendor/gems/devise-1.0.7/test/rails_app/app/active_record/admin.rb deleted file mode 100644 index e48760422..000000000 --- a/vendor/gems/devise-1.0.7/test/rails_app/app/active_record/admin.rb +++ /dev/null @@ -1,7 +0,0 @@ -class Admin < ActiveRecord::Base - devise :authenticatable, :registerable, :timeoutable - - def self.find_for_authentication(conditions) - last(:conditions => conditions) - end -end diff --git a/vendor/gems/devise-1.0.7/test/rails_app/app/active_record/user.rb b/vendor/gems/devise-1.0.7/test/rails_app/app/active_record/user.rb deleted file mode 100644 index 1c9bc6682..000000000 --- a/vendor/gems/devise-1.0.7/test/rails_app/app/active_record/user.rb +++ /dev/null @@ -1,7 +0,0 @@ -class User < ActiveRecord::Base - devise :authenticatable, :http_authenticatable, :confirmable, :lockable, :recoverable, - :registerable, :rememberable, :timeoutable, :token_authenticatable, - :trackable, :validatable - - attr_accessible :username, :email, :password, :password_confirmation -end diff --git a/vendor/gems/devise-1.0.7/test/rails_app/app/controllers/admins_controller.rb b/vendor/gems/devise-1.0.7/test/rails_app/app/controllers/admins_controller.rb deleted file mode 100644 index 6c1fa3b54..000000000 --- a/vendor/gems/devise-1.0.7/test/rails_app/app/controllers/admins_controller.rb +++ /dev/null @@ -1,6 +0,0 @@ -class AdminsController < ApplicationController - before_filter :authenticate_admin! - - def index - end -end diff --git a/vendor/gems/devise-1.0.7/test/rails_app/app/controllers/application_controller.rb b/vendor/gems/devise-1.0.7/test/rails_app/app/controllers/application_controller.rb deleted file mode 100644 index 2821d59aa..000000000 --- a/vendor/gems/devise-1.0.7/test/rails_app/app/controllers/application_controller.rb +++ /dev/null @@ -1,12 +0,0 @@ -# Filters added to this controller apply to all controllers in the application. -# Likewise, all the methods added will be available for all controllers. - -class ApplicationController < ActionController::Base - helper :all # include all helpers, all the time - protect_from_forgery # See ActionController::RequestForgeryProtection for details - - # Scrub sensitive parameters from your log - filter_parameter_logging :password - - before_filter :current_user -end diff --git a/vendor/gems/devise-1.0.7/test/rails_app/app/controllers/home_controller.rb b/vendor/gems/devise-1.0.7/test/rails_app/app/controllers/home_controller.rb deleted file mode 100644 index 95f29929c..000000000 --- a/vendor/gems/devise-1.0.7/test/rails_app/app/controllers/home_controller.rb +++ /dev/null @@ -1,4 +0,0 @@ -class HomeController < ApplicationController - def index - end -end diff --git a/vendor/gems/devise-1.0.7/test/rails_app/app/controllers/users_controller.rb b/vendor/gems/devise-1.0.7/test/rails_app/app/controllers/users_controller.rb deleted file mode 100644 index ef3884639..000000000 --- a/vendor/gems/devise-1.0.7/test/rails_app/app/controllers/users_controller.rb +++ /dev/null @@ -1,16 +0,0 @@ -class UsersController < ApplicationController - before_filter :authenticate_user! - - def index - user_session[:cart] = "Cart" - end - - def expire - user_session['last_request_at'] = 31.minutes.ago.utc - render :text => 'User will be expired on next request' - end - - def show - render :text => current_user.id.to_s - end -end diff --git a/vendor/gems/devise-1.0.7/test/rails_app/app/helpers/application_helper.rb b/vendor/gems/devise-1.0.7/test/rails_app/app/helpers/application_helper.rb deleted file mode 100644 index 22a7940eb..000000000 --- a/vendor/gems/devise-1.0.7/test/rails_app/app/helpers/application_helper.rb +++ /dev/null @@ -1,3 +0,0 @@ -# Methods added to this helper will be available to all templates in the application. -module ApplicationHelper -end diff --git a/vendor/gems/devise-1.0.7/test/rails_app/app/mongo_mapper/admin.rb b/vendor/gems/devise-1.0.7/test/rails_app/app/mongo_mapper/admin.rb deleted file mode 100644 index c43aa85a7..000000000 --- a/vendor/gems/devise-1.0.7/test/rails_app/app/mongo_mapper/admin.rb +++ /dev/null @@ -1,13 +0,0 @@ -class Admin - include MongoMapper::Document - devise :authenticatable, :registerable, :timeoutable - - def self.find_for_authentication(conditions) - last(:conditions => conditions) - end - - def self.last(options={}) - options.merge!(:order => 'email') - super options - end -end diff --git a/vendor/gems/devise-1.0.7/test/rails_app/app/mongo_mapper/user.rb b/vendor/gems/devise-1.0.7/test/rails_app/app/mongo_mapper/user.rb deleted file mode 100644 index fd7664439..000000000 --- a/vendor/gems/devise-1.0.7/test/rails_app/app/mongo_mapper/user.rb +++ /dev/null @@ -1,14 +0,0 @@ -class User - include MongoMapper::Document - key :created_at, DateTime - devise :authenticatable, :http_authenticatable, :confirmable, :lockable, :recoverable, - :registerable, :rememberable, :timeoutable, :token_authenticatable, - :trackable, :validatable - # attr_accessible :username, :email, :password, :password_confirmation - - def self.last(options={}) - options.merge!(:order => 'email') - super options - end - -end diff --git a/vendor/gems/devise-1.0.7/test/rails_app/app/views/admins/index.html.erb b/vendor/gems/devise-1.0.7/test/rails_app/app/views/admins/index.html.erb deleted file mode 100644 index 798119e9e..000000000 --- a/vendor/gems/devise-1.0.7/test/rails_app/app/views/admins/index.html.erb +++ /dev/null @@ -1 +0,0 @@ -Welcome Admin! diff --git a/vendor/gems/devise-1.0.7/test/rails_app/app/views/devise_mailer/users/confirmation_instructions.erb b/vendor/gems/devise-1.0.7/test/rails_app/app/views/devise_mailer/users/confirmation_instructions.erb deleted file mode 100644 index f6e30c3eb..000000000 --- a/vendor/gems/devise-1.0.7/test/rails_app/app/views/devise_mailer/users/confirmation_instructions.erb +++ /dev/null @@ -1 +0,0 @@ -<%= @resource.email %> \ No newline at end of file diff --git a/vendor/gems/devise-1.0.7/test/rails_app/app/views/home/index.html.erb b/vendor/gems/devise-1.0.7/test/rails_app/app/views/home/index.html.erb deleted file mode 100644 index c3942a09a..000000000 --- a/vendor/gems/devise-1.0.7/test/rails_app/app/views/home/index.html.erb +++ /dev/null @@ -1 +0,0 @@ -Home! diff --git a/vendor/gems/devise-1.0.7/test/rails_app/app/views/layouts/application.html.erb b/vendor/gems/devise-1.0.7/test/rails_app/app/views/layouts/application.html.erb deleted file mode 100644 index d300607b4..000000000 --- a/vendor/gems/devise-1.0.7/test/rails_app/app/views/layouts/application.html.erb +++ /dev/null @@ -1,20 +0,0 @@ - - - - Devise Test App - - -
- <%- flash.each do |name, msg| -%> - <%= content_tag :div, msg, :id => "flash_#{name}" if msg.is_a?(String) %> - <%- end -%> - - <% if user_signed_in? -%> -

Hello User! You are signed in!

- <% end -%> - - <%= yield %> -
- - diff --git a/vendor/gems/devise-1.0.7/test/rails_app/app/views/sessions/users/new.html.erb b/vendor/gems/devise-1.0.7/test/rails_app/app/views/sessions/users/new.html.erb deleted file mode 100644 index 280cbd0d2..000000000 --- a/vendor/gems/devise-1.0.7/test/rails_app/app/views/sessions/users/new.html.erb +++ /dev/null @@ -1 +0,0 @@ -Special user view diff --git a/vendor/gems/devise-1.0.7/test/rails_app/app/views/users/index.html.erb b/vendor/gems/devise-1.0.7/test/rails_app/app/views/users/index.html.erb deleted file mode 100644 index 93b6afc32..000000000 --- a/vendor/gems/devise-1.0.7/test/rails_app/app/views/users/index.html.erb +++ /dev/null @@ -1 +0,0 @@ -Welcome User! diff --git a/vendor/gems/devise-1.0.7/test/rails_app/config/boot.rb b/vendor/gems/devise-1.0.7/test/rails_app/config/boot.rb deleted file mode 100644 index dd5e3b691..000000000 --- a/vendor/gems/devise-1.0.7/test/rails_app/config/boot.rb +++ /dev/null @@ -1,110 +0,0 @@ -# Don't change this file! -# Configure your app in config/environment.rb and config/environments/*.rb - -RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT) - -module Rails - class << self - def boot! - unless booted? - preinitialize - pick_boot.run - end - end - - def booted? - defined? Rails::Initializer - end - - def pick_boot - (vendor_rails? ? VendorBoot : GemBoot).new - end - - def vendor_rails? - File.exist?("#{RAILS_ROOT}/vendor/rails") - end - - def preinitialize - load(preinitializer_path) if File.exist?(preinitializer_path) - end - - def preinitializer_path - "#{RAILS_ROOT}/config/preinitializer.rb" - end - end - - class Boot - def run - load_initializer - Rails::Initializer.run(:set_load_path) - end - end - - class VendorBoot < Boot - def load_initializer - require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer" - Rails::Initializer.run(:install_gem_spec_stubs) - Rails::GemDependency.add_frozen_gem_path - end - end - - class GemBoot < Boot - def load_initializer - self.class.load_rubygems - load_rails_gem - require 'initializer' - end - - def load_rails_gem - if version = self.class.gem_version - gem 'rails', version - else - gem 'rails' - end - rescue Gem::LoadError => load_error - $stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.) - exit 1 - end - - class << self - def rubygems_version - Gem::RubyGemsVersion rescue nil - end - - def gem_version - if defined? RAILS_GEM_VERSION - RAILS_GEM_VERSION - elsif ENV.include?('RAILS_GEM_VERSION') - ENV['RAILS_GEM_VERSION'] - else - parse_gem_version(read_environment_rb) - end - end - - def load_rubygems - min_version = '1.3.2' - require 'rubygems' - unless rubygems_version >= min_version - $stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.) - exit 1 - end - - rescue LoadError - $stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org) - exit 1 - end - - def parse_gem_version(text) - $1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/ - end - - private - def read_environment_rb - File.read("#{RAILS_ROOT}/config/environment.rb") - end - end - end -end - -# All that for this: -Rails.boot! diff --git a/vendor/gems/devise-1.0.7/test/rails_app/config/database.yml b/vendor/gems/devise-1.0.7/test/rails_app/config/database.yml deleted file mode 100644 index 64ba5d03a..000000000 --- a/vendor/gems/devise-1.0.7/test/rails_app/config/database.yml +++ /dev/null @@ -1,18 +0,0 @@ -development: - adapter: sqlite3 - database: db/development.sqlite3 - pool: 5 - timeout: 5000 - -test: - adapter: sqlite3 - database: db/test.sqlite3 - pool: 5 - timeout: 5000 - -production: - adapter: sqlite3 - database: db/production.sqlite3 - pool: 5 - timeout: 5000 - diff --git a/vendor/gems/devise-1.0.7/test/rails_app/config/environment.rb b/vendor/gems/devise-1.0.7/test/rails_app/config/environment.rb deleted file mode 100644 index 8c010ddea..000000000 --- a/vendor/gems/devise-1.0.7/test/rails_app/config/environment.rb +++ /dev/null @@ -1,42 +0,0 @@ -# Be sure to restart your server when you modify this file - -# Specifies gem version of Rails to use when vendor/rails is not present -RAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION -DEVISE_ORM = :active_record unless defined? DEVISE_ORM - -# Bootstrap the Rails environment, frameworks, and default configuration -require File.join(File.dirname(__FILE__), 'boot') - -Rails::Initializer.run do |config| - # Settings in config/environments/* take precedence over those specified here. - # Application configuration should go into files in config/initializers - # -- all .rb files in that directory are automatically loaded. - - # Add additional load paths for your own custom dirs - config.load_paths += [ "#{RAILS_ROOT}/app/#{DEVISE_ORM}/" ] - - # Specify gems that this application depends on and have them installed with rake gems:install - # config.gem "bj" - # config.gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net" - # config.gem "sqlite3-ruby", :lib => "sqlite3" - # config.gem "aws-s3", :lib => "aws/s3" - - # Only load the plugins named here, in the order given (default is alphabetical). - # :all can be used as a placeholder for all plugins not explicitly named - # config.plugins = [ :exception_notification, :ssl_requirement, :all ] - - # Skip frameworks you're not going to use. To use Rails without a database, - # you must remove the Active Record framework. - config.frameworks -= [ :active_record ] unless DEVISE_ORM == :active_record - - # Activate observers that should always be running - # config.active_record.observers = :cacher, :garbage_collector, :forum_observer - - # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. - # Run "rake -D time" for a list of tasks for finding time zone names. - config.time_zone = 'UTC' - - # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded. - # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}')] - # config.i18n.default_locale = :en -end diff --git a/vendor/gems/devise-1.0.7/test/rails_app/config/environments/development.rb b/vendor/gems/devise-1.0.7/test/rails_app/config/environments/development.rb deleted file mode 100644 index 85c9a6080..000000000 --- a/vendor/gems/devise-1.0.7/test/rails_app/config/environments/development.rb +++ /dev/null @@ -1,17 +0,0 @@ -# Settings specified here will take precedence over those in config/environment.rb - -# In the development environment your application's code is reloaded on -# every request. This slows down response time but is perfect for development -# since you don't have to restart the webserver when you make code changes. -config.cache_classes = false - -# Log error messages when you accidentally call methods on nil. -config.whiny_nils = true - -# Show full error reports and disable caching -config.action_controller.consider_all_requests_local = true -config.action_view.debug_rjs = true -config.action_controller.perform_caching = false - -# Don't care if the mailer can't send -config.action_mailer.raise_delivery_errors = false \ No newline at end of file diff --git a/vendor/gems/devise-1.0.7/test/rails_app/config/environments/production.rb b/vendor/gems/devise-1.0.7/test/rails_app/config/environments/production.rb deleted file mode 100644 index 27119d2d1..000000000 --- a/vendor/gems/devise-1.0.7/test/rails_app/config/environments/production.rb +++ /dev/null @@ -1,28 +0,0 @@ -# Settings specified here will take precedence over those in config/environment.rb - -# The production environment is meant for finished, "live" apps. -# Code is not reloaded between requests -config.cache_classes = true - -# Full error reports are disabled and caching is turned on -config.action_controller.consider_all_requests_local = false -config.action_controller.perform_caching = true -config.action_view.cache_template_loading = true - -# See everything in the log (default is :info) -# config.log_level = :debug - -# Use a different logger for distributed setups -# config.logger = SyslogLogger.new - -# Use a different cache store in production -# config.cache_store = :mem_cache_store - -# Enable serving of images, stylesheets, and javascripts from an asset server -# config.action_controller.asset_host = "http://assets.example.com" - -# Disable delivery errors, bad email addresses will be ignored -# config.action_mailer.raise_delivery_errors = false - -# Enable threaded mode -# config.threadsafe! \ No newline at end of file diff --git a/vendor/gems/devise-1.0.7/test/rails_app/config/environments/test.rb b/vendor/gems/devise-1.0.7/test/rails_app/config/environments/test.rb deleted file mode 100644 index d6f80a408..000000000 --- a/vendor/gems/devise-1.0.7/test/rails_app/config/environments/test.rb +++ /dev/null @@ -1,28 +0,0 @@ -# Settings specified here will take precedence over those in config/environment.rb - -# The test environment is used exclusively to run your application's -# test suite. You never need to work with it otherwise. Remember that -# your test database is "scratch space" for the test suite and is wiped -# and recreated between test runs. Don't rely on the data there! -config.cache_classes = true - -# Log error messages when you accidentally call methods on nil. -config.whiny_nils = true - -# Show full error reports and disable caching -config.action_controller.consider_all_requests_local = true -config.action_controller.perform_caching = false -config.action_view.cache_template_loading = true - -# Disable request forgery protection in test environment -config.action_controller.allow_forgery_protection = false - -# Tell Action Mailer not to deliver emails to the real world. -# The :test delivery method accumulates sent emails in the -# ActionMailer::Base.deliveries array. -config.action_mailer.delivery_method = :test - -# 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 \ No newline at end of file diff --git a/vendor/gems/devise-1.0.7/test/rails_app/config/initializers/devise.rb b/vendor/gems/devise-1.0.7/test/rails_app/config/initializers/devise.rb deleted file mode 100644 index 1fbf5e320..000000000 --- a/vendor/gems/devise-1.0.7/test/rails_app/config/initializers/devise.rb +++ /dev/null @@ -1,82 +0,0 @@ -# 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| - # Invoke `rake secret` and use the printed value to setup a pepper to generate - # the encrypted password. By default no pepper is used. - # config.pepper = "rake secret output" - - # Configure how many times you want the password is reencrypted. Default is 10. - # config.stretches = 10 - - # Define which will be the encryption algorithm. Supported algorithms are :sha1 - # (default) and :sha512. Devise also supports encryptors from others authentication - # frameworks as :clearance_sha1, :authlogic_sha512 (then you should set stretches - # above to 20 for default behavior) and :restful_authentication_sha1 (then you - # should set stretches to 10, and copy REST_AUTH_SITE_KEY to pepper) - # config.encryptor = :sha1 - - # Configure which keys are used when authenticating an user. By default is - # just :email. You can configure it to use [:username, :subdomain], so for - # authenticating an user, both parameters are required. Remember that those - # parameters are used only when authenticating and not when retrieving from - # session. If you need permissions, you should implement that in a before filter. - # config.authentication_keys = [ :email ] - - # The time you want give to your user to confirm his account. During this time - # he will be able to access your application without confirming. Default is nil. - # config.confirm_within = 2.days - - # The time the user will be remembered without asking for credentials again. - # config.remember_for = 2.weeks - - # The time you want to timeout the user session without activity. After this - # time the user will be asked for credentials again. - # config.timeout_in = 10.minutes - - # Configure the e-mail address which will be shown in DeviseMailer. - config.mailer_sender = "please-change-me-omg@yourapp.com" - - # Configure the content type of DeviseMailer mails (defaults to text/html") - # config.mailer_content_type = "text/plain" - - # Load and configure the ORM. Supports :active_record, :data_mapper and :mongo_mapper. - require "devise/orm/#{DEVISE_ORM}" - config.orm = DEVISE_ORM - - # Turn scoped views on. Before rendering "sessions/new", it will first check for - # "sessions/users/new". It's turned off by default because it's slower if you - # are using only default views. - # config.scoped_views = true - - # Number of authentication tries before locking an account. - # config.maximum_attempts = 20 - - # Defines which strategy will be used to unlock an account. - # :email = Sends an unlock link to the user email - # :time = Reanables login after a certain ammount of time (see :unlock_in below) - # :both = enables both strategies - # config.unlock_strategy = :both - - # Time interval to unlock the account if :time is enabled as unlock_strategy. - # config.unlock_in = 1.hour - - # If you want to use other strategies, that are not (yet) supported by Devise, - # you can configure them inside the config.warden block. The example below - # allows you to setup OAuth, using http://github.com/roman/warden_oauth - # - # config.warden do |manager| - # manager.oauth(:twitter) do |twitter| - # twitter.consumer_secret = - # twitter.consumer_key = - # twitter.options :site => 'http://twitter.com' - # end - # manager.default_strategies.unshift :twitter_oauth - # end - - # Configure default_url_options if you are using dynamic segments in :path_prefix - # for devise_for. - # - # config.default_url_options do - # { :locale => I18n.locale } - # end -end diff --git a/vendor/gems/devise-1.0.7/test/rails_app/config/initializers/inflections.rb b/vendor/gems/devise-1.0.7/test/rails_app/config/initializers/inflections.rb deleted file mode 100644 index 45fc8f45a..000000000 --- a/vendor/gems/devise-1.0.7/test/rails_app/config/initializers/inflections.rb +++ /dev/null @@ -1,2 +0,0 @@ -ActiveSupport::Inflector.inflections do |inflect| -end diff --git a/vendor/gems/devise-1.0.7/test/rails_app/config/initializers/new_rails_defaults.rb b/vendor/gems/devise-1.0.7/test/rails_app/config/initializers/new_rails_defaults.rb deleted file mode 100644 index d0df8b9e3..000000000 --- a/vendor/gems/devise-1.0.7/test/rails_app/config/initializers/new_rails_defaults.rb +++ /dev/null @@ -1,24 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# These settings change the behavior of Rails 2 apps and will be defaults -# for Rails 3. You can remove this initializer when Rails 3 is released. - -if defined?(ActiveRecord) - # Include Active Record class name as root for JSON serialized output. - ActiveRecord::Base.include_root_in_json = true - - # Store the full class name (including module namespace) in STI type column. - ActiveRecord::Base.store_full_sti_class = true -end - -ActionController::Routing.generate_best_match = false - -# Use ISO 8601 format for JSON serialized times and dates. -ActiveSupport.use_standard_json_time_format = true - -# Don't escape HTML entities in JSON, leave that for the #json_escape helper. -# if you're including raw json in an HTML page. -ActiveSupport.escape_html_entities_in_json = false - -# Clean up silencers -Rails.backtrace_cleaner.remove_silencers! \ No newline at end of file diff --git a/vendor/gems/devise-1.0.7/test/rails_app/config/initializers/session_store.rb b/vendor/gems/devise-1.0.7/test/rails_app/config/initializers/session_store.rb deleted file mode 100644 index ceb4225f7..000000000 --- a/vendor/gems/devise-1.0.7/test/rails_app/config/initializers/session_store.rb +++ /dev/null @@ -1,15 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Your secret key for verifying cookie session data integrity. -# If you change this key, all old sessions will become invalid! -# Make sure the secret is at least 30 characters and all random, -# no regular words or you'll be exposed to dictionary attacks. -ActionController::Base.session = { - :key => '_rails_app_session', - :secret => '89e8147901a0d7c221ac130e0ded3eeab6dab4a97127255909f08fedaae371918b41dec9d4d75c5b27a55c3772d43c2b6a3cbac232c5cc2ce4b8ec22242f5e60' -} - -# Use the database for sessions instead of the cookie-based default, -# which shouldn't be used to store highly confidential information -# (create the session table with "rake db:sessions:create") -# ActionController::Base.session_store = :active_record_store diff --git a/vendor/gems/devise-1.0.7/test/rails_app/config/routes.rb b/vendor/gems/devise-1.0.7/test/rails_app/config/routes.rb deleted file mode 100644 index 59fb9298b..000000000 --- a/vendor/gems/devise-1.0.7/test/rails_app/config/routes.rb +++ /dev/null @@ -1,21 +0,0 @@ -ActionController::Routing::Routes.draw do |map| - map.devise_for :users - map.devise_for :admin, :as => 'admin_area' - map.devise_for :accounts, :scope => 'manager', :path_prefix => ':locale', - :class_name => "User", :requirements => { :extra => 'value' }, :path_names => { - :sign_in => 'login', :sign_out => 'logout', - :password => 'secret', :confirmation => 'verification', - :unlock => 'unblock', :sign_up => 'register' - } - - map.resources :users, :only => [:index], :member => { :expire => :get } - map.resources :admins, :only => :index - map.root :controller => :home - - map.connect '/admin_area/password/new', :controller => "passwords", :action => "new" - map.admin_root '/admin_area/home', :controller => "admins", :action => "index" - - map.connect '/sign_in', :controller => "sessions", :action => "new" - map.connect ':controller/:action/:id' - map.connect ':controller/:action/:id.:format' -end diff --git a/vendor/gems/devise-1.0.7/test/rails_app/public/404.html b/vendor/gems/devise-1.0.7/test/rails_app/public/404.html deleted file mode 100644 index eff660b90..000000000 --- a/vendor/gems/devise-1.0.7/test/rails_app/public/404.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - The page you were looking for doesn't exist (404) - - - - - -
-

The page you were looking for doesn't exist.

-

You may have mistyped the address or the page may have moved.

-
- - \ No newline at end of file diff --git a/vendor/gems/devise-1.0.7/test/rails_app/public/422.html b/vendor/gems/devise-1.0.7/test/rails_app/public/422.html deleted file mode 100644 index b54e4a3ca..000000000 --- a/vendor/gems/devise-1.0.7/test/rails_app/public/422.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - The change you wanted was rejected (422) - - - - - -
-

The change you wanted was rejected.

-

Maybe you tried to change something you didn't have access to.

-
- - \ No newline at end of file diff --git a/vendor/gems/devise-1.0.7/test/rails_app/public/500.html b/vendor/gems/devise-1.0.7/test/rails_app/public/500.html deleted file mode 100644 index ec3bbf02c..000000000 --- a/vendor/gems/devise-1.0.7/test/rails_app/public/500.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - We're sorry, but something went wrong (500) - - - - - -
-

We're sorry, but something went wrong.

-

We've been notified about this issue and we'll take a look at it shortly.

-
- - diff --git a/vendor/gems/devise-1.0.7/test/rails_app/public/favicon.ico b/vendor/gems/devise-1.0.7/test/rails_app/public/favicon.ico deleted file mode 100644 index e69de29bb..000000000 diff --git a/vendor/gems/devise-1.0.7/test/rails_app/script/about b/vendor/gems/devise-1.0.7/test/rails_app/script/about deleted file mode 100755 index 1eeb6eb91..000000000 --- a/vendor/gems/devise-1.0.7/test/rails_app/script/about +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env ruby -require File.expand_path('../../config/boot', __FILE__) -$LOAD_PATH.unshift "#{RAILTIES_PATH}/builtin/rails_info" -require 'commands/about' diff --git a/vendor/gems/devise-1.0.7/test/rails_app/script/console b/vendor/gems/devise-1.0.7/test/rails_app/script/console deleted file mode 100755 index 235a1f278..000000000 --- a/vendor/gems/devise-1.0.7/test/rails_app/script/console +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env ruby -require File.expand_path('../../config/boot', __FILE__) -require 'commands/console' diff --git a/vendor/gems/devise-1.0.7/test/rails_app/script/dbconsole b/vendor/gems/devise-1.0.7/test/rails_app/script/dbconsole deleted file mode 100755 index 83c8436a9..000000000 --- a/vendor/gems/devise-1.0.7/test/rails_app/script/dbconsole +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env ruby -require File.expand_path('../../config/boot', __FILE__) -require 'commands/dbconsole' diff --git a/vendor/gems/devise-1.0.7/test/rails_app/script/destroy b/vendor/gems/devise-1.0.7/test/rails_app/script/destroy deleted file mode 100755 index 88d295f7a..000000000 --- a/vendor/gems/devise-1.0.7/test/rails_app/script/destroy +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env ruby -require File.expand_path('../../config/boot', __FILE__) -require 'commands/destroy' diff --git a/vendor/gems/devise-1.0.7/test/rails_app/script/generate b/vendor/gems/devise-1.0.7/test/rails_app/script/generate deleted file mode 100755 index 62a8a4c0c..000000000 --- a/vendor/gems/devise-1.0.7/test/rails_app/script/generate +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env ruby -require File.expand_path('../../config/boot', __FILE__) -require 'commands/generate' diff --git a/vendor/gems/devise-1.0.7/test/rails_app/script/performance/benchmarker b/vendor/gems/devise-1.0.7/test/rails_app/script/performance/benchmarker deleted file mode 100755 index 3bff809fb..000000000 --- a/vendor/gems/devise-1.0.7/test/rails_app/script/performance/benchmarker +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env ruby -require File.expand_path('../../../config/boot', __FILE__) -require 'commands/performance/benchmarker' diff --git a/vendor/gems/devise-1.0.7/test/rails_app/script/performance/profiler b/vendor/gems/devise-1.0.7/test/rails_app/script/performance/profiler deleted file mode 100755 index 07640575c..000000000 --- a/vendor/gems/devise-1.0.7/test/rails_app/script/performance/profiler +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env ruby -require File.expand_path('../../../config/boot', __FILE__) -require 'commands/performance/profiler' diff --git a/vendor/gems/devise-1.0.7/test/rails_app/script/plugin b/vendor/gems/devise-1.0.7/test/rails_app/script/plugin deleted file mode 100755 index b82201fa8..000000000 --- a/vendor/gems/devise-1.0.7/test/rails_app/script/plugin +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env ruby -require File.expand_path('../../config/boot', __FILE__) -require 'commands/plugin' diff --git a/vendor/gems/devise-1.0.7/test/rails_app/script/runner b/vendor/gems/devise-1.0.7/test/rails_app/script/runner deleted file mode 100755 index be4c5d457..000000000 --- a/vendor/gems/devise-1.0.7/test/rails_app/script/runner +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env ruby -require File.expand_path('../../config/boot', __FILE__) -require 'commands/runner' diff --git a/vendor/gems/devise-1.0.7/test/rails_app/script/server b/vendor/gems/devise-1.0.7/test/rails_app/script/server deleted file mode 100755 index b9fcb7179..000000000 --- a/vendor/gems/devise-1.0.7/test/rails_app/script/server +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env ruby -require File.expand_path('../../config/boot', __FILE__) -require 'commands/server' diff --git a/vendor/gems/devise-1.0.7/test/rails_app/vendor/plugins/devise b/vendor/gems/devise-1.0.7/test/rails_app/vendor/plugins/devise deleted file mode 120000 index 11a54ed36..000000000 --- a/vendor/gems/devise-1.0.7/test/rails_app/vendor/plugins/devise +++ /dev/null @@ -1 +0,0 @@ -../../../../ \ No newline at end of file diff --git a/vendor/gems/devise-1.0.7/test/routes_test.rb b/vendor/gems/devise-1.0.7/test/routes_test.rb deleted file mode 100644 index a7b12c9c6..000000000 --- a/vendor/gems/devise-1.0.7/test/routes_test.rb +++ /dev/null @@ -1,110 +0,0 @@ -require 'test/test_helper' - -class MapRoutingTest < ActionController::TestCase - - test 'map new user session' do - assert_recognizes({:controller => 'sessions', :action => 'new'}, {:path => 'users/sign_in', :method => :get}) - end - - test 'map create user session' do - assert_recognizes({:controller => 'sessions', :action => 'create'}, {:path => 'users/sign_in', :method => :post}) - end - - test 'map destroy user session' do - assert_recognizes({:controller => 'sessions', :action => 'destroy'}, {:path => 'users/sign_out', :method => :get}) - end - - test 'map new user confirmation' do - assert_recognizes({:controller => 'confirmations', :action => 'new'}, 'users/confirmation/new') - end - - test 'map create user confirmation' do - assert_recognizes({:controller => 'confirmations', :action => 'create'}, {:path => 'users/confirmation', :method => :post}) - end - - test 'map show user confirmation' do - assert_recognizes({:controller => 'confirmations', :action => 'show'}, {:path => 'users/confirmation', :method => :get}) - end - - test 'map new user password' do - assert_recognizes({:controller => 'passwords', :action => 'new'}, 'users/password/new') - end - - test 'map create user password' do - assert_recognizes({:controller => 'passwords', :action => 'create'}, {:path => 'users/password', :method => :post}) - end - - test 'map edit user password' do - assert_recognizes({:controller => 'passwords', :action => 'edit'}, 'users/password/edit') - end - - test 'map update user password' do - assert_recognizes({:controller => 'passwords', :action => 'update'}, {:path => 'users/password', :method => :put}) - end - - test 'map new user unlock' do - assert_recognizes({:controller => 'unlocks', :action => 'new'}, 'users/unlock/new') - end - - test 'map create user unlock' do - assert_recognizes({:controller => 'unlocks', :action => 'create'}, {:path => 'users/unlock', :method => :post}) - end - - test 'map show user unlock' do - assert_recognizes({:controller => 'unlocks', :action => 'show'}, {:path => 'users/unlock', :method => :get}) - end - - test 'map new user registration' do - assert_recognizes({:controller => 'registrations', :action => 'new'}, 'users/sign_up') - end - - test 'map create user registration' do - assert_recognizes({:controller => 'registrations', :action => 'create'}, {:path => 'users', :method => :post}) - end - - test 'map edit user registration' do - assert_recognizes({:controller => 'registrations', :action => 'edit'}, {:path => 'users/edit', :method => :get}) - end - - test 'map update user registration' do - assert_recognizes({:controller => 'registrations', :action => 'update'}, {:path => 'users', :method => :put}) - end - - test 'map destroy user registration' do - assert_recognizes({:controller => 'registrations', :action => 'destroy'}, {:path => 'users', :method => :delete}) - end - - test 'map admin session with :as option' do - assert_recognizes({:controller => 'sessions', :action => 'new'}, {:path => 'admin_area/sign_in', :method => :get}) - end - - test 'does not map admin confirmation' do - assert_raise ActionController::RoutingError do - assert_recognizes({:controller => 'confirmations', :action => 'new'}, 'admin_area/confirmation/new') - end - end - - test 'map account with custom path name for session sign in' do - assert_recognizes({:controller => 'sessions', :action => 'new', :locale => 'en', :extra => 'value'}, '/en/accounts/login') - end - - test 'map account with custom path name for session sign out' do - assert_recognizes({:controller => 'sessions', :action => 'destroy', :locale => 'en', :extra => 'value'}, '/en/accounts/logout') - end - - test 'map account with custom path name for password' do - assert_recognizes({:controller => 'passwords', :action => 'new', :locale => 'en', :extra => 'value'}, '/en/accounts/secret/new') - end - - test 'map account with custom path name for confirmation' do - assert_recognizes({:controller => 'confirmations', :action => 'new', :locale => 'en', :extra => 'value'}, '/en/accounts/verification/new') - end - - test 'map account with custom path name for unlock' do - assert_recognizes({:controller => 'unlocks', :action => 'new', :locale => 'en', :extra => 'value'}, '/en/accounts/unblock/new') - end - - test 'map account with custom path name for registration' do - assert_recognizes({:controller => 'registrations', :action => 'new', :locale => 'en', :extra => 'value'}, '/en/accounts/register') - end -end diff --git a/vendor/gems/devise-1.0.7/test/support/assertions_helper.rb b/vendor/gems/devise-1.0.7/test/support/assertions_helper.rb deleted file mode 100644 index 264f52bc5..000000000 --- a/vendor/gems/devise-1.0.7/test/support/assertions_helper.rb +++ /dev/null @@ -1,37 +0,0 @@ -class ActiveSupport::TestCase - def assert_not(assertion) - assert !assertion - end - - def assert_blank(assertion) - assert assertion.blank? - end - - def assert_not_blank(assertion) - assert !assertion.blank? - end - alias :assert_present :assert_not_blank - - def assert_email_sent(&block) - assert_difference('ActionMailer::Base.deliveries.size') { yield } - end - - def assert_email_not_sent(&block) - assert_no_difference('ActionMailer::Base.deliveries.size') { yield } - end - - # Execute the block setting the given values and restoring old values after - # the block is executed. - def swap(object, new_values) - old_values = {} - new_values.each do |key, value| - old_values[key] = object.send key - object.send :"#{key}=", value - end - yield - ensure - old_values.each do |key, value| - object.send :"#{key}=", value - end - end -end diff --git a/vendor/gems/devise-1.0.7/test/support/integration_tests_helper.rb b/vendor/gems/devise-1.0.7/test/support/integration_tests_helper.rb deleted file mode 100644 index e168400c5..000000000 --- a/vendor/gems/devise-1.0.7/test/support/integration_tests_helper.rb +++ /dev/null @@ -1,71 +0,0 @@ -class ActionController::IntegrationTest - - def warden - request.env['warden'] - end - - def create_user(options={}) - @user ||= begin - user = User.create!( - :username => 'usertest', - :email => 'user@test.com', - :password => '123456', - :password_confirmation => '123456', - :created_at => Time.now.utc - ) - user.confirm! unless options[:confirm] == false - user.lock_access! if options[:locked] == true - user - end - end - - def create_admin(options={}) - @admin ||= begin - admin = Admin.create!( - :email => 'admin@test.com', :password => '123456', :password_confirmation => '123456' - ) - admin - end - end - - def sign_in_as_user(options={}, &block) - user = create_user(options) - visit new_user_session_path unless options[:visit] == false - fill_in 'email', :with => 'user@test.com' - fill_in 'password', :with => options[:password] || '123456' - check 'remember me' if options[:remember_me] == true - yield if block_given? - click_button 'Sign In' - user - end - - def sign_in_as_admin(options={}, &block) - admin = create_admin(options) - visit new_admin_session_path unless options[:visit] == false - fill_in 'email', :with => 'admin@test.com' - fill_in 'password', :with => '123456' - yield if block_given? - click_button 'Sign In' - admin - end - - # Fix assert_redirect_to in integration sessions because they don't take into - # account Middleware redirects. - # - def assert_redirected_to(url) - assert [301, 302].include?(@integration_session.status), - "Expected status to be 301 or 302, got #{@integration_session.status}" - - url = prepend_host(url) - location = prepend_host(@integration_session.headers["Location"]) - assert_equal url, location - end - - protected - - def prepend_host(url) - url = "http://#{request.host}#{url}" if url[0] == ?/ - url - end - -end diff --git a/vendor/gems/devise-1.0.7/test/support/test_silencer.rb b/vendor/gems/devise-1.0.7/test/support/test_silencer.rb deleted file mode 100644 index 274a0aa9f..000000000 --- a/vendor/gems/devise-1.0.7/test/support/test_silencer.rb +++ /dev/null @@ -1,5 +0,0 @@ -module Devise - module TestSilencer - def test(*args, &block); end - end -end \ No newline at end of file diff --git a/vendor/gems/devise-1.0.7/test/support/tests_helper.rb b/vendor/gems/devise-1.0.7/test/support/tests_helper.rb deleted file mode 100644 index eb92b0910..000000000 --- a/vendor/gems/devise-1.0.7/test/support/tests_helper.rb +++ /dev/null @@ -1,39 +0,0 @@ -class ActiveSupport::TestCase - VALID_AUTHENTICATION_TOKEN = 'AbCdEfGhIjKlMnOpQrSt'.freeze - - def setup_mailer - ActionMailer::Base.deliveries = [] - end - - def store_translations(locale, translations, &block) - begin - I18n.backend.store_translations locale, translations - yield - ensure - I18n.reload! - end - end - - # Helpers for creating new users - # - def generate_unique_email - @@email_count ||= 0 - @@email_count += 1 - "test#{@@email_count}@email.com" - end - - def valid_attributes(attributes={}) - { :username => "usertest", - :email => generate_unique_email, - :password => '123456', - :password_confirmation => '123456' }.update(attributes) - end - - def new_user(attributes={}) - User.new(valid_attributes(attributes)) - end - - def create_user(attributes={}) - User.create!(valid_attributes(attributes)) - end -end \ No newline at end of file diff --git a/vendor/gems/devise-1.0.7/test/test_helper.rb b/vendor/gems/devise-1.0.7/test/test_helper.rb deleted file mode 100644 index d680e8196..000000000 --- a/vendor/gems/devise-1.0.7/test/test_helper.rb +++ /dev/null @@ -1,21 +0,0 @@ -require 'rubygems' - -ENV["RAILS_ENV"] = "test" -DEVISE_ORM = (ENV["DEVISE_ORM"] || :active_record).to_sym - -puts "\n==> Devise.orm = #{DEVISE_ORM.inspect}" -require File.join(File.dirname(__FILE__), 'orm', DEVISE_ORM.to_s) - -require 'webrat' -require 'mocha' - -Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f} - -ActionMailer::Base.delivery_method = :test -ActionMailer::Base.perform_deliveries = true -ActionMailer::Base.default_url_options[:host] = 'test.com' - -Webrat.configure do |config| - config.mode = :rails - config.open_error_files = false -end \ No newline at end of file diff --git a/vendor/gems/devise-1.0.7/test/test_helpers_test.rb b/vendor/gems/devise-1.0.7/test/test_helpers_test.rb deleted file mode 100644 index 8cd82da28..000000000 --- a/vendor/gems/devise-1.0.7/test/test_helpers_test.rb +++ /dev/null @@ -1,57 +0,0 @@ -require 'test/test_helper' - -class TestHelpersTest < ActionController::TestCase - tests UsersController - include Devise::TestHelpers - - test "redirects if attempting to access a page unauthenticated" do - get :show - assert_redirected_to "/users/sign_in?unauthenticated=true" - end - - test "redirects if attempting to access a page with a unconfirmed account" do - swap Devise, :confirm_within => 0 do - sign_in create_user - get :show - assert_redirected_to "/users/sign_in?unconfirmed=true" - end - end - - test "does not redirect with valid user" do - user = create_user - user.confirm! - - sign_in user - get :show - assert_response :success - end - - test "redirects if valid user signed out" do - user = create_user - user.confirm! - - sign_in user - get :show - - sign_out user - get :show - assert_redirected_to "/users/sign_in?unauthenticated=true" - end - - test "allows to sign in with different users" do - first_user = create_user - first_user.confirm! - - sign_in first_user - get :show - assert_equal first_user.id.to_s, @response.body - sign_out first_user - - second_user = create_user - second_user.confirm! - - sign_in second_user - get :show - assert_equal second_user.id.to_s, @response.body - end -end