scharfie-bones 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/bones.gemspec +2 -2
  2. data/lib/cache.rb +13 -4
  3. data/lib/tasks/bones.rb +2 -2
  4. metadata +2 -2
data/bones.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "bones"
3
- s.version = "0.1.3"
4
- s.date = "2009-02-02"
3
+ s.version = "0.1.4"
4
+ s.date = "2009-02-04"
5
5
  s.authors = ["Chris Scharf", "Ryan Heath"]
6
6
  s.email = "scharfie@gmail.com"
7
7
 
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
- @release = Bones::Release.new(@destination, path)
62
- @destination = release.destination
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
- release? ? release.destination : super
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'] if ENV['BASE']
19
- options.destination = ENV['DESTINATION'] if 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.3
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-02 00:00:00 -08:00
13
+ date: 2009-02-04 00:00:00 -08:00
14
14
  default_executable: bones
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency