MainMenu

Home Java Overview Maven Tutorials

Tuesday 28 August 2018

How to install Cucumber In rubymine

How to install Cucumber in rubymine



Hello Friends,
In this article i will describe that how can we install Cucumber in ruby mine & how can we create automation projects in Ruby Mine.



For Video :-

1).Open Your rubymine and copy the path of the project as shown below :-


2). Open commond prompt & paste the project path after cd and hit enter as below :-


3). Go to url https://rubygems.org/gems/cucumber/versions/2.4.0or click here and from the left pane click the copy to clipboard button as below


4). Now in commond promt paste the commond as copied above and hit the enter key


5). If below message in your commond prompt appears then congratulation cucumber have been installed in your rubymine




Next Topic :- Overview of Postman API Testing tool

Previous Topic :- Ruby basic programing Array, String & Methods

Sunday 26 August 2018

Basic program in ruby 2

Basic Programming in ruby Array, String, Methods



Hello Friends,
We will learn more about ruby programming that how to create Array, Access elements from array , String & methods


0). How to create an Array in Ruby :-

arr1 =Array.[](1,3,5,7,9)
puts arr1



Output :-

1
3
5
7
9


----------------------------------------------------
1). How to create an Array in Ruby by second way :-

arr2 = Array[2,4,6,8]
puts arr2



2
4
6
8
-------------------------------------------------------

2). How to get length an Array in Ruby :-

arr = Array.new(10)
puts array.length
puts arr.size
puts arr.length


Output :-

10
10


--------------------------------------------------------------
3). How to create a string Array in Ruby :-

arr3 = Array["chandan", "shina", "adhiraj", 2, 46, "akshat", "sarvakaram"]
puts arr3[2..5]


Output :-
adhiraj
2
46
akshat

--------------------------------------------------------------
4). String in Ruby :-

str = "chandanSingh"
puts str.capitalize
puts str.upcase
puts str.downcase
puts str.reverse
puts str.length
puts str[2]
puts str[2..4]


Output :-
Chandansingh
CHANDANSINGH
chandansingh
hgniSnadnahc
12
a
and

--------------------------------------------------------------
5). Methods in Ruby :-

def add(x, y)
puts x+y
end
add 10, 20
def language(a, b)
puts "best language for beginner is #{a}"
puts "second best language for beginner is #{ b}"
end
language "Ruby", "Core java"
def name(x= "chandan", y ="Shreya")
puts "my name is #{x}"
puts "my friend name is #{y}"
end
name
name "adhiraj" , "ritu"



Output :-
30
best language for beginner is Ruby
second best language for beginner is Core java
my name is chandan
my friend name is Shreya
my name is adhiraj
my friend name is ritu


--------------------------------------------------------------
6). How to pass multiple parameter in methods in Ruby :-

def multipara(*test)
puts "length of parameter is #{test.length}"
for i in 0..test.length-1
puts "Elements of parameter is #{test[i]}"
end
end
multipara "chandan", "Shina", "arti" ,"reena"





Output :-
length of parameter is 4
Elements of parameter is chandan
Elements of parameter is Shina
Elements of parameter is arti
Elements of parameter is reena



Next Topic :- How to configure cucumber in Ruby Mine

Previous Topic :- Basic Programming in ruby for, if-else, while do-while loop etc

Friday 24 August 2018

How to Download and install Ruby and Ruby mine

How to download and install ruby and rubymine in windows



Hello Friends,

In this article i will describe that how can we download and install ruby and ruby mine in windows machine.

A) Download & Install the Ruby
B) Download and install the ruby mine
C) Install the cucumber in ruby mine



1). Go to the website "https://rubyinstaller.org/" or Click Here

2). Click the Download button as shown in below screen


3). Select the file as per your computer as below
For example : my system is window 7 32 bit, so i will select Ruby 2.5.1-2 (x86) file to download


4). If you are facing any problem then you can directly download from my google drive as below
Click here to download Ruby from drive
Now double click on the setup and then click on Run button, then next .....as we install normal software.


5). To verify that ruby has been installed properly or not , open the commond prompt(cmd)
and Enter ruby -v and hit Enter key.
ruby version will appear and if so, congratulation ruby have installed in your machine.


6). To access "ruby interactive shell", type irb and hit Enter key as below


7). Now you can run your ruby program also from cmd as below


