-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
27 lines (25 loc) · 992 Bytes
/
Rakefile
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
require 'psych'
require 'echoe'
Echoe.new("proc_for_case_equality") do |p|
p.project = 'proc_for_case_equality'
p.author = "De Santis Maurizio"
p.email = 'desantis.maurizio@gmail.com'
p.description = "proc_for_case_equality - For using procs in case comparisons"
p.url = "https://github.com/ProGNOMmers/proc_for_case_equality"
p.summary = "It lets you use procs for case comparisons. Example:
all_multiples_of_3 = ProcForCaseEquality.new { |numbers| numbers.all? { |number| number.modulo(3).zero? } }
any_multiple_of_3 = ProcForCaseEquality.new { |numbers| numbers.any? { |number| number.modulo(3).zero? } }
case [1, 2, 3]
when all_multiples_of_3 then puts 'all numbers are multiples of 3'
when any_multiple_of_3 then puts 'at least one number is multiple of 3'
else puts 'no multiples of 3'
end"
end
desc 'IRB console'
task :irb do
$LOAD_PATH << "#{Dir.pwd}/lib"
require 'proc_for_case_equality/pfce'
require 'irb'
ARGV.clear
IRB.start
end