octopress-ink 1.0.0.rc.2 → 1.0.0.rc.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -2
- data/lib/octopress-ink/commands/helpers.rb +2 -2
- data/lib/octopress-ink/plugin.rb +7 -6
- data/lib/octopress-ink/version.rb +1 -1
- data/lib/octopress-ink.rb +22 -10
- data/test/copy_test/_copy/stylesheets/disable.sass +2 -1
- data/test/plugins/test-theme/stylesheets/disable.sass +2 -1
- data/test/source/_posts/2014-02-01-test-post.md +1 -0
- 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: e476ab7bb87cbaf0d374bf52ed469ebc89036015
|
4
|
+
data.tar.gz: 9d38606191260e669ad620d8ce594e56403495e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 664d0f6419d7c8941483904059e051b72d7e9bda48c0c85cea78e904354cc8599f0f46b3f4ca99d8027a82fc0f073b5bd334bd2a435437213af28155e8418a2d
|
7
|
+
data.tar.gz: a67dc2f4c8e144b7767ca634ebf02e94ae410a4b32ae9947e0adf62ed890aa6d93e2245d2b4231b8149881a50d248802397d9e3c92892f7539d7c491ac147113
|
data/CHANGELOG.md
CHANGED
@@ -1,12 +1,17 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
3
|
## Current released version
|
4
|
-
### 1.0.0 RC2 - 2014-05-26
|
5
4
|
|
6
|
-
|
5
|
+
### 1.0.0 RC3 - 2014-05-27
|
6
|
+
|
7
|
+
- Improved: Now copy and list commands use the flag --config-file instead of --defaults
|
7
8
|
|
8
9
|
## Past versions
|
9
10
|
|
11
|
+
### 1.0.0 RC2 - 2014-05-26
|
12
|
+
|
13
|
+
- Fixed: Post and Page data is appended to at read time.
|
14
|
+
|
10
15
|
### 1.0.0 RC1 - 2014-05-25
|
11
16
|
|
12
17
|
- Initial release candidate
|
@@ -3,6 +3,7 @@ module Octopress
|
|
3
3
|
module Commands
|
4
4
|
module CommandHelpers
|
5
5
|
def self.add_asset_options(c, action)
|
6
|
+
c.option "config-file", "--config-file", "#{action} plugin's default configuration"
|
6
7
|
c.option "layouts", "--layouts", "#{action} only layouts"
|
7
8
|
c.option "includes", "--includes", "#{action} only includes"
|
8
9
|
c.option "pages", "--pages", "#{action} only pages"
|
@@ -15,8 +16,7 @@ module Octopress
|
|
15
16
|
c.option "images", "--images", "#{action} only images"
|
16
17
|
c.option "fonts", "--fonts", "#{action} only fonts"
|
17
18
|
c.option "files", "--files", "#{action} only files"
|
18
|
-
c.option "
|
19
|
-
c.option "config", "--config <CONFIG_FILE>[,CONFIG_FILE2,...]", Array, "Custom configuration file"
|
19
|
+
c.option "config", "--config <CONFIG_FILE>[,CONFIG_FILE2,...]", Array, "Custom Jekyll configuration file"
|
20
20
|
end
|
21
21
|
end
|
22
22
|
end
|
data/lib/octopress-ink/plugin.rb
CHANGED
@@ -116,7 +116,7 @@ module Octopress
|
|
116
116
|
#
|
117
117
|
def add_asset_files(options)
|
118
118
|
select_assets(options).each do |name, assets|
|
119
|
-
next if name == '
|
119
|
+
next if name == 'config-file'
|
120
120
|
assets.each {|file| file.add unless file.disabled? }
|
121
121
|
end
|
122
122
|
end
|
@@ -130,6 +130,7 @@ module Octopress
|
|
130
130
|
next if name == 'docs'
|
131
131
|
assets.each { |a| copied << a.copy(path) }
|
132
132
|
end
|
133
|
+
|
133
134
|
copied
|
134
135
|
end
|
135
136
|
|
@@ -148,7 +149,7 @@ module Octopress
|
|
148
149
|
# returns: Hash of merged user and default config.yml files
|
149
150
|
#
|
150
151
|
def config
|
151
|
-
@
|
152
|
+
@read_config ||= config_defaults.read
|
152
153
|
end
|
153
154
|
|
154
155
|
# Remove files from Jekyll since they'll be proccessed by Ink instead
|
@@ -183,8 +184,8 @@ module Octopress
|
|
183
184
|
config['disable'] = disabled
|
184
185
|
end
|
185
186
|
|
186
|
-
def
|
187
|
-
@
|
187
|
+
def config_defaults
|
188
|
+
@config ||= Assets::Config.new(self, @config_file)
|
188
189
|
end
|
189
190
|
|
190
191
|
|
@@ -216,7 +217,7 @@ module Octopress
|
|
216
217
|
'images' => @images,
|
217
218
|
'fonts' => @fonts,
|
218
219
|
'files' => @files,
|
219
|
-
'
|
220
|
+
'config-file' => [@config]
|
220
221
|
}
|
221
222
|
end
|
222
223
|
|
@@ -232,7 +233,7 @@ module Octopress
|
|
232
233
|
when 'docs'
|
233
234
|
header = "documentation: /#{docs_base_path}/"
|
234
235
|
message += asset_list(assets, header)
|
235
|
-
when '
|
236
|
+
when 'config-file'
|
236
237
|
message += asset_list(assets, 'default configuration')
|
237
238
|
else
|
238
239
|
message += asset_list(assets, name)
|
data/lib/octopress-ink.rb
CHANGED
@@ -60,7 +60,11 @@ module Octopress
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def self.site(options={})
|
63
|
-
@site
|
63
|
+
unless @site
|
64
|
+
@site ||= init_site(options)
|
65
|
+
end
|
66
|
+
|
67
|
+
@site
|
64
68
|
end
|
65
69
|
|
66
70
|
def self.site=(site)
|
@@ -139,16 +143,11 @@ module Octopress
|
|
139
143
|
def self.copy_plugin_assets(name, options)
|
140
144
|
site(options)
|
141
145
|
Plugins.register
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
abort "Error: directory #{path} is not empty. Use --force to overwrite files."
|
146
|
-
end
|
147
|
-
else
|
148
|
-
full_path = File.join(Ink.site.source, Plugins.custom_dir, name)
|
149
|
-
end
|
146
|
+
path = copy_path(name, options)
|
147
|
+
|
148
|
+
|
150
149
|
if p = plugin(name)
|
151
|
-
copied = p.copy_asset_files(
|
150
|
+
copied = p.copy_asset_files(path, options)
|
152
151
|
if !copied.empty?
|
153
152
|
puts "Copied files:\n#{copied.join("\n")}"
|
154
153
|
else
|
@@ -159,6 +158,19 @@ module Octopress
|
|
159
158
|
end
|
160
159
|
end
|
161
160
|
|
161
|
+
def self.copy_path(name, options)
|
162
|
+
if path = options.delete('path')
|
163
|
+
full_path = File.join(Ink.site.source, path)
|
164
|
+
if !Dir["#{full_path}/*"].empty? && options['force'].nil?
|
165
|
+
abort "Error: directory #{path} is not empty. Use --force to overwrite files."
|
166
|
+
end
|
167
|
+
else
|
168
|
+
full_path = File.join(Ink.site.source, Plugins.custom_dir, name)
|
169
|
+
end
|
170
|
+
|
171
|
+
full_path
|
172
|
+
end
|
173
|
+
|
162
174
|
def self.list_plugins(options={})
|
163
175
|
site(options)
|
164
176
|
Plugins.register
|
@@ -1 +1,2 @@
|
|
1
|
-
.do-not-exist
|
1
|
+
.do-not-exist
|
2
|
+
background: #f00
|
@@ -1 +1,2 @@
|
|
1
|
-
.do-not-exist
|
1
|
+
.do-not-exist
|
2
|
+
background: #f00
|