File tree Expand file tree Collapse file tree 3 files changed +14
-9
lines changed
app/lib/mulukhiya/controller Expand file tree Collapse file tree 3 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,8 @@ Layout/ArrayAlignment:
2727 EnforcedStyle : with_fixed_indentation
2828Layout/EmptyLineAfterGuardClause :
2929 Enabled : false
30+ Layout/EndAlignment :
31+ EnforcedStyleAlignWith : variable
3032Layout/EndOfLine :
3133 EnforcedStyle : lf
3234Layout/FirstArgumentIndentation :
@@ -125,6 +127,8 @@ Sequel:
125127 - app/migration/**/*.rb
126128Sequel/ConcurrentIndex :
127129 Enabled : false
130+ Sequel/IrreversibleMigration :
131+ Enabled : false
128132Style/AsciiComments :
129133 Enabled : false
130134Style/ConditionalAssignment :
Original file line number Diff line number Diff line change @@ -57,15 +57,15 @@ class MastodonController < Controller
5757 put '/api/:version/statuses/:id' do
5858 verify_token_integrity!
5959 purpose = request . env [ 'HTTP_X_MULUKHIYA_PURPOSE' ]
60- body = case purpose
61- when nil , '' , 'media_update'
62- source = sns . fetch_status_source ( params [ :id ] , { headers : @headers } )
63- { status : source [ 'text' ] , media_attributes : params [ :media_attributes ] } . compact
64- when 'tag'
65- { status : params [ :status ] , media_attributes : params [ :media_attributes ] } . compact
66- else
67- raise Ginseng ::ValidateError , "unknown purpose: #{ purpose } "
68- end
60+ case purpose
61+ when nil , '' , 'media_update'
62+ source = sns . fetch_status_source ( params [ :id ] , { headers : @headers } )
63+ body = { status : source [ 'text' ] , media_attributes : params [ :media_attributes ] } . compact
64+ when 'tag'
65+ body = { status : params [ :status ] , media_attributes : params [ :media_attributes ] } . compact
66+ else
67+ raise Ginseng ::ValidateError , "unknown purpose: #{ purpose } "
68+ end
6969 raise Ginseng ::ValidateError , 'media_attributes is required' if body . empty?
7070 reporter . response = sns . update_status ( params [ :id ] , body , { headers : @headers } )
7171 @renderer . message = reporter . response . parsed_response
Original file line number Diff line number Diff line change @@ -532,6 +532,7 @@ CIでは `config/local.yaml` に `controller: mastodon|misskey` のみ設定さ
532532以下はユーザーから都度指示される。指示があり次第ここに追記する。
533533
534534- メソッド末尾でも `return` を省略しない(暗黙のreturnを使わない)
535+ - インデントは常に2スペース。見栄えのための位置揃え(代入の右辺にcase/if式を置いて深くインデントする等)は使わない。`x = case ...` ではなく、各分岐内で個別に代入する
535536
536537# ## ドキュメント表記規約
537538
You can’t perform that action at this time.
0 commit comments