trackman 0.6.4 → 0.6.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,8 +8,9 @@ module Trackman
8
8
  def initialize attributes = {}
9
9
  @assets = []
10
10
 
11
- self.virtual_path = attributes[:virtual_path]
11
+
12
12
  self.path = attributes[:path]
13
+ self.virtual_path = attributes[:virtual_path]
13
14
  end
14
15
 
15
16
  attr_accessor :virtual_path
@@ -1,8 +1,8 @@
1
1
  module Trackman
2
2
  module Assets
3
3
  module CompositeAsset
4
- @@url = /url\(['"]?([^'")]+)['"]?\)/
5
- @@import = /url\(['"]?[^'"]+['"]?\)/
4
+ @@url ||= /url\(['"]?([^'"\)]+)['"]?\)/
5
+ @@import ||= /url\(['"]?[^'"\)]+['"]?\)/
6
6
 
7
7
  def self.included(mod)
8
8
  mod.send(:include, Path::Resolver)
@@ -7,7 +7,6 @@ module Trackman
7
7
 
8
8
  def translate url, parent_url
9
9
  root = working_dir.realpath
10
-
11
10
  path = url.dup
12
11
  path.slice! /^\/?assets/
13
12
  path = Pathname.new(path)
@@ -1,3 +1,3 @@
1
1
  module Trackman
2
- VERSION = "0.6.4"
2
+ VERSION = "0.6.5"
3
3
  end
@@ -19,11 +19,13 @@ describe Rails32Resolver do
19
19
  end
20
20
  end
21
21
  end
22
+
22
23
  after :all do
23
24
  module Resolver
24
25
  alias file_exist? old_exist
25
26
  end
26
27
  end
28
+
27
29
  it "serves an image linked by an html" do
28
30
  parent_url = 'public/503.html'
29
31
  url = '/assets/bombero.jpeg'
@@ -123,4 +125,14 @@ describe Rails32Resolver do
123
125
 
124
126
  actual.should == expected
125
127
  end
128
+
129
+ it "can find a normal absolute path" do
130
+ parent_url = 'public/503.html'
131
+ url = '/assets/trackman70x70.png'
132
+
133
+ actual = Rails32Tester.translate url, parent_url
134
+ expected = 'app/assets/images/trackman70x70.png'
135
+
136
+ actual.should == expected
137
+ end
126
138
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trackman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.4
4
+ version: 0.6.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-10-16 00:00:00.000000000 Z
13
+ date: 2012-10-17 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rest-client