octopress-printable 0.0.2 → 0.0.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: 2899c118b415254ec12fc9638c9d81c806536b62
4
- data.tar.gz: eb65ab65ae7d777cf1862b50de768d60c53780ed
3
+ metadata.gz: 20f5c0e3fd5d01d59859f822a963b5d8f68dd26f
4
+ data.tar.gz: 3bbb7c559fbd021aa1a088a55539cd96c77500b3
5
5
  SHA512:
6
- metadata.gz: d448e01014ad59f6219d3db69be53382b0f86ca506a77df50b0ae8ee17f19ad0c876119d130dcc7be8a8fc8e070181d12fa0cb5d5df9eb9f6401d3896e07ef4a
7
- data.tar.gz: d91b93c00927289c1138bda7e18d68a899631f42acdc44059e04002b8d953ffca30480d4eb00ef24a2d1bdc2e79ded8fd9394482ffa70bbec52f9d849b3c52f3
6
+ metadata.gz: fef828f2b5fd5395645662ce474a6c02365dea94419f9e60eb38b5b86535b3c3fcaae47d824f3acc2f6afa02875613492900c979deaf0899697ac162910193f5
7
+ data.tar.gz: 624b0d3666b70aced2ba0e1ae7a943daee639dc32a4103cd0aae1e6ec06fdc4120e30292e1a6f039f62ce715a1c3054f07817091950d4e99e32e053aab362f7a
data/CHANGELOG.md CHANGED
@@ -1,4 +1,10 @@
1
1
  # Changelog
2
2
 
3
- ## 1.0.0 - 2015-04-29
3
+ ## 0.0.3 - 2015-05-13
4
+ - Support convert from draft
5
+
6
+ ## 0.0.2 - 2015-05-02
7
+ - Avoid error when deleting bib
8
+
9
+ ## 0.0.1 - 2015-04-29
4
10
  - Initial release
@@ -33,9 +33,10 @@ module Octopress
33
33
 
34
34
  site.posts.each do |p|
35
35
  post = p.path
36
- pdf = post.sub(/#{posts_dir}\//, "#{printables_dir}/")
37
- pdf = pdf.sub(/\.markdown$/, ".pdf")
38
- pdf = pdf.sub(/\.md$/, ".pdf")
36
+ pdf = p.url.sub(/^\//, "")
37
+ pdf = pdf.sub(/\/$/, "")
38
+ pdf = pdf.gsub(/\//, "-")
39
+ pdf = "#{printables_dir}/#{pdf}.pdf"
39
40
 
40
41
  if !File.exists?(pdf) || File.stat(post).mtime > File.stat(pdf).mtime
41
42
  puts "Converting #{post} to #{pdf}"
@@ -16,12 +16,25 @@ module Octopress
16
16
  while /{% post_link (?<markup>[^\s]+)(?<text>\s+.+)? %}/ =~ str
17
17
  @match = true
18
18
 
19
- /^(?<year>\d+)-(?<month>\d+)-(?<day>\d+)-(?<title>.*)/ =~ markup
19
+ found_year = false
20
+ if /^(?<year>\d+)-(?<month>\d+)-(?<day>\d+)-(?<title>.*)/ =~ markup
21
+ found_year = true
22
+ end
20
23
 
21
24
  if ! text
22
25
  File.open("#{@source_dir}/#{@posts_dir}/#{markup}.markdown", 'r') do |f|
26
+ found_text = false
23
27
  while l = f.gets
24
28
  if /title: (?:"|')(?<text>.*)(?:"|')/ =~ l
29
+ found_text = true
30
+ end
31
+ if ! found_year
32
+ if /date: (?<year>\d+)-(?<month>\d+)-(?<day>\d+)/ =~ l
33
+ found_year = true
34
+ end
35
+ end
36
+
37
+ if found_text && found_year
25
38
  break
26
39
  end
27
40
  end
@@ -1,5 +1,5 @@
1
1
  module Octopress
2
2
  module Printable
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octopress-printable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Wang Jian
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-01 00:00:00.000000000 Z
11
+ date: 2015-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler