- 2025/10/22にRails8.1がリリースされましたね
- Ruby on Rails 8.1 Release Notes — Ruby on Rails Guidesにリリースノートが書かれている
- 上記メジャーフィーチャーに含まれなかったマイナーフィーチャーのうち、気になったものをざっくりまとめています
- 間違いの指摘や、これも追加してくれ〜という物があればコメントお願いします
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'prism' | |
| require 'ripper' | |
| chars = %w[1 % = a b == * . ( ) , % ? ** & [ ] { } | ; : => ~ ! ^ || && '' .. ... < > + $a @a] + [' ', "\n", ' if ', ' and ',' rescue ', ' in '] | |
| p seed: seed = rand(10000) | |
| srand seed | |
| $VERBOSE=nil | |
| (3..10).each do |n| | |
| [chars.size**n, 100000].min.times do |i| | |
| code = n.times.map{chars.sample}.join | |
| p [n, i] if i % 1000 == 0 |
In programming languages, literals are textual representations of values in the source code. This is a syntactical concept.
Some examples:
7 # integer literal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'erb' | |
| class ERB | |
| class ERBOut | |
| Buffer = String # SafeBuffer if rails | |
| def initialize(s='') | |
| @str = Buffer.new(s) | |
| end | |
こんにちは。今後、GPT-4を使ったアプリケーションやサービスがたくさん登場してくると思います。その中には、たとえばSNSを利用したbotもたくさん出てくるでしょう(現在でもすでにありますけれど)。そこで質問なんですが、SNSでおしゃべりしている相手が、人間なのか、GPT-4などの技術を使ったAIなのかを識別するにはどのような会話をしてみればいいでしょうか。一般的なAIでは難しいかもしれないので、GPT-4に限ってもいいです。あなたの考えを聞かせてください。
GPT-4のような高度なAIと人間を識別するのは、時に難しいことがあります。しかし、いくつかの方法を試してみることで、相手が人間かAIかを見極めることができるかもしれません。
- 複雑な感情やニュアンスについて尋ねる: AIは感情やニュアンスを理解するのが苦手です。複雑な感情を表現する文章やシチュエーションについて尋ねてみて、その反応を見てください。
- Rails 7.0.1 is compatible with Ruby 3.1.0.
- Rails 7.0.1 addes net-smtp, net-imap and net-pop gems as Action Mailbox and Action Mailer dependency, you do not need to add them explicitly in your application Gemfile anymore.
- thor 1.2.1 has been released. You will not see
DidYouMean::SPELL_CHECKERS.mergedeprecate warnings anymore.
- Use Rails 6.1.5 to support
database.ymlwith aliases andsecrets.ymlwith aliases.
-- Build better software with more intuitive, maintainable, scalable, and high-performance Ruby code
「Rubyの磨きかた -- わかりやすくてメンテナンスしやすい、スケール可能で高性能なRubyコードでソフトウェアを上手につくろう」みたいな感じ?
https://www.packtpub.com/product/polished-ruby-programming/9781801072724
- Publication date: June 2021
- Publisher: Packt
- Pages: 381
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # frozen_string_literal: true | |
| module Bowling | |
| class Game | |
| def initialize(marks) = (@frame_builder = Frame.builder(marks)) | |
| def score = frames.sum(&:score) | |
| private | |
| def frames = (@frames ||= Array.new(10){ build_frame(final?(_1)) }) | |
| def build_frame(final) = @frame_builder.call(final) |
NewerOlder