javascripto 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -17,8 +17,22 @@ module Javascripto
17
17
 
18
18
  attr_accessor :path, :package
19
19
 
20
+ def resource_path
21
+ @remote_url || @path
22
+ end
23
+
20
24
  def initialize(path)
21
25
  @path = path
26
+
27
+ # Handle remote packages.
28
+ first_line = ::File.open(@@js_root.join(@path + JS), &:gets)
29
+ if first_line
30
+ @remote_url = /\s*^\/\/\s*use_remote_package(.*)/.match(first_line)
31
+ if @remote_url
32
+ @remote_url = @remote_url.captures[0].strip
33
+ @package = self
34
+ end
35
+ end
22
36
  end
23
37
 
24
38
  def file_dependencies
@@ -66,6 +80,12 @@ module Javascripto
66
80
  end
67
81
 
68
82
  # Override Package Methods
83
+
84
+ def cache
85
+ # Disable rails caching for single file packages
86
+ nil
87
+ end
88
+
69
89
  def package_files
70
90
  [self]
71
91
  end
@@ -25,5 +25,10 @@ module Javascripto
25
25
  file.package = self
26
26
  end
27
27
  end
28
+
29
+ # A unique key to be use for caching.
30
+ def cache
31
+ @package_name
32
+ end
28
33
  end
29
34
  end
@@ -1,3 +1,3 @@
1
1
  module Javascripto
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 1
9
- version: 0.0.1
8
+ - 2
9
+ version: 0.0.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Blake Taylor
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-01-17 00:00:00 -05:00
17
+ date: 2011-01-18 00:00:00 -05:00
18
18
  default_executable:
19
19
  dependencies: []
20
20