bunto 1.0.0 → 2.0.0.pre

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: db4d93530a7eb0e73c615ce0699607440a4dfc3c
4
- data.tar.gz: 3817cf82a033d008dad8a0438ddcf303a6d71c16
3
+ metadata.gz: a35757459d1fb37d6fd83479cd61dd9ece4b5cf1
4
+ data.tar.gz: 914345bc95069ad5982a3141674b94b55a7bb011
5
5
  SHA512:
6
- metadata.gz: b19c626c0e74905faddc592b4c6b832d77c2a65d14dafab7ebd81af6ae77763abf1790555c049685b25df402efb2ab7ab26e83c214755c960ff8395776ae7d57
7
- data.tar.gz: aae78e9d6637ac07b5b12f5fa7bc508bf79ef4cc59ec24266b2de8b0cbb5295da8664c0e4dfee1475a2437b77fe73e4f9da0c5ae317310f32cca158ef7fbc6dd
6
+ metadata.gz: 480427bb9fbb1a4dc7f5d3401375011083bf4866ed47138986a916476cdc7b75534236549639ecac598b7f529007115c7eea1df4583cf16dd2db36e8f64b5ab7
7
+ data.tar.gz: 959bb7e751224b8bfb9d164801f5b394e9440f401a28a74db5f267e7242909a5e30ec092accddcc7aca806ce977090b0acc08ef083168cfee37c8d91f249e9b4
data/README.markdown CHANGED
@@ -1,10 +1,9 @@
1
1
  # ![Bunto](https://cloud.githubusercontent.com/assets/5073946/9288138/f4335fee-4337-11e5-9a28-068900097035.png)
2
-
3
-
4
2
  > **Bunto** is a Web Application Framework which can be used as a simple, static site generator for personal, project, or organization sites.
5
3
 
