Skip to content

Commit

Permalink
Merge pull request #1009 from bobvanderlinden/rust-rewrite-rubyonrail…
Browse files Browse the repository at this point in the history
…s-fixes

Fixes to pass rubyonrails test
  • Loading branch information
domenkozar authored Mar 16, 2024
2 parents 3baecf3 + 74364ee commit 9a90212
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions examples/rubyonrails/.test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
set -ex

pushd blog
wait_for_port 5100
wait_for_port 3000
rails db:create
curl -s http://localhost:5100/ | grep "version"
curl -s http://localhost:3000/ | grep "version"
popd

# make sure puma was compiled with ssl
Expand Down
2 changes: 1 addition & 1 deletion examples/rubyonrails/devenv.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
enterShell = ''
if [ ! -d "blog" ]; then
gem install rails
rails new blog -d=postgresql
rails new blog --database=postgresql --force
fi
export PATH="$DEVENV_ROOT/blog/bin:$PATH"
pushd blog
Expand Down
11 changes: 6 additions & 5 deletions package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ pkgs.rustPlatform.buildRustPackage {
pname = "devenv";
version = "1.0.0";

src = builtins.path {
path = ./.;
filter = path: type:
path != "Cargo.lock" || path != "Cargo.toml" || path != "src/devenv";
};
src = pkgs.lib.sourceByRegex ./. [
"Cargo.toml"
"Cargo.lock"
"devenv(/\.*)?"
"devenv-run-tests(/\.*)?"
];

cargoLock = {
lockFile = ./Cargo.lock;
Expand Down
5 changes: 4 additions & 1 deletion src/modules/services/postgres.nix
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ let
cfg.initialDatabases)
else
lib.optionalString cfg.createDatabase ''
echo "CREATE DATABASE ''${USER:-$(id -nu)};" | psql --dbname postgres'';
psql --dbname postgres << EOF
CREATE DATABASE "''${USER:-$(id -nu)}";
EOF
'';

runInitialScript =
if cfg.initialScript != null then
Expand Down

0 comments on commit 9a90212

Please sign in to comment.