Skip to content

Commit

Permalink
Merge pull request #37 from minodisk/master
Browse files Browse the repository at this point in the history
v0.1.4
  • Loading branch information
minodisk committed Feb 19, 2016
2 parents 06089a3 + b170090 commit b8a3ede
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .goxc.json
Expand Up @@ -5,7 +5,7 @@
"package"
],
"BuildConstraints": "linux darwin windows",
"PackageVersion": "0.1.3",
"PackageVersion": "0.1.4",
"TaskSettings": {
"publish-github": {
"body": "[Changes](https://github.com/minodisk/qiitactl/blob/master/CHANGELOG.md)",
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,10 @@
## v0.1.4

Fix bug

- Fix bug in multi comment
- Parse as meta from the first of comment opener to the last of comment closer.

## v0.1.3

Remove debug code
Expand Down
10 changes: 5 additions & 5 deletions README.md
Expand Up @@ -4,7 +4,7 @@ Command line interface to manage your posts in Qitta.

## Description

`qiitactl` can fetch your posts from Qiita and write them as markdown files to your local. After you edit the file in the editor you like, `qiitactl update post -f path/to/file.md`. Then, the post will be updated in Qiita. You can also generate a new file for post, create a new post from the file and delete a post with this tool.
`qiitactl` can fetch your posts from Qiita and write them as markdown files to your local. After you edit the file in the editor you like, `qiitactl update post path/to/file.md`. Then, the post will be updated in Qiita. You can also generate a new file for post, create a new post from the file and delete a post with this tool.

## Usage

Expand All @@ -22,15 +22,15 @@ qiitactl fetch posts
### Update a post

```bash
qiitactl update post -f path/to/file.md
qiitactl update post path/to/file.md
```

### Create a new post

```bash
qiitactl generate file -t "The title of new post"
qiitactl generate file "The title of new post"
vim path/to/file.md
qiitactl create post -f path/to/file.md
qiitactl create post path/to/file.md
```

### And more:
Expand All @@ -44,7 +44,7 @@ qiitactl help
To install, use `go get`:

```bash
go get -d github.com/minodisk/qiitactl
go get github.com/minodisk/qiitactl
```

## Contribution
Expand Down
2 changes: 1 addition & 1 deletion model/post.go
Expand Up @@ -32,7 +32,7 @@ const (
)

var (
rPostDecoder = regexp.MustCompile(`^(?ms:\n*<!--(.*)-->\n{2,}# +(.*?)\n+(.*))$`)
rPostDecoder = regexp.MustCompile(`^(?ms:\n*<!--(.*?)-->\n{2,}# +(.*?)\n+(.*))$`)
tmpl = func() (t *template.Template) {
t = template.New("postfile")
template.Must(t.Parse(postTemplate))
Expand Down
33 changes: 32 additions & 1 deletion model/post_test.go
Expand Up @@ -1733,6 +1733,37 @@ Paragraph
}
}

func TestPostDecodeWithMultiComment(t *testing.T) {
testutil.CleanUp()
defer testutil.CleanUp()

var post model.Post
err := post.Decode([]byte(`<!--
id: ""
url: ""
created_at: 2016-02-17T13:08:30+09:00
updated_at: 2016-02-17T13:08:30+09:00
private: false
coediting: false
tags:
- Qiita
- Go
team: null
-->
# Example Title
<!--
This is not meta
-->
# This is not title of this post
`))
if err != nil {
t.Fatal(err)
}
}

func TestPostDecodeWithWrongTag(t *testing.T) {
testutil.CleanUp()
defer testutil.CleanUp()
Expand Down Expand Up @@ -1765,7 +1796,7 @@ Paragraph
}
}

func TestDecodeWithWrongTitle(t *testing.T) {
func TestPostDecodeWithWrongTitle(t *testing.T) {
testutil.CleanUp()
defer testutil.CleanUp()

Expand Down

0 comments on commit b8a3ede

Please sign in to comment.