Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
ca99645
exercite 1.
caberoDaniel Jul 11, 2017
95666bb
exercite 1.
caberoDaniel Jul 11, 2017
8afccd1
This is the Question and Answer about Ruby
ReinaldoAguilar Jul 11, 2017
44e0f5c
This practitice with operator and convert second
ReinaldoAguilar Jul 11, 2017
e85616c
tasks
666nonak666 Jul 11, 2017
02dd0d9
Homewor
Jul 11, 2017
eddee75
Homework
Jul 11, 2017
253f114
Homework
Jul 11, 2017
460d422
Homework Practice #1
Jul 11, 2017
dcf5fdd
Delete unnecessary files
Jul 11, 2017
05da84c
Homework Update Question 3
Jul 11, 2017
8e88539
Homework
Jul 11, 2017
5c879c0
practice
jpaitken Jul 11, 2017
31273e8
practice adding files
jpaitken Jul 11, 2017
489f30c
Homework
NandoOU Jul 11, 2017
ab9da5d
Merge pull request #1 from caberoDaniel/feature/test
karimeSalomon Jul 11, 2017
1fadf28
some fixes
Jul 11, 2017
eabbe99
exercite 2.
caberoDaniel Jul 12, 2017
1257d57
Task3 about variable and input
ReinaldoAguilar Jul 12, 2017
53244f9
assignment two and some fixes
Jul 12, 2017
b0058d9
Homework #2
Jul 12, 2017
ec17ac1
2nd practice
jpaitken Jul 12, 2017
f8e259d
Homework2
NandoOU Jul 12, 2017
1e8ed9f
tasks 2
666nonak666 Jul 12, 2017
db7046a
Merge pull request #2 from daniel-m10/master
karimeSalomon Jul 12, 2017
91d855d
exercite 2.
caberoDaniel Jul 13, 2017
0f6293b
Homework #3 and change of folders
Jul 13, 2017
826f65a
assignment three
Jul 13, 2017
ced34d3
This is the task 4 moudule,mixin
ReinaldoAguilar Jul 13, 2017
8261b14
Practice3
NandoOU Jul 13, 2017
c4bddfd
tasks 3
666nonak666 Jul 13, 2017
ebc1285
tasks 3 import
666nonak666 Jul 13, 2017
fafe1c9
task 4
jpaitken Jul 13, 2017
243540f
task 4
jpaitken Jul 13, 2017
75ffb92
assignment four
Jul 14, 2017
986a26b
task5
jpaitken Jul 14, 2017
cb2b88f
Homework4
NandoOU Jul 14, 2017
905baf0
Ruby exercises
Jul 15, 2017
932812e
Ruby exercises
Jul 15, 2017
eb8d82d
Homework #4 - Array and Hash
Jul 16, 2017
152cb4b
Merge pull request #3 from pablopzsj/master
karimeSalomon Jul 16, 2017
7ed2f7d
Ruby Practice5
Jul 17, 2017
36bce54
Merge pull request #4 from ReinaldoAguilar/master
karimeSalomon Jul 17, 2017
5c0d71c
Merge pull request #5 from jpaitken/master
karimeSalomon Jul 17, 2017
76f9087
Merge pull request #6 from 666nonak666/master
karimeSalomon Jul 17, 2017
dfeba2b
Merge pull request #7 from NandoOU/master
karimeSalomon Jul 17, 2017
d2794be
Merge pull request #8 from caberoDaniel/feature/test
karimeSalomon Jul 17, 2017
69bf49b
Merge pull request #9 from daniel-m10/master
karimeSalomon Jul 17, 2017
d0304a9
Task5
ReinaldoAguilar Jul 17, 2017
e5e3419
task6
ReinaldoAguilar Jul 18, 2017
5c759b8
Task6
ReinaldoAguilar Jul 18, 2017
ac17411
task6
ReinaldoAguilar Jul 18, 2017
10910fc
EXAMEN RESUELTO AT03
ReinaldoAguilar Jul 18, 2017
e03e18a
BDD and Cucumber
ReinaldoAguilar Jul 20, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions DanielCabero/Practice1/RubyLanguage
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

Ruby

1.-Whats is ruby
Ruby is an open source, interpreted, object-oriented programming language created by Yukihiro Matsumoto.
Who chose the gemstone's name to suggest "a jewel of a language."

Ruby is designed to be simple, complete, extensible, and portable.

The Ruby programming language was created by Yukihiro Matsumoto and is named after the birthstone of one his colleagues.
Interestingly, the pearl (as in the Perl language) is the June gemstone, while ruby is the July gemstone.
This makes the subtle suggestion that Ruby is a step forward from Perl.

The syntax is very basic and it is completely object-oriented.
This means every type of data handled by the language is treated as an object, even data types as simple as integers.

Ruby is open source and freely available for both development and deployment.

2.-Pros and cons

pros cons
Easily used Slow processing
Not declared variables MultiThreads
Not used ";" Scalability issues
Very easy learn Boot Speed
Flexibility Consume resources
Not implements class
Large community

3 According what we talked today, what are the 3 testing tiers?

The fisrt level is the implement the unit test in develop fase, it is the embrace the higher test.
The second level is API test for testing with the data under the application, see the atributes.
The third level is UI test for testing the user interface the changes the variables in the user interface.
31 changes: 31 additions & 0 deletions DanielCabero/Practice1/examples.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#--*--coding :utf 8-*-
puts "I will now count my fruts"

#I will count the banana fruit.
Bananas = 25+30/6
puts "Banana :#{Bananas}"

# exercises 2
# this is the error the variable no defined or initial
# undefined local variable or method `stroberry' for main:Object (NameError) Banana :30
# stroberry
# the variable is not defined

#I will count apple fruit.
Apples = 100-25*3%4
puts "Apples :#{Apples}"

puts "I will now count my potato"

#count of the potato.
sum = 4+3+1+4-6
puts sum
#question about 3+2<5-7?
puts "Is it true that 3+2<5-7"
#assert of the result.
puts 3+2<5-7
#questions whats is it 3+2 and 5-7.
puts "Whats is 3+2 It is #{3+2}"
puts "Whats is 5-7 It is #{5-7}"


15 changes: 15 additions & 0 deletions DanielCabero/Practice1/hours.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
years=24*3600*365
day=24*3600
hour = 3600
min=60

#the variable is changes for the seconds.
seconds= 100000000

#this show the seconds in days,hours and minutes.
puts "this in #{seconds} is equals #{seconds/years} years: #{(seconds%years)/day} days: #{(seconds%day)/hour} hours: #{(seconds%hour)/60} minites: #{seconds%min} seconds"

#this method is the show the seconds in Days , hours and minutes.
puts "this in #{seconds} in days is: #{seconds/day}"
puts "this in #{seconds} in hours is: #{seconds/hour}"
puts "this in #{seconds} in minutes is: #{seconds/min}"
16 changes: 16 additions & 0 deletions DanielCabero/Practice1/practice.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

string = "number is: "

numbers = 2+5+3

print string
print numbers

# the use the numbers + string the message is error the main
# Did you mean? String
# from -e:1:in `load'
# from -e:1:in `<main>'
# the idea correct to error.

arg = string numbers
puts arg
55 changes: 55 additions & 0 deletions DanielCabero/Practice2/Father.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
class Father
#variable class amount.
@@amount
#initialize of the father class
def initialize(amount)
@@amount = amount
end

def amount
@@amount
end

end

#class child
class Child <Father
#variable instance
@amountChild
#initializeof the child.
def initialize(amountChil)
@amountChild = amountChil
end

def childHave
@@amount -= @amountChild
end
end


puts "the introducing the amount the father"

amount=gets.chomp.to_i
father = Father.new(amount)

puts "the introducing the amount the child"

amountChilder=gets.chomp.to_i
child = Child.new(amountChilder)

puts "the introducing the amount the child2"

amountChild2=gets.chomp.to_i
child2 = Child.new(amountChild2)
puts "the introducing the amount the child3"

amountChild3=gets.chomp.to_i
child3 = Child.new(amountChild3)
#distribute between in the 3 childers.
child=child.childHave
child2 =child2.childHave
child3 =child3.childHave
#the show the amount of the father.
puts "the amount father money is #{child3}"


10 changes: 10 additions & 0 deletions DanielCabero/Practice2/exercise1.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

print"Give me a number"
number = gets.chomp.to_i
# the variable chop.to_i also the input integer.
# the input other such as string the number result 0.
bigger = number*100
puts "A bigger number is #{bigger}"



9 changes: 9 additions & 0 deletions DanielCabero/Practice2/exercise2.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@


print"Give me a number"

number = gets.chomp.to_f
#the number to input is considered such as float.
#if input other variable that not number is considered as 0.
bigger = number*100
puts "The float number is #{bigger}"
28 changes: 28 additions & 0 deletions DanielCabero/Practice2/exercise3.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
class Exercise3

#the initialize of the Exercise3 or the circle.
def initialize(radius)
@radius = radius
end

#the calculate og the circle area.
#use the PI of the Math class.
def area
Math::PI*@radius*2
end
# the calculate of the circle perimeter.
def perimeter
Math::PI*(@radius**2)
end
end
#the input the variable radius.
puts "Write the radius"
radius = gets.to_i
areaCircle = Exercise3.new(radius)
perimeterCircle = Exercise3.new(radius)

#the print of the circle area and area perimeter.
puts "the circle area is : #{areaCircle.area}"
puts "the circle perimeter is : #{areaCircle.perimeter}"


29 changes: 29 additions & 0 deletions DanielCabero/Practice2/exercise4.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
class Exercise4

#declared the age variable class.
@@age
#method initialize
def initialize(name, age)
name = name
@@age = age
end

#the method that calculate the minutes of the age.
def ageMinutes
@@age*24*60*365
end

end

puts "Introduce the name and age"
#input the class variables.
#use the chomp to_s for ensure the name.
name = gets.chomp.to_s
#use chomp to_i for the age.
age = gets.chomp.to_i
minutes = Exercise4.new(name,age)
#print the variables.
puts "the age #{age} in minutes is #{minutes.ageMinutes}"
puts "the name is : #{name} and age : #{age}"


12 changes: 12 additions & 0 deletions DanielCabero/practice/method.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@



def test(name,costumer_id)
puts result= costumer_id>100? "Thanks to be our customer #{costumer_id} name #{name}": "thanks "
end



puts test "test",55


17 changes: 17 additions & 0 deletions DanielCabero/practice/ruby_blocks.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
def test_block
puts "you are in the method"
yield
puts "you are again back to the method"
yield

end

test_block {puts "you are in the block"}

value_1=10
5.times do |value_2,value_1|
value_1=value_2
puts "value_1 inside the #{value_1}"
end

puts "value_1 outside the block:#{value_1}"
29 changes: 29 additions & 0 deletions DanielCabero/practice3/car.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
class Car

#defined the atributes for the gets and setters.
# the atributes to changes is the color and velocity.
attr_accessor :color, :velocity
# the atributes allow read are the year and modelo.
attr_reader :year ,:modelo

def initialize color,year,modelo
@color=color
@year= year
@modelo= modelo
@velocity =0
end
# the method for the change the velocity.
def spped number
@velocity +=number
puts "You accelerator to #{@velocity}"
end

end
car=Car.new "blanco","1999","corolla"
# this used the get of the all atributes.
puts "the car is #{car.color}, is #{car.year} and #{car.modelo} modelo"
puts "With another color you would paint it"
newColor = gets.to_s
#this used the set for change the atribute.
puts "the color is #{car.color =newColor}"
car.spped 50
36 changes: 36 additions & 0 deletions DanielCabero/practice3/considerations
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

Practice

Lets consider you are in a new team
-define which code guideline you would suggest for:
Format(int, float, string)
the variables format is for the initialize is
with vocal in lower case for the write easily and fast.
Example
int number,
String name,

Classes
the classes should be with correct format in the name and vocal in up case,
methods names clear and with comments clear and precise of the actionof the method.

class Number, class Example

Variables, Getters Setters
the variables should be clear
the getters and setters should be
precise and comments that objects be get or the change of attributes

number = 25,
getNumber(),


If condition
the if conditional should be the minor cantidad for not miss the class coverage and
not miss time in implemented unit test for cover the coverage.

the sintax should be clear and precise not have two or
more conditions in the head of the if condition.

if(condition1) if(condition1 condition2 condition3)
correct no correct
17 changes: 17 additions & 0 deletions DanielCabero/practice3/default_parameter.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
class DefaultParameter

def priceTravel name, destination= "CBBA",price = 50.20
puts " #{name}, #{destination}, #{price}"

end

end

travel = DefaultParameter.new
puts "#{travel.priceTravel"tomas"}"
puts "#{travel.priceTravel"tomas","Lapaz"}"
puts "#{travel.priceTravel"tomas","sta cruz",100.50}"




8 changes: 8 additions & 0 deletions DanielCabero/practice3/exercise3.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

def test(name,costumer_id)
puts result= costumer_id>100? "Thanks to be our customer #{costumer_id} name #{name}": "thanks "
end



puts test "test",55
Loading