8). Download ruby editor Rubymine
a).go to the Url : https://www.jetbrains.com/ruby/download/ or click here
b).Click on the "Donwload" button to download the rubymine
Click here to download from driver


9). Install the ruby mine in your machine
double click on setup file & then click run button as below


Now as normal software installation click on next button and the next if required the finish


Now select the Ruby 2.5.1 as shown below and click on install button


Now click the finish button


Now launch the ruby mine and if you are launching/opening it first time then select "Do not import" radio button as below


10). Create your project/file & run the ruby programs


Now select the Ruby option from open matching files in ruby mine as below :-


11). Create a simple ruby program to print name "chandan singh"


12). Install the cucumber in rubymine
open the commond prompt(cmd) and type the commond gem install cucumber and hit enter, as below


Next Topic :- Basic Programming in ruby if else, for, while do while loop etc

Previous Topic :- Ruby Introduction

Thursday 23 August 2018

Basic Programs in Ruby

Basic Programming in ruby



Basic Programming in Ruby :-


0). How to print something in Ruby :-

print 'welcome to ruby'
puts 'hello ruby'
puts "hello again ruby"


Output :-welcome to rubyhello ruby
hello again ruby
Note :puts will change the row, but print will not.

--------------------------------------------------------------
1). Arithmatic Operator :-
Always remember ruby is case senstive.

x = 10
y =20
z = x+y
puts z
z = x*y
puts z
z = x-y
puts z
z = y/z
puts z

Output :-
30
200
-10
-2
--------------------------------------------------------------

2). If Else loop in ruby :-

x = 10
y = 20
if x>y
puts "x is greater than y"
else
puts "y is greater than x"
end

Output :-x is greater than y
-------------------------------------------------------------
3). While & Do while loop in ruby :-

x = 10
y = 20
while x<y do
x = x+1;
print "value of x is"
puts x
end



In the below code first value of x will be incremented and then printed after that condition will be checked

x = 10
y = 20
begin
x = x+1
puts x
end while x

Output in both the code:-
11
12
13
14
15
16
17
18
19
20
------------------------------------------------------
4).For Loop & for loop with break :-

for i in 0..5
puts i
end



Output :-
0
1
2
3
4
5

For loop with break statement

for i in 0..5
if i>2 then
break
end
puts i
end

Output :-
0
1
2


Next Topic :- Basic Programming in ruby Array, String & Methods etc

Previous Topic :- How to download and install Ruby & Rubymine

Ruby Tutorials

Ruby Tutorials



For Video Tutorial : Move on Youtube Channel


Note : Select the playlist as per your need & move with number sequence













1.Introduction of Ruby

2.Download & Install Ruby


3.Basic Programs in Ruby Part 1


4. Basic Programming in Ruby Part 2


4.1. How to install Cucumber in rubymine


5.Introduction of API Testing tool Postman


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.











Java Tutorial

Learn Ruby

Java for beginner

Ruby programming Tutorial

Java course

Ruby Programming for beginner

Java Online Course

Learn Ruby Online

Wednesday 22 August 2018

Ruby Introduction

A brief intro of ruby



Hello Friends,
In this article , i will describe about Scripting Language Ruby :-


Ruby :-

>> was created by "Yukihiro Matsumoto" in mid of 1990.
>>Ruby is an open-source and is freely available on the web, but it is subject to a license.
>> A programmer's best friend
>> It runs on variety of platforms such as windows, Mac OS and the various version of Unix.
>> Ruby is a true object-oriented programming language.
>> Dynamic >> Open source programming language with a focus on simplicity and productivity.
>> It has an elegant syntax that is natural to read and easy to write.
>> Used for internet application.
>> Ruby can be used to write Common Gateway Interface (CGI) scripts.
>> Ruby can be embedded into Hypertext Markup Language (HTML).
>> Twitter Github are developed using ruby etc.
>> A simple programming practice(INTRO).
>> Extension of Ruby program file is ".rb".
>> comment in ruby is followed by "#".


Different Naming conventions in Ruby

Ruby defines some naming conventions for its variable, method, constant and class.
Constant: Starts with a capital letter.
Global variable: Starts with a dollar sign ($).
Instance variable: Starts with a (@) sign.
Class variable: Starts with a (@@) sign.
Method name: Allowed to start with a capital letter.



Next Topic :-

How to Download & Install Ruby & Rubymine