jekyll_remote_assets 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jekyll_remote_assets.rb +6 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 384462552ce67d2b99c6fb9da0f08c63d00ca70b
|
4
|
+
data.tar.gz: a6316b7f7b99f28eaf41069afcfbf7007c1a4599
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ceee12f657f8db8f84b7bdef89b8249288abd6086f86aedade4fca0f6439867d6e2b28922101b80b92dd047cc42131a2f6a0956123e6f6416c16d00a80bb0c9
|
7
|
+
data.tar.gz: 1d90a8676a1d824362b3957c8e4f07863954d0dd0145be374d607861e2c024c80f32f773c2e032efba1278a200cdd00e7375e04b078506a3985caccb8010c3b8
|
data/lib/jekyll_remote_assets.rb
CHANGED
@@ -35,7 +35,7 @@ module Jekyll
|
|
35
35
|
|
36
36
|
def config_oauth(plugin_config)
|
37
37
|
@oauth_config = {}
|
38
|
-
config_file = plugin_config["config"]
|
38
|
+
config_file = plugin_config["config"]
|
39
39
|
if not File.exist?(config_file)
|
40
40
|
puts "1. Create a new application on the Dropbox App Console, if you haven't already: https://www.dropbox.com/developers/apps"
|
41
41
|
$stdin.gets
|
@@ -74,7 +74,7 @@ module Jekyll
|
|
74
74
|
|
75
75
|
def init_cache(plugin_config)
|
76
76
|
@cache = {}
|
77
|
-
cache_file = plugin_config["cache"]
|
77
|
+
cache_file = plugin_config["cache"]
|
78
78
|
|
79
79
|
# TODO: fix first-time set up of cache
|
80
80
|
if not File.exist?(cache_file)
|
@@ -110,6 +110,9 @@ module Jekyll
|
|
110
110
|
|
111
111
|
def generate(site)
|
112
112
|
plugin_config = site.config["remote_assets"] || {}
|
113
|
+
plugin_config["config"] ||= site.source + "/.remote_assets_config"
|
114
|
+
plugin_config["cache"] ||= site.source + "/.remote_assets_cache"
|
115
|
+
|
113
116
|
config_oauth(plugin_config)
|
114
117
|
init_cache(plugin_config)
|
115
118
|
|
@@ -160,8 +163,7 @@ module Jekyll
|
|
160
163
|
end
|
161
164
|
@cache.delete_if { |key, value| not file_set.include? key }
|
162
165
|
|
163
|
-
|
164
|
-
File.open(plugin_config["cache"] || __dir__ + "/.remote_assets_cache", 'w+') do |f|
|
166
|
+
File.open(plugin_config["cache"], 'w+') do |f|
|
165
167
|
YAML.dump(@cache, f)
|
166
168
|
end
|
167
169
|
end
|