middleman-tansu 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/features/tansu_cli.feature +1 -13
- data/lib/middleman-tansu/command.rb +5 -13
- data/lib/middleman-tansu/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b062e5143a8ff3b6f7ea5e0d130acaa7004671a8
|
4
|
+
data.tar.gz: 8182a19a35a914404b08cc375b309077d14618bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b3d9f1c72320919efbf994e8cf58ec848700c68a11f6b5cb542a3793cedc0681ba412548fc5d0e4aec391a5ff8be01a67cf997bf3178262f2c5b56d16b83198
|
7
|
+
data.tar.gz: 80c017632967da703f8fbf0552dbe217d80eb78a5f537b1fed7ddfb929f05be3bb0dcc3cd0c01a97ceec7b562ea80417c803a345c371263cf3c95373c3658850
|
data/CHANGELOG.md
CHANGED
data/features/tansu_cli.feature
CHANGED
@@ -4,8 +4,8 @@ Feature: Tansu Command
|
|
4
4
|
Given a fixture app "empty-app"
|
5
5
|
When I run `middleman tansu foo`
|
6
6
|
Then the exit status should be 0
|
7
|
-
And a file named "source/foo.html.md" should exist
|
8
7
|
And the output should contain "create tansu page: foo.html.md"
|
8
|
+
And a file named "source/foo.html.md" should exist
|
9
9
|
And the file "source/foo.html.md" should contain "title: foo"
|
10
10
|
And the file "source/foo.html.md" should not contain "title: foo.html.md"
|
11
11
|
And the file "source/foo.html.md" should contain "author:"
|
@@ -117,15 +117,3 @@ 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 -c
|
122
|
-
Given a fixture app "empty-app"
|
123
|
-
And a directory named "source/subdirectory"
|
124
|
-
And I cd to "source/subdirectory"
|
125
|
-
When I run `middleman tansu foo -c`
|
126
|
-
Then the exit status should be 0
|
127
|
-
And the output should contain "create tansu page: foo.html.md"
|
128
|
-
And a file named "foo.html.md" should exist
|
129
|
-
And the file "foo.html.md" should contain "title: foo"
|
130
|
-
And the file "foo.html.md" should contain "author:"
|
131
|
-
And the file "foo.html.md" should contain "date:"
|
@@ -47,11 +47,6 @@ module Middleman
|
|
47
47
|
method_option 'author',
|
48
48
|
aliases: '-a',
|
49
49
|
desc: 'The author name of Frontmatter (default: ENV["USER"])'
|
50
|
-
method_option 'current',
|
51
|
-
type: :boolean,
|
52
|
-
aliases: '-c',
|
53
|
-
default: false,
|
54
|
-
desc: 'Create file from current direcotry'
|
55
50
|
method_option 'frontmatter',
|
56
51
|
desc: 'Additions of Frontmatter ex:"category:sample,tags:frontmatter"',
|
57
52
|
default: ''
|
@@ -68,13 +63,10 @@ module Middleman
|
|
68
63
|
filename = "#{title}.html.#{ext}"
|
69
64
|
end
|
70
65
|
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
file = File.join(dir, filename)
|
76
|
-
FileUtils.mkdir_p dir unless Dir.exist?(dir)
|
77
|
-
end
|
66
|
+
dir = destination_dir(paths)
|
67
|
+
file = File.join(dir, filename)
|
68
|
+
|
69
|
+
FileUtils.mkdir_p dir unless Dir.exist?(dir)
|
78
70
|
|
79
71
|
if File.exist?(file)
|
80
72
|
say "#{display_path(file)} is exist"
|
@@ -137,7 +129,7 @@ module Middleman
|
|
137
129
|
end
|
138
130
|
|
139
131
|
def display_path(path)
|
140
|
-
path.sub(Regexp.new("^#{source}/"),
|
132
|
+
path.sub(Regexp.new("^#{source}/"), "")
|
141
133
|
end
|
142
134
|
end
|
143
135
|
end
|