-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtopicos
136 lines (96 loc) · 1.99 KB
/
topicos
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
Indice
versões
rvm
instalação
ruby instalação
2 projects
linguagem
types
utilização
modificado a class
- versionamento (rvm)
1.8.6[-p420]
1.8.7[-p358]
1.8.7-head
1.9.1[-p431]
1.9.2-p180
1.9.2-p290
1.9.2[-p318]
1.9.2-head
1.9.3-preview1
1.9.3-rc1
1.9.3-p0
1.9.3[-p125]
1.9.3-head
-para gerenciar temos o RVM
install, manage, and work
(Ruby, Gems and IRB)
Instalação
-install packages (require later)
sudo apt-get update
sudo apt-get install build-essential <b>git-core curl</b>
Lastest RVM
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' >> ~/.bashrc
. ~/.bashrc
- install essential packages
sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion
Ruby instalation
rvm install 1.9.3
ruby -v
rvm --default use 1.9.3
- Gemsets
new 2 projects
oldVersion
file .rvmrc
rvm use 1.8.7@oldVersion
rvm gemset create oldVersion
newVersion
file .rvmrc
rvm use 1.9.3@newVersion
rvm gemset create newVersion
gem install haml
gem list
rvm list
rvm gemset list
Isolated projects
linguagem interpretada
Everything is object
true, nil, false
IRB
Object
Numeric
Integer
Fixnum
Bignum
float
String
Symbol
Array
Hash
Regexp
1
1,5
"This is String".class
:name
[1, "asfsd", [1, 2]]
{"RS" => 10_914_128, "SC" => 6_248_436, "PR" => 10_439_601}
explain the diference bettwen hash -> array
array nao tem key
hash custom key
Contactening strings
puts "isso eh um teste de #{teste}"
var = "vazio"
var.empty? # => false
class String
def empty?
self == "vazio" || self == ""
end
end
class String
def twoTimes
self + self
end
end
"eduardo".twoTimes
1.twoTimes