Skip to content
This repository was archived by the owner on Apr 14, 2023. It is now read-only.

Commit 29fbdbc

Browse files
authored
v2.0.9 (#103)
* fix(app): viaが空文字の場合に表示が壊れる #102 * docs(CHANGELOG): v2.0.9 * chore(deps): 依存関係を更新
1 parent 3c6987e commit 29fbdbc

5 files changed

Lines changed: 53 additions & 13 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
## [Unreleased]
44

5+
## [v2.0.9] - 2022-12-11
6+
7+
### Fixed
8+
9+
- viaが空文字の場合に表示が壊れる
10+
511
## [v2.0.8] - 2022-10-28
612

713
### Added
@@ -159,7 +165,8 @@
159165

160166
- リリースしました! 😸
161167

162-
[unreleased]: https://github.com/arrow2nd/nekome/compare/v2.0.8...HEAD
168+
[unreleased]: https://github.com/arrow2nd/nekome/compare/v2.0.9...HEAD
169+
[v2.0.9]: https://github.com/arrow2nd/nekome/compare/v2.0.8...v2.0.9
163170
[v2.0.8]: https://github.com/arrow2nd/nekome/compare/v2.0.7...v2.0.8
164171
[v2.0.7]: https://github.com/arrow2nd/nekome/compare/v2.0.6...v2.0.7
165172
[v2.0.6]: https://github.com/arrow2nd/nekome/compare/v2.0.5...v2.0.6

app/layout_tweet.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,11 @@ func createTweetDetailLayout(t *twitter.TweetObj) string {
176176
layout = replaceLayoutTag(layout, "{created_at}", date)
177177

178178
// 投稿元クライアント
179-
layout = replaceLayoutTag(layout, "{via}", t.Source)
179+
via := t.Source
180+
if via == "" {
181+
via = "unknown"
182+
}
183+
layout = replaceLayoutTag(layout, "{via}", via)
180184

181185
// メトリクス
182186
metrics := createTweetMetricsLayout(t)

app/layout_tweet_test.go

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,11 +360,12 @@ func TestCreateTweetDetailLayout(t *testing.T) {
360360
},
361361
}
362362

363+
p, _ := time.Parse(time.RFC3339, o.CreatedAt)
364+
d := p.Local().Format("2006/01/02 15:04:05")
365+
363366
t.Run("作成できるか", func(t *testing.T) {
364367
s := createTweetDetailLayout(o)
365368

366-
p, _ := time.Parse(time.RFC3339, o.CreatedAt)
367-
d := p.Local().Format("2006/01/02 15:04:05")
368369
want := fmt.Sprintf(
369370
`[style_detail]%s | via nekome for term
370371
[style_like]10likes[-:-:-] [style_rt]5rts[-:-:-][-:-:-]`,
@@ -373,6 +374,20 @@ func TestCreateTweetDetailLayout(t *testing.T) {
373374

374375
assert.Equal(t, want, s)
375376
})
377+
378+
t.Run("viaが空文字の場合にunknownが入るか", func(t *testing.T) {
379+
o := *o
380+
o.Source = ""
381+
s := createTweetDetailLayout(&o)
382+
383+
want := fmt.Sprintf(
384+
`[style_detail]%s | via unknown
385+
[style_like]10likes[-:-:-] [style_rt]5rts[-:-:-][-:-:-]`,
386+
d,
387+
)
388+
389+
assert.Equal(t, want, s)
390+
})
376391
}
377392

378393
func TestCreateTweetMetricsLayout(t *testing.T) {

go.mod

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ require (
66
code.rocketnine.space/tslocum/cbind v0.1.5
77
github.com/BurntSushi/toml v1.2.1
88
github.com/atotto/clipboard v0.1.4
9-
github.com/dghubble/oauth1 v0.7.1
9+
github.com/dghubble/oauth1 v0.7.2
1010
github.com/g8rswimmer/go-twitter/v2 v2.1.4
1111
github.com/manifoldco/promptui v0.9.0
1212
github.com/mattn/go-runewidth v0.0.14
1313
github.com/skanehira/clipboard-image/v2 v2.0.0
1414
github.com/spf13/pflag v1.0.5
15-
golang.org/x/term v0.2.0
15+
golang.org/x/term v0.3.0
1616
)
1717

1818
require (
@@ -21,17 +21,17 @@ require (
2121
github.com/gdamore/encoding v1.0.0 // indirect
2222
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
2323
github.com/pmezard/go-difflib v1.0.0 // indirect
24-
github.com/rivo/uniseg v0.4.2 // indirect
25-
golang.org/x/text v0.4.0 // indirect
24+
github.com/rivo/uniseg v0.4.3 // indirect
25+
golang.org/x/text v0.5.0 // indirect
2626
gopkg.in/yaml.v3 v3.0.1 // indirect
2727
)
2828

2929
require (
3030
github.com/gdamore/tcell/v2 v2.5.3
3131
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8
32-
github.com/rivo/tview v0.0.0-20220916081518-2e69b7385a37
32+
github.com/rivo/tview v0.0.0-20221210235652-e6cd7110ac63
3333
github.com/stretchr/testify v1.8.1
34-
golang.org/x/crypto v0.3.0
34+
golang.org/x/crypto v0.4.0
3535
golang.org/x/sync v0.1.0
36-
golang.org/x/sys v0.2.0 // indirect
36+
golang.org/x/sys v0.3.0 // indirect
3737
)

go.sum

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
1818
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
1919
github.com/dghubble/oauth1 v0.7.1 h1:JjbOVSVVkms9A4h/sTQy5Jb2nFuAAVb2qVYgenJPyrE=
2020
github.com/dghubble/oauth1 v0.7.1/go.mod h1:0eEzON0UY/OLACQrmnjgJjmvCGXzjBCsZqL1kWDXtF0=
21+
github.com/dghubble/oauth1 v0.7.2 h1:pwcinOZy8z6XkNxvPmUDY52M7RDPxt0Xw1zgZ6Cl5JA=
22+
github.com/dghubble/oauth1 v0.7.2/go.mod h1:9erQdIhqhOHG/7K9s/tgh9Ks/AfoyrO5mW/43Lu2+kE=
2123
github.com/g8rswimmer/go-twitter/v2 v2.1.4 h1:BLnf4ZTIpRItlICbjIQGKnT9jcum9dQYHxJF7/hrJP0=
2224
github.com/g8rswimmer/go-twitter/v2 v2.1.4/go.mod h1:/55xWb313KQs25X7oZrNSEwLQNkYHhPsDwFstc45vhc=
2325
github.com/gdamore/encoding v1.0.0 h1:+7OoQ1Bc6eTm5niUzBa0Ctsh6JbMW6Ra+YNuAtDBdko=
@@ -40,10 +42,14 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
4042
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
4143
github.com/rivo/tview v0.0.0-20220916081518-2e69b7385a37 h1:cTzFg1FfTXwXuODi7Doz70hsW+dAye1OBwAFWHCqmww=
4244
github.com/rivo/tview v0.0.0-20220916081518-2e69b7385a37/go.mod h1:YX2wUZOcJGOIycErz2s9KvDaP0jnWwRCirQMPLPpQ+Y=
45+
github.com/rivo/tview v0.0.0-20221210235652-e6cd7110ac63 h1:4kfxHWea5BNbvgK2+branQdsSFld55Veww8wac8utK4=
46+
github.com/rivo/tview v0.0.0-20221210235652-e6cd7110ac63/go.mod h1:YX2wUZOcJGOIycErz2s9KvDaP0jnWwRCirQMPLPpQ+Y=
4347
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
4448
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
4549
github.com/rivo/uniseg v0.4.2 h1:YwD0ulJSJytLpiaWua0sBDusfsCZohxjxzVTYjwxfV8=
4650
github.com/rivo/uniseg v0.4.2/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
51+
github.com/rivo/uniseg v0.4.3 h1:utMvzDsuh3suAEnhH0RdHmoPbU648o6CvXxTx4SBMOw=
52+
github.com/rivo/uniseg v0.4.3/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
4753
github.com/skanehira/clipboard-image/v2 v2.0.0 h1:Kp+RNOgIlgzDkP3EskwuBnM0Fk4sc+HgcWE5RC+PnNI=
4854
github.com/skanehira/clipboard-image/v2 v2.0.0/go.mod h1:NXSYl4FJinIUFKJfeP1lGz8DIEUYjnEqwdMZ777S1E0=
4955
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
@@ -56,8 +62,10 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
5662
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
5763
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
5864
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
59-
golang.org/x/crypto v0.3.0 h1:a06MkbcxBrEFc0w0QIZWXrH/9cCX6KJyWbBOIwAn+7A=
60-
golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4=
65+
golang.org/x/crypto v0.2.0 h1:BRXPfhNivWL5Yq0BGQ39a2sW6t44aODpfxkWjYdzewE=
66+
golang.org/x/crypto v0.2.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4=
67+
golang.org/x/crypto v0.4.0 h1:UVQgzMY87xqpKNgb+kDsll2Igd33HszWHFLmpaRMq/8=
68+
golang.org/x/crypto v0.4.0/go.mod h1:3quD/ATkf6oY+rnes5c3ExXTbLc8mueNue5/DoinL80=
6169
golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=
6270
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
6371
golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -68,15 +76,21 @@ golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBc
6876
golang.org/x/sys v0.0.0-20220318055525-2edf467146b5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
6977
golang.org/x/sys v0.2.0 h1:ljd4t30dBnAvMZaQCevtY0xLLD0A+bRZXbgLMLU1F/A=
7078
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
79+
golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ=
80+
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
7181
golang.org/x/term v0.0.0-20201210144234-2321bbc49cbf/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
7282
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
7383
golang.org/x/term v0.2.0 h1:z85xZCsEl7bi/KwbNADeBYoOP0++7W1ipu+aGnpwzRM=
7484
golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
85+
golang.org/x/term v0.3.0 h1:qoo4akIqOcDME5bhc/NgxUdovd6BSS2uMsVjB56q1xI=
86+
golang.org/x/term v0.3.0/go.mod h1:q750SLmJuPmVoN1blW3UFBPREJfb1KmY3vwxfr+nFDA=
7587
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
7688
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
7789
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
7890
golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg=
7991
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
92+
golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM=
93+
golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
8094
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
8195
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
8296
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=

0 commit comments

Comments
 (0)