Skip to content

Commit

Permalink
Support new signature from method in IRB > 1.15
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgemanrubia committed Jan 30, 2025
1 parent 04fa9ff commit 109d7a2
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 31 deletions.
11 changes: 7 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ PATH
remote: .
specs:
console1984 (0.2.1)
irb (~> 1.13)
irb (~> 1.15.1)
parser
rails (>= 7.0)
rainbow
Expand Down Expand Up @@ -100,7 +100,8 @@ GEM
i18n (1.14.1)
concurrent-ruby (~> 1.0)
io-console (0.7.2)
irb (1.14.0)
irb (1.15.1)
pp (>= 0.6.0)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
json (2.6.3)
Expand Down Expand Up @@ -139,7 +140,9 @@ GEM
parser (3.2.2.3)
ast (~> 2.4.1)
racc
pg (1.5.3)
pp (0.6.2)
prettyprint
prettyprint (0.2.0)
psych (5.1.2)
stringio
racc (1.7.1)
Expand Down Expand Up @@ -225,6 +228,7 @@ GEM
PLATFORMS
arm64-darwin-21
arm64-darwin-22
arm64-darwin-24
x86_64-linux

DEPENDENCIES
Expand All @@ -233,7 +237,6 @@ DEPENDENCIES
console1984!
mocha
mysql2
pg
rubocop (>= 1.18.4)
rubocop-minitest
rubocop-packaging
Expand Down
4 changes: 2 additions & 2 deletions console1984.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
spec.add_dependency 'rainbow'
spec.add_dependency 'parser'
spec.add_dependency 'rails', '>= 7.0'
spec.add_dependency 'irb', '~> 1.13'
spec.add_dependency 'irb', '~> 1.15.1'

spec.add_development_dependency 'benchmark-ips'
spec.add_development_dependency 'mocha'
Expand All @@ -38,7 +38,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'rubocop-minitest'
spec.add_development_dependency 'rubocop-rails'
spec.add_development_dependency 'sqlite3'
spec.add_development_dependency 'pg'
# spec.add_development_dependency 'pg'
spec.add_development_dependency 'mysql2'
spec.add_development_dependency 'rubyzip'
end
2 changes: 1 addition & 1 deletion lib/console1984/ext/irb/context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Console1984::Ext::Irb::Context

# This method is invoked for showing returned objects in the console
# Overridden to make sure their evaluation is supervised.
def inspect_last_value
def inspect_last_value(...)
Console1984.command_executor.execute_in_protected_mode do
super
end
Expand Down
36 changes: 12 additions & 24 deletions test/dummy/db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,58 +10,46 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2021_08_10_092639) do
create_table "console1984_audits", force: :cascade do |t|
t.integer "status", default: 0, null: false
t.text "notes"
t.integer "session_id", null: false
t.integer "auditor_id", null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["auditor_id"], name: "index_console1984_audits_on_auditor_id"
t.index ["session_id"], name: "index_console1984_audits_on_session_id"
end

ActiveRecord::Schema[7.0].define(version: 2021_05_17_203931) do
create_table "console1984_commands", force: :cascade do |t|
t.text "statements"
t.integer "sensitive_access_id"
t.integer "session_id", null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["sensitive_access_id"], name: "index_console1984_commands_on_sensitive_access_id"
t.index ["session_id", "created_at", "sensitive_access_id"], name: "on_session_and_sensitive_chronologically"
t.index ["session_id"], name: "index_console1984_commands_on_session_id"
end

create_table "console1984_sensitive_accesses", force: :cascade do |t|
t.text "justification"
t.integer "session_id", null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["session_id"], name: "index_console1984_sensitive_accesses_on_session_id"
end

create_table "console1984_sessions", force: :cascade do |t|
t.text "reason"
t.integer "user_id", null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["created_at"], name: "index_console1984_sessions_on_created_at"
t.index ["user_id", "created_at"], name: "index_console1984_sessions_on_user_id_and_created_at"
t.index ["user_id"], name: "index_console1984_sessions_on_user_id"
end

create_table "console1984_users", force: :cascade do |t|
t.string "username", null: false
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["username"], name: "index_console1984_users_on_username"
end

create_table "people", force: :cascade do |t|
t.string "name"
t.string "email"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

end

0 comments on commit 109d7a2

Please sign in to comment.