middleman-tansu 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +14 -14
- data/CHANGELOG.md +6 -0
- data/features/tansu_cli.feature +14 -0
- data/features/template_cli.feature +5 -0
- data/lib/middleman-tansu/command.rb +23 -9
- data/lib/middleman-tansu/template/shared/Gemfile.tt +1 -1
- data/lib/middleman-tansu/template/source/stylesheets/_gemoji.sass +8 -0
- data/lib/middleman-tansu/template/source/stylesheets/all.css.sass +1 -0
- data/lib/middleman-tansu/template.rb +1 -0
- data/lib/middleman-tansu/version.rb +1 -1
- data/middleman-tansu.gemspec +1 -0
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bad745d140fedddb0e4fe94910dbd396d38f0d9c
|
4
|
+
data.tar.gz: c0787d6126e53ea25fbb45d03176e880e9e4e58b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f594799c8f773ffbef2a8445724509addd03dd5cae7fad8310440a8d781c0ebf3817bead81db0a25986c60c2d48cfde97574f1c4d8ca7a3539b269fd4c172e90
|
7
|
+
data.tar.gz: 9fbce8a427bbcb4af8adbe612de3b027db0f6558dcb4c290c367061ee391577dbcede6fe8b4d801a57347b5801ea7a094aa0ea583d7a9ffed95d3e04fdc8c9e0
|
data/.travis.yml
CHANGED
@@ -1,23 +1,23 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
3
|
+
- ruby-head
|
4
|
+
- jruby-head
|
5
|
+
- jruby-19mode
|
6
|
+
- 2.2
|
7
|
+
- 2.1
|
8
|
+
- 2.0
|
9
|
+
- 1.9.3
|
10
10
|
os:
|
11
|
-
|
12
|
-
|
11
|
+
- linux
|
12
|
+
- osx
|
13
13
|
matrix:
|
14
14
|
fast_finish: true
|
15
15
|
allow_failures:
|
16
|
-
|
17
|
-
|
18
|
-
|
16
|
+
- rvm: ruby-head
|
17
|
+
- rvm: jruby-19mode
|
18
|
+
- rvm: jruby-head
|
19
19
|
script: bundle exec cucumber
|
20
20
|
env: TEST=true
|
21
21
|
notifications:
|
22
|
-
|
23
|
-
|
22
|
+
slack:
|
23
|
+
secure: goKYNwT4vB0QjmP952MZ/3Y4DPt9ll/sVX2w9fLVvL6hwxrAFYDsfQgrxolG1ZKXbgQVxHWBQ+R9LbKUNoFWQR420M0r70hW8K6IW92JZDoeeDfXKSyDGj/UZy7EvQuEzssPWDwKNX3NGK8rKzRmyKm7XepPHkHllIQScrawzjA=
|
data/CHANGELOG.md
CHANGED
data/features/tansu_cli.feature
CHANGED
@@ -5,6 +5,7 @@ Feature: Tansu Command
|
|
5
5
|
When I run `middleman tansu foo`
|
6
6
|
Then the exit status should be 0
|
7
7
|
And a file named "source/foo.html.md" should exist
|
8
|
+
And the output should contain "create tansu page: foo.html.md"
|
8
9
|
And the file "source/foo.html.md" should contain "title: foo"
|
9
10
|
And the file "source/foo.html.md" should not contain "title: foo.html.md"
|
10
11
|
And the file "source/foo.html.md" should contain "author:"
|
@@ -14,6 +15,7 @@ Feature: Tansu Command
|
|
14
15
|
Given a fixture app "empty-app"
|
15
16
|
When I run `middleman tansu foo/bar/baz`
|
16
17
|
Then the exit status should be 0
|
18
|
+
And the output should contain "create tansu page: foo/bar/baz.html.md"
|
17
19
|
And a file named "source/foo/bar/baz.html.md" should exist
|
18
20
|
And the file "source/foo/bar/baz.html.md" should contain "title: baz"
|
19
21
|
And the file "source/foo/bar/baz.html.md" should not contain "title: foo/bar/baz"
|
@@ -115,3 +117,15 @@ Feature: Tansu Command
|
|
115
117
|
And the file "source/foo.html.md" should contain "author:"
|
116
118
|
And the file "source/foo.html.md" should contain "date:"
|
117
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:"
|
@@ -12,6 +12,8 @@ Feature: Template CLI
|
|
12
12
|
| source/sitemap.xml.builder |
|
13
13
|
| source/layouts/layout.slim |
|
14
14
|
| source/stylesheets/all.css.sass |
|
15
|
+
| source/stylesheets/_gemoji.sass |
|
16
|
+
| source/stylesheets/pure-min.css |
|
15
17
|
| source/stylesheets/github-markdown.css |
|
16
18
|
| source/templates/index.html.slim |
|
17
19
|
|
@@ -25,6 +27,9 @@ Feature: Template CLI
|
|
25
27
|
| build/sample.html |
|
26
28
|
| build/sitemap.xml |
|
27
29
|
| build/stylesheets/all.css |
|
30
|
+
And the file "build/stylesheets/all.css" should contain "Pure"
|
31
|
+
And the file "build/stylesheets/all.css" should contain ".gemoji"
|
32
|
+
And the file "build/stylesheets/all.css" should contain ".markdown-body"
|
28
33
|
And the file "build/index.html" should contain "middleman-tansu の簡単な紹介"
|
29
34
|
And the helper result "build/sample.html" should contain:
|
30
35
|
"""
|
@@ -47,6 +47,11 @@ 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'
|
50
55
|
method_option 'frontmatter',
|
51
56
|
desc: 'Additions of Frontmatter ex:"category:sample,tags:frontmatter"',
|
52
57
|
default: ''
|
@@ -63,20 +68,23 @@ module Middleman
|
|
63
68
|
filename = "#{title}.html.#{ext}"
|
64
69
|
end
|
65
70
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
71
|
+
if options[:current]
|
72
|
+
file = File.join(filename)
|
73
|
+
else
|
74
|
+
dir = destination_dir(paths)
|
75
|
+
file = File.join(dir, filename)
|
76
|
+
FileUtils.mkdir_p dir unless Dir.exist?(dir)
|
77
|
+
end
|
70
78
|
|
71
79
|
if File.exist?(file)
|
72
|
-
|
80
|
+
say "#{display_path(file)} is exist"
|
73
81
|
exit
|
74
82
|
end
|
75
83
|
|
76
84
|
File.open(file, 'w') do |f|
|
77
85
|
f.puts frontmatter(title, author, date, add_frontmatter)
|
78
86
|
end
|
79
|
-
|
87
|
+
say "create tansu page: #{display_path(file)}"
|
80
88
|
end
|
81
89
|
|
82
90
|
no_tasks do
|
@@ -116,15 +124,21 @@ module Middleman
|
|
116
124
|
end
|
117
125
|
|
118
126
|
def destination_dir(dir)
|
119
|
-
app = Middleman::Application
|
120
|
-
source = File.join(app.root, app.config.source)
|
121
|
-
|
122
127
|
if dir.nil? || dir == '.'
|
123
128
|
source
|
124
129
|
else
|
125
130
|
File.join(source, dir)
|
126
131
|
end
|
127
132
|
end
|
133
|
+
|
134
|
+
def source
|
135
|
+
app = Middleman::Application
|
136
|
+
File.join(app.root, app.config.source)
|
137
|
+
end
|
138
|
+
|
139
|
+
def display_path(path)
|
140
|
+
path.sub(Regexp.new("^#{source}/"), '')
|
141
|
+
end
|
128
142
|
end
|
129
143
|
end
|
130
144
|
end
|
@@ -33,6 +33,7 @@ module Middleman
|
|
33
33
|
copy_file 'source/layouts/layout.slim', File.join(location, 'source/layouts/layout.slim')
|
34
34
|
copy_file 'source/templates/index.html.slim', File.join(location, 'source/templates/index.html.slim')
|
35
35
|
copy_file 'source/stylesheets/all.css.sass', File.join(location, 'source', options[:css_dir], 'all.css.sass')
|
36
|
+
copy_file 'source/stylesheets/_gemoji.sass', File.join(location, 'source', options[:css_dir], '_gemoji.sass')
|
36
37
|
copy_file 'source/stylesheets/pure-min.css', File.join(location, 'source', options[:css_dir], 'pure-min.css')
|
37
38
|
copy_file 'source/stylesheets/github-markdown.css', File.join(location, 'source', options[:css_dir], 'github-markdown.css')
|
38
39
|
end
|
data/middleman-tansu.gemspec
CHANGED
@@ -21,6 +21,7 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.required_ruby_version = '>= 1.9.3'
|
22
22
|
|
23
23
|
spec.add_runtime_dependency "middleman", "~> 3.3"
|
24
|
+
spec.add_runtime_dependency "middleman-livereload", "~> 3.4"
|
24
25
|
spec.add_runtime_dependency "middleman-syntax", "~> 2.0"
|
25
26
|
spec.add_runtime_dependency "middleman-gemoji", ">= 0.0.2"
|
26
27
|
spec.add_runtime_dependency "slim", "~> 3.0"
|
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.
|
4
|
+
version: 0.1.1
|
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-
|
11
|
+
date: 2015-02-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: middleman
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '3.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: middleman-livereload
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '3.4'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '3.4'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: middleman-syntax
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -284,6 +298,7 @@ files:
|
|
284
298
|
- lib/middleman-tansu/template/source/layouts/layout.slim
|
285
299
|
- lib/middleman-tansu/template/source/sample.html.md
|
286
300
|
- lib/middleman-tansu/template/source/sitemap.xml.builder
|
301
|
+
- lib/middleman-tansu/template/source/stylesheets/_gemoji.sass
|
287
302
|
- lib/middleman-tansu/template/source/stylesheets/all.css.sass
|
288
303
|
- lib/middleman-tansu/template/source/stylesheets/github-markdown.css
|
289
304
|
- lib/middleman-tansu/template/source/stylesheets/pure-min.css
|