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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 95b695c1790cd0bba8f1cc1fc0c0d53d30fdaaca
4
- data.tar.gz: 24f76e2a0450a822bc59194e6e88b4fa363b3e4b
3
+ metadata.gz: e476ab7bb87cbaf0d374bf52ed469ebc89036015
4
+ data.tar.gz: 9d38606191260e669ad620d8ce594e56403495e8
5
5
  SHA512:
6
- metadata.gz: b9e478581c5b16475d982fdf4c219b75970b670fc3a4eb1975978006b2f672f1dc977b6131ef95bc33cecfbe65276ffd17bb98598a7a1983a281a24060fb9036
7
- data.tar.gz: 08c3aa98a5078ae00aff10a85ed008515506379be8f409f14ae29022f1736d04ea80babc90f8a989170b95c08c977d7354d7d9b59a4a4ac75efbf9d2317740b1
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
- - Fixed: Post and Page data is appended to at read time.
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 "defaults", "--defaults", "#{action} plugin's default configuration"
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
@@ -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 == 'defaults'
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
- @config ||= defaults.read
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 defaults
187
- @defaults ||= Assets::Config.new(self, @config_file)
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
- 'defaults' => [@defaults]
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 'defaults'
236
+ when 'config-file'
236
237
  message += asset_list(assets, 'default configuration')
237
238
  else
238
239
  message += asset_list(assets, name)
@@ -1,5 +1,5 @@
1
1
  module Octopress
2
2
  module Ink
3
- VERSION = "1.0.0.rc.2"
3
+ VERSION = "1.0.0.rc.3"
4
4
  end
5
5
  end
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 ||= init_site(options)
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
- if path = options.delete('path')
143
- full_path = File.join(Ink.site.source, path)
144
- if !Dir["#{full_path}/*"].empty? && options['force'].nil?
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(full_path, options)
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 { background: #f00; }
1
+ .do-not-exist
2
+ background: #f00
@@ -1 +1,2 @@
1
- .do-not-exist { background: #f00; }
1
+ .do-not-exist
2
+ background: #f00
@@ -1,4 +1,5 @@
1
1
  ---
2
+ title: Test Post
2
3
  layout: theme:test
3
4
  external-url: http://timecube.com
4
5
  ---
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octopress-ink
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.rc.2
4
+ version: 1.0.0.rc.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Mathis