octopress-ink 1.0.0.rc.39 → 1.0.0.rc.40

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: 2fefc72653c604f6032907e28920a720c14dac6d
4
- data.tar.gz: 6948d4deaf142cbf2da3cf6d2aa3b9dce5cc01da
3
+ metadata.gz: a89f28e51ee7ad62be2b3b82f3eab970633d96e6
4
+ data.tar.gz: addb76d7efda7eaa527508d1ecc122d4fa2dbcd3
5
5
  SHA512:
6
- metadata.gz: 2dd6f7519fefc7dbde61d38c1278676d573a8b687da792b9055fd0b0e0d18473529e8b2c26e31ca35ed461cf1463621af3c82380545883d51aaada8e02421ab6
7
- data.tar.gz: c0c6f57fc24b1d99b4f33cc9696df24f8852b3259371f4859f93eb8453577d078ecf91a34ea4271c65ac9c5e3679c9d0058cddbc090c94c55c38fd55176ede64
6
+ metadata.gz: 0c27542401b8df9a907e1f45f0c2d209b3418771f694aec430d68bfa79c0897d39ca61f9070602538ddc4fee05ffb80ed95e1c5b1252a002bf65a8ab366ca886
7
+ data.tar.gz: c67e1a389461818bdf350b0541dbfc6b8f7abdbf455acf099ee665756b8ee3724f2786b63e568c12d462fa4c37605a10109191db3559b0677f99249344edf885
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ### 1.0.0 RC40 - 2015-02-08
4
+ - Improvements to ink list command output.
5
+ - Ensures plugins cannot be registered multiple times.
6
+
3
7
  ### 1.0.0 RC39 - 2015-02-07
4
8
  - New: Octopress Page assets have methods for accessing the plugin and asset that generated them.
5
9
 
@@ -60,7 +60,7 @@ module Octopress
60
60
  def info
61
61
  message = super
62
62
  name = permalink_name << page.ext
63
- message.sub!(/#{filename}/, name.ljust(filename.size))
63
+ message.sub!(/#{filename}\s*/, name.ljust(35))
64
64
  message.ljust(25) << (permalink || page.permalink || '')
65
65
  end
66
66
 
@@ -97,6 +97,7 @@ module Octopress
97
97
  copied = []
98
98
 
99
99
  select_assets(options).each do |name, assets|
100
+ next if name == 'user-lang-configs'
100
101
  assets.each { |a| copied << a.copy(path) }
101
102
  end
102
103
 
@@ -260,12 +261,18 @@ module Octopress
260
261
  message << asset_list(assets, header)
261
262
  when 'config-file'
262
263
  message << asset_list(assets, 'config')
263
- when 'lang-configs'
264
+
264
265
  lang_config_hash.keys.each do |lang|
266
+ message << "\n"
265
267
  message << " config_#{lang}:\n"
266
268
  message << Ink::Utils.pretty_print_yaml(config(lang))
267
- message << "\n"
268
269
  end
270
+
271
+ # Lang configs are listed above with the config hash, ensuring
272
+ # that user configured files can be listed even if the plugin
273
+ # does not ship with alternate language config files
274
+ #
275
+ when 'lang-configs'; next
269
276
  else
270
277
  message << asset_list(assets, name)
271
278
  end
@@ -1,32 +1,34 @@
1
1
  module Octopress
2
2
  module Ink
3
3
  module Plugins
4
+ extend self
4
5
 
5
6
  @static_files = []
6
7
  @plugins = []
7
8
  @user_plugins = []
8
9
  @css_tags = []
9
10
  @js_tags = []
11
+ @registered = false
10
12
 
11
- def self.theme
13
+ def theme
12
14
  @theme
13
15
  end
14
16
 
15
- def self.each(&block)
17
+ def each(&block)
16
18
  plugins.each(&block)
17
19
  end
18
20
 
19
21
  # Store static files to be written
20
22
  #
21
- def self.static_files
23
+ def static_files
22
24
  @static_files
23
25
  end
24
26
 
25
- def self.size
27
+ def size
26
28
  plugins.size
27
29
  end
28
30
 
29
- def self.plugin(slug)
31
+ def plugin(slug)
30
32
  if slug == 'theme'
31
33
  @theme
32
34
  else
@@ -38,37 +40,38 @@ module Octopress
38
40
  end
39
41
  end
40
42
 
41
- def self.plugins
43
+ def plugins
42
44
  [@theme].concat(@plugins).concat(@user_plugins).compact
43
45
  end
44
46
 
45
- def self.register
46
- plugins.each do |p|
47
- p.register
47
+ def register
48
+ unless @registered
49
+ @registered = true
50
+ plugins.each(&:register)
48
51
  end
49
52
  end
50
53
 
51
- def self.add_files
54
+ def add_files
52
55
  add_assets(%w{images pages files fonts docs})
53
56
  add_stylesheets
54
57
  add_javascripts
55
58
  end
56
59
 
57
- def self.add_assets(assets)
60
+ def add_assets(assets)
58
61
  plugins.each do |p|
59
62
  p.add_asset_files(assets)
60
63
  end
61
64
  end
62
65
 
63
- def self.add_css_tag(tag)
66
+ def add_css_tag(tag)
64
67
  @css_tags << tag
65
68
  end
66
69
 
67
- def self.add_js_tag(tag)
70
+ def add_js_tag(tag)
68
71
  @js_tags << tag
69
72
  end
70
73
 
71
- def self.register_plugin(plugin, options=nil)
74
+ def register_plugin(plugin, options=nil)
72
75
  new_plugin = plugin.new(options)
73
76
 
74
77
  case new_plugin.type
@@ -83,12 +86,12 @@ module Octopress
83
86
  end
84
87
  end
85
88
 
86
- def self.config(lang=nil)
89
+ def config(lang=nil)
87
90
  @configs ||= {}
88
91
  @configs[lang || 'default'] ||= get_config(lang)
89
92
  end
90
93
 
91
- def self.get_config(lang=nil)
94
+ def get_config(lang=nil)
92
95
  config = {}
93
96
  config['plugins'] = {}
94
97
 
@@ -105,20 +108,20 @@ module Octopress
105
108
 
106
109
  # Inclue partials from plugins
107
110
  #
108
- def self.include(name, file)
111
+ def include(name, file)
109
112
  p = plugin(name)
110
113
  p.include(file)
111
114
  end
112
115
 
113
116
  # Read plugin dir from site configs
114
117
  #
115
- def self.custom_dir
118
+ def custom_dir
116
119
  Octopress.site.plugin_manager.plugins_path.first
117
120
  end
118
121
 
119
122
  # Copy/Generate Stylesheets
120
123
  #
121
- def self.add_stylesheets
124
+ def add_stylesheets
122
125
  if Ink.configuration['asset_pipeline']['combine_css']
123
126
  PluginAssetPipeline.write_combined_stylesheet
124
127
  else
@@ -128,7 +131,7 @@ module Octopress
128
131
 
129
132
  # Copy/Generate Javascripts
130
133
  #
131
- def self.add_javascripts
134
+ def add_javascripts
132
135
  if Ink.configuration['asset_pipeline']['combine_js']
133
136
  PluginAssetPipeline.write_combined_javascript
134
137
  else
@@ -136,7 +139,7 @@ module Octopress
136
139
  end
137
140
  end
138
141
 
139
- def self.css_tags
142
+ def css_tags
140
143
  if Ink.configuration['asset_pipeline']['combine_css']
141
144
  PluginAssetPipeline.combined_stylesheet_tag
142
145
  else
@@ -144,7 +147,7 @@ module Octopress
144
147
  end
145
148
  end
146
149
 
147
- def self.js_tags
150
+ def js_tags
148
151
  if Ink.configuration['asset_pipeline']['combine_js']
149
152
  PluginAssetPipeline.combined_javascript_tag
150
153
  else
@@ -9,12 +9,13 @@ module Octopress
9
9
  # Use json pretty_print, but make it look like yaml
10
10
  #
11
11
  JSON.pretty_generate(yaml)
12
- .sub(/\A{\n/,'') # remove leading {
13
- .sub(/}\z/,'') # remove trailing }
14
- .gsub(/^/,' ') # indent
15
- .gsub(/"(.+?)":/,'\1:') # remove quotes around keys
16
- .gsub(/,$/,'') # remove commas from end of lines
17
- .gsub(/\w+: {\s+}\n/,'') # remove keys with empty hashes
12
+ .sub(/\A{\n/,'') # remove leading {
13
+ .sub(/}\z/,'') # remove trailing }
14
+ .gsub(/^/,' ') # indent
15
+ .gsub(/"(.+?)":/,'\1:') # remove quotes around keys
16
+ .gsub(/,$/,'') # remove commas from end of lines
17
+ .gsub(/{\n/,"\n") # remove keys with empty hashes
18
+ .gsub(/^\s+}\n/,'') # remove keys with empty hashes
18
19
  end
19
20
  end
20
21
  end
@@ -1,5 +1,5 @@
1
1
  module Octopress
2
2
  module Ink
3
- VERSION = "1.0.0.rc.39"
3
+ VERSION = "1.0.0.rc.40"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octopress-ink
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.rc.39
4
+ version: 1.0.0.rc.40
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Mathis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-07 00:00:00.000000000 Z
11
+ date: 2015-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll