From 92fc64655c5b51ddec3286befd87d9693ca718c2 Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Wed, 5 Nov 2014 15:07:54 +0000 Subject: Update to use bundler and work on Ubuntu Trusty. Switching to bundler saves confusion about gem paths when running sass/compass to compile the CSS. Trusty can use precisely the same packages as precise, with a few tweaks to generalise the contents. --- .gitignore | 1 + Gemfile | 3 +++ Gemfile.lock | 16 ++++++++++++++++ bin/install-as-user | 21 +++++++++------------ bin/make_css | 14 ++++++++++---- bin/make_css_watch | 14 ++++++++++++-- conf/packages.debian-squeeze | 4 ++-- conf/packages.debian-wheezy | 4 ++-- conf/packages.ubuntu-precise | 6 +++--- 9 files changed, 58 insertions(+), 25 deletions(-) create mode 100644 Gemfile create mode 100644 Gemfile.lock diff --git a/.gitignore b/.gitignore index 577167f34..72bc29420 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ ._* .vagrant +.bundle .DS_Store .carton local-lib5 diff --git a/Gemfile b/Gemfile new file mode 100644 index 000000000..eca052933 --- /dev/null +++ b/Gemfile @@ -0,0 +1,3 @@ +source "https://rubygems.org" + +gem "compass", "0.12.7" diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 000000000..c86a5ca9a --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,16 @@ +GEM + remote: https://rubygems.org/ + specs: + chunky_png (1.3.3) + compass (0.12.7) + chunky_png (~> 1.2) + fssm (>= 0.2.7) + sass (~> 3.2.19) + fssm (0.2.10) + sass (3.2.19) + +PLATFORMS + ruby + +DEPENDENCIES + compass (= 0.12.7) diff --git a/bin/install-as-user b/bin/install-as-user index bd48bdebb..ebff69ed2 100755 --- a/bin/install-as-user +++ b/bin/install-as-user @@ -71,25 +71,22 @@ if [ ! "$DEVELOPMENT_INSTALL" = true ]; then fi # Install the compass gem locally - it's required for generating the -# CSS: +# CSS. Don't trust the bundled bundler in e.g. precise. echo "Setting up CSS... " -export GEM_HOME="$DIRECTORY/gems" -mkdir -p "$GEM_HOME" -export GEM_PATH= -export PATH="$GEM_HOME/bin:$PATH" +gem1.9.1 install --user-install --no-ri --no-rdoc bundler +FMS_GEMPATH="$DIRECTORY/gem-bin" +FMS_GEMPATH="$FMS_GEMPATH:$(ruby1.9.1 -rubygems -e 'puts Gem.user_dir')/bin" +export PATH="$FMS_GEMPATH:$PATH" -if ! grep -q 'Set up local gem directory for FixMyStreet' $HOME/.bashrc; then +if ! grep -q 'Set up local PATH for FixMyStreet' $HOME/.bashrc; then cat >>$HOME/.bashrc <instantiate_watcher( filter => $filter, ); +my $script_compass = 'compass'; +my $script_sass = 'sass'; +my $gem_bin = abs_path("$FindBin::Bin/../../gem-bin"); +if (-f "$gem_bin/compass") { + $script_compass = "$gem_bin/compass"; + $script_sass = "$gem_bin/sass"; +} + sub title { my $what = shift; # TODO, check if xtitle is installed and if so, run following command: @@ -61,13 +71,13 @@ while ( my @events = $watcher->wait_for_events() ) { } for my $dir (@update_dirs) { if (-e "$dir/config.rb") { - system compass => + system $script_compass, 'compile', '--output-style' => 'compressed', $dir; } else { - system sass => + system $script_sass, '--scss', '--update', '--style' => 'compressed', diff --git a/conf/packages.debian-squeeze b/conf/packages.debian-squeeze index 4f7887484..21e5d0485 100644 --- a/conf/packages.debian-squeeze +++ b/conf/packages.debian-squeeze @@ -8,8 +8,8 @@ perl perlmagick libmath-bigint-gmp-perl gettext -libhaml-ruby -postgresql-8.4 +ruby1.9.1 +postgresql postgresql-server-dev-8.4 gnuplot ttf-bitstream-vera diff --git a/conf/packages.debian-wheezy b/conf/packages.debian-wheezy index d925dfcad..546cdf72f 100644 --- a/conf/packages.debian-wheezy +++ b/conf/packages.debian-wheezy @@ -8,9 +8,9 @@ perl perlmagick libmath-bigint-gmp-perl gettext -ruby-compass +ruby1.9.1 postgresql -postgresql-server-dev-9.1 +postgresql-server-dev-all gnuplot ttf-bitstream-vera libexpat1-dev diff --git a/conf/packages.ubuntu-precise b/conf/packages.ubuntu-precise index fc8a7d511..546cdf72f 100644 --- a/conf/packages.ubuntu-precise +++ b/conf/packages.ubuntu-precise @@ -8,9 +8,9 @@ perl perlmagick libmath-bigint-gmp-perl gettext -libhaml-ruby -postgresql-9.1 -postgresql-server-dev-9.1 +ruby1.9.1 +postgresql +postgresql-server-dev-all gnuplot ttf-bitstream-vera libexpat1-dev -- cgit v1.2.3