ENV and IRB
来源:互联网 发布:有抢房秒杀的软件吗 编辑:程序博客网 时间:2024/05/22 16:44
1. ENV
ENV can be inherited by children, but what children do will be transparent to parent.
2. irb
Ways to enable the completion:
The code bellow illustrate the subsession.
While, if you pass an object to the irb command, then the object will be binding to the self, and you can involk all the method directly without the object name.
ENV can be inherited by children, but what children do will be transparent to parent.
puts "In parent, term = #{ENV['TERM']}" fork doputs "Start of child 1, term = #{ENV['TERM']}" ENV['TERM'] = "ansi" fork doputs "Start of child 2, term = #{ENV['TERM']}" end Process.wait puts "End of child 1, term = #{ENV['TERM']}" endProcess.waitputs "Back in parent, term = #{ENV['TERM']}"
2. irb
2.1 complete facility
Ways to enable the completion:
irb -r irb/completionirb -r irb/completion
2. subsession and bind
The code bellow illustrate the subsession.
irb(main):001:0> a = 12=> 12irb(main):002:0> irbirb#1(main):001:0> a = [1,2,3]=> [1, 2, 3]irb#1(main):002:0> jobs=> #0->irb on main (#<Thread:0x007fdd328bc8d0>: stop)#1->irb#1 on main (#<Thread:0x007fdd339fb6a0>: running)irb#1(main):003:0> fg 0=> #<IRB::Irb: @context=#<IRB::Context:0x007fdd339c82c8>, @signal_status=:IN_EVAL, @scanner=#<RubyLex:0x007fdd3281d690>>irb(main):003:0> a=> 12
While, if you pass an object to the irb command, then the object will be binding to the self, and you can involk all the method directly without the object name.
irb(main):001:0> a = [1,2,3]=> [1, 2, 3]irb(main):002:0> irb airb#1([1, 2, 3]):001:0> size=> 3irb#1([1, 2, 3]):002:0> reverse=> [3, 2, 1]irb#1([1, 2, 3]):003:0> self=> [1, 2, 3]irb#1([1, 2, 3]):004:0> irb_exit=> #<IRB::Irb: @context=#<IRB::Context:0x007fd2fa2c4320>, @signal_status=:IN_EVAL, @scanner=#<RubyLex:0x007fd2fb809708>>irb(main):003:0> a=> [1, 2, 3]irb(main):004:0> sizeNameError: undefined local variable or method `size' for main:Objectfrom (irb):4from /usr/bin/irb:12:in `<main>'irb(main):005:0>
0 0
- ENV and IRB
- Rerun DTE BI Env and Refresh Hudson Preflight Env
- env
- env
- env
- env
- Application ENV parameter:CLASSPATH and AF_CLASSPATH
- 交互式 Ruby Shell irb
- Cisco IRB BVI
- irb 與 ruby 指令
- 交互式Ruby Shell irb
- #/usr/bin/env python and #!/usr/local/bin/python
- cross-compile env set and build(eg,uImage)
- JMeter daily notes --- env setup and install JMeter
- irb是干什么的 ruby
- The Difference between <resource-ref> and <resource-env-ref>,the title should be long...
- mapped-name/lookup/jndi-name and any ResourceProvider could’t process resource-env-ref named
- Install Rouge and Pyrouge for python 2.7 (conda virtual env) on Linux 64
- Spring JSR-250注解
- Linux下Mysql的rpm的安装
- [about phd]读博=
- ZOJ 3882Help Bob
- [黑马程序员](第50天)一些平时刷的题(3)
- ENV and IRB
- Spring Bean 的作用域、初始化和销毁
- 初识HTML+ CSS
- HDUOJ 1022 (栈的基本应用)火车进站问题I
- 如何编写Xcode 插件
- 初识html
- poj_1877
- 索引的建立方式,直接会影响到查询性能。
- ZOJ 3888Twelves Monkeys