sitepress-cli 0.1.24 → 0.1.25

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/sitepress/compiler.rb +13 -8
  3. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 14c315ff7925c7226ecbe15952d6f76e388bb662
4
- data.tar.gz: 95e039b11e6d7eb758ff11d2373fc902a7ec68e5
3
+ metadata.gz: 41755633b83a13d9fc0f8c4aa0a637a40736e446
4
+ data.tar.gz: 630e38e57b6f05a2c4a47db58d05c10ec970e50f
5
5
  SHA512:
6
- metadata.gz: 95652bf5e886def861c70f8e1237a0ca2ab69bde70d74efcc037028b5e4a3bd6d0fa28d106fa660c331454bd8a2e32499d47b9865679ce8398f29b2c69726137
7
- data.tar.gz: 6f973d6728a9b3defa18eeda18ddb55d6481d521956a2efce5a785566e4044952d05fa668f9c0bf95cc7ed4267f0e0062b91545433a161332a6d6fb850d08647
6
+ metadata.gz: e7e23214bdeec503ebf013a19de64edb7697e68d455f5b99fc61b75e7b0b58a79e3d0ffc097c4a760df63b9b9b54dc66a2aef6a4270930990478b04955550e3c
7
+ data.tar.gz: 6389afc5fbf0177e7285b335c8e448962ab1dceb6c6f9cbbf55c30267c4c67df11f1e9bbe866e29c9f37ae4fb3e68ea27c64b7a0250d30f205fa2ebdf3821544
@@ -16,16 +16,21 @@ module Sitepress
16
16
  target_path = Pathname.new(target_path)
17
17
  mkdir_p target_path
18
18
  root = Pathname.new("/")
19
+ cache_resources = @site.cache_resources
19
20
  @stdout.puts "Compiling #{@site.root_path.expand_path}"
20
- @site.resources.each do |resource|
21
- # These are root `resource.request_path`
22
- derooted = Pathname.new(resource.request_path).relative_path_from(root)
23
- path = target_path.join(derooted)
24
- mkdir_p path.dirname
25
- @stdout.puts " #{path}"
26
- File.open(path.expand_path, "w"){ |f| f.write render(resource) }
21
+ begin
22
+ @site.cache_resources = true
23
+ @site.resources.each do |resource|
24
+ derooted = Pathname.new(resource.request_path).relative_path_from(root)
25
+ path = target_path.join(derooted)
26
+ mkdir_p path.dirname
27
+ @stdout.puts " #{path}"
28
+ File.open(path.expand_path, "w"){ |f| f.write render(resource) }
29
+ end
30
+ @stdout.puts "Successful compilation to #{target_path.expand_path}"
31
+ ensure
32
+ @site.cache_resources = cache_resources
27
33
  end
28
- @stdout.puts "Successful compilation to #{target_path.expand_path}"
29
34
  end
30
35
 
31
36
  private
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sitepress-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.24
4
+ version: 0.1.25
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brad Gessler
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-11-11 00:00:00.000000000 Z
11
+ date: 2016-11-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sitepress-server
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.1.24
19
+ version: 0.1.25
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.1.24
26
+ version: 0.1.25
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: thor
29
29
  requirement: !ruby/object:Gem::Requirement