gem作成してるメモ
早速なんかCI落ちてる
code: plain
Resquirrel
has a version number
does something useful (FAILED - 1)
Failures:
1) Resquirrel does something useful
Failure/Error: expect(false).to eq(true)
expected: true
got: false
(compared using ==)
Diff:
@@ -1 +1 @@
-true
+false
# ./spec/resquirrel_spec.rb:9:in `block (2 levels) in <top (required)>'
Finished in 0.01742 seconds (files took 0.07813 seconds to load)
2 examples, 1 failure
Failed examples:
rspec ./spec/resquirrel_spec.rb:8 # Resquirrel does something useful
わざと失敗するテストらしい。ほ〜。
code: ruby
it "does something useful" do
expect(false).to eq(true)
end
「偽は真」
開発時gem
TODO: githubのci動かす
TODO: notionのAPIが動くか確かめる
TODO: openaiのAPIが動くか確かめる
リポジトリシークレット入れたら普通に動いた ナイス
https://scrapbox.io/files/662c8b02ed88500025de8c69.png
責務の意識しっかりしよう
今はテストだからclientの中でデータの形変えてるけど、それはmainでやろう
open aiからも帰ってきた
https://scrapbox.io/files/662c8b27a506550024e757fa.png
じゃあ中身を整えていく
1. PRがマージされる時のイベントを取得しよう
これドキュメントどこなんだろう
payloadっていうらしい 自分の知りたいのは
2. その中身を見て、notionに投げる
できた。
PRが閉じた時に何故か実行されない
runs-on抜けてたわ
いい感じになったが、URLの中身が取れない
もう実際にやってみてみる
ゴール
1. 中身と、PRのリンクができている
2. テストがちゃんと書けている
ユーザーが呼び出す時どうするか考えている
公開
なんかgitをあげると勝手にバージョン上がる?
気のせいだった
アプデまでちゃんとやりたい
多分gitをあげる
リリース作る
その時に一緒にgemのバージョンもあげる
マージされたらgemにpushじゃないかな
二重で実行される感じになってた
大元の方直さないとだ
混乱、後で直す
bundle installしたのに呼び出せない
Run ruby lib/resquirrel/main.rb
lib/resquirrel/main.rb:3:in <main>': undefined method new' for module Resquirrel (NoMethodError)
resquirrel = Resquirrel.new
module??
- 解決した
Run bundle install
Your bundle is locked to resquirrel (0.1.1) from rubygems repository
found in that source. That means the author of resquirrel (0.1.1) has removed
it. You'll need to update your bundle to a version other than resquirrel (0.1.1)
that hasn't been removed in order to install.
わかった。ディレクトリの階層が違った。。。
なるほど、指定された場所があるのか
これ説明に書かないとだ
require 'resquirrel'
Resquirrel.generate_release_note
エラーは出ていないのにアップデートされない
code: plain
Run ruby lib/resquirrel/main.rb
notionのリンク間違ってたっぽい
一通りうまくいったのでgemはgemで管理しつつ、actionsで公開することを考えてみる
まずテスト書いてから
webmockはbody指定しなければなんでも良くなる。1つ指定すると、1文字単位で合ってないと怒られる
自分でリリースをgitに作らなくてもrake releaseでいい感じにしてくれた