6
4
  [![Gem Version](https://img.shields.io/gem/v/bunto.svg)][ruby-gems]
7
5
  [![Build Status](https://travis-ci.org/bunto/bunto.svg?branch=ruby)][travis]
6
+ [![Join the chat at https://gitter.im/bunto/bunto](https://badges.gitter.im/bunto/bunto.svg)](https://gitter.im/bunto/bunto?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
8
7
  <!--
9
8
  [![Test Coverage](https://codeclimate.com/github/bunto/bunto/badges/coverage.svg)][coverage]
10
9
  [![Code Climate](https://codeclimate.com/github/bunto/bunto/badges/gpa.svg)][codeclimate]
@@ -56,4 +55,4 @@ and we will address it as soon as possible.
56
55
 
57
56
  ## License
58
57
 
59
- See [LICENSE](https://github.com/bunto/bunto/blob/master/LICENSE).
58
+ See the [LICENSE](https://github.com/bunto/bunto/blob/master/LICENSE) file.
@@ -48,7 +48,7 @@ In order to use Bunto as currently configured, you'll need to install this gem.
48
48
 
49
49
  The full error message from Ruby is: '#{e.message}'
50
50
 
51
- If you run into trouble, you can find helpful resources at http://buntorb.com/help/!
51
+ If you run into trouble, you can find helpful resources at https://bunto.github.io/help/!
52
52
  MSG
53
53
  raise Bunto::Errors::MissingDependencyException.new(name)
54
54
  end
data/lib/bunto/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Bunto
2
- VERSION = '1.0.0'
2
+ VERSION = '2.0.0.pre'
3
3
  end
@@ -1,5 +1,5 @@
1
1
  <!DOCTYPE html>
2
- <html>
2
+ <html lang="en">
3
3
 
4
4
  {% include head.html %}
5
5
 
@@ -14,12 +14,12 @@ Bunto also offers powerful support for code snippets:
14
14
  def print_hi(name)
15
15
  puts "Hi, #{name}"
16
16
  end
17
- print_hi('Tom')
18
- #=> prints 'Hi, Tom' to STDOUT.
17
+ print_hi('Suriyaa')
18
+ #=> prints 'Hi, Suriyaa' to STDOUT.
19
19
  {% endhighlight %}
20
20
 
21
21
  Check out the [Bunto docs][bunto-docs] for more info on how to get the most out of Bunto. File all bugs/feature requests at [Bunto’s GitHub repo][bunto-gh]. If you have questions, you can ask them on [Bunto Talk][bunto-talk].
22
22
 
23
- [bunto-docs]: http://bunto.github.io/docs/home
23
+ [bunto-docs]: http://bunto.github.io/docs/
24
24
  [bunto-gh]: https://github.com/bunto/bunto
25
25
  [bunto-talk]: https://bunto.github.io/talk/
@@ -4,11 +4,7 @@ title: About
4
4
  permalink: /about/
5
5
  ---
6
6
 
7
- This is the base Bunto theme. You can find out more info about customizing your Bunto theme, as well as basic Bunto usage documentation at [buntor.isc](http://bunto.github.io/)
8
-
9
- You can find the source code for the Bunto new theme at:
10
- {% include icon-github.html username="jglovier" %} /
11
- [bunto-new](https://github.com/jglovier/bunto-new)
7
+ This is the base Bunto theme. You can find out more info about customizing your Bunto theme, as well as basic Bunto usage documentation at [bunto.isc](http://bunto.github.io/)
12
8
 
13
9
  You can find the source code for Bunto at
14
10
  {% include icon-github.html username="bunto" %} /
metadata CHANGED
@@ -1,122 +1,122 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bunto
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 2.0.0.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Suriyaa Kudo
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-14 00:00:00.000000000 Z
11
+ date: 2016-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: liquid
15
14
  requirement: !ruby/object:Gem::Requirement
16
15
  requirements:
17
16
  - - "~>"
18
17
  - !ruby/object:Gem::Version
19
18
  version: '3.0'
20
- type: :runtime
19
+ name: liquid
21
20
  prerelease: false
21
+ type: :runtime
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '3.0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: kramdown
29
28
  requirement: !ruby/object:Gem::Requirement
30
29
  requirements:
31
30
  - - "~>"
32
31
  - !ruby/object:Gem::Version
33
32
  version: '1.3'
34
- type: :runtime
33
+ name: kramdown
35
34
  prerelease: false
35
+ type: :runtime
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.3'
41
41
  - !ruby/object:Gem::Dependency
42
- name: mercenary
43
42
  requirement: !ruby/object:Gem::Requirement
44
43
  requirements:
45
44
  - - "~>"
46
45
  - !ruby/object:Gem::Version
47
46
  version: 0.3.3
48
- type: :runtime
47
+ name: mercenary
49
48
  prerelease: false
49
+ type: :runtime
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: 0.3.3
55
55
  - !ruby/object:Gem::Dependency
56
- name: safe_yaml
57
56
  requirement: !ruby/object:Gem::Requirement
58
57
  requirements:
59
58
  - - "~>"
60
59
  - !ruby/object:Gem::Version
61
60
  version: '1.0'
62
- type: :runtime
61
+ name: safe_yaml
63
62
  prerelease: false
63
+ type: :runtime
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '1.0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: colorator
71
70
  requirement: !ruby/object:Gem::Requirement
72
71
  requirements:
73
72
  - - "~>"
74
73
  - !ruby/object:Gem::Version
75
74
  version: '0.1'
76
- type: :runtime
75
+ name: colorator
77
76
  prerelease: false
77
+ type: :runtime
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0.1'
83
83
  - !ruby/object:Gem::Dependency
84
- name: rouge
85
84
  requirement: !ruby/object:Gem::Requirement
86
85
  requirements:
87
86
  - - "~>"
88
87
  - !ruby/object:Gem::Version
89
88
  version: '1.7'
90
- type: :runtime
89
+ name: rouge
91
90
  prerelease: false
91
+ type: :runtime
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '1.7'
97
97
  - !ruby/object:Gem::Dependency
98
- name: bunto-sass-converter
99
98
  requirement: !ruby/object:Gem::Requirement
100
99
  requirements:
101
100
  - - "~>"
102
101
  - !ruby/object:Gem::Version
103
102
  version: '2.0'
104
- type: :runtime
103
+ name: bunto-sass-converter
105
104
  prerelease: false
105
+ type: :runtime
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '2.0'
111
111
  - !ruby/object:Gem::Dependency
112
- name: bunto-watch
113
112
  requirement: !ruby/object:Gem::Requirement
114
113
  requirements:
115
114
  - - "~>"
116
115
  - !ruby/object:Gem::Version
117
116
  version: '1.0'
118
- type: :runtime
117
+ name: bunto-watch
119
118
  prerelease: false
119
+ type: :runtime
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
@@ -181,7 +181,6 @@ files:
181
181
  - lib/bunto/page.rb
182
182
  - lib/bunto/plugin.rb
183
183
  - lib/bunto/plugin_manager.rb
184
- - lib/bunto/post.rb
185
184
  - lib/bunto/publisher.rb
186
185
  - lib/bunto/reader.rb
187
186
  - lib/bunto/readers/collection_reader.rb
@@ -228,7 +227,7 @@ homepage: https://github.com/bunto/bunto
228
227
  licenses:
229
228
  - MIT
230
229
  metadata: {}
231
- post_install_message:
230
+ post_install_message:
232
231
  rdoc_options:
233
232
  - "--charset=UTF-8"
234
233
  require_paths:
@@ -240,13 +239,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
240
239
  version: 2.0.0
241
240
  required_rubygems_version: !ruby/object:Gem::Requirement
242
241
  requirements:
243
- - - ">="
242
+ - - ">"
244
243
  - !ruby/object:Gem::Version
245
- version: '0'
244
+ version: 1.3.1
246
245
  requirements: []
247
- rubyforge_project:
248
- rubygems_version: 2.2.2
249
- signing_key:
246
+ rubyforge_project:
247
+ rubygems_version: 2.4.8
248
+ signing_key:
250
249
  specification_version: 2
251
250
  summary: A simple, static site generator.
252
251
  test_files: []
data/lib/bunto/post.rb DELETED
@@ -1,329 +0,0 @@
1
- module Bunto
2
- class Post
3
- include Comparable
4
- include Convertible
5
-
6
- # Valid post name regex.
7
- MATCHER = /^(.+\/)*(\d+-\d+-\d+)-(.*)(\.[^.]+)$/
8
-
9
- EXCERPT_ATTRIBUTES_FOR_LIQUID = %w[
10
- title
11
- url
12
- dir
13
- date
14
- id
15
- categories
16
- next
17
- previous
18
- tags
19
- path
20
- ]
21
-
22
- # Attributes for Liquid templates
23
- ATTRIBUTES_FOR_LIQUID = EXCERPT_ATTRIBUTES_FOR_LIQUID + %w[
24
- content
25
- excerpt
26
- excerpt_separator
27
- draft?
28
- ]
29
-
30
- # Post name validator. Post filenames must be like:
31
- # 2008-11-05-my-awesome-post.textile
32
- #
33
- # Returns true if valid, false if not.
34
- def self.valid?(name)
35
- name =~ MATCHER
36
- end
37
-
38
- attr_accessor :site
39
- attr_accessor :data, :extracted_excerpt, :content, :output, :ext
40
- attr_accessor :date, :slug, :tags, :categories
41
-
42
- attr_reader :name
43
-
44
- # Initialize this Post instance.
45
- #
46
- # site - The Site.
47
- # base - The String path to the dir containing the post file.
48
- # name - The String filename of the post file.
49
- #
50
- # Returns the new Post.
51
- def initialize(site, source, dir, name)
52
- @site = site
53
- @dir = dir
54
- @base = containing_dir(dir)
55
- @name = name
56
-
57
- self.categories = dir.split('/').reject { |x| x.empty? }
58
- process(name)
59
- read_yaml(@base, name)
60
-
61
- data.default_proc = proc do |hash, key|
62
- site.frontmatter_defaults.find(relative_path, type, key)
63
- end
64
-
65
- if data.key?('date')
66
- self.date = Utils.parse_date(data["date"].to_s, "Post '#{relative_path}' does not have a valid date in the YAML front matter.")
67
- end
68
-
69
- populate_categories
70
- populate_tags
71
- end
72
-
73
- def published?
74
- if data.key?('published') && data['published'] == false
75
- false
76
- else
77
- true
78
- end
79
- end
80
-
81
- def populate_categories
82
- categories_from_data = Utils.pluralized_array_from_hash(data, 'category', 'categories')
83
- self.categories = (
84
- Array(categories) + categories_from_data
85
- ).map { |c| c.to_s }.flatten.uniq
86
- end
87
-
88
- def populate_tags
89
- self.tags = Utils.pluralized_array_from_hash(data, "tag", "tags").flatten
90
- end
91
-
92
- # Get the full path to the directory containing the post files
93
- def containing_dir(dir)
94
- site.in_source_dir(dir, '_posts')
95
- end
96
-
97
- # Read the YAML frontmatter.
98
- #
99
- # base - The String path to the dir containing the file.
100
- # name - The String filename of the file.
101
- #
102
- # Returns nothing.
103
- def read_yaml(base, name)
104
- super(base, name)
105
- self.extracted_excerpt = extract_excerpt
106
- end
107
-
108
- # The post excerpt. This is either a custom excerpt
109
- # set in YAML front matter or the result of extract_excerpt.
110
- #
111
- # Returns excerpt string.
112
- def excerpt
113
- data.fetch('excerpt') { extracted_excerpt.to_s }
114
- end
115
-
116
- # Public: the Post title, from the YAML Front-Matter or from the slug
117
- #
118
- # Returns the post title
119
- def title
120
- data.fetch('title') { titleized_slug }
121
- end
122
-
123
- # Public: the Post excerpt_separator, from the YAML Front-Matter or site default
124
- # excerpt_separator value
125
- #
126
- # Returns the post excerpt_separator
127
- def excerpt_separator
128
- (data['excerpt_separator'] || site.config['excerpt_separator']).to_s
129
- end
130
-
131
- # Turns the post slug into a suitable title
132
- def titleized_slug
133
- slug.split('-').select {|w| w.capitalize! || w }.join(' ')
134
- end
135
-
136
- # Public: the path to the post relative to the site source,
137
- # from the YAML Front-Matter or from a combination of
138
- # the directory it's in, "_posts", and the name of the
139
- # post file
140
- #
141
- # Returns the path to the file relative to the site source
142
- def path
143
- data.fetch('path') { relative_path.sub(/\A\//, '') }
144
- end
145
-
146
- # The path to the post source file, relative to the site source
147
- def relative_path
148
- File.join(*[@dir, "_posts", @name].map(&:to_s).reject(&:empty?))
149
- end
150
-
151
- # Compares Post objects. First compares the Post date. If the dates are
152
- # equal, it compares the Post slugs.
153
- #
154
- # other - The other Post we are comparing to.
155
- #
156
- # Returns -1, 0, 1
157
- def <=>(other)
158
- cmp = self.date <=> other.date
159
- if 0 == cmp
160
- cmp = self.slug <=> other.slug
161
- end
162
- return cmp
163
- end
164
-
165
- # Extract information from the post filename.
166
- #
167
- # name - The String filename of the post file.
168
- #
169
- # Returns nothing.
170
- def process(name)
171
- m, cats, date, slug, ext = *name.match(MATCHER)
172
- self.date = Utils.parse_date(date, "Post '#{relative_path}' does not have a valid date in the filename.")
173
- self.slug = slug
174
- self.ext = ext
175
- end
176
-
177
- # The generated directory into which the post will be placed
178
- # upon generation. This is derived from the permalink or, if
179
- # permalink is absent, set to the default date
180
- # e.g. "/2008/11/05/" if the permalink style is :date, otherwise nothing.
181
- #
182
- # Returns the String directory.
183
- def dir
184
- File.dirname(url)
185
- end
186
-
187
- # The full path and filename of the post. Defined in the YAML of the post
188
- # body (optional).
189
- #
190
- # Returns the String permalink.
191
- def permalink
192
- data && data['permalink']
193
- end
194
-
195
- def template
196
- case site.permalink_style
197
- when :pretty
198
- "/:categories/:year/:month/:day/:title/"
199
- when :none
200
- "/:categories/:title.html"
201
- when :date
202
- "/:categories/:year/:month/:day/:title.html"
203
- when :ordinal
204
- "/:categories/:year/:y_day/:title.html"
205
- else
206
- site.permalink_style.to_s
207
- end
208
- end
209
-
210
- # The generated relative url of this post.
211
- #
212
- # Returns the String url.
213
- def url
214
- @url ||= URL.new({
215
- :template => template,
216
- :placeholders => url_placeholders,
217
- :permalink => permalink
218
- }).to_s
219
- end
220
-
221
- # Returns a hash of URL placeholder names (as symbols) mapping to the
222
- # desired placeholder replacements. For details see "url.rb"
223
- def url_placeholders
224
- {
225
- :year => date.strftime("%Y"),
226
- :month => date.strftime("%m"),
227
- :day => date.strftime("%d"),
228
- :title => slug,
229
- :i_day => date.strftime("%-d"),
230
- :i_month => date.strftime("%-m"),
231
- :categories => (categories || []).map { |c| c.to_s.downcase }.uniq.join('/'),
232
- :short_month => date.strftime("%b"),
233
- :short_year => date.strftime("%y"),
234
- :y_day => date.strftime("%j"),
235
- :output_ext => output_ext
236
- }
237
- end
238
-
239
- # The UID for this post (useful in feeds).
240
- # e.g. /2008/11/05/my-awesome-post
241
- #
242
- # Returns the String UID.
243
- def id
244
- File.join(dir, slug)
245
- end
246
-
247
- # Calculate related posts.
248
- #
249
- # Returns an Array of related Posts.
250
- def related_posts(posts)
251
- Bunto::RelatedPosts.new(self).build
252
- end
253
-
254
- # Add any necessary layouts to this post.
255
- #
256
- # layouts - A Hash of {"name" => "layout"}.
257
- # site_payload - The site payload hash.
258
- #
259
- # Returns nothing.
260
- def render(layouts, site_payload)
261
- # construct payload
262
- payload = Utils.deep_merge_hashes({
263
- "site" => { "related_posts" => related_posts(site_payload["site"]["posts"]) },
264
- "page" => to_liquid(self.class::EXCERPT_ATTRIBUTES_FOR_LIQUID)
265
- }, site_payload)
266
-
267
- if generate_excerpt?
268
- extracted_excerpt.do_layout(payload, {})
269
- end
270
-
271
- do_layout(payload.merge({"page" => to_liquid}), layouts)
272
- end
273
-
274
- # Obtain destination path.
275
- #
276
- # dest - The String path to the destination dir.
277
- #
278
- # Returns destination file path String.
279
- def destination(dest)
280
- # The url needs to be unescaped in order to preserve the correct filename
281
- path = site.in_dest_dir(dest, URL.unescape_path(url))
282
- path = File.join(path, "index.html") if self.url.end_with?("/")
283
- path << output_ext unless path.end_with?(output_ext)
284
- path
285
- end
286
-
287
- # Returns the shorthand String identifier of this Post.
288
- def inspect
289
- "<Post: #{id}>"
290
- end
291
-
292
- def next
293
- pos = site.posts.index {|post| post.equal?(self) }
294
- if pos && pos < site.posts.length - 1
295
- site.posts[pos + 1]
296
- else
297
- nil
298
- end
299
- end
300
-
301
- def previous
302
- pos = site.posts.index {|post| post.equal?(self) }
303
- if pos && pos > 0
304
- site.posts[pos - 1]
305
- else
306
- nil
307
- end
308
- end
309
-
310
- # Returns if this Post is a Draft
311
- def draft?
312
- is_a?(Bunto::Draft)
313
- end
314
-
315
- protected
316
-
317
- def extract_excerpt
318
- if generate_excerpt?
319
- Bunto::Excerpt.new(self)
320
- else
321
- ""
322
- end
323
- end
324
-
325
- def generate_excerpt?
326
- !excerpt_separator.empty?
327
- end
328
- end
329
- end