Skip to content
This repository
Browse code

compile assets from the rails pipeline

  • Loading branch information...
commit 6c9ebf46a28a52a91b1c7d72c66a3188cc948135 1 parent 2a6106a
Diego Carrion authored December 07, 2012
2  lib/inploy.rb
@@ -8,4 +8,4 @@ class Railtie < ::Rails::Railtie
8 8
       load 'tasks/inploy.rake'
9 9
     end
10 10
   end
11  
-end if defined?(Rails) and Rails::VERSION::MAJOR == 3 
  11
+end if defined?(Rails) and Rails::VERSION::MAJOR == 3
1  lib/inploy/deploy.rb
@@ -101,6 +101,7 @@ def after_update_code
101 101
       rake_if_included "barista:brew"
102 102
       rake_if_included "asset:packager:build_all"
103 103
       rake_if_included "hoptoad:deploy RAILS_ENV=#{environment} TO=#{environment} REPO=#{repository} REVISION=#{`git log | head -1 | cut -d ' ' -f 2`}"
  104
+      rake_if_included "assets:precompile"
104 105
       notify_new_relic
105 106
       callback :before_restarting_server
106 107
       restart_server
2  lib/inploy/dsl.rb
... ...
@@ -1,3 +1,5 @@
  1
+require 'bundler'
  2
+
1 3
 module Inploy
2 4
   module DSL
3 5
     module ClassMethods
12  spec/deploy_spec.rb
@@ -126,14 +126,12 @@ def setup(subject)
126 126
       end
127 127
 
128 128
       it "should execute bundle install with configured params" do
129  
-           file_exists "Gemfile"
130  
-           subject.bundler_opts = "--binstubs"
131  
-           expect_setup_with @branch, @environment, nil, true, nil, '--binstubs'
132  
-
133  
-           subject.remote_setup
134  
-           file_doesnt_exists "Gemfile"
  129
+        file_exists "Gemfile"
  130
+        subject.bundler_opts = "--binstubs"
  131
+        expect_setup_with @branch, @environment, nil, true, nil, '--binstubs'
  132
+        subject.remote_setup
  133
+        file_doesnt_exists "Gemfile"
135 134
        end
136  
-
137 135
     end
138 136
 
139 137
     context "on local setup" do
13  spec/shared_examples.rb
@@ -55,7 +55,7 @@
55 55
     subject.local_setup
56 56
     File.exists?("config/database.yml").should be_true
57 57
   end
58  
-  
  58
+
59 59
   it "should copy config/*.template* to config/*" do
60 60
     path_exists "config"
61 61
     file_exists "config/database.template.yml"
@@ -272,6 +272,17 @@
272 272
     subject.local_update
273 273
   end
274 274
 
  275
+  it "should compile the assets if the rake task exists" do
  276
+    subject.stub!(:tasks).and_return("rake acceptance rake assets:precompile")
  277
+    expect_command "rake assets:precompile"
  278
+    subject.local_update
  279
+  end
  280
+
  281
+  it "should not compile the assets if the rake task doesnt exists" do
  282
+    dont_accept_command "rake assets:precompile"
  283
+    subject.local_update
  284
+  end
  285
+
275 286
   it "should install gems" do
276 287
     subject.environment = "env6"
277 288
     expect_command "rake gems:install RAILS_ENV=#{subject.environment}"

0 notes on commit 6c9ebf4

Please sign in to comment.
Something went wrong with that request. Please try again.