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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/octopress-ink/assets/page.rb +1 -1
- data/lib/octopress-ink/plugin.rb +9 -2
- data/lib/octopress-ink/plugins.rb +25 -22
- data/lib/octopress-ink/utils.rb +7 -6
- data/lib/octopress-ink/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a89f28e51ee7ad62be2b3b82f3eab970633d96e6
|
4
|
+
data.tar.gz: addb76d7efda7eaa527508d1ecc122d4fa2dbcd3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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}
|
63
|
+
message.sub!(/#{filename}\s*/, name.ljust(35))
|
64
64
|
message.ljust(25) << (permalink || page.permalink || '')
|
65
65
|
end
|
66
66
|
|
data/lib/octopress-ink/plugin.rb
CHANGED
@@ -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
|
-
|
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
|
13
|
+
def theme
|
12
14
|
@theme
|
13
15
|
end
|
14
16
|
|
15
|
-
def
|
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
|
23
|
+
def static_files
|
22
24
|
@static_files
|
23
25
|
end
|
24
26
|
|
25
|
-
def
|
27
|
+
def size
|
26
28
|
plugins.size
|
27
29
|
end
|
28
30
|
|
29
|
-
def
|
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
|
43
|
+
def plugins
|
42
44
|
[@theme].concat(@plugins).concat(@user_plugins).compact
|
43
45
|
end
|
44
46
|
|
45
|
-
def
|
46
|
-
|
47
|
-
|
47
|
+
def register
|
48
|
+
unless @registered
|
49
|
+
@registered = true
|
50
|
+
plugins.each(&:register)
|
48
51
|
end
|
49
52
|
end
|
50
53
|
|
51
|
-
def
|
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
|
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
|
66
|
+
def add_css_tag(tag)
|
64
67
|
@css_tags << tag
|
65
68
|
end
|
66
69
|
|
67
|
-
def
|
70
|
+
def add_js_tag(tag)
|
68
71
|
@js_tags << tag
|
69
72
|
end
|
70
73
|
|
71
|
-
def
|
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
|
89
|
+
def config(lang=nil)
|
87
90
|
@configs ||= {}
|
88
91
|
@configs[lang || 'default'] ||= get_config(lang)
|
89
92
|
end
|
90
93
|
|
91
|
-
def
|
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
|
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
|
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
|
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
|
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
|
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
|
150
|
+
def js_tags
|
148
151
|
if Ink.configuration['asset_pipeline']['combine_js']
|
149
152
|
PluginAssetPipeline.combined_javascript_tag
|
150
153
|
else
|
data/lib/octopress-ink/utils.rb
CHANGED
@@ -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/,'')
|
13
|
-
.sub(/}\z/,'')
|
14
|
-
.gsub(/^/,' ')
|
15
|
-
.gsub(/"(.+?)":/,'\1:')
|
16
|
-
.gsub(/,$/,'')
|
17
|
-
.gsub(
|
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
|
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.
|
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-
|
11
|
+
date: 2015-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|