smart_asset 0.5.9 → 0.5.10

Sign up to get free protection for your applications and to get access to all the features.
File without changes
data/lib/smart_asset.rb CHANGED
@@ -124,6 +124,10 @@ class SmartAsset
124
124
  def load_config(root, relative_config=nil)
125
125
  relative_config ||= 'config/assets.yml'
126
126
  @root = File.expand_path(root)
127
+
128
+ return unless File.file?("#{@root}/#{relative_config}")
129
+
130
+ @cache = nil
127
131
  @config = YAML::load(File.read("#{@root}/#{relative_config}"))
128
132
 
129
133
  # Default values
@@ -29,7 +29,7 @@ class SmartAsset
29
29
  end
30
30
 
31
31
  def before_render
32
- return if @stasis.options[:development]
32
+ return if @stasis.options[:development] || @stasis.path.nil?
33
33
  if @stasis.path =~ REGEX
34
34
  @asset_rendered = true
35
35
  elsif @asset_rendered && !@packaged
@@ -0,0 +1,15 @@
1
+ require File.join File.dirname(__FILE__),'..','smart_asset'
2
+ Capistrano::Configuration.instance(:must_exist).load do
3
+ namespace :smart_asset do
4
+
5
+ desc 'Precompile assets for deploys'
6
+ task :precompile do
7
+ destination = SmartAsset.load_config(Dir.pwd) && SmartAsset.dest
8
+ run_locally "smart_asset"
9
+ return unless scm == :git
10
+ run_locally "git ls-files -d #{destination['javascripts']} #{destination['stylesheets']} | xargs git rm"
11
+ run_locally "git add #{destination['javascripts']} #{destination['stylesheets']}"
12
+ run_locally "git commit -m 'autocommit: smart_asset'"
13
+ end
14
+ end
15
+ end
@@ -0,0 +1 @@
1
+ require File.join File.dirname(__FILE__),'..','lib','smart_asset','recipes'
data/smart_asset.gemspec CHANGED
@@ -6,7 +6,7 @@ $:.unshift lib unless $:.include?(lib)
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "smart_asset"
9
- s.version = '0.5.9'
9
+ s.version = '0.5.10'
10
10
  s.platform = Gem::Platform::RUBY
11
11
  s.authors = ["Winton Welsh"]
12
12
  s.email = ["mail@wintoni.us"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smart_asset
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 9
10
- version: 0.5.9
9
+ - 10
10
+ version: 0.5.10
11
11
  platform: ruby
12
12
  authors:
13
13
  - Winton Welsh
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-11-21 00:00:00 Z
18
+ date: 2012-06-03 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: framework_fixture
@@ -84,6 +84,8 @@ files:
84
84
  - lib/smart_asset/adapters/sinatra.rb
85
85
  - lib/smart_asset/adapters/stasis.rb
86
86
  - lib/smart_asset/helper.rb
87
+ - lib/smart_asset/recipes.rb
88
+ - recipes/smart_asset.rb
87
89
  - smart_asset.gemspec
88
90
  - spec/fixtures/all_frameworks/assets.yml
89
91
  - spec/fixtures/all_frameworks/test.html.erb