trackman 0.6.3 → 0.6.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +2 -2
- data/lib/trackman/assets/asset_factory.rb +1 -1
- data/lib/trackman/path/rails32_resolver.rb +4 -4
- data/lib/trackman/path/resolver.rb +8 -7
- data/lib/trackman/path.rb +0 -1
- data/lib/trackman/version.rb +1 -1
- data/spec/fixtures/sprockets/app/assets/images/trackman70x70.png +5359 -0
- data/spec/helpers/fakable_pathman_tester.rb +8 -1
- data/spec/paths/{rails32_pathman_spec.rb → rails32_resolver_spec.rb} +23 -0
- data/spec/paths/{pathman_spec.rb → resolver_spec.rb} +16 -2
- data/spec/rails32_resolver_spec.rb +13 -2
- data/spec/spec_helper.rb +0 -1
- metadata +7 -6
- data/lib/trackman/path/rails_resolver.rb +0 -29
data/Gemfile.lock
CHANGED
@@ -9,7 +9,7 @@ GIT
|
|
9
9
|
PATH
|
10
10
|
remote: .
|
11
11
|
specs:
|
12
|
-
trackman (0.6.
|
12
|
+
trackman (0.6.4)
|
13
13
|
heroku (>= 2.26.2)
|
14
14
|
json
|
15
15
|
nokogiri
|
@@ -24,7 +24,7 @@ GEM
|
|
24
24
|
blockenspiel (0.4.5)
|
25
25
|
diff-lcs (1.1.3)
|
26
26
|
excon (0.16.4)
|
27
|
-
heroku (2.32.
|
27
|
+
heroku (2.32.14)
|
28
28
|
heroku-api (~> 0.3.5)
|
29
29
|
launchy (>= 0.3.2)
|
30
30
|
netrc (~> 0.7.7)
|
@@ -23,7 +23,7 @@ module Trackman
|
|
23
23
|
instance.extend Trackman::Path::Rails32Resolver, BundledAsset
|
24
24
|
return instance
|
25
25
|
elsif rails_defined? #fallback to rails without asset pipeline
|
26
|
-
instance.extend Trackman::Path::
|
26
|
+
instance.extend Trackman::Path::Resolver
|
27
27
|
end
|
28
28
|
instance.extend Trackman::Components::Hashable
|
29
29
|
|
@@ -1,16 +1,16 @@
|
|
1
1
|
module Trackman
|
2
2
|
module Path
|
3
3
|
module Rails32Resolver
|
4
|
-
include
|
4
|
+
include Resolver
|
5
5
|
|
6
6
|
alias old_rails_translate translate
|
7
7
|
|
8
8
|
def translate url, parent_url
|
9
9
|
root = working_dir.realpath
|
10
|
-
|
10
|
+
|
11
11
|
path = url.dup
|
12
|
-
path.slice!
|
13
|
-
path =
|
12
|
+
path.slice! /^\/?assets/
|
13
|
+
path = Pathname.new(path)
|
14
14
|
|
15
15
|
path = prepare_for_sprocket(path, parent_url, root) if path.relative?
|
16
16
|
begin
|
@@ -11,14 +11,15 @@ module Trackman
|
|
11
11
|
parent = parent_of(parent_url)
|
12
12
|
child = url
|
13
13
|
else
|
14
|
-
parent = working_dir
|
15
|
-
|
16
|
-
child = Pathname.new(s[1...s.length])
|
14
|
+
parent = working_dir + 'public/'
|
15
|
+
child = Pathname.new(url.to_s[1..-1])
|
17
16
|
end
|
18
|
-
|
19
|
-
(
|
20
|
-
|
21
|
-
|
17
|
+
relative_path = (parent + child).relative_path_from(working_dir).to_s
|
18
|
+
file_exist?(relative_path) ? relative_path : nil
|
19
|
+
end
|
20
|
+
def file_exist? path
|
21
|
+
File.exists? path
|
22
|
+
end
|
22
23
|
def working_dir
|
23
24
|
Pathname.new Dir.pwd
|
24
25
|
end
|
data/lib/trackman/path.rb
CHANGED
data/lib/trackman/version.rb
CHANGED