投影片網址: https://speakerdeck.com/johnlinvc/ru-he-shi-yong-byebug-lai-chu-cuo-ruby-cheng-shi
Last active
August 2, 2020 06:24
-
-
Save johnlinvc/d3cde05b8a7ed5c155498b1534e43bd8 to your computer and use it in GitHub Desktop.
Coscup 2020 Ruby Byebug
This file contains 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
def get_coupon(user_id, history) | |
if history[user_id] = true | |
return 0 | |
end | |
history[user_id] = true | |
3000 | |
end | |
puts get_coupon(1, {}) |
This file contains 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
#!/usr/bin/env ruby | |
require_relative 'my_code.rb' | |
puts eval("my"+"_"+"method") |
This file contains 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 | |
source "https://rubygems.org" | |
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } | |
# gem "rails" | |
gem 'byebug' |
This file contains 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_relative 'hidden_lib.rb' | |
puts HiddenLib.new.hello("world") |
This file contains 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 'byebug' | |
def my_method | |
byebug | |
"hello" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment