middleman-tansu 0.1.2 → 0.1.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: b062e5143a8ff3b6f7ea5e0d130acaa7004671a8
4
- data.tar.gz: 8182a19a35a914404b08cc375b309077d14618bd
3
+ metadata.gz: 50411d04e8f3b70aa3e8236bf4b26ac113fa1b13
4
+ data.tar.gz: eba1e6140f24a1f2e2cb7c2dc774e83d33d1825f
5
5
  SHA512:
6
- metadata.gz: 3b3d9f1c72320919efbf994e8cf58ec848700c68a11f6b5cb542a3793cedc0681ba412548fc5d0e4aec391a5ff8be01a67cf997bf3178262f2c5b56d16b83198
7
- data.tar.gz: 80c017632967da703f8fbf0552dbe217d80eb78a5f537b1fed7ddfb929f05be3bb0dcc3cd0c01a97ceec7b562ea80417c803a345c371263cf3c95373c3658850
6
+ metadata.gz: 93265575213eb79a2c07390753b14814b5e5e4e5d7fd1d8b221f54870f8f6406f7948d5775920bb34639aae56415f76e0be75b68d14c9693a17e2e95bdc96c43
7
+ data.tar.gz: 03e7b7ad4c9544950fdaddf88002740e50b0ef73fe729b95efb21f93a89b669564b04595bb52a1a1ce7ca3c0f0febba8cacd57a4c1a4e03713abd371105f12b2
data/.travis.yml CHANGED
@@ -1,4 +1,5 @@
1
1
  language: ruby
2
+ sudo: false
2
3
  rvm:
3
4
  - ruby-head
4
5
  - jruby-head
@@ -17,6 +18,7 @@ matrix:
17
18
  - rvm: jruby-19mode
18
19
  - rvm: jruby-head
19
20
  script: bundle exec cucumber
21
+ cache: bundler
20
22
  env: TEST=true
21
23
  notifications:
22
24
  slack:
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # 0.1.3
2
+
3
+ - Fix: URI is not encoded in sitemap.xml.
4
+ マルチバイト文字列を含む URI がエンコードされていなかった問題を修正。
5
+ - `-z` option in `tansu` command accepts UPPERCASE or downcase timezone. ex: tokyo, TOKYO
6
+ tansu コマンドのタイムゾーンのオプションは大文字小文字の値を受け付けるようになりました。
7
+
1
8
  # 0.1.2
2
9
 
3
10
  - Drop `--current` (alias: `-c`) from `tansu` command.
@@ -5,7 +12,7 @@
5
12
 
6
13
  # 0.1.1
7
14
 
8
- - Add option `--current` (alias: `-c`) into `tansu` command.
15
+ - Add option `--current` (alias: `-c`) into `tansu` command.(__DROPPED in v0.1.2__)
9
16
  - If you use `-c` option, `tansu` command create file with _relative path_ from current directory.
10
17
  - Add emoji stylesheet in template.
11
18
 
@@ -117,3 +117,27 @@ Feature: Tansu Command
117
117
  And the file "source/foo.html.md" should contain "author:"
118
118
  And the file "source/foo.html.md" should contain "date:"
119
119
  And the file "source/foo.html.md" should contain "+0900"
120
+
121
+ Scenario: `middleman tansu` create a markdown file with -z option(downcase)
122
+ Given a fixture app "empty-app"
123
+ And I set the timezone to "UTC"
124
+ When I run `middleman tansu foo -z tokyo`
125
+ Then the exit status should be 0
126
+ And a file named "source/foo.html.md" should exist
127
+ And the file "source/foo.html.md" should contain "title: foo"
128
+ And the file "source/foo.html.md" should not contain "title: foo.html.md"
129
+ And the file "source/foo.html.md" should contain "author:"
130
+ And the file "source/foo.html.md" should contain "date:"
131
+ And the file "source/foo.html.md" should contain "+0900"
132
+
133
+ Scenario: `middleman tansu` create a markdown file with -z option(uppercase)
134
+ Given a fixture app "empty-app"
135
+ And I set the timezone to "UTC"
136
+ When I run `middleman tansu foo -z TOKYO`
137
+ Then the exit status should be 0
138
+ And a file named "source/foo.html.md" should exist
139
+ And the file "source/foo.html.md" should contain "title: foo"
140
+ And the file "source/foo.html.md" should not contain "title: foo.html.md"
141
+ And the file "source/foo.html.md" should contain "author:"
142
+ And the file "source/foo.html.md" should contain "date:"
143
+ And the file "source/foo.html.md" should contain "+0900"
@@ -40,6 +40,17 @@ Feature: Template CLI
40
40
  <loc>http://localhost:4567/index.html</loc>
41
41
  """
42
42
 
43
+ Scenario: sitemap.xml contains escaped URI
44
+ Given I run `middleman init MY_PROJECT --template tansu`
45
+ And I cd to "MY_PROJECT"
46
+ And I run `middleman tansu マルチバイトページ`
47
+ When I run `middleman build`
48
+ Then the exit status should be 0
49
+ And the following files should exist:
50
+ | build/マルチバイトページ.html |
51
+ | build/sitemap.xml |
52
+ And the file "build/sitemap.xml" should contain "%E3%83%9E%E3%83%AB%E3%83%81%E3%83%90%E3%82%A4%E3%83%88%E3%83%9A%E3%83%BC%E3%82%B8"
53
+
43
54
  Scenario: Build a new project with app.config.sitemap_url
44
55
  Given I run `middleman init MY_PROJECT --template tansu`
45
56
  And a file named "MY_PROJECT/config.rb" with:
@@ -54,7 +54,8 @@ module Middleman
54
54
  paths = path.split('/')
55
55
  title = paths.pop
56
56
  ext = options[:file]
57
- Time.zone = options[:timezone] || ENV['TZ'] || 'UTC'
57
+ zone = options[:timezone] || ENV['TZ'] || 'UTC'
58
+ Time.zone = (zone != 'UTC') ? zone.downcase.capitalize : zone
58
59
  date = options[:date] ? Time.zone.parse(options[:date]) : Time.zone.now
59
60
  author = options[:author] || ENV['USER']
60
61
  add_frontmatter = options[:frontmatter]
@@ -6,7 +6,7 @@ xml.instruct!
6
6
  xml.urlset 'xmlns' => "http://www.sitemaps.org/schemas/sitemap/0.9" do
7
7
  sitemap.resources.select { |page| page.destination_path =~ /\.html/ }.each do |page|
8
8
  xml.url do
9
- xml.loc File.join(site_url, page.destination_path)
9
+ xml.loc URI.escape(File.join(site_url, page.destination_path))
10
10
  xml.lastmod Time.now.iso8601
11
11
  xml.changefreq page.data.changefreq || "weekly"
12
12
  xml.priority page.data.priority || "0.5"
@@ -1,5 +1,5 @@
1
1
  module Middleman
2
2
  module Tansu
3
- VERSION = '0.1.2'
3
+ VERSION = '0.1.3'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleman-tansu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuya Terajima
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-15 00:00:00.000000000 Z
11
+ date: 2015-03-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: middleman