Literals are ugly. Let's remove them.
True/false:
2.0.0p0 :001 > !Date
=> false
2.0.0p0 :002 > require Date.to_s.downcase
=> true
Integers and floats:
Literals are ugly. Let's remove them.
True/false:
2.0.0p0 :001 > !Date
=> false
2.0.0p0 :002 > require Date.to_s.downcase
=> true
Integers and floats:
~> irb | |
1.9.3-p194 :001 > Date | |
NameError: uninitialized constant Date | |
from (irb):1 | |
from /Users/thomasstuart/.rvm/rubies/ruby-1.9.3-p194/bin/irb:16:in `<main>' | |
1.9.3-p194 :002 > exit | |
~> rvm use 2.0.0 | |
Using /Users/thomasstuart/.rvm/gems/ruby-2.0.0-p0 | |
~> irb | |
2.0.0p0 :001 > Date |
!some-branch ~/some_repo> gst | |
# On branch some-branch | |
# Changes not staged for commit: | |
# (use "git add <file>..." to update what will be committed) | |
# (use "git checkout -- <file>..." to discard changes in working directory) | |
# | |
# modified: app/models/user.rb | |
# | |
no changes added to commit (use "git add" and/or "git commit -a") | |
!some-branch ~/some_repo> ga app/models/user.rb |
> rvm install 1.9.3 | |
Searching for binary rubies, this might take some time. | |
No binary rubies available for: osx/10.8/x86_64/ruby-1.9.3-p392. | |
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies. | |
Installing requirements for osx/10.8/x86_64, might require sudo password | |
Warning: Your Xcode (4.5.2) is outdated | |
Please install Xcode 4.6. | |
==> Upgrading git <- WAT | |
==> Downloading http://git-core.googlecode.com/files/git-1.8.1.4.tar.gz######################################################################## 100.0% | |
==> make prefix=/usr/local/Cellar/git/1.8.1.4 CC=cc CFLAGS= LDFLAGS= install |
A search for 'using' on http://www.ruby-doc.org/core-2.0/index.html returns, well, nothing. So, what is it?
2.0.0p0 :001 > method(:using)
=> #<Method: main.using>
2.0.0p0 :002 > _.source_location
=> nil
So it's some kind of method on main
with no source location. Hmm. Well, the changelog mentions ri ruby:syntax
. Let's try that.
~/code/200-test> ri ruby:syntax | cat
(http://www.ruby-lang.org/en/news/2013/02/24/ruby-2-0-0-p0-is-released/)
Documentation
We have also made documentation improvements which many rubyists have requested. We have added a huge amount of rdoc for modules and methods. 2.0.0 will be around 75% documented while 1.9.3 was about 60%. Also, we have added a description of Ruby's syntax. You can see:
ri ruby:syntax
#unverified.list obtained from https://gist.github.com/raw/865b05630be54544ca72/a1a0c114d5eab0e65efccc941ca013fd06e6f43c/unverified.list | |
File.readlines("unverified.list").map do |line| | |
line.split.last.gsub("./", "").gsub(/-(\d+).*/, "") | |
end.sort.uniq.each do |gem| | |
in_gemfile_lock = system "grep -q #{gem} Gemfile.lock" | |
puts "Unsafe #{gem}" if in_gemfile_lock | |
end |
(apply str (map #(str "String value for " %) some-seq)) |
for file in $(find . -name '*.rb') | |
do | |
if [ $(egrep "\b[A-Z]" $file | wc -l) -gt $(egrep "(class|module)" $file | wc -l) ] | |
then | |
echo $file " fails" | |
fi | |
done | wc -l |
(function() { | |
var C = JS.Console; | |
var adapterConditions = {}; | |
var registerAdapterCondition = function(check, initializer) { | |
adapterConditions[check] = initializer; | |
}; | |
var configureC = function() { | |
C.adapter = new C.Base(); |