scharfie-bones 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/bones.gemspec +2 -2
- data/lib/cache.rb +13 -4
- data/lib/tasks/bones.rb +2 -2
- metadata +2 -2
data/bones.gemspec
CHANGED
data/lib/cache.rb
CHANGED
@@ -13,7 +13,6 @@ class Bones
|
|
13
13
|
super
|
14
14
|
self.base = '' # Base URL is empty
|
15
15
|
self.release = nil
|
16
|
-
self.destination = ROOT / 'public' # Set original destination
|
17
16
|
end
|
18
17
|
|
19
18
|
def merge(options={})
|
@@ -58,8 +57,17 @@ class Bones
|
|
58
57
|
end
|
59
58
|
|
60
59
|
def destination=(path)
|
61
|
-
|
62
|
-
|
60
|
+
if File.expand_path(path) == default_destination
|
61
|
+
@release = nil
|
62
|
+
@destination = default_destination
|
63
|
+
else
|
64
|
+
@release = Bones::Release.new(@destination, path)
|
65
|
+
@destination = release.destination
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
def default_destination
|
70
|
+
File.expand_path(ROOT / 'public')
|
63
71
|
end
|
64
72
|
|
65
73
|
# Returns true if the versions enabled
|
@@ -73,7 +81,8 @@ class Bones
|
|
73
81
|
|
74
82
|
# Returns destination
|
75
83
|
def destination
|
76
|
-
|
84
|
+
return release.destination if release?
|
85
|
+
@destination ||= default_destination
|
77
86
|
end
|
78
87
|
end
|
79
88
|
|
data/lib/tasks/bones.rb
CHANGED
@@ -15,8 +15,8 @@ task :cache => 'cache:simple'
|
|
15
15
|
namespace :cache do
|
16
16
|
def generate_options_from_environment(extra={})
|
17
17
|
returning Bones::Cache::Options.new do |options|
|
18
|
-
options.base = ENV['BASE']
|
19
|
-
options.destination = ENV['DESTINATION']
|
18
|
+
options.base = ENV['BASE'] unless ENV['BASE'].blank?
|
19
|
+
options.destination = ENV['DESTINATION'] unless ENV['DESTINATION'].blank?
|
20
20
|
options.merge extra
|
21
21
|
end
|
22
22
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scharfie-bones
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Scharf
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2009-02-
|
13
|
+
date: 2009-02-04 00:00:00 -08:00
|
14
14
|
default_executable: bones
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|