From 1d28ac42b9746980100daa511ed766d670dcdc7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=83=D1=80=20=D0=A4=D0=B0=D0=B8=CC=86?= =?UTF-8?q?=D0=B7=D1=80=D0=B0=D1=85=D0=BC=D0=B0=D0=BD=D0=BE=D0=B2?= Date: Fri, 25 Jul 2014 21:48:42 +0600 Subject: [PATCH 01/51] Basic form i18n for Russian Language Some of translations maybe need to be discussed, because of some translations are not literal. --- yesod-form/Yesod/Form/I18n/Russian.hs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 yesod-form/Yesod/Form/I18n/Russian.hs diff --git a/yesod-form/Yesod/Form/I18n/Russian.hs b/yesod-form/Yesod/Form/I18n/Russian.hs new file mode 100644 index 00000000..8ccea99c --- /dev/null +++ b/yesod-form/Yesod/Form/I18n/Russian.hs @@ -0,0 +1,26 @@ +{-# LANGUAGE OverloadedStrings #-} +module Yesod.Form.I18n.English where + +import Yesod.Form.Types (FormMessage (..)) +import Data.Monoid (mappend) +import Data.Text (Text) + +englishFormMessage :: FormMessage -> Text +englishFormMessage (MsgInvalidInteger t) = "Неверно записано целое число: " `mappend` t +englishFormMessage (MsgInvalidNumber t) = "Неверный формат числа: " `mappend` t +englishFormMessage (MsgInvalidEntry t) = "Неверный выбор: " `mappend` t +englishFormMessage MsgInvalidTimeFormat = "Неверно указано время, используйте формат ЧЧ:ММ[:СС]" +englishFormMessage MsgInvalidDay = "Неверно указана дата, используйте формат ГГГГ-ММ-ДД" +englishFormMessage (MsgInvalidUrl t) = "Неверно указан URL адрес: " `mappend` t +englishFormMessage (MsgInvalidEmail t) = "Неверно указана электронная почта: " `mappend` t +englishFormMessage (MsgInvalidHour t) = "Неверно указан час: " `mappend` t +englishFormMessage (MsgInvalidMinute t) = "Неверно указаны минуты: " `mappend` t +englishFormMessage (MsgInvalidSecond t) = "Неверны указаны секунды: " `mappend` t +englishFormMessage MsgCsrfWarning = "Для защиты от межсайтовой подделки запросов (CSRF), пожалуйста, подтвердите отправку данных формы." +englishFormMessage MsgValueRequired = "Отсутствует требуемое значение." +englishFormMessage (MsgInputNotFound t) = "Поле не найдено: " `mappend` t +englishFormMessage MsgSelectNone = "<Не выбрано>" +englishFormMessage (MsgInvalidBool t) = "Неверное логическое значение: " `mappend` t +englishFormMessage MsgBoolYes = "Да" +englishFormMessage MsgBoolNo = "Нет" +englishFormMessage MsgDelete = "Удалить?" From 10524fdd82fa9b13b075d9530a11bf269e0e7f89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=83=D1=80=20=D0=A4=D0=B0=D0=B8=CC=86?= =?UTF-8?q?=D0=B7=D1=80=D0=B0=D1=85=D0=BC=D0=B0=D0=BD=D0=BE=D0=B2?= Date: Sat, 26 Jul 2014 07:19:50 +0600 Subject: [PATCH 02/51] Fixed typo in module name --- yesod-form/Yesod/Form/I18n/Russian.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yesod-form/Yesod/Form/I18n/Russian.hs b/yesod-form/Yesod/Form/I18n/Russian.hs index 8ccea99c..c0892f72 100644 --- a/yesod-form/Yesod/Form/I18n/Russian.hs +++ b/yesod-form/Yesod/Form/I18n/Russian.hs @@ -1,5 +1,5 @@ {-# LANGUAGE OverloadedStrings #-} -module Yesod.Form.I18n.English where +module Yesod.Form.I18n.Russian where import Yesod.Form.Types (FormMessage (..)) import Data.Monoid (mappend) From d6b24510ea7b3f674bc5bd943ed46363bf16b56b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=83=D1=80=20=D0=A4=D0=B0=D0=B8=CC=86?= =?UTF-8?q?=D0=B7=D1=80=D0=B0=D1=85=D0=BC=D0=B0=D0=BD=D0=BE=D0=B2?= Date: Sat, 26 Jul 2014 07:26:11 +0600 Subject: [PATCH 03/51] Fixed function name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sorry friends, I’m so inattentive! --- yesod-form/Yesod/Form/I18n/Russian.hs | 38 +++++++++++++-------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/yesod-form/Yesod/Form/I18n/Russian.hs b/yesod-form/Yesod/Form/I18n/Russian.hs index c0892f72..1d5ab317 100644 --- a/yesod-form/Yesod/Form/I18n/Russian.hs +++ b/yesod-form/Yesod/Form/I18n/Russian.hs @@ -5,22 +5,22 @@ import Yesod.Form.Types (FormMessage (..)) import Data.Monoid (mappend) import Data.Text (Text) -englishFormMessage :: FormMessage -> Text -englishFormMessage (MsgInvalidInteger t) = "Неверно записано целое число: " `mappend` t -englishFormMessage (MsgInvalidNumber t) = "Неверный формат числа: " `mappend` t -englishFormMessage (MsgInvalidEntry t) = "Неверный выбор: " `mappend` t -englishFormMessage MsgInvalidTimeFormat = "Неверно указано время, используйте формат ЧЧ:ММ[:СС]" -englishFormMessage MsgInvalidDay = "Неверно указана дата, используйте формат ГГГГ-ММ-ДД" -englishFormMessage (MsgInvalidUrl t) = "Неверно указан URL адрес: " `mappend` t -englishFormMessage (MsgInvalidEmail t) = "Неверно указана электронная почта: " `mappend` t -englishFormMessage (MsgInvalidHour t) = "Неверно указан час: " `mappend` t -englishFormMessage (MsgInvalidMinute t) = "Неверно указаны минуты: " `mappend` t -englishFormMessage (MsgInvalidSecond t) = "Неверны указаны секунды: " `mappend` t -englishFormMessage MsgCsrfWarning = "Для защиты от межсайтовой подделки запросов (CSRF), пожалуйста, подтвердите отправку данных формы." -englishFormMessage MsgValueRequired = "Отсутствует требуемое значение." -englishFormMessage (MsgInputNotFound t) = "Поле не найдено: " `mappend` t -englishFormMessage MsgSelectNone = "<Не выбрано>" -englishFormMessage (MsgInvalidBool t) = "Неверное логическое значение: " `mappend` t -englishFormMessage MsgBoolYes = "Да" -englishFormMessage MsgBoolNo = "Нет" -englishFormMessage MsgDelete = "Удалить?" +russianFormMessage :: FormMessage -> Text +russianFormMessage (MsgInvalidInteger t) = "Неверно записано целое число: " `mappend` t +russianFormMessage (MsgInvalidNumber t) = "Неверный формат числа: " `mappend` t +russianFormMessage (MsgInvalidEntry t) = "Неверный выбор: " `mappend` t +russianFormMessage MsgInvalidTimeFormat = "Неверно указано время, используйте формат ЧЧ:ММ[:СС]" +russianFormMessage MsgInvalidDay = "Неверно указана дата, используйте формат ГГГГ-ММ-ДД" +russianFormMessage (MsgInvalidUrl t) = "Неверно указан URL адрес: " `mappend` t +russianFormMessage (MsgInvalidEmail t) = "Неверно указана электронная почта: " `mappend` t +russianFormMessage (MsgInvalidHour t) = "Неверно указан час: " `mappend` t +russianFormMessage (MsgInvalidMinute t) = "Неверно указаны минуты: " `mappend` t +russianFormMessage (MsgInvalidSecond t) = "Неверны указаны секунды: " `mappend` t +russianFormMessage MsgCsrfWarning = "Для защиты от межсайтовой подделки запросов (CSRF), пожалуйста, подтвердите отправку данных формы." +russianFormMessage MsgValueRequired = "Отсутствует требуемое значение." +russianFormMessage (MsgInputNotFound t) = "Поле не найдено: " `mappend` t +russianFormMessage MsgSelectNone = "<Не выбрано>" +russianFormMessage (MsgInvalidBool t) = "Неверное логическое значение: " `mappend` t +russianFormMessage MsgBoolYes = "Да" +russianFormMessage MsgBoolNo = "Нет" +russianFormMessage MsgDelete = "Удалить?" From 09ecf9e211b239feedb94c8e1c694bd5ad64b6fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=83=D1=80=20=D0=A4=D0=B0=D0=B8=CC=86?= =?UTF-8?q?=D0=B7=D1=80=D0=B0=D1=85=D0=BC=D0=B0=D0=BD=D0=BE=D0=B2?= Date: Sat, 26 Jul 2014 07:36:58 +0600 Subject: [PATCH 04/51] Corrected `ValueRequired` translation --- yesod-form/Yesod/Form/I18n/Russian.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yesod-form/Yesod/Form/I18n/Russian.hs b/yesod-form/Yesod/Form/I18n/Russian.hs index 1d5ab317..d2171286 100644 --- a/yesod-form/Yesod/Form/I18n/Russian.hs +++ b/yesod-form/Yesod/Form/I18n/Russian.hs @@ -17,7 +17,7 @@ russianFormMessage (MsgInvalidHour t) = "Неверно указан час: " ` russianFormMessage (MsgInvalidMinute t) = "Неверно указаны минуты: " `mappend` t russianFormMessage (MsgInvalidSecond t) = "Неверны указаны секунды: " `mappend` t russianFormMessage MsgCsrfWarning = "Для защиты от межсайтовой подделки запросов (CSRF), пожалуйста, подтвердите отправку данных формы." -russianFormMessage MsgValueRequired = "Отсутствует требуемое значение." +russianFormMessage MsgValueRequired = "Обязательно к заполнению" russianFormMessage (MsgInputNotFound t) = "Поле не найдено: " `mappend` t russianFormMessage MsgSelectNone = "<Не выбрано>" russianFormMessage (MsgInvalidBool t) = "Неверное логическое значение: " `mappend` t From 6a09bc3406dffdca7c3cff463fa9dcd3c189f178 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sat, 26 Jul 2014 21:53:26 +0300 Subject: [PATCH 05/51] Version bumps --- yesod-auth/yesod-auth.cabal | 2 +- yesod-bin/yesod-bin.cabal | 2 +- yesod-core/yesod-core.cabal | 2 +- yesod-form/yesod-form.cabal | 2 +- yesod-newsfeed/yesod-newsfeed.cabal | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/yesod-auth/yesod-auth.cabal b/yesod-auth/yesod-auth.cabal index cc39b15c..f16b22d4 100644 --- a/yesod-auth/yesod-auth.cabal +++ b/yesod-auth/yesod-auth.cabal @@ -1,5 +1,5 @@ name: yesod-auth -version: 1.3.1.1 +version: 1.3.2 license: MIT license-file: LICENSE author: Michael Snoyman, Patrick Brisbin diff --git a/yesod-bin/yesod-bin.cabal b/yesod-bin/yesod-bin.cabal index 2a346157..ae53941a 100644 --- a/yesod-bin/yesod-bin.cabal +++ b/yesod-bin/yesod-bin.cabal @@ -1,5 +1,5 @@ name: yesod-bin -version: 1.2.11 +version: 1.2.12 license: MIT license-file: LICENSE author: Michael Snoyman diff --git a/yesod-core/yesod-core.cabal b/yesod-core/yesod-core.cabal index eac143da..16b89374 100644 --- a/yesod-core/yesod-core.cabal +++ b/yesod-core/yesod-core.cabal @@ -1,5 +1,5 @@ name: yesod-core -version: 1.2.17 +version: 1.2.18 license: MIT license-file: LICENSE author: Michael Snoyman diff --git a/yesod-form/yesod-form.cabal b/yesod-form/yesod-form.cabal index b7fff339..b11cdaf2 100644 --- a/yesod-form/yesod-form.cabal +++ b/yesod-form/yesod-form.cabal @@ -1,5 +1,5 @@ name: yesod-form -version: 1.3.11 +version: 1.3.12 license: MIT license-file: LICENSE author: Michael Snoyman diff --git a/yesod-newsfeed/yesod-newsfeed.cabal b/yesod-newsfeed/yesod-newsfeed.cabal index cfb9bd65..5d20b9ad 100644 --- a/yesod-newsfeed/yesod-newsfeed.cabal +++ b/yesod-newsfeed/yesod-newsfeed.cabal @@ -1,5 +1,5 @@ name: yesod-newsfeed -version: 1.2.0.2 +version: 1.2.1 license: MIT license-file: LICENSE author: Michael Snoyman, Patrick Brisbin From 99484ab894fe6f5feb623b5d937e0c8d71940e18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=83=D1=80=20=D0=A4=D0=B0=D0=B8=CC=86?= =?UTF-8?q?=D0=B7=D1=80=D0=B0=D1=85=D0=BC=D0=B0=D0=BD=D0=BE=D0=B2?= Date: Sun, 27 Jul 2014 01:08:39 +0600 Subject: [PATCH 06/51] Fixed cabal file Added Russian form translation as exposed module in .cabal --- yesod-form/yesod-form.cabal | 1 + 1 file changed, 1 insertion(+) diff --git a/yesod-form/yesod-form.cabal b/yesod-form/yesod-form.cabal index b7fff339..33ba20dc 100644 --- a/yesod-form/yesod-form.cabal +++ b/yesod-form/yesod-form.cabal @@ -57,6 +57,7 @@ library Yesod.Form.I18n.Norwegian Yesod.Form.I18n.Japanese Yesod.Form.I18n.Czech + Yesod.Form.I18n.Russian -- FIXME Yesod.Helpers.Crud ghc-options: -Wall From b33650551ea56b901e35877a8a70a590dc3561ac Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sat, 26 Jul 2014 22:16:37 +0300 Subject: [PATCH 07/51] Version bump --- yesod-form/yesod-form.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yesod-form/yesod-form.cabal b/yesod-form/yesod-form.cabal index 92a40f22..db225636 100644 --- a/yesod-form/yesod-form.cabal +++ b/yesod-form/yesod-form.cabal @@ -1,5 +1,5 @@ name: yesod-form -version: 1.3.12 +version: 1.3.13 license: MIT license-file: LICENSE author: Michael Snoyman From c06724402caed3cf20b26822f97a845e270cd705 Mon Sep 17 00:00:00 2001 From: Maximilian Tagher Date: Sat, 26 Jul 2014 12:48:56 -0700 Subject: [PATCH 08/51] Fix typo in yesod-test; analize -> analyze --- yesod-test/Yesod/Test.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yesod-test/Yesod/Test.hs b/yesod-test/Yesod/Test.hs index 1301797d..d71ebd74 100644 --- a/yesod-test/Yesod/Test.hs +++ b/yesod-test/Yesod/Test.hs @@ -187,7 +187,7 @@ data RequestPart -- | The RequestBuilder state monad constructs an url encoded string of arguments -- to send with your requests. Some of the functions that run on it use the current --- response to analize the forms that the server is expecting to receive. +-- response to analyze the forms that the server is expecting to receive. type RequestBuilder site = ST.StateT (RequestBuilderData site) IO -- | Start describing a Tests suite keeping cookies and a reference to the tested 'Application' From 23ffdbe4f87be0cbfe789295e1288330b452b4c3 Mon Sep 17 00:00:00 2001 From: Joel Taylor Date: Sun, 27 Jul 2014 11:17:03 -0700 Subject: [PATCH 09/51] strip src prefix --- yesod-bin/Build.hs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/yesod-bin/Build.hs b/yesod-bin/Build.hs index ec81bbae..50d76971 100644 --- a/yesod-bin/Build.hs +++ b/yesod-bin/Build.hs @@ -33,7 +33,8 @@ import qualified Data.Set as Set import qualified System.Posix.Types import System.Directory -import System.FilePath (takeExtension, replaceExtension, (), takeDirectory) +import System.FilePath (takeExtension, replaceExtension, (), takeDirectory, + splitPath, joinPath) import System.PosixCompat.Files (getFileStatus, setFileTimes, accessTime, modificationTime) @@ -112,7 +113,7 @@ removeHi :: FilePath -> FilePath -> IO () removeHi _ hs = mapM_ removeFile' hiFiles where removeFile' file = try' (removeFile file) >> return () - hiFiles = map (\e -> "dist/build" replaceExtension hs e) + hiFiles = map (\e -> "dist/build" removeSrc (replaceExtension hs e)) ["hi", "p_hi"] -- | change file mtime of .hs file to that of the dependency @@ -124,7 +125,12 @@ updateFileTime x hs = do return () hiFile :: FilePath -> FilePath -hiFile hs = "dist/build" replaceExtension hs "hi" +hiFile hs = "dist/build" removeSrc (replaceExtension hs "hi") + +removeSrc :: FilePath -> FilePath +removeSrc f = case splitPath f of + ("src/" : xs) -> joinPath xs + _ -> f try' :: IO x -> IO (Either SomeException x) try' = try From 30be70918fcf1067a591fde13c548da26c753372 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=83=D1=80=20=D0=A4=D0=B0=D0=B8=CC=86?= =?UTF-8?q?=D0=B7=D1=80=D0=B0=D1=85=D0=BC=D0=B0=D0=BD=D0=BE=D0=B2?= Date: Mon, 28 Jul 2014 23:13:31 +0600 Subject: [PATCH 10/51] added messages for Russian language `.cabal` unchanged, need version bump --- yesod-auth/Yesod/Auth/Message.hs | 45 ++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/yesod-auth/Yesod/Auth/Message.hs b/yesod-auth/Yesod/Auth/Message.hs index fb3d5f28..b7297f68 100644 --- a/yesod-auth/Yesod/Auth/Message.hs +++ b/yesod-auth/Yesod/Auth/Message.hs @@ -15,6 +15,7 @@ module Yesod.Auth.Message , chineseMessage , spanishMessage , czechMessage + , russianMessage ) where import Data.Monoid (mappend) @@ -533,3 +534,47 @@ czechMessage PasswordResetPrompt = "Zadejte svou e-mailovou adresu nebo uživate czechMessage InvalidUsernamePass = "Neplatná kombinace uživatelského jména a hesla" -- TODO czechMessage i@(IdentifierNotFound _) = englishMessage i + +-- Так как e-mail – это фактическое сокращение словосочетания electronic mail, +-- для русского перевода так же использовано сокращение: эл.почта +russianMessage :: AuthMessage -> Text +russianMessage NoOpenID = "Идентификатор OpenID не найден" +russianMessage LoginOpenID = "Вход с помощью OpenID" +russianMessage LoginGoogle = "Вход с помощью Google" +russianMessage LoginYahoo = "Вход с помощью Yahoo" +russianMessage Email = "Эл.почта" +russianMessage Password = "Пароль" +russianMessage Register = "Регистрация" +russianMessage RegisterLong = "Создать учётную запись" +russianMessage EnterEmail = "Введите свой адрес эл.почты ниже, вам будет отправлено письмо для подтверждения." +russianMessage ConfirmationEmailSentTitle = "Письмо для подтверждения отправлено" +russianMessage (ConfirmationEmailSent email) = + "Письмо для подтверждения было отправлено на адрес " `mappend` + email `mappend` + "." +russianMessage AddressVerified = "Адрес подтверждён. Пожалуйста, установите новый пароль." +russianMessage InvalidKeyTitle = "Неверный ключ подтверждения" +russianMessage InvalidKey = "Извините, но ключ подтверждения оказался недействительным." +russianMessage InvalidEmailPass = "Неверное сочетание эл.почты и пароля" +russianMessage BadSetPass = "Чтобы изменить пароль, необходимо выполнить вход" +russianMessage SetPassTitle = "Установить пароль" +russianMessage SetPass = "Установить новый пароль" +russianMessage NewPass = "Новый пароль" +russianMessage ConfirmPass = "Подтверждение" +russianMessage PassMismatch = "Пароли не совпадают, повторите снова" +russianMessage PassUpdated = "Пароль обновлён" +russianMessage Facebook = "Вход с помощью Facebook" +russianMessage LoginViaEmail = "Вход по адресу эл.почты" +russianMessage InvalidLogin = "Неверный логин" +russianMessage NowLoggedIn = "Вход выполнен" +russianMessage LoginTitle = "Вход" +russianMessage PleaseProvideUsername = "Пожалуйста, введите ваше имя пользователя" +russianMessage PleaseProvidePassword = "Пожалуйста, введите ваш пароль" +russianMessage NoIdentifierProvided = "Не указан адрес эл.почты/имя пользователя" +russianMessage InvalidEmailAddress = "Указан неверный адрес эл.почты" +russianMessage PasswordResetTitle = "Сброс пароля" +russianMessage ProvideIdentifier = "Имя пользователя или эл.почта" +russianMessage SendPasswordResetEmail = "Отправить письмо для сброса пароля" +russianMessage PasswordResetPrompt = "Введите адрес эл.почты или ваше имя пользователя ниже, вам будет отправлено письмо для сброса пароля." +russianMessage InvalidUsernamePass = "Неверное сочетание имени пользователя и пароля" +russianMessage (IdentifierNotFound ident) = "Логин не найден: " `mappend` ident From 8f2e84fa0aa72159a9dcd6f1ee73ae5405020314 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Mon, 28 Jul 2014 20:55:34 +0300 Subject: [PATCH 11/51] Version bump --- yesod-auth/yesod-auth.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yesod-auth/yesod-auth.cabal b/yesod-auth/yesod-auth.cabal index f16b22d4..0ee85392 100644 --- a/yesod-auth/yesod-auth.cabal +++ b/yesod-auth/yesod-auth.cabal @@ -1,5 +1,5 @@ name: yesod-auth -version: 1.3.2 +version: 1.3.3 license: MIT license-file: LICENSE author: Michael Snoyman, Patrick Brisbin From 05d31d66217734172c944b2b8a71f7cf0aa445c0 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Wed, 30 Jul 2014 11:33:38 +0300 Subject: [PATCH 12/51] Add MonadActive instances --- yesod-core/Yesod/Core/Types.hs | 10 ++++++++++ yesod-core/yesod-core.cabal | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/yesod-core/Yesod/Core/Types.hs b/yesod-core/Yesod/Core/Types.hs index 09d274f8..388dfe32 100644 --- a/yesod-core/Yesod/Core/Types.hs +++ b/yesod-core/Yesod/Core/Types.hs @@ -68,6 +68,9 @@ import Yesod.Routes.Class (RenderRoute (..), ParseRout import Control.Monad.Reader (MonadReader (..)) import Prelude hiding (catch) import Control.DeepSeq (NFData (rnf)) +#if MIN_VERSION_conduit(1, 1, 0) +import Data.Conduit.Lazy (MonadActive, monadActive) +#endif -- Sessions type SessionMap = Map Text ByteString @@ -458,6 +461,13 @@ instance MonadIO m => MonadLogger (WidgetT site m) where monadLoggerLog a b c d = WidgetT $ \hd -> liftIO $ fmap (, mempty) $ rheLog (handlerEnv hd) a b c (toLogStr d) +#if MIN_VERSION_conduit(1, 1, 0) +instance MonadActive m => MonadActive (WidgetT site m) where + monadActive = lift monadActive +instance MonadActive m => MonadActive (HandlerT site m) where + monadActive = lift monadActive +#endif + instance MonadTrans (HandlerT site) where lift = HandlerT . const diff --git a/yesod-core/yesod-core.cabal b/yesod-core/yesod-core.cabal index 16b89374..81c138ca 100644 --- a/yesod-core/yesod-core.cabal +++ b/yesod-core/yesod-core.cabal @@ -1,5 +1,5 @@ name: yesod-core -version: 1.2.18 +version: 1.2.19 license: MIT license-file: LICENSE author: Michael Snoyman From 7f5ed740a9c0dee35a21dc1918e435ec9cf0a1b9 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Wed, 30 Jul 2014 11:52:04 +0300 Subject: [PATCH 13/51] renderBootstrap2 --- yesod-form/Yesod/Form/Functions.hs | 11 +++++++++-- yesod-form/yesod-form.cabal | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/yesod-form/Yesod/Form/Functions.hs b/yesod-form/Yesod/Form/Functions.hs index bd3b5003..5fd03e6a 100644 --- a/yesod-form/Yesod/Form/Functions.hs +++ b/yesod-form/Yesod/Form/Functions.hs @@ -34,6 +34,7 @@ module Yesod.Form.Functions , renderDivs , renderDivsNoLabels , renderBootstrap + , renderBootstrap2 -- * Validation , check , checkBool @@ -426,8 +427,10 @@ $forall view <- views -- > ^{formWidget} -- >
-- > -renderBootstrap :: Monad m => FormRender m a -renderBootstrap aform fragment = do +-- +-- Since 1.3.14 +renderBootstrap2 :: Monad m => FormRender m a +renderBootstrap2 aform fragment = do (res, views') <- aFormToForm aform let views = views' [] has (Just _) = True @@ -446,6 +449,10 @@ renderBootstrap aform fragment = do #{err} |] return (res, widget) + +-- | Deprecated synonym for 'renderBootstrap2'. +renderBootstrap :: Monad m => FormRender m a +renderBootstrap = renderBootstrap2 {-# DEPRECATED renderBootstrap "Please use the Yesod.Form.Bootstrap3 module." #-} check :: (Monad m, RenderMessage (HandlerSite m) msg) diff --git a/yesod-form/yesod-form.cabal b/yesod-form/yesod-form.cabal index db225636..11b852fd 100644 --- a/yesod-form/yesod-form.cabal +++ b/yesod-form/yesod-form.cabal @@ -1,5 +1,5 @@ name: yesod-form -version: 1.3.13 +version: 1.3.14 license: MIT license-file: LICENSE author: Michael Snoyman From e6492ca507d43212bc6aa17448f6f3ed191f6410 Mon Sep 17 00:00:00 2001 From: Isamu Mogi Date: Fri, 1 Aug 2014 20:57:08 +0900 Subject: [PATCH 14/51] unix-compat and yaml bump to support Win64 --- yesod-platform/yesod-platform.cabal | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yesod-platform/yesod-platform.cabal b/yesod-platform/yesod-platform.cabal index c56597fd..039129eb 100644 --- a/yesod-platform/yesod-platform.cabal +++ b/yesod-platform/yesod-platform.cabal @@ -124,7 +124,7 @@ library , tls == 1.2.8 , transformers-base == 0.4.2 -- , transformers-compat == 0.3.3.4 - , unix-compat == 0.4.1.1 + , unix-compat == 0.4.1.3 , unordered-containers == 0.2.4.0 , utf8-string == 0.3.8 , vector == 0.10.11.0 @@ -144,7 +144,7 @@ library , xml-conduit == 1.2.0.2 , xml-types == 0.3.4 , xss-sanitize == 0.3.5.2 - , yaml == 0.8.8.3 + , yaml == 0.8.8.4 , yesod == 1.2.6 , yesod-auth == 1.3.1 , yesod-auth-hashdb == 1.3.0.1 From c0ebb1624e7d80aa8aa47ea2a6d9336191546121 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Fri, 1 Aug 2014 15:44:41 +0300 Subject: [PATCH 15/51] More haskell-platform workarounds --- yesod-platform/to-cabal.hs | 2 +- yesod-platform/yesod-platform.cabal | 14 +++++--------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/yesod-platform/to-cabal.hs b/yesod-platform/to-cabal.hs index b8ff2220..b4c2e300 100644 --- a/yesod-platform/to-cabal.hs +++ b/yesod-platform/to-cabal.hs @@ -3,7 +3,7 @@ import Control.Applicative ((<$>)) main = do pkgs <- map (intercalate " == ") - . filter (\xs -> not $ any (`isPrefixOf` xs) $ map return ["parsec", "text", "transformers", "mtl", "HUnit", "QuickCheck", "binary", "zlib", "stm", "regex-compat", "hashable", "vault", "integer-gmp"]) + . filter (\xs -> not $ any (`isPrefixOf` xs) $ map return ["parsec", "text", "transformers", "mtl", "HUnit", "QuickCheck", "binary", "zlib", "stm", "regex-compat", "hashable", "vault", "integer-gmp", "unordered-containers", "async", "aeson", "attoparsec", "scientific", "case-insensitive", "vector", "primitive"]) . map words . filter (not . null) . lines diff --git a/yesod-platform/yesod-platform.cabal b/yesod-platform/yesod-platform.cabal index 039129eb..6ae5d07d 100644 --- a/yesod-platform/yesod-platform.cabal +++ b/yesod-platform/yesod-platform.cabal @@ -1,5 +1,5 @@ name: yesod-platform -version: 1.2.12.2 +version: 1.2.12.3 license: MIT license-file: LICENSE author: Michael Snoyman @@ -15,14 +15,13 @@ homepage: http://www.yesodweb.com/ library build-depends: base >= 4 && < 5 , SHA == 1.6.4 - , aeson == 0.7.0.6 + -- , aeson == 0.7.0.6 , ansi-terminal == 0.6.1.1 , ansi-wl-pprint == 0.6.7.1 , asn1-encoding == 0.8.1.3 , asn1-parse == 0.8.1 , asn1-types == 0.2.3 - , async == 2.0.1.5 - , attoparsec == 0.12.0.0 + --, attoparsec == 0.12.0.0 , attoparsec-conduit == 1.1.0 , authenticate == 1.3.2.8 , base16-bytestring == 0.1.1.6 @@ -33,7 +32,7 @@ library , blaze-markup == 0.6.1.0 , byteable == 0.1.1 , byteorder == 1.0.4 - , case-insensitive == 1.2.0.0 + -- , case-insensitive == 1.2.0.0 , cereal == 0.4.0.1 , cipher-aes == 0.2.7 , cipher-des == 0.0.6 @@ -92,14 +91,13 @@ library , pem == 0.2.2 , persistent == 1.3.1.1 , persistent-template == 1.3.1.4 - , primitive == 0.5.3.0 , publicsuffixlist == 0.1 , pwstore-fast == 2.4.1 , quickcheck-io == 0.1.1 , resource-pool == 0.2.3.0 , resourcet == 1.1.2.2 , safe == 0.3.4 - , scientific == 0.3.2.1 + -- , scientific == 0.3.2.1 , securemem == 0.1.3 , semigroups == 0.15 , setenv == 0.1.1.1 @@ -125,9 +123,7 @@ library , transformers-base == 0.4.2 -- , transformers-compat == 0.3.3.4 , unix-compat == 0.4.1.3 - , unordered-containers == 0.2.4.0 , utf8-string == 0.3.8 - , vector == 0.10.11.0 , void == 0.6.1 , wai == 3.0.0 , wai-app-static == 3.0.0 From 970f81af151b9c64a0c005d24b0aed944fb9c54d Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 3 Aug 2014 12:35:20 +0300 Subject: [PATCH 16/51] Scaffolding updates Addresses kazu-yamamoto/logger#44 and #791 --- yesod-bin/hsfiles/mongo.hsfiles | 22 +++++----------------- yesod-bin/hsfiles/mysql.hsfiles | 22 +++++----------------- yesod-bin/hsfiles/postgres-fay.hsfiles | 22 +++++----------------- yesod-bin/hsfiles/postgres.hsfiles | 22 +++++----------------- yesod-bin/hsfiles/simple.hsfiles | 25 +++++-------------------- yesod-bin/hsfiles/sqlite.hsfiles | 22 +++++----------------- 6 files changed, 30 insertions(+), 105 deletions(-) diff --git a/yesod-bin/hsfiles/mongo.hsfiles b/yesod-bin/hsfiles/mongo.hsfiles index ed261fe2..f1a7f36f 100644 --- a/yesod-bin/hsfiles/mongo.hsfiles +++ b/yesod-bin/hsfiles/mongo.hsfiles @@ -45,8 +45,7 @@ import Network.Wai.Middleware.RequestLogger import qualified Network.Wai.Middleware.RequestLogger as RequestLogger import qualified Database.Persist import Network.HTTP.Client.Conduit (newManager) -import Control.Concurrent (forkIO, threadDelay) -import System.Log.FastLogger (newStdoutLoggerSet, defaultBufSize, flushLogStr) +import System.Log.FastLogger (newStdoutLoggerSet, defaultBufSize) import Network.Wai.Logger (clockDateCacher) import Data.Default (def) import Yesod.Core.Types (loggerSet, Logger (Logger)) @@ -94,18 +93,7 @@ makeFoundation conf = do p <- Database.Persist.createPoolConfig (dbconf :: Settings.PersistConf) loggerSet' <- newStdoutLoggerSet defaultBufSize - (getter, updater) <- clockDateCacher - - -- If the Yesod logger (as opposed to the request logger middleware) is - -- used less than once a second on average, you may prefer to omit this - -- thread and use "(updater >> getter)" in place of "getter" below. That - -- would update the cache every time it is used, instead of every second. - let updateLoop = do - threadDelay 1000000 - updater - flushLogStr loggerSet' - updateLoop - _ <- forkIO updateLoop + (getter, _) <- clockDateCacher let logger = Yesod.Core.Types.Logger loggerSet' getter foundation = App conf s p manager dbconf logger @@ -442,11 +430,11 @@ library , directory >= 1.1 && < 1.3 , warp >= 3.0 && < 3.1 , data-default - , aeson >= 0.6 && < 0.8 + , aeson >= 0.6 && < 0.9 , conduit >= 1.0 && < 2.0 , monad-logger >= 0.3 && < 0.4 - , fast-logger >= 2.1.4 && < 2.2 - , wai-logger >= 2.1 && < 2.2 + , fast-logger >= 2.2 && < 2.3 + , wai-logger >= 2.2 && < 2.3 executable PROJECTNAME if flag(library-only) diff --git a/yesod-bin/hsfiles/mysql.hsfiles b/yesod-bin/hsfiles/mysql.hsfiles index 9d6b7b9a..1ac4e7f7 100644 --- a/yesod-bin/hsfiles/mysql.hsfiles +++ b/yesod-bin/hsfiles/mysql.hsfiles @@ -47,8 +47,7 @@ import qualified Database.Persist import Database.Persist.Sql (runMigration) import Network.HTTP.Client.Conduit (newManager) import Control.Monad.Logger (runLoggingT) -import Control.Concurrent (forkIO, threadDelay) -import System.Log.FastLogger (newStdoutLoggerSet, defaultBufSize, flushLogStr) +import System.Log.FastLogger (newStdoutLoggerSet, defaultBufSize) import Network.Wai.Logger (clockDateCacher) import Data.Default (def) import Yesod.Core.Types (loggerSet, Logger (Logger)) @@ -96,18 +95,7 @@ makeFoundation conf = do p <- Database.Persist.createPoolConfig (dbconf :: Settings.PersistConf) loggerSet' <- newStdoutLoggerSet defaultBufSize - (getter, updater) <- clockDateCacher - - -- If the Yesod logger (as opposed to the request logger middleware) is - -- used less than once a second on average, you may prefer to omit this - -- thread and use "(updater >> getter)" in place of "getter" below. That - -- would update the cache every time it is used, instead of every second. - let updateLoop = do - threadDelay 1000000 - updater - flushLogStr loggerSet' - updateLoop - _ <- forkIO updateLoop + (getter, _) <- clockDateCacher let logger = Yesod.Core.Types.Logger loggerSet' getter foundation = App conf s p manager dbconf logger @@ -446,11 +434,11 @@ library , directory >= 1.1 && < 1.3 , warp >= 3.0 && < 3.1 , data-default - , aeson >= 0.6 && < 0.8 + , aeson >= 0.6 && < 0.9 , conduit >= 1.0 && < 2.0 , monad-logger >= 0.3 && < 0.4 - , fast-logger >= 2.1.4 && < 2.2 - , wai-logger >= 2.1 && < 2.2 + , fast-logger >= 2.2 && < 2.3 + , wai-logger >= 2.2 && < 2.3 executable PROJECTNAME if flag(library-only) diff --git a/yesod-bin/hsfiles/postgres-fay.hsfiles b/yesod-bin/hsfiles/postgres-fay.hsfiles index 64387842..e10831fa 100644 --- a/yesod-bin/hsfiles/postgres-fay.hsfiles +++ b/yesod-bin/hsfiles/postgres-fay.hsfiles @@ -49,8 +49,7 @@ import Database.Persist.Sql (runMigration) import Network.HTTP.Client.Conduit (newManager) import Yesod.Fay (getFaySite) import Control.Monad.Logger (runLoggingT) -import Control.Concurrent (forkIO, threadDelay) -import System.Log.FastLogger (newStdoutLoggerSet, defaultBufSize, flushLogStr) +import System.Log.FastLogger (newStdoutLoggerSet, defaultBufSize) import Network.Wai.Logger (clockDateCacher) import Data.Default (def) import Yesod.Core.Types (loggerSet, Logger (Logger)) @@ -99,18 +98,7 @@ makeFoundation conf = do p <- Database.Persist.createPoolConfig (dbconf :: Settings.PersistConf) loggerSet' <- newStdoutLoggerSet defaultBufSize - (getter, updater) <- clockDateCacher - - -- If the Yesod logger (as opposed to the request logger middleware) is - -- used less than once a second on average, you may prefer to omit this - -- thread and use "(updater >> getter)" in place of "getter" below. That - -- would update the cache every time it is used, instead of every second. - let updateLoop = do - threadDelay 1000000 - updater - flushLogStr loggerSet' - updateLoop - _ <- forkIO updateLoop + (getter, _) <- clockDateCacher let logger = Yesod.Core.Types.Logger loggerSet' getter foundation = App conf s p manager dbconf onCommand logger @@ -483,11 +471,11 @@ library , directory >= 1.1 && < 1.3 , warp >= 3.0 && < 3.1 , data-default - , aeson >= 0.6 && < 0.8 + , aeson >= 0.6 && < 0.9 , conduit >= 1.0 && < 2.0 , monad-logger >= 0.3 && < 0.4 - , fast-logger >= 2.1.4 && < 2.2 - , wai-logger >= 2.1 && < 2.2 + , fast-logger >= 2.2 && < 2.3 + , wai-logger >= 2.2 && < 2.3 executable PROJECTNAME if flag(library-only) diff --git a/yesod-bin/hsfiles/postgres.hsfiles b/yesod-bin/hsfiles/postgres.hsfiles index 5ea0d5fb..f3572bdd 100644 --- a/yesod-bin/hsfiles/postgres.hsfiles +++ b/yesod-bin/hsfiles/postgres.hsfiles @@ -47,8 +47,7 @@ import qualified Database.Persist import Database.Persist.Sql (runMigration) import Network.HTTP.Client.Conduit (newManager) import Control.Monad.Logger (runLoggingT) -import Control.Concurrent (forkIO, threadDelay) -import System.Log.FastLogger (newStdoutLoggerSet, defaultBufSize, flushLogStr) +import System.Log.FastLogger (newStdoutLoggerSet, defaultBufSize) import Network.Wai.Logger (clockDateCacher) import Data.Default (def) import Yesod.Core.Types (loggerSet, Logger (Logger)) @@ -96,18 +95,7 @@ makeFoundation conf = do p <- Database.Persist.createPoolConfig (dbconf :: Settings.PersistConf) loggerSet' <- newStdoutLoggerSet defaultBufSize - (getter, updater) <- clockDateCacher - - -- If the Yesod logger (as opposed to the request logger middleware) is - -- used less than once a second on average, you may prefer to omit this - -- thread and use "(updater >> getter)" in place of "getter" below. That - -- would update the cache every time it is used, instead of every second. - let updateLoop = do - threadDelay 1000000 - updater - flushLogStr loggerSet' - updateLoop - _ <- forkIO updateLoop + (getter, _) <- clockDateCacher let logger = Yesod.Core.Types.Logger loggerSet' getter foundation = App conf s p manager dbconf logger @@ -446,11 +434,11 @@ library , directory >= 1.1 && < 1.3 , warp >= 3.0 && < 3.1 , data-default - , aeson >= 0.6 && < 0.8 + , aeson >= 0.6 && < 0.9 , conduit >= 1.0 && < 2.0 , monad-logger >= 0.3 && < 0.4 - , fast-logger >= 2.1.4 && < 2.2 - , wai-logger >= 2.1 && < 2.2 + , fast-logger >= 2.2 && < 2.3 + , wai-logger >= 2.2 && < 2.3 executable PROJECTNAME if flag(library-only) diff --git a/yesod-bin/hsfiles/simple.hsfiles b/yesod-bin/hsfiles/simple.hsfiles index 11a3e6f6..1b4eac4f 100644 --- a/yesod-bin/hsfiles/simple.hsfiles +++ b/yesod-bin/hsfiles/simple.hsfiles @@ -42,8 +42,7 @@ import Network.Wai.Middleware.RequestLogger ) import qualified Network.Wai.Middleware.RequestLogger as RequestLogger import Network.HTTP.Client.Conduit (newManager) -import Control.Concurrent (forkIO, threadDelay) -import System.Log.FastLogger (newStdoutLoggerSet, defaultBufSize, flushLogStr) +import System.Log.FastLogger (newStdoutLoggerSet, defaultBufSize) import Network.Wai.Logger (clockDateCacher) import Data.Default (def) import Yesod.Core.Types (loggerSet, Logger (Logger)) @@ -87,18 +86,7 @@ makeFoundation conf = do s <- staticSite loggerSet' <- newStdoutLoggerSet defaultBufSize - (getter, updater) <- clockDateCacher - - -- If the Yesod logger (as opposed to the request logger middleware) is - -- used less than once a second on average, you may prefer to omit this - -- thread and use "(updater >> getter)" in place of "getter" below. That - -- would update the cache every time it is used, instead of every second. - let updateLoop = do - threadDelay 1000000 - updater - flushLogStr loggerSet' - updateLoop - _ <- forkIO updateLoop + (getter, _) <- clockDateCacher let logger = Yesod.Core.Types.Logger loggerSet' getter foundation = App conf s manager logger @@ -120,8 +108,6 @@ module Foundation where import Prelude import Yesod import Yesod.Static -import Yesod.Auth -import Yesod.Auth.BrowserId import Yesod.Default.Config import Yesod.Default.Util (addStaticContentExternal) import Network.HTTP.Client.Conduit (Manager, HasHttpManager (getHttpManager)) @@ -197,7 +183,6 @@ instance Yesod App where urlRenderOverride _ _ = Nothing -- Routes not requiring authenitcation. - isAuthorized (AuthR _) _ = return Authorized isAuthorized FaviconR _ = return Authorized isAuthorized RobotsR _ = return Authorized -- Default to Authorized for now. @@ -373,11 +358,11 @@ library , directory >= 1.1 && < 1.3 , warp >= 3.0 && < 3.1 , data-default - , aeson >= 0.6 && < 0.8 + , aeson >= 0.6 && < 0.9 , conduit >= 1.0 && < 2.0 , monad-logger >= 0.3 && < 0.4 - , fast-logger >= 2.1.4 && < 2.2 - , wai-logger >= 2.1 && < 2.2 + , fast-logger >= 2.2 && < 2.3 + , wai-logger >= 2.2 && < 2.3 executable PROJECTNAME if flag(library-only) diff --git a/yesod-bin/hsfiles/sqlite.hsfiles b/yesod-bin/hsfiles/sqlite.hsfiles index 30436df7..f46a5b89 100644 --- a/yesod-bin/hsfiles/sqlite.hsfiles +++ b/yesod-bin/hsfiles/sqlite.hsfiles @@ -47,8 +47,7 @@ import qualified Database.Persist import Database.Persist.Sql (runMigration) import Network.HTTP.Client.Conduit (newManager) import Control.Monad.Logger (runLoggingT) -import Control.Concurrent (forkIO, threadDelay) -import System.Log.FastLogger (newStdoutLoggerSet, defaultBufSize, flushLogStr) +import System.Log.FastLogger (newStdoutLoggerSet, defaultBufSize) import Network.Wai.Logger (clockDateCacher) import Data.Default (def) import Yesod.Core.Types (loggerSet, Logger (Logger)) @@ -96,18 +95,7 @@ makeFoundation conf = do p <- Database.Persist.createPoolConfig (dbconf :: Settings.PersistConf) loggerSet' <- newStdoutLoggerSet defaultBufSize - (getter, updater) <- clockDateCacher - - -- If the Yesod logger (as opposed to the request logger middleware) is - -- used less than once a second on average, you may prefer to omit this - -- thread and use "(updater >> getter)" in place of "getter" below. That - -- would update the cache every time it is used, instead of every second. - let updateLoop = do - threadDelay 1000000 - updater - flushLogStr loggerSet' - updateLoop - _ <- forkIO updateLoop + (getter, _) <- clockDateCacher let logger = Yesod.Core.Types.Logger loggerSet' getter foundation = App conf s p manager dbconf logger @@ -446,11 +434,11 @@ library , directory >= 1.1 && < 1.3 , warp >= 3.0 && < 3.1 , data-default - , aeson >= 0.6 && < 0.8 + , aeson >= 0.6 && < 0.9 , conduit >= 1.0 && < 2.0 , monad-logger >= 0.3 && < 0.4 - , fast-logger >= 2.1.4 && < 2.2 - , wai-logger >= 2.1 && < 2.2 + , fast-logger >= 2.2 && < 2.3 + , wai-logger >= 2.2 && < 2.3 executable PROJECTNAME if flag(library-only) From b3959dead3f993955c88e4952ee9b2d86c4939c5 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 3 Aug 2014 12:36:36 +0300 Subject: [PATCH 17/51] Version bumps --- yesod-bin/yesod-bin.cabal | 2 +- yesod-test/yesod-test.cabal | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/yesod-bin/yesod-bin.cabal b/yesod-bin/yesod-bin.cabal index ae53941a..529fca00 100644 --- a/yesod-bin/yesod-bin.cabal +++ b/yesod-bin/yesod-bin.cabal @@ -1,5 +1,5 @@ name: yesod-bin -version: 1.2.12 +version: 1.2.12.1 license: MIT license-file: LICENSE author: Michael Snoyman diff --git a/yesod-test/yesod-test.cabal b/yesod-test/yesod-test.cabal index db8d469c..0c236b3f 100644 --- a/yesod-test/yesod-test.cabal +++ b/yesod-test/yesod-test.cabal @@ -1,5 +1,5 @@ name: yesod-test -version: 1.2.3.1 +version: 1.2.3.2 license: MIT license-file: LICENSE author: Nubis From 13f0eb38951c392eecfbec439cefe3798aaccd65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=83=D1=80=20=D0=A4=D0=B0=D0=B8=CC=86?= =?UTF-8?q?=D0=B7=D1=80=D0=B0=D1=85=D0=BC=D0=B0=D0=BD=D0=BE=D0=B2?= Date: Sun, 3 Aug 2014 16:02:52 +0600 Subject: [PATCH 18/51] pre-baked Route Auth value Added forwardUrl alias for `PluginR "browserid" []` as in other plugins (e.g. GoogleEmail2 and OpenID). --- yesod-auth/Yesod/Auth/BrowserId.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/yesod-auth/Yesod/Auth/BrowserId.hs b/yesod-auth/Yesod/Auth/BrowserId.hs index 31c4d7fb..ebe7f66b 100644 --- a/yesod-auth/Yesod/Auth/BrowserId.hs +++ b/yesod-auth/Yesod/Auth/BrowserId.hs @@ -9,6 +9,7 @@ module Yesod.Auth.BrowserId , BrowserIdSettings , bisAudience , bisLazyLoad + , forwardUrl ) where import Yesod.Auth @@ -28,8 +29,10 @@ import Data.Default pid :: Text pid = "browserid" -complete :: Route Auth -complete = PluginR pid [] +forwardUrl :: AuthRoute +forwardUrl = PluginR pid [] + +complete = forwardUrl -- | A settings type for various configuration options relevant to BrowserID. -- From ed53d46adc2be44218ba11298c7b1fefa7f81719 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=83=D1=80=20=D0=A4=D0=B0=D0=B8=CC=86?= =?UTF-8?q?=D0=B7=D1=80=D0=B0=D1=85=D0=BC=D0=B0=D0=BD=D0=BE=D0=B2?= Date: Sun, 3 Aug 2014 16:07:16 +0600 Subject: [PATCH 19/51] Type signature fix --- yesod-auth/Yesod/Auth/BrowserId.hs | 1 + 1 file changed, 1 insertion(+) diff --git a/yesod-auth/Yesod/Auth/BrowserId.hs b/yesod-auth/Yesod/Auth/BrowserId.hs index ebe7f66b..74971bbf 100644 --- a/yesod-auth/Yesod/Auth/BrowserId.hs +++ b/yesod-auth/Yesod/Auth/BrowserId.hs @@ -32,6 +32,7 @@ pid = "browserid" forwardUrl :: AuthRoute forwardUrl = PluginR pid [] +complete :: AuthRoute complete = forwardUrl -- | A settings type for various configuration options relevant to BrowserID. From 0a619bf29ae1697eff45207b148a73f99fe18d6a Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 3 Aug 2014 16:23:16 +0300 Subject: [PATCH 20/51] Version bump --- yesod-auth/yesod-auth.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yesod-auth/yesod-auth.cabal b/yesod-auth/yesod-auth.cabal index 0ee85392..7edeba7b 100644 --- a/yesod-auth/yesod-auth.cabal +++ b/yesod-auth/yesod-auth.cabal @@ -1,5 +1,5 @@ name: yesod-auth -version: 1.3.3 +version: 1.3.4 license: MIT license-file: LICENSE author: Michael Snoyman, Patrick Brisbin From 9dba11c83c67375a6907551a95397298bacc1851 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 3 Aug 2014 19:43:40 +0300 Subject: [PATCH 21/51] Relax unix-compat --- yesod-platform/to-cabal.hs | 2 +- yesod-platform/yesod-platform.cabal | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/yesod-platform/to-cabal.hs b/yesod-platform/to-cabal.hs index b4c2e300..f99a3c95 100644 --- a/yesod-platform/to-cabal.hs +++ b/yesod-platform/to-cabal.hs @@ -3,7 +3,7 @@ import Control.Applicative ((<$>)) main = do pkgs <- map (intercalate " == ") - . filter (\xs -> not $ any (`isPrefixOf` xs) $ map return ["parsec", "text", "transformers", "mtl", "HUnit", "QuickCheck", "binary", "zlib", "stm", "regex-compat", "hashable", "vault", "integer-gmp", "unordered-containers", "async", "aeson", "attoparsec", "scientific", "case-insensitive", "vector", "primitive"]) + . filter (\xs -> not $ any (`isPrefixOf` xs) $ map return ["parsec", "text", "transformers", "mtl", "HUnit", "QuickCheck", "binary", "zlib", "stm", "regex-compat", "hashable", "vault", "integer-gmp", "unordered-containers", "async", "aeson", "attoparsec", "scientific", "case-insensitive", "vector", "primitive", "unix-compat"]) . map words . filter (not . null) . lines diff --git a/yesod-platform/yesod-platform.cabal b/yesod-platform/yesod-platform.cabal index 6ae5d07d..98d93681 100644 --- a/yesod-platform/yesod-platform.cabal +++ b/yesod-platform/yesod-platform.cabal @@ -1,5 +1,5 @@ name: yesod-platform -version: 1.2.12.3 +version: 1.2.12.4 license: MIT license-file: LICENSE author: Michael Snoyman @@ -122,7 +122,7 @@ library , tls == 1.2.8 , transformers-base == 0.4.2 -- , transformers-compat == 0.3.3.4 - , unix-compat == 0.4.1.3 + -- , unix-compat == 0.4.1.3 , utf8-string == 0.3.8 , void == 0.6.1 , wai == 3.0.0 From 1959ec7aae7a47b21e9825d217bb6523162bd57a Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Mon, 4 Aug 2014 12:29:35 +0300 Subject: [PATCH 22/51] jqueryAutocmpleteField' #793 --- yesod-form/Yesod/Form/Jquery.hs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/yesod-form/Yesod/Form/Jquery.hs b/yesod-form/Yesod/Form/Jquery.hs index 2c4ae250..362eb8a0 100644 --- a/yesod-form/Yesod/Form/Jquery.hs +++ b/yesod-form/Yesod/Form/Jquery.hs @@ -7,6 +7,7 @@ module Yesod.Form.Jquery ( YesodJquery (..) , jqueryDayField , jqueryAutocompleteField + , jqueryAutocompleteField' , googleHostedJqueryUiCss , JqueryDaySettings (..) , Default (..) @@ -98,7 +99,13 @@ $(function(){ jqueryAutocompleteField :: (RenderMessage site FormMessage, YesodJquery site) => Route site -> Field (HandlerT site IO) Text -jqueryAutocompleteField src = Field +jqueryAutocompleteField = jqueryAutocompleteField' 2 + +jqueryAutocompleteField' :: (RenderMessage site FormMessage, YesodJquery site) + => Int -- ^ autocomplete minimum length + -> Route site + -> Field (HandlerT site IO) Text +jqueryAutocompleteField' minLen src = Field { fieldParse = parseHelper $ Right , fieldView = \theId name attrs val isReq -> do toWidget [shamlet| @@ -109,7 +116,7 @@ $newline never addScript' urlJqueryUiJs addStylesheet' urlJqueryUiCss toWidget [julius| -$(function(){$("##{rawJS theId}").autocomplete({source:"@{src}",minLength:2})}); +$(function(){$("##{rawJS theId}").autocomplete({source:"@{src}",minLength:#{toJSON minLen}})}); |] , fieldEnctype = UrlEncoded } From 68b4f455dadd5f999abd49b73776323ac25d14f7 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Tue, 5 Aug 2014 22:56:38 +0300 Subject: [PATCH 23/51] Don't include transformers-compat --- yesod-platform/to-cabal.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yesod-platform/to-cabal.hs b/yesod-platform/to-cabal.hs index f99a3c95..d04886cb 100644 --- a/yesod-platform/to-cabal.hs +++ b/yesod-platform/to-cabal.hs @@ -3,7 +3,7 @@ import Control.Applicative ((<$>)) main = do pkgs <- map (intercalate " == ") - . filter (\xs -> not $ any (`isPrefixOf` xs) $ map return ["parsec", "text", "transformers", "mtl", "HUnit", "QuickCheck", "binary", "zlib", "stm", "regex-compat", "hashable", "vault", "integer-gmp", "unordered-containers", "async", "aeson", "attoparsec", "scientific", "case-insensitive", "vector", "primitive", "unix-compat"]) + . filter (\xs -> not $ any (`isPrefixOf` xs) $ map return ["parsec", "text", "transformers", "mtl", "HUnit", "QuickCheck", "binary", "zlib", "stm", "regex-compat", "hashable", "vault", "integer-gmp", "unordered-containers", "async", "aeson", "attoparsec", "scientific", "case-insensitive", "vector", "primitive", "unix-compat", "transformers-compat"]) . map words . filter (not . null) . lines From 6088f9049c1f4fd286bb50138e7bd04ef2e14a30 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Tue, 5 Aug 2014 22:56:54 +0300 Subject: [PATCH 24/51] platform update --- yesod-platform/yesod-platform.cabal | 91 ++++++++++++++--------------- 1 file changed, 43 insertions(+), 48 deletions(-) diff --git a/yesod-platform/yesod-platform.cabal b/yesod-platform/yesod-platform.cabal index 98d93681..6fec6ce8 100644 --- a/yesod-platform/yesod-platform.cabal +++ b/yesod-platform/yesod-platform.cabal @@ -1,5 +1,5 @@ name: yesod-platform -version: 1.2.12.4 +version: 1.2.13 license: MIT license-file: LICENSE author: Michael Snoyman @@ -14,16 +14,15 @@ homepage: http://www.yesodweb.com/ library build-depends: base >= 4 && < 5 - , SHA == 1.6.4 - -- , aeson == 0.7.0.6 + , SHA == 1.6.4.1 , ansi-terminal == 0.6.1.1 , ansi-wl-pprint == 0.6.7.1 , asn1-encoding == 0.8.1.3 , asn1-parse == 0.8.1 , asn1-types == 0.2.3 - --, attoparsec == 0.12.0.0 , attoparsec-conduit == 1.1.0 - , authenticate == 1.3.2.8 + , authenticate == 1.3.2.9 + , auto-update == 0.1.0.0 , base16-bytestring == 0.1.1.6 , base64-bytestring == 1.0.0.1 , blaze-builder == 0.3.3.2 @@ -32,16 +31,15 @@ library , blaze-markup == 0.6.1.0 , byteable == 0.1.1 , byteorder == 1.0.4 - -- , case-insensitive == 1.2.0.0 , cereal == 0.4.0.1 - , cipher-aes == 0.2.7 + , cipher-aes == 0.2.8 , cipher-des == 0.0.6 , cipher-rc4 == 0.1.4 , clientsession == 0.9.0.3 - , conduit == 1.1.6 - , conduit-extra == 1.1.0.4 - , connection == 0.2.1 - , cookie == 0.4.1.1 + , conduit == 1.1.7 + , conduit-extra == 1.1.3 + , connection == 0.2.3 + , cookie == 0.4.1.2 , cprng-aes == 0.5.2 , crypto-api == 0.13 , crypto-cipher-types == 0.0.9 @@ -49,7 +47,7 @@ library , crypto-pubkey == 0.2.4 , crypto-pubkey-types == 0.4.2.2 , crypto-random == 0.0.7 - , cryptohash == 0.11.5 + , cryptohash == 0.11.6 , cryptohash-conduit == 0.1.1 , css-text == 0.1.2.1 , data-default == 0.5.3 @@ -58,36 +56,36 @@ library , data-default-instances-containers == 0.0.1 , data-default-instances-dlist == 0.0.1 , data-default-instances-old-locale == 0.0.1 - , dlist == 0.7.0.1 + , dlist == 0.7.1 , email-validate == 2.0.1 , entropy == 0.3.2 - , esqueleto == 1.4.1.2 + , esqueleto == 1.4.4 , exceptions == 0.6.1 - , fast-logger == 2.1.5 + , fast-logger == 2.2.0 , file-embed == 0.0.7 , hamlet == 1.2.0 - , hjsmin == 0.1.4.6 - , hspec == 1.9.5 - , hspec-expectations == 0.5.0.1 + , hjsmin == 0.1.4.7 + , hspec == 1.11.0 + , hspec-expectations == 0.6.0.1 , html-conduit == 1.1.0.5 - , http-client == 0.3.3 - , http-client-tls == 0.2.1.1 - , http-conduit == 2.1.2 + , http-client == 0.3.6.1 + , http-client-tls == 0.2.2 + , http-conduit == 2.1.4 , http-date == 0.0.4 - , http-reverse-proxy == 0.3.1.8 + , http-reverse-proxy == 0.4.0.1 , http-types == 0.8.5 , language-javascript == 0.5.13 - , lifted-base == 0.2.2.2 + , lifted-base == 0.2.3.0 , mime-mail == 0.4.5.2 , mime-types == 0.1.0.4 , mmorph == 1.0.3 , monad-control == 0.3.3.0 - , monad-logger == 0.3.6.1 - , monad-loops == 0.4.2 + , monad-logger == 0.3.7.1 + , monad-loops == 0.4.2.1 , nats == 0.2 , network-conduit == 1.1.0 - , optparse-applicative == 0.8.1 - , path-pieces == 0.1.3.1 + , optparse-applicative == 0.9.1.1 + , path-pieces == 0.1.4 , pem == 0.2.2 , persistent == 1.3.1.1 , persistent-template == 1.3.1.4 @@ -95,23 +93,22 @@ library , pwstore-fast == 2.4.1 , quickcheck-io == 0.1.1 , resource-pool == 0.2.3.0 - , resourcet == 1.1.2.2 - , safe == 0.3.4 - -- , scientific == 0.3.2.1 + , resourcet == 1.1.2.3 + , safe == 0.3.7 , securemem == 0.1.3 - , semigroups == 0.15 + , semigroups == 0.15.2 , setenv == 0.1.1.1 - , shakespeare == 2.0.0.3 + , shakespeare == 2.0.1.1 , shakespeare-css == 1.1.0 , shakespeare-i18n == 1.1.0 , shakespeare-js == 1.3.0 , shakespeare-text == 1.1.0 , silently == 1.2.4.1 - , simple-sendfile == 0.2.14 + , simple-sendfile == 0.2.15 , skein == 1.0.9 , socks == 0.5.4 , stm-chans == 3.0.0.2 - , streaming-commons == 0.1.3 + , streaming-commons == 0.1.4.1 , stringsearch == 0.3.6.5 , system-fileio == 0.3.14 , system-filepath == 0.4.12 @@ -121,35 +118,33 @@ library , tf-random == 0.5 , tls == 1.2.8 , transformers-base == 0.4.2 - -- , transformers-compat == 0.3.3.4 - -- , unix-compat == 0.4.1.3 , utf8-string == 0.3.8 , void == 0.6.1 - , wai == 3.0.0 + , wai == 3.0.1.1 , wai-app-static == 3.0.0 - , wai-extra == 3.0.0 - , wai-logger == 2.1.1 + , wai-extra == 3.0.1.2 + , wai-logger == 2.2.0 , wai-test == 3.0.0 - , warp == 3.0.0.2 + , warp == 3.0.0.5 , warp-tls == 3.0.0 - , word8 == 0.0.4 + , word8 == 0.1.1 , x509 == 1.4.11 , x509-store == 1.4.4 , x509-system == 1.4.5 , x509-validation == 1.5.0 - , xml-conduit == 1.2.0.2 + , xml-conduit == 1.2.1 , xml-types == 0.3.4 , xss-sanitize == 0.3.5.2 , yaml == 0.8.8.4 - , yesod == 1.2.6 - , yesod-auth == 1.3.1 + , yesod == 1.2.6.1 + , yesod-auth == 1.3.4 , yesod-auth-hashdb == 1.3.0.1 - , yesod-core == 1.2.16 - , yesod-form == 1.3.10 + , yesod-core == 1.2.19 + , yesod-form == 1.3.14 , yesod-persistent == 1.2.3 - , yesod-routes == 1.2.0.6 + , yesod-routes == 1.2.0.7 , yesod-static == 1.2.4 - , yesod-test == 1.2.3 + , yesod-test == 1.2.3.2 exposed-modules: Yesod.Platform From 8cc1accc1156483ed4cc345bc6d205bb48daf5db Mon Sep 17 00:00:00 2001 From: John Lenz Date: Tue, 5 Aug 2014 22:46:55 -0500 Subject: [PATCH 25/51] Include google person information in the credsExtra field for GoogleEmail2 auth --- yesod-auth/Yesod/Auth/GoogleEmail2.hs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/yesod-auth/Yesod/Auth/GoogleEmail2.hs b/yesod-auth/Yesod/Auth/GoogleEmail2.hs index bfe3d897..d836c73a 100644 --- a/yesod-auth/Yesod/Auth/GoogleEmail2.hs +++ b/yesod-auth/Yesod/Auth/GoogleEmail2.hs @@ -30,11 +30,14 @@ import Blaze.ByteString.Builder (fromByteString, toByteString) import Control.Applicative ((<$>), (<*>)) import Control.Arrow (second) import Control.Monad (liftM, unless) +import qualified Data.Aeson as A import Data.Aeson.Parser (json') import Data.Aeson.Types (FromJSON (parseJSON), parseEither, withObject) +import qualified Data.ByteString.Lazy as BL import Data.Conduit (($$+-)) import Data.Conduit.Attoparsec (sinkParser) +import qualified Data.HashMap.Strict as M import Data.Monoid (mappend) import Data.Text (Text) import qualified Data.Text as T @@ -175,7 +178,7 @@ authGoogleEmail clientID clientSecret = [e] -> return e [] -> error "No account email" x -> error $ "Too many account emails: " ++ show x - lift $ setCredsRedirect $ Creds pid email [] + lift $ setCredsRedirect $ Creds pid email $ allPersonInfo value2 dispatch _ _ = notFound @@ -200,3 +203,9 @@ instance FromJSON Email where parseJSON = withObject "Email" $ \o -> Email <$> o .: "value" <*> o .: "type" + +allPersonInfo :: A.Value -> [(Text, Text)] +allPersonInfo (A.Object o) = map enc $ M.toList o + where enc (key, A.String s) = (key, s) + enc (key, v) = (key, decodeUtf8 $ BL.toStrict $ A.encode v) +allPersonInfo _ = error "Google did not return a person object" From cfb96fd316e3b983bbb235891b991226832eb4b1 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Wed, 6 Aug 2014 13:47:34 +0300 Subject: [PATCH 26/51] add-handler: check if file exists #798 --- yesod-bin/AddHandler.hs | 11 +++++++++-- yesod-bin/yesod-bin.cabal | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/yesod-bin/AddHandler.hs b/yesod-bin/AddHandler.hs index 27fb40b5..ca3a6ce3 100644 --- a/yesod-bin/AddHandler.hs +++ b/yesod-bin/AddHandler.hs @@ -6,7 +6,8 @@ import Data.Char (isLower, toLower, isSpace) import Data.List (isPrefixOf, isSuffixOf) import qualified Data.Text as T import qualified Data.Text.IO as TIO -import System.Directory (getDirectoryContents) +import System.Directory (getDirectoryContents, doesFileExist) +import Control.Monad (when) -- strict readFile readFile :: FilePath -> IO String @@ -29,6 +30,12 @@ addHandler = do c:_ | isLower c -> error "Name must start with an upper case letter" | otherwise -> return () + + -- Check that the handler file doesn't already exist + let handlerFile = concat ["Handler/", name, ".hs"] + exists <- doesFileExist handlerFile + when exists $ error $ "File already exists: " ++ show handlerFile + putStr "Enter route pattern (ex: /entry/#EntryId): " hFlush stdout pattern <- getLine @@ -41,7 +48,7 @@ addHandler = do modify "Application.hs" $ fixApp name modify cabal $ fixCabal name modify "config/routes" $ fixRoutes name pattern methods - writeFile ("Handler/" ++ name ++ ".hs") $ mkHandler name pattern methods + writeFile handlerFile $ mkHandler name pattern methods fixApp :: String -> String -> String fixApp name = diff --git a/yesod-bin/yesod-bin.cabal b/yesod-bin/yesod-bin.cabal index 529fca00..73305cff 100644 --- a/yesod-bin/yesod-bin.cabal +++ b/yesod-bin/yesod-bin.cabal @@ -1,5 +1,5 @@ name: yesod-bin -version: 1.2.12.1 +version: 1.2.12.2 license: MIT license-file: LICENSE author: Michael Snoyman From 9726f9c59f793982804444ab245866fd7f7ed8f3 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Wed, 6 Aug 2014 14:03:53 +0300 Subject: [PATCH 27/51] Version bump --- yesod-form/yesod-form.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yesod-form/yesod-form.cabal b/yesod-form/yesod-form.cabal index 11b852fd..26ac87fe 100644 --- a/yesod-form/yesod-form.cabal +++ b/yesod-form/yesod-form.cabal @@ -1,5 +1,5 @@ name: yesod-form -version: 1.3.14 +version: 1.3.15 license: MIT license-file: LICENSE author: Michael Snoyman From 1d3b60abefb9833e9f3d3a382ae3404313638652 Mon Sep 17 00:00:00 2001 From: Paul Rouse Date: Wed, 6 Aug 2014 20:27:24 +0100 Subject: [PATCH 28/51] Mitigate yesod devel load (#767) by increasing a timeout --- yesod-bin/Devel.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yesod-bin/Devel.hs b/yesod-bin/Devel.hs index 77f34286..67ec07ad 100644 --- a/yesod-bin/Devel.hs +++ b/yesod-bin/Devel.hs @@ -388,7 +388,7 @@ watchForChanges filesModified hsSourceDirs extraFiles list t = do Map.differenceWith compareTimes newList list `Map.union` Map.differenceWith compareTimes list newList return (haskellFileChanged, newList) - else timeout (1000000*t) (takeMVar filesModified) >> + else timeout (10000000*t) (takeMVar filesModified) >> watchForChanges filesModified hsSourceDirs extraFiles list t where compareTimes x y From c1ba0dc2fad3b15b99698ba3da6f7887978422b0 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Thu, 7 Aug 2014 08:23:46 +0300 Subject: [PATCH 29/51] Version bump --- yesod-bin/yesod-bin.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yesod-bin/yesod-bin.cabal b/yesod-bin/yesod-bin.cabal index 73305cff..47772ffc 100644 --- a/yesod-bin/yesod-bin.cabal +++ b/yesod-bin/yesod-bin.cabal @@ -1,5 +1,5 @@ name: yesod-bin -version: 1.2.12.2 +version: 1.2.12.3 license: MIT license-file: LICENSE author: Michael Snoyman From a9f526bb39f12fe8c8f3209d0e2b317d830ec496 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Fri, 8 Aug 2014 11:28:33 +0300 Subject: [PATCH 30/51] Scaffolding changes for Ctrl-C --- yesod-bin/hsfiles/mongo.hsfiles | 9 +++++++++ yesod-bin/hsfiles/mysql.hsfiles | 9 +++++++++ yesod-bin/hsfiles/postgres-fay.hsfiles | 9 +++++++++ yesod-bin/hsfiles/postgres.hsfiles | 9 +++++++++ yesod-bin/hsfiles/simple.hsfiles | 9 +++++++++ yesod-bin/hsfiles/sqlite.hsfiles | 9 +++++++++ 6 files changed, 54 insertions(+) diff --git a/yesod-bin/hsfiles/mongo.hsfiles b/yesod-bin/hsfiles/mongo.hsfiles index f1a7f36f..654ed6f2 100644 --- a/yesod-bin/hsfiles/mongo.hsfiles +++ b/yesod-bin/hsfiles/mongo.hsfiles @@ -878,6 +878,7 @@ Production: web: ./dist/build/PROJECTNAME/PROJECTNAME production -p $PORT {-# START_FILE devel.hs #-} +{-# LANGUAGE CPP #-} {-# LANGUAGE PackageImports #-} import "PROJECTNAME" Application (getApplicationDev) import Network.Wai.Handler.Warp @@ -887,8 +888,16 @@ import System.Directory (doesFileExist, removeFile) import System.Exit (exitSuccess) import Control.Concurrent (threadDelay) +#ifndef mingw32_HOST_OS +import System.Posix.Signals (installHandler, sigINT, Handler(Catch)) +#endif + main :: IO () main = do +#ifndef mingw32_HOST_OS + _ <- installHandler sigINT (Catch $ return ()) Nothing +#endif + putStrLn "Starting devel application" (port, app) <- getApplicationDev forkIO $ runSettings (setPort port defaultSettings) app diff --git a/yesod-bin/hsfiles/mysql.hsfiles b/yesod-bin/hsfiles/mysql.hsfiles index 1ac4e7f7..3929b2d2 100644 --- a/yesod-bin/hsfiles/mysql.hsfiles +++ b/yesod-bin/hsfiles/mysql.hsfiles @@ -908,6 +908,7 @@ Production: web: ./dist/build/PROJECTNAME/PROJECTNAME production -p $PORT {-# START_FILE devel.hs #-} +{-# LANGUAGE CPP #-} {-# LANGUAGE PackageImports #-} import "PROJECTNAME" Application (getApplicationDev) import Network.Wai.Handler.Warp @@ -917,8 +918,16 @@ import System.Directory (doesFileExist, removeFile) import System.Exit (exitSuccess) import Control.Concurrent (threadDelay) +#ifndef mingw32_HOST_OS +import System.Posix.Signals (installHandler, sigINT, Handler(Catch)) +#endif + main :: IO () main = do +#ifndef mingw32_HOST_OS + _ <- installHandler sigINT (Catch $ return ()) Nothing +#endif + putStrLn "Starting devel application" (port, app) <- getApplicationDev forkIO $ runSettings (setPort port defaultSettings) app diff --git a/yesod-bin/hsfiles/postgres-fay.hsfiles b/yesod-bin/hsfiles/postgres-fay.hsfiles index e10831fa..8db29eda 100644 --- a/yesod-bin/hsfiles/postgres-fay.hsfiles +++ b/yesod-bin/hsfiles/postgres-fay.hsfiles @@ -932,6 +932,7 @@ Production: web: ./dist/build/PROJECTNAME/PROJECTNAME production -p $PORT {-# START_FILE devel.hs #-} +{-# LANGUAGE CPP #-} {-# LANGUAGE PackageImports #-} import "PROJECTNAME" Application (getApplicationDev) import Network.Wai.Handler.Warp @@ -941,8 +942,16 @@ import System.Directory (doesFileExist, removeFile) import System.Exit (exitSuccess) import Control.Concurrent (threadDelay) +#ifndef mingw32_HOST_OS +import System.Posix.Signals (installHandler, sigINT, Handler(Catch)) +#endif + main :: IO () main = do +#ifndef mingw32_HOST_OS + _ <- installHandler sigINT (Catch $ return ()) Nothing +#endif + putStrLn "Starting devel application" (port, app) <- getApplicationDev forkIO $ runSettings (setPort port defaultSettings) app diff --git a/yesod-bin/hsfiles/postgres.hsfiles b/yesod-bin/hsfiles/postgres.hsfiles index f3572bdd..788bb6f3 100644 --- a/yesod-bin/hsfiles/postgres.hsfiles +++ b/yesod-bin/hsfiles/postgres.hsfiles @@ -882,6 +882,7 @@ Production: web: ./dist/build/PROJECTNAME/PROJECTNAME production -p $PORT {-# START_FILE devel.hs #-} +{-# LANGUAGE CPP #-} {-# LANGUAGE PackageImports #-} import "PROJECTNAME" Application (getApplicationDev) import Network.Wai.Handler.Warp @@ -891,8 +892,16 @@ import System.Directory (doesFileExist, removeFile) import System.Exit (exitSuccess) import Control.Concurrent (threadDelay) +#ifndef mingw32_HOST_OS +import System.Posix.Signals (installHandler, sigINT, Handler(Catch)) +#endif + main :: IO () main = do +#ifndef mingw32_HOST_OS + _ <- installHandler sigINT (Catch $ return ()) Nothing +#endif + putStrLn "Starting devel application" (port, app) <- getApplicationDev forkIO $ runSettings (setPort port defaultSettings) app diff --git a/yesod-bin/hsfiles/simple.hsfiles b/yesod-bin/hsfiles/simple.hsfiles index 1b4eac4f..1fdd7d3b 100644 --- a/yesod-bin/hsfiles/simple.hsfiles +++ b/yesod-bin/hsfiles/simple.hsfiles @@ -756,6 +756,7 @@ Production: web: ./dist/build/PROJECTNAME/PROJECTNAME production -p $PORT {-# START_FILE devel.hs #-} +{-# LANGUAGE CPP #-} {-# LANGUAGE PackageImports #-} import "PROJECTNAME" Application (getApplicationDev) import Network.Wai.Handler.Warp @@ -765,8 +766,16 @@ import System.Directory (doesFileExist, removeFile) import System.Exit (exitSuccess) import Control.Concurrent (threadDelay) +#ifndef mingw32_HOST_OS +import System.Posix.Signals (installHandler, sigINT, Handler(Catch)) +#endif + main :: IO () main = do +#ifndef mingw32_HOST_OS + _ <- installHandler sigINT (Catch $ return ()) Nothing +#endif + putStrLn "Starting devel application" (port, app) <- getApplicationDev forkIO $ runSettings (setPort port defaultSettings) app diff --git a/yesod-bin/hsfiles/sqlite.hsfiles b/yesod-bin/hsfiles/sqlite.hsfiles index f46a5b89..c667b909 100644 --- a/yesod-bin/hsfiles/sqlite.hsfiles +++ b/yesod-bin/hsfiles/sqlite.hsfiles @@ -878,6 +878,7 @@ Production: web: ./dist/build/PROJECTNAME/PROJECTNAME production -p $PORT {-# START_FILE devel.hs #-} +{-# LANGUAGE CPP #-} {-# LANGUAGE PackageImports #-} import "PROJECTNAME" Application (getApplicationDev) import Network.Wai.Handler.Warp @@ -887,8 +888,16 @@ import System.Directory (doesFileExist, removeFile) import System.Exit (exitSuccess) import Control.Concurrent (threadDelay) +#ifndef mingw32_HOST_OS +import System.Posix.Signals (installHandler, sigINT, Handler(Catch)) +#endif + main :: IO () main = do +#ifndef mingw32_HOST_OS + _ <- installHandler sigINT (Catch $ return ()) Nothing +#endif + putStrLn "Starting devel application" (port, app) <- getApplicationDev forkIO $ runSettings (setPort port defaultSettings) app From 20dfec4d88f728429dc2a3e5bdaebf01c3433f40 Mon Sep 17 00:00:00 2001 From: Paul Rouse Date: Fri, 8 Aug 2014 11:10:07 +0100 Subject: [PATCH 31/51] Revise previous fix (#799) to yesod devel timeout --- yesod-bin/Devel.hs | 2 +- yesod-bin/main.hs | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/yesod-bin/Devel.hs b/yesod-bin/Devel.hs index 67ec07ad..77f34286 100644 --- a/yesod-bin/Devel.hs +++ b/yesod-bin/Devel.hs @@ -388,7 +388,7 @@ watchForChanges filesModified hsSourceDirs extraFiles list t = do Map.differenceWith compareTimes newList list `Map.union` Map.differenceWith compareTimes list newList return (haskellFileChanged, newList) - else timeout (10000000*t) (takeMVar filesModified) >> + else timeout (1000000*t) (takeMVar filesModified) >> watchForChanges filesModified hsSourceDirs extraFiles list t where compareTimes x y diff --git a/yesod-bin/main.hs b/yesod-bin/main.hs index 2202fb54..ef1882d0 100755 --- a/yesod-bin/main.hs +++ b/yesod-bin/main.hs @@ -152,6 +152,9 @@ optParser = Options keterOptions :: Parser Command keterOptions = Keter <$> switch ( long "nobuild" <> short 'n' <> help "Skip rebuilding" ) +defaultRescan :: Int +defaultRescan = 10 + develOptions :: Parser Command develOptions = Devel <$> switch ( long "disable-api" <> short 'd' <> help "Disable fast GHC API rebuilding") @@ -159,8 +162,10 @@ develOptions = Devel <$> switch ( long "disable-api" <> short 'd' <> help "Run COMMAND after rebuild succeeds") <*> optStr ( long "failure-hook" <> short 'f' <> metavar "COMMAND" <> help "Run COMMAND when rebuild fails") - <*> option ( long "event-timeout" <> short 't' <> value 1 <> metavar "N" - <> help "Force rescan of files every N seconds" ) + <*> option ( long "event-timeout" <> short 't' <> value defaultRescan <> metavar "N" + <> help ("Force rescan of files every N seconds (default " + ++ show defaultRescan + ++ ", use -1 to rely on FSNotify alone)") ) <*> optStr ( long "builddir" <> short 'b' <> help "Set custom cabal build directory, default `dist'") <*> many ( strOption ( long "ignore" <> short 'i' <> metavar "DIR" From 00f8bcf59b6f410f2661161484a92bda97d95d69 Mon Sep 17 00:00:00 2001 From: Greg Weber Date: Mon, 11 Aug 2014 15:58:47 -0700 Subject: [PATCH 32/51] expose YesodExampleData --- yesod-test/Yesod/Test.hs | 3 ++- yesod-test/yesod-test.cabal | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/yesod-test/Yesod/Test.hs b/yesod-test/Yesod/Test.hs index d71ebd74..5b1bc3ee 100644 --- a/yesod-test/Yesod/Test.hs +++ b/yesod-test/Yesod/Test.hs @@ -29,6 +29,7 @@ module Yesod.Test , YesodSpec , yesodSpecWithSiteGenerator , YesodExample + , YesodExampleData(..) , YesodSpecTree (..) , ydescribe , yit @@ -125,7 +126,7 @@ import Data.Time.Clock (getCurrentTime) -- | The state used in a single test case defined using 'yit' -- --- Since 1.2.0 +-- Since 1.2.4 data YesodExampleData site = YesodExampleData { yedApp :: !Application , yedSite :: !site diff --git a/yesod-test/yesod-test.cabal b/yesod-test/yesod-test.cabal index 0c236b3f..8a322391 100644 --- a/yesod-test/yesod-test.cabal +++ b/yesod-test/yesod-test.cabal @@ -1,9 +1,9 @@ name: yesod-test -version: 1.2.3.2 +version: 1.2.4 license: MIT license-file: LICENSE author: Nubis -maintainer: Nubis , Michael Snoyman +maintainer: Michael Snoyman, Greg Weber, Nubis synopsis: integration testing for WAI/Yesod Applications category: Web, Yesod, Testing stability: Experimental From e74709433bb61a60f3043c300074f0bd1c27beb8 Mon Sep 17 00:00:00 2001 From: Greg Weber Date: Mon, 11 Aug 2014 16:23:41 -0700 Subject: [PATCH 33/51] add yesodSpecApp --- yesod-test/Yesod/Test.hs | 22 ++++++++++++++++++++++ yesod-test/yesod-test.cabal | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/yesod-test/Yesod/Test.hs b/yesod-test/Yesod/Test.hs index 5b1bc3ee..4d922d6f 100644 --- a/yesod-test/Yesod/Test.hs +++ b/yesod-test/Yesod/Test.hs @@ -28,6 +28,7 @@ module Yesod.Test yesodSpec , YesodSpec , yesodSpecWithSiteGenerator + , yesodSpecApp , YesodExample , YesodExampleData(..) , YesodSpecTree (..) @@ -235,6 +236,27 @@ yesodSpecWithSiteGenerator getSiteAction yspecs = , yedResponse = Nothing } +-- | Same as yesodSpec, but instead of taking a site it +-- takes an action which produces the 'Application' for each test. +-- This lets you use your middleware from makeApplication +yesodSpecApp :: YesodDispatch site + => site + -> IO Application + -> YesodSpec site + -> Hspec.Spec +yesodSpecApp site getApp yspecs = + Core.fromSpecList $ map unYesod $ execWriter yspecs + where + unYesod (YesodSpecGroup x y) = Core.SpecGroup x $ map unYesod y + unYesod (YesodSpecItem x y) = Core.it x $ do + app <- getApp + ST.evalStateT y YesodExampleData + { yedApp = app + , yedSite = site + , yedCookies = M.empty + , yedResponse = Nothing + } + -- | Describe a single test that keeps cookies, and a reference to the last response. yit :: String -> YesodExample site () -> YesodSpec site yit label example = tell [YesodSpecItem label example] diff --git a/yesod-test/yesod-test.cabal b/yesod-test/yesod-test.cabal index 8a322391..02400a24 100644 --- a/yesod-test/yesod-test.cabal +++ b/yesod-test/yesod-test.cabal @@ -1,5 +1,5 @@ name: yesod-test -version: 1.2.4 +version: 1.2.5 license: MIT license-file: LICENSE author: Nubis From c1f08eeb9f812c76aba0a6cbfffe9b51378d266a Mon Sep 17 00:00:00 2001 From: Christopher Reichert Date: Wed, 13 Aug 2014 21:19:14 -0500 Subject: [PATCH 34/51] Load keter config file with yml or yaml extension. Complimentary fix for snoyberg/keter#41 --- yesod-bin/Keter.hs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/yesod-bin/Keter.hs b/yesod-bin/Keter.hs index 1a7192a4..7837ab4f 100644 --- a/yesod-bin/Keter.hs +++ b/yesod-bin/Keter.hs @@ -27,16 +27,17 @@ keter :: String -- ^ cabal command -> Bool -- ^ no build? -> IO () keter cabal noBuild = do - mvalue <- decodeFile "config/keter.yaml" + ketercfg <- keterConfig + mvalue <- decodeFile ketercfg value <- case mvalue of Nothing -> error "No config/keter.yaml found" Just (Object value) -> case Map.lookup "host" value of Just (String s) | "<<" `T.isPrefixOf` s -> - error "Please set your hostname in config/keter.yaml" + error $ "Please set your hostname in " ++ ketercfg _ -> return value - Just _ -> error "config/keter.yaml is not an object" + Just _ -> error $ ketercfg ++ " is not an object" files <- getDirectoryContents "." project <- @@ -48,7 +49,7 @@ keter cabal noBuild = do exec <- case Map.lookup "exec" value of Just (String s) -> return $ F.collapse $ "config" F. F.fromText s - _ -> error "exec not found in config/keter.yaml" + _ -> error $ "exec not found in " ++ ketercfg unless noBuild $ do run cabal ["clean"] @@ -67,6 +68,12 @@ keter cabal noBuild = do Just i -> run "scp" ["-P" ++ show (i :: Int), fp, T.unpack s] Nothing -> run "scp" [fp, T.unpack s] _ -> return () + where + -- Test for alternative config file extension (yaml or yml). + keterConfig = do + let yml = "config/keter.yml" + ymlExists <- doesFileExist yml + return $ if ymlExists then yml else "config/keter.yaml" try' :: IO a -> IO (Either SomeException a) try' = try From c20cb20438aa4ea4bf5e637f622bbb4933460b49 Mon Sep 17 00:00:00 2001 From: Erik de Castro Lopo Date: Thu, 14 Aug 2014 18:15:49 +1000 Subject: [PATCH 35/51] yesod-bin/Devel.hs : Relax requirements on location of Application.hs. I often move Application.hs to MyApp/Application.hs (and change the module name as needed) which would result in yesod-bin printing a warning about a missing Application.hs. The code should now accept any file named Application.hs (either in the top level source directory or somewhere in the tree. --- yesod-bin/Devel.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yesod-bin/Devel.hs b/yesod-bin/Devel.hs index 77f34286..af4a6959 100644 --- a/yesod-bin/Devel.hs +++ b/yesod-bin/Devel.hs @@ -416,7 +416,7 @@ checkCabalFile gpd = case D.condLibrary gpd of unless (null unlisted) $ do putStrLn "WARNING: the following source files are not listed in exposed-modules or other-modules:" mapM_ putStrLn unlisted - when (D.fromString "Application" `notElem` D.exposedModules dLib) $ + when ("Application" `notElem` (map (last . D.components) $ D.exposedModules dLib)) $ putStrLn "WARNING: no exposed module Application" return (hsSourceDirs, dLib) From 1fe72e8351c79befaa8aa56c7d5be67048826c27 Mon Sep 17 00:00:00 2001 From: Kadzuya OKAMOTO Date: Fri, 15 Aug 2014 12:57:39 +0900 Subject: [PATCH 36/51] fixed Japanese message --- yesod-auth/Yesod/Auth/Message.hs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/yesod-auth/Yesod/Auth/Message.hs b/yesod-auth/Yesod/Auth/Message.hs index b7297f68..c9cc05b0 100644 --- a/yesod-auth/Yesod/Auth/Message.hs +++ b/yesod-auth/Yesod/Auth/Message.hs @@ -397,15 +397,15 @@ japaneseMessage NowLoggedIn = "ログインしました" japaneseMessage LoginTitle = "ログイン" japaneseMessage PleaseProvideUsername = "ユーザ名を入力してください" japaneseMessage PleaseProvidePassword = "パスワードを入力してください" -japaneseMessage NoIdentifierProvided = "No email/username provided" -japaneseMessage InvalidEmailAddress = "Invalid email address provided" -japaneseMessage PasswordResetTitle = "Password Reset" -japaneseMessage ProvideIdentifier = "Email or Username" -japaneseMessage SendPasswordResetEmail = "Send password reset email" -japaneseMessage PasswordResetPrompt = "Enter your e-mail address or username below, and a password reset e-mail will be sent to you." -japaneseMessage InvalidUsernamePass = "Invalid username/password combination" +japaneseMessage NoIdentifierProvided = "メールアドレス/ユーザ名が入力されていません" +japaneseMessage InvalidEmailAddress = "メールアドレスが無効です" +japaneseMessage PasswordResetTitle = "パスワードの再設定" +japaneseMessage ProvideIdentifier = "メールアドレスまたはユーザ名" +japaneseMessage SendPasswordResetEmail = "パスワード再設定用メールの送信" +japaneseMessage PasswordResetPrompt = "以下にメールアドレスまたはユーザ名を入力してください。パスワードを再設定するためのメールが送信されます。" +japaneseMessage InvalidUsernamePass = "ユーザ名とパスワードの組み合わせが間違っています" japaneseMessage (IdentifierNotFound ident) = - "「" `mappend` ident `mappend` "」は正しくないログインので、または未入力の項目があります。" + ident `mappend` "は登録されていません" finnishMessage :: AuthMessage -> Text finnishMessage NoOpenID = "OpenID-tunnistetta ei löydy" From 2a6956a85c26a0c629f8ee40833956fdc83b2822 Mon Sep 17 00:00:00 2001 From: John Lenz Date: Fri, 15 Aug 2014 21:17:52 -0500 Subject: [PATCH 37/51] Small fixes to adding person info to creds extra for google auth --- yesod-auth/Yesod/Auth/GoogleEmail2.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/yesod-auth/Yesod/Auth/GoogleEmail2.hs b/yesod-auth/Yesod/Auth/GoogleEmail2.hs index d836c73a..04afd433 100644 --- a/yesod-auth/Yesod/Auth/GoogleEmail2.hs +++ b/yesod-auth/Yesod/Auth/GoogleEmail2.hs @@ -31,10 +31,10 @@ import Control.Applicative ((<$>), (<*>)) import Control.Arrow (second) import Control.Monad (liftM, unless) import qualified Data.Aeson as A +import qualified Data.Aeson.Encode as A import Data.Aeson.Parser (json') import Data.Aeson.Types (FromJSON (parseJSON), parseEither, withObject) -import qualified Data.ByteString.Lazy as BL import Data.Conduit (($$+-)) import Data.Conduit.Attoparsec (sinkParser) import qualified Data.HashMap.Strict as M @@ -42,6 +42,8 @@ import Data.Monoid (mappend) import Data.Text (Text) import qualified Data.Text as T import Data.Text.Encoding (decodeUtf8, encodeUtf8) +import qualified Data.Text.Lazy as TL +import qualified Data.Text.Lazy.Builder as TL import Network.HTTP.Client (parseUrl, requestHeaders, responseBody, urlEncodedBody) import Network.HTTP.Conduit (http) @@ -207,5 +209,5 @@ instance FromJSON Email where allPersonInfo :: A.Value -> [(Text, Text)] allPersonInfo (A.Object o) = map enc $ M.toList o where enc (key, A.String s) = (key, s) - enc (key, v) = (key, decodeUtf8 $ BL.toStrict $ A.encode v) -allPersonInfo _ = error "Google did not return a person object" + enc (key, v) = (key, TL.toStrict $ TL.toLazyText $ A.encodeToTextBuilder v) +allPersonInfo _ = [] From a2d118e2366e8c17324c891a0cd206c2b12dade0 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sat, 16 Aug 2014 23:02:32 +0300 Subject: [PATCH 38/51] network/network-uri split --- yesod-form/yesod-form.cabal | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/yesod-form/yesod-form.cabal b/yesod-form/yesod-form.cabal index 26ac87fe..12a67ede 100644 --- a/yesod-form/yesod-form.cabal +++ b/yesod-form/yesod-form.cabal @@ -1,5 +1,5 @@ name: yesod-form -version: 1.3.15 +version: 1.3.15.1 license: MIT license-file: LICENSE author: Michael Snoyman @@ -12,6 +12,10 @@ build-type: Simple homepage: http://www.yesodweb.com/ description: Form handling support for Yesod Web Framework +flag network-uri + description: Get Network.URI from the network-uri package + default: True + library build-depends: base >= 4 && < 5 , yesod-core >= 1.2 && < 1.3 @@ -27,7 +31,6 @@ library , data-default , xss-sanitize >= 0.3.0.1 , blaze-builder >= 0.2.1.4 - , network >= 2.2 , email-validate >= 1.0 , bytestring >= 0.9.1.4 , text >= 0.9 @@ -40,6 +43,11 @@ library , aeson , resourcet + if flag(network-uri) + build-depends: network-uri >= 2.6 + else + build-depends: network < 2.6 + exposed-modules: Yesod.Form Yesod.Form.Types Yesod.Form.Functions From 63e7cd8e2f862cc55fa0b4bab164722e9ed41d69 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sat, 16 Aug 2014 23:05:10 +0300 Subject: [PATCH 39/51] network/network-uri split (again) --- yesod-auth/yesod-auth.cabal | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/yesod-auth/yesod-auth.cabal b/yesod-auth/yesod-auth.cabal index 7edeba7b..b6d6922d 100644 --- a/yesod-auth/yesod-auth.cabal +++ b/yesod-auth/yesod-auth.cabal @@ -1,5 +1,5 @@ name: yesod-auth -version: 1.3.4 +version: 1.3.4.1 license: MIT license-file: LICENSE author: Michael Snoyman, Patrick Brisbin @@ -20,6 +20,10 @@ description: * : An alternative to the HashDB module. extra-source-files: persona_sign_in_blue.png +flag network-uri + description: Get Network.URI from the network-uri package + default: True + library build-depends: base >= 4 && < 5 , authenticate >= 1.3 @@ -48,7 +52,6 @@ library , lifted-base >= 0.1 , blaze-html >= 0.5 , blaze-markup >= 0.5.1 - , network , http-types , file-embed , email-validate >= 1.0 @@ -65,6 +68,11 @@ library , conduit-extra , attoparsec-conduit + if flag(network-uri) + build-depends: network-uri >= 2.6 + else + build-depends: network < 2.6 + exposed-modules: Yesod.Auth Yesod.Auth.BrowserId Yesod.Auth.Dummy From 404e1b2f9c8ea27745b057b67895990be16e1a9a Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sat, 16 Aug 2014 23:05:58 +0300 Subject: [PATCH 40/51] Platform update --- yesod-platform/yesod-platform.cabal | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/yesod-platform/yesod-platform.cabal b/yesod-platform/yesod-platform.cabal index 6fec6ce8..a393d564 100644 --- a/yesod-platform/yesod-platform.cabal +++ b/yesod-platform/yesod-platform.cabal @@ -1,5 +1,5 @@ name: yesod-platform -version: 1.2.13 +version: 1.2.13.1 license: MIT license-file: LICENSE author: Michael Snoyman @@ -21,7 +21,7 @@ library , asn1-parse == 0.8.1 , asn1-types == 0.2.3 , attoparsec-conduit == 1.1.0 - , authenticate == 1.3.2.9 + , authenticate == 1.3.2.10 , auto-update == 0.1.0.0 , base16-bytestring == 0.1.1.6 , base64-bytestring == 1.0.0.1 @@ -68,7 +68,7 @@ library , hspec == 1.11.0 , hspec-expectations == 0.6.0.1 , html-conduit == 1.1.0.5 - , http-client == 0.3.6.1 + , http-client == 0.3.7.1 , http-client-tls == 0.2.2 , http-conduit == 2.1.4 , http-date == 0.0.4 @@ -134,13 +134,13 @@ library , x509-validation == 1.5.0 , xml-conduit == 1.2.1 , xml-types == 0.3.4 - , xss-sanitize == 0.3.5.2 + , xss-sanitize == 0.3.5.3 , yaml == 0.8.8.4 , yesod == 1.2.6.1 - , yesod-auth == 1.3.4 + , yesod-auth == 1.3.4.1 , yesod-auth-hashdb == 1.3.0.1 , yesod-core == 1.2.19 - , yesod-form == 1.3.14 + , yesod-form == 1.3.15.1 , yesod-persistent == 1.2.3 , yesod-routes == 1.2.0.7 , yesod-static == 1.2.4 From 9831220c4759cae169e560dc328b9615aa283c67 Mon Sep 17 00:00:00 2001 From: Dunric Date: Sun, 17 Aug 2014 20:15:50 +0200 Subject: [PATCH 41/51] add-handler interactive --- yesod-bin/AddHandler.hs | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/yesod-bin/AddHandler.hs b/yesod-bin/AddHandler.hs index ca3a6ce3..9c59c59b 100644 --- a/yesod-bin/AddHandler.hs +++ b/yesod-bin/AddHandler.hs @@ -22,20 +22,28 @@ addHandler = do [] -> error "No cabal file found" _ -> error "Too many cabal files found" - putStr "Name of route (without trailing R): " - hFlush stdout - name <- getLine - case name of - [] -> error "Please provide a name" - c:_ - | isLower c -> error "Name must start with an upper case letter" - | otherwise -> return () - - -- Check that the handler file doesn't already exist - let handlerFile = concat ["Handler/", name, ".hs"] - exists <- doesFileExist handlerFile - when exists $ error $ "File already exists: " ++ show handlerFile + let routeInput = do + putStr "Name of route (without trailing R): " + hFlush stdout + name <- getLine + case name of + [] -> error "No name entered. Quitting ..." + c:_ + | isLower c -> do + putStrLn "Name must start with an upper case letter" + routeInput + | otherwise -> do + -- Check that the handler file doesn't already exist + let handlerFile = concat ["Handler/", name, ".hs"] + exists <- doesFileExist handlerFile + if exists + then do + putStrLn $ "File already exists: " ++ show handlerFile + putStrLn "Try another name or leave blank to exit" + routeInput + else return (name, handlerFile) + (name, handlerFile) <- routeInput putStr "Enter route pattern (ex: /entry/#EntryId): " hFlush stdout pattern <- getLine From d4175f11ccd22f33c700b9e88b63e75f977c9b06 Mon Sep 17 00:00:00 2001 From: Dunric Date: Wed, 20 Aug 2014 01:53:59 +0200 Subject: [PATCH 42/51] `required' attribute for nicHtmlField (textfield tag) --- yesod-form/Yesod/Form/Nic.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yesod-form/Yesod/Form/Nic.hs b/yesod-form/Yesod/Form/Nic.hs index 28626789..7e4af077 100644 --- a/yesod-form/Yesod/Form/Nic.hs +++ b/yesod-form/Yesod/Form/Nic.hs @@ -26,10 +26,10 @@ class Yesod a => YesodNic a where nicHtmlField :: YesodNic site => Field (HandlerT site IO) Html nicHtmlField = Field { fieldParse = \e _ -> return . Right . fmap (preEscapedToMarkup . sanitizeBalance) . listToMaybe $ e - , fieldView = \theId name attrs val _isReq -> do + , fieldView = \theId name attrs val isReq -> do toWidget [shamlet| $newline never -