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 CHANGED
@@ -9,7 +9,7 @@ GIT
9
9
  PATH
10
10
  remote: .
11
11
  specs:
12
- trackman (0.6.2)
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.13)
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::RailsResolver
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 RailsResolver
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! /^(\/assets|assets\/)/
13
- path = Pathname.new 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
- s = url.to_s
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
- (parent + child).relative_path_from(working_dir).to_s
20
- end
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
@@ -2,6 +2,5 @@ module Trackman
2
2
  module Path
3
3
  autoload :Resolver, 'trackman/path/resolver'
4
4
  autoload :Rails32Resolver, 'trackman/path/rails32_resolver'
5
- autoload :RailsResolver, 'trackman/path/rails_resolver'
6
5
  end
7
6
  end
@@ -1,3 +1,3 @@
1
1
  module Trackman
2
- VERSION = "0.6.3"
2
+ VERSION = "0.6.4"
3
3
  end