Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitead0f50

Browse files
author
Hubot
committed
Sync changes from upstream repository
1 parent218f6d1 commitead0f50

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

‎spec/content/blog_date_spec.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
require'spec_helper'
22

33
describe'Blog Date'do
4-
beforedo
5-
@posts=`git diff --name-only --diff-filter=ACMRTUXB master... | grep .md`.split("\n")
6-
end
7-
84
it'is not in the past'do
9-
@posts.eachdo |post|
5+
posts.eachdo |post|
106
matches=post.match(%r{(\d{4}-\d{2}-\d{2})-})
117
nextunlessmatches
128

‎spec/spec_helper.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,21 @@
1111

1212
Dir.glob('tasks/*.rake').each{ |r|loadr}
1313

14+
# All the blog posts we're interested in checking. This means we're looking at
15+
# files that have changed on this particular branch we're on.
16+
#
17+
# Returns an Array of String filenames.
18+
defposts
19+
return@postsifdefined?@posts
20+
21+
diffable_files=`git diff -z --name-only --diff-filter=ACMRTUXB origin/master`.split("\0")
22+
23+
@posts=diffable_files.selectdo |filename|
24+
ext=File.extname(filename)
25+
ext ==".md" ||ext ==".html"
26+
end
27+
end
28+
1429
# this does the file serving
1530
classImplictIndex
1631
definitialize(root)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp