SlideShare une entreprise Scribd logo
1  sur  29
Tres gemas de Ruby
          Leo Soto M.
   Lenguajes Dinámicos Chile
1. Rake
¿Algo así como Make?
ps: $(NAME).ps

%.ps: %.dvi
        dvips $(DVIPSOPT) $< -o $@

hyper: $(NAME).dtx $(NAME).sty
        pdflatex "relaxletmakehyperrefactiveinput $(NAME).dtx"

$(NAME).pdf: $(NAME).dtx $(NAME).sty
        pdflatex $(NAME).dtx

archive:
         @ tar -czf $(ARCHNAME) $(ARCHIVE)
         @ echo $(ARCHNAME)

clean:
        rm -f $(NAME).
{log,toc,lot,lof,idx,ilg,ind,aux,blg,bbl,dvi,ins,out}

distclean: clean
        rm -f $(NAME).{ps,sty,pdf} $(ARCHNAME)
http://www.flickr.com/photos/ross/28330560/
Dos grandes diferencias:
task :compile do
  mxmlc 'FlexApp', OUTPUT_FOLDER, ['libs/ThunderBoltAS3_Flex.swc']
end

task :test do
  mxmlc 'TestRunner', '', ['libs/flexunit.swc']
  run_swf 'TestRunner.swf'
end

task :copy_to_main_project => [:compile] do
  sh "cp -af #{FILES_TO_COPY} #{OUTPUT_FOLDER}"
end

task :clean do
  sh "rm -rf #{OUTPUT_FOLDER}/*"
end

task :default => [:compile, :copy_to_main_project]
task :compile do
  mxmlc 'FlexApp', OUTPUT_FOLDER, ['libs/ThunderBoltAS3_Flex.swc']
end

task :test do
  mxmlc 'TestRunner', '', ['libs/flexunit.swc']
  run_swf 'TestRunner.swf'
end

task :copy_to_main_project => [:compile] do
  sh "cp -af #{FILES_TO_COPY} #{OUTPUT_FOLDER}"
end

task :clean do
  sh "rm -rf #{OUTPUT_FOLDER}/*"
end

task :default => [:compile, :copy_to_main_project]
def mxmlc(file, output_folder, include_libraries=nil,
          warnings=false, debug=true)
  # Uses fcshd <http://code.google.com/p/flex-compiler-shell-daemon/>
  # if found:
  if command_exists? "fcshd.py" and not ENV['IGNORE_FCSH']
    # fcshd wants absolute paths
    file = File.expand_path(file)
    output_folder = File.expand_path(output_folder)
    if include_libraries
      include_libraries =
        include_libraries.map { |x| File.expand_path(x) }
    end

    cmdline = mxmlc_cmdline(file, output_folder, include_libraries,
                            warnings, debug)
    sh "fcshd.py "mxmlc #{cmdline}""
  else
    cmdline = mxmlc_cmdline(file, output_folder, include_libraries,
                            warnings, debug)
    sh "$FLEX_HOME/bin/mxmlc #{cmdline}"
  end
end
task :compile do
  mxmlc 'FlexApp', OUTPUT_FOLDER, ['libs/ThunderBoltAS3_Flex.swc']
end

task :test do
  mxmlc 'TestRunner', '', ['libs/flexunit.swc']
  run_swf 'TestRunner.swf'
end

task :copy_to_main_project => [:compile] do
  sh "cp -af #{FILES_TO_COPY} #{OUTPUT_FOLDER}"
end

task :clean do
  sh "rm -rf #{OUTPUT_FOLDER}/*"
end

task :default => [:compile, :copy_to_main_project]
def run_swf(swf)
  FLASH_PLAYERS.each do |cmd|
    if command_exists? cmd
      sh "#{cmd} #{swf}"
      return
    end
  end
end
Y metaprogramming!
namespace :rpc do
  task :compile => [:bigflexlib, :semanticflash] do
    compile_sandbox "rpc"
  end
  task :run => [:compile] do
    run_sandbox "rpc"
  end
end
namespace :graph do
  task :compile => [:bigflexlib, :semanticflash] do
    compile_sandbox "graph"
  end
  task :run => [:compile] do
    run_sandbox "graph"
  end
end
namespace :lang do
  task :compile => [:bigflexlib, :semanticflash] do
    compile_sandbox "lang"
  end
  task :run => [:compile] do
    run_sandbox "lang"
  end
end
$ rake rpc:compile
$ rake graph:compile
namespace :rpc do
  task :compile => [:bigflexlib, :semanticflash] do
    compile_sandbox "rpc"
  end
  task :run => [:compile] do
    run_sandbox "rpc"
  end
end
namespace :graph do
  task :compile => [:bigflexlib, :semanticflash] do
    compile_sandbox "graph"
  end
  task :run => [:compile] do
    run_sandbox "graph"
  end
end
namespace :lang do
  task :compile => [:bigflexlib, :semanticflash] do
    compile_sandbox "lang"
  end
  task :run => [:compile] do
    run_sandbox "lang"
  end
end
def flex_sandbox(*names)
  names.each do |name|
    namespace name do
      task :compile => [:bigflexlib, :semanticflash] do
        compile_sandbox name
      end
      task :run => [:compile] do
        run_sandbox name
      end
    end
  end

  namespace :sandboxes do
    task :compile => names.map { |name| "#{name}:compile" }
    task :run => names.map { |name| "#{name}:run"}
  end
end
def flex_sandbox(*names)
  names.each do |name|
    namespace name do
      task :compile => [:bigflexlib, :semanticflash] do
        compile_sandbox name
      end
      task :run => [:compile] do
        run_sandbox name
      end
    end
  end

  namespace :sandboxes do
    task :compile => names.map { |name| "#{name}:compile" }
    task :run => names.map { |name| "#{name}:run"}
  end
end

flex_sandbox :rpc,
             :graph,
             :lang
$ rake rpc:compile
$ rake graph:compile
$ rake rpc:compile
$ rake graph:compile
$ rake sandboxes:compile
2. RSpec
xUnit vs RSpec:
class FactorialTestCase < TestCase
  def test_factorial_method_added_to_integer_numbers
    assert_true 1.respond_to?(:factorial)
  end
  def test_factorial_of_zero
    assert_equals 0.factorial, 1
  end
  def test_factorial_of_positives
    assert_equals 1.factorial, 1
    assert_equals 2.factorial, 2
    assert_equals 3.factorial, 6
    assert_equals 20.factorial, 2432902008176640000
  end
  def test_factorial_of_negatives
    assert_raises ArgumentError do
      -1.factorial
    end
  end
end
describe '#factorial' do
  it "adds a factorial method to integer numbers" do
    1.respond_to?(:factorial).should be_true
  end
  it "defines the factorial of 0 as 1" do
    0.factorial.should == 1
  end
  it "calculates the factorial of any positive integer" do
    1.factorial.should == 1
    2.factorial.should == 2
    3.factorial.should == 6
    20.factorial.should == 2432902008176640000
  end
  it "raises an exception when applied to negative numbers" do
    -1.factorial.should raise_error(ArgumentError)
  end
end
describe '#prime?' do
  it "adds a prime method to integer numbers" do
    1.respond_to?(:prime?).should be_true
  end
  it "returns true for prime numbers" do
    2.should be_prime
    3.should be_prime
    11.should be_prime
    97.should be_prime
    727.should be_prime
  end
  it "returns false for non prime numbers" do
    20.should_not be_prime
    999.should_not be_prime
  end
end
One more thing...
One more thing...

   3. WebRat
describe "creating a new CEO letter campaign" do
  before do
    click_link 'Campaigns'
    click_link 'New CEO Letter Campaign'
  end

 it "persists delivery method, start date and end date" do
   check 'Email'
   click_button 'Create campaign'
   response.body.should contain_text("1 Delivery method: Email")
   response.body.should contain("12/12/2009")
   response.body.should contain("6/12/2010")
 end

  it "allows an email campaign" do
    check 'Email'
    click_button 'Create campaign'
    response.body.should contain_text("1 Delivery method: Email")
  end
end
http://rake.rubyforge.org/

             http://rspec.info/

http://gitrdoc.com/brynary/webrat/tree/master/
http://rake.rubyforge.org/

             http://rspec.info/

http://gitrdoc.com/brynary/webrat/tree/master/



                 ¡Gracias!

Contenu connexe

Tendances

全裸でワンライナー(仮)
全裸でワンライナー(仮)全裸でワンライナー(仮)
全裸でワンライナー(仮)Yoshihiro Sugi
 
RedHat/CentOs Commands for administrative works
RedHat/CentOs Commands for administrative worksRedHat/CentOs Commands for administrative works
RedHat/CentOs Commands for administrative worksMd Shihab
 
Shell实现的windows回收站功能的脚本
Shell实现的windows回收站功能的脚本Shell实现的windows回收站功能的脚本
Shell实现的windows回收站功能的脚本Lingfei Kong
 
Shell Script to Extract IP Address, MAC Address Information
Shell Script to Extract IP Address, MAC Address InformationShell Script to Extract IP Address, MAC Address Information
Shell Script to Extract IP Address, MAC Address InformationVCP Muthukrishna
 
Bash Script Disk Space Utilization Report and EMail
Bash Script Disk Space Utilization Report and EMailBash Script Disk Space Utilization Report and EMail
Bash Script Disk Space Utilization Report and EMailVCP Muthukrishna
 
File Space Usage Information and EMail Report - Shell Script
File Space Usage Information and EMail Report - Shell ScriptFile Space Usage Information and EMail Report - Shell Script
File Space Usage Information and EMail Report - Shell ScriptVCP Muthukrishna
 
Workshop on command line tools - day 2
Workshop on command line tools - day 2Workshop on command line tools - day 2
Workshop on command line tools - day 2Leandro Lima
 
Unit 7 standard i o
Unit 7 standard i oUnit 7 standard i o
Unit 7 standard i oroot_fibo
 
Workshop on command line tools - day 1
Workshop on command line tools - day 1Workshop on command line tools - day 1
Workshop on command line tools - day 1Leandro Lima
 
App-o-Lockalypse now!
App-o-Lockalypse now!App-o-Lockalypse now!
App-o-Lockalypse now!Oddvar Moe
 
Elixir & Phoenix - fast, concurrent and explicit
Elixir & Phoenix - fast, concurrent and explicitElixir & Phoenix - fast, concurrent and explicit
Elixir & Phoenix - fast, concurrent and explicitTobias Pfeiffer
 
Parsing JSON with a single regex
Parsing JSON with a single regexParsing JSON with a single regex
Parsing JSON with a single regexbrian d foy
 
"PostgreSQL and Python" Lightning Talk @EuroPython2014
"PostgreSQL and Python" Lightning Talk @EuroPython2014"PostgreSQL and Python" Lightning Talk @EuroPython2014
"PostgreSQL and Python" Lightning Talk @EuroPython2014Henning Jacobs
 
Ruby to Elixir - what's great and what you might miss
Ruby to Elixir - what's great and what you might missRuby to Elixir - what's great and what you might miss
Ruby to Elixir - what's great and what you might missTobias Pfeiffer
 
我在 Mac 上的常用开发工具
我在 Mac 上的常用开发工具我在 Mac 上的常用开发工具
我在 Mac 上的常用开发工具dennis zhuang
 

Tendances (20)

全裸でワンライナー(仮)
全裸でワンライナー(仮)全裸でワンライナー(仮)
全裸でワンライナー(仮)
 
Unix cheatsheet
Unix cheatsheetUnix cheatsheet
Unix cheatsheet
 
RedHat/CentOs Commands for administrative works
RedHat/CentOs Commands for administrative worksRedHat/CentOs Commands for administrative works
RedHat/CentOs Commands for administrative works
 
Bag of tricks
Bag of tricksBag of tricks
Bag of tricks
 
Shell实现的windows回收站功能的脚本
Shell实现的windows回收站功能的脚本Shell实现的windows回收站功能的脚本
Shell实现的windows回收站功能的脚本
 
Shell Script to Extract IP Address, MAC Address Information
Shell Script to Extract IP Address, MAC Address InformationShell Script to Extract IP Address, MAC Address Information
Shell Script to Extract IP Address, MAC Address Information
 
Bash Script Disk Space Utilization Report and EMail
Bash Script Disk Space Utilization Report and EMailBash Script Disk Space Utilization Report and EMail
Bash Script Disk Space Utilization Report and EMail
 
File Space Usage Information and EMail Report - Shell Script
File Space Usage Information and EMail Report - Shell ScriptFile Space Usage Information and EMail Report - Shell Script
File Space Usage Information and EMail Report - Shell Script
 
Workshop on command line tools - day 2
Workshop on command line tools - day 2Workshop on command line tools - day 2
Workshop on command line tools - day 2
 
serverstats
serverstatsserverstats
serverstats
 
Perl6 one-liners
Perl6 one-linersPerl6 one-liners
Perl6 one-liners
 
Unit 7 standard i o
Unit 7 standard i oUnit 7 standard i o
Unit 7 standard i o
 
Workshop on command line tools - day 1
Workshop on command line tools - day 1Workshop on command line tools - day 1
Workshop on command line tools - day 1
 
App-o-Lockalypse now!
App-o-Lockalypse now!App-o-Lockalypse now!
App-o-Lockalypse now!
 
Elixir & Phoenix - fast, concurrent and explicit
Elixir & Phoenix - fast, concurrent and explicitElixir & Phoenix - fast, concurrent and explicit
Elixir & Phoenix - fast, concurrent and explicit
 
Parsing JSON with a single regex
Parsing JSON with a single regexParsing JSON with a single regex
Parsing JSON with a single regex
 
"PostgreSQL and Python" Lightning Talk @EuroPython2014
"PostgreSQL and Python" Lightning Talk @EuroPython2014"PostgreSQL and Python" Lightning Talk @EuroPython2014
"PostgreSQL and Python" Lightning Talk @EuroPython2014
 
Bash Scripting Workshop
Bash Scripting WorkshopBash Scripting Workshop
Bash Scripting Workshop
 
Ruby to Elixir - what's great and what you might miss
Ruby to Elixir - what's great and what you might missRuby to Elixir - what's great and what you might miss
Ruby to Elixir - what's great and what you might miss
 
我在 Mac 上的常用开发工具
我在 Mac 上的常用开发工具我在 Mac 上的常用开发工具
我在 Mac 上的常用开发工具
 

Similaire à Tres Gemas De Ruby

Blocks by Lachs Cox
Blocks by Lachs CoxBlocks by Lachs Cox
Blocks by Lachs Coxlachie
 
Phoenix for laravel developers
Phoenix for laravel developersPhoenix for laravel developers
Phoenix for laravel developersLuiz Messias
 
Railsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshareRailsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slidesharetomcopeland
 
Desarrollando aplicaciones web en minutos
Desarrollando aplicaciones web en minutosDesarrollando aplicaciones web en minutos
Desarrollando aplicaciones web en minutosEdgar Suarez
 
Ruby on Rails at PROMPT ISEL '11
Ruby on Rails at PROMPT ISEL '11Ruby on Rails at PROMPT ISEL '11
Ruby on Rails at PROMPT ISEL '11Pedro Cunha
 
Ruby: OOP, metaprogramming, blocks, iterators, mix-ins, duck typing. Code style
Ruby: OOP, metaprogramming, blocks, iterators, mix-ins, duck typing. Code styleRuby: OOP, metaprogramming, blocks, iterators, mix-ins, duck typing. Code style
Ruby: OOP, metaprogramming, blocks, iterators, mix-ins, duck typing. Code styleAnton Shemerey
 
Integrating Flex And Rails With Ruby Amf
Integrating Flex And Rails With Ruby AmfIntegrating Flex And Rails With Ruby Amf
Integrating Flex And Rails With Ruby Amfrailsconf
 
Damn Fine CoffeeScript
Damn Fine CoffeeScriptDamn Fine CoffeeScript
Damn Fine CoffeeScriptniklal
 
Things about Functional JavaScript
Things about Functional JavaScriptThings about Functional JavaScript
Things about Functional JavaScriptChengHui Weng
 
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and JasmineSingle Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and JasminePaulo Ragonha
 
Real world scala
Real world scalaReal world scala
Real world scalalunfu zhong
 
Metaprogramovanie #1
Metaprogramovanie #1Metaprogramovanie #1
Metaprogramovanie #1Jano Suchal
 
03 Geographic scripting in uDig - halfway between user and developer
03 Geographic scripting in uDig - halfway between user and developer03 Geographic scripting in uDig - halfway between user and developer
03 Geographic scripting in uDig - halfway between user and developerAndrea Antonello
 
Intro to Ruby - Twin Cities Code Camp 7
Intro to Ruby - Twin Cities Code Camp 7Intro to Ruby - Twin Cities Code Camp 7
Intro to Ruby - Twin Cities Code Camp 7Brian Hogan
 

Similaire à Tres Gemas De Ruby (20)

Fabric Python Lib
Fabric Python LibFabric Python Lib
Fabric Python Lib
 
Blocks by Lachs Cox
Blocks by Lachs CoxBlocks by Lachs Cox
Blocks by Lachs Cox
 
Phoenix for laravel developers
Phoenix for laravel developersPhoenix for laravel developers
Phoenix for laravel developers
 
Railsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshareRailsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshare
 
Why ruby
Why rubyWhy ruby
Why ruby
 
Desarrollando aplicaciones web en minutos
Desarrollando aplicaciones web en minutosDesarrollando aplicaciones web en minutos
Desarrollando aplicaciones web en minutos
 
Ruby on Rails at PROMPT ISEL '11
Ruby on Rails at PROMPT ISEL '11Ruby on Rails at PROMPT ISEL '11
Ruby on Rails at PROMPT ISEL '11
 
Ruby: OOP, metaprogramming, blocks, iterators, mix-ins, duck typing. Code style
Ruby: OOP, metaprogramming, blocks, iterators, mix-ins, duck typing. Code styleRuby: OOP, metaprogramming, blocks, iterators, mix-ins, duck typing. Code style
Ruby: OOP, metaprogramming, blocks, iterators, mix-ins, duck typing. Code style
 
DataMapper
DataMapperDataMapper
DataMapper
 
Integrating Flex And Rails With Ruby Amf
Integrating Flex And Rails With Ruby AmfIntegrating Flex And Rails With Ruby Amf
Integrating Flex And Rails With Ruby Amf
 
Flex With Rubyamf
Flex With RubyamfFlex With Rubyamf
Flex With Rubyamf
 
Damn Fine CoffeeScript
Damn Fine CoffeeScriptDamn Fine CoffeeScript
Damn Fine CoffeeScript
 
Things about Functional JavaScript
Things about Functional JavaScriptThings about Functional JavaScript
Things about Functional JavaScript
 
PHP PPT FILE
PHP PPT FILEPHP PPT FILE
PHP PPT FILE
 
Ruby on Rails
Ruby on RailsRuby on Rails
Ruby on Rails
 
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and JasmineSingle Page Web Applications with CoffeeScript, Backbone and Jasmine
Single Page Web Applications with CoffeeScript, Backbone and Jasmine
 
Real world scala
Real world scalaReal world scala
Real world scala
 
Metaprogramovanie #1
Metaprogramovanie #1Metaprogramovanie #1
Metaprogramovanie #1
 
03 Geographic scripting in uDig - halfway between user and developer
03 Geographic scripting in uDig - halfway between user and developer03 Geographic scripting in uDig - halfway between user and developer
03 Geographic scripting in uDig - halfway between user and developer
 
Intro to Ruby - Twin Cities Code Camp 7
Intro to Ruby - Twin Cities Code Camp 7Intro to Ruby - Twin Cities Code Camp 7
Intro to Ruby - Twin Cities Code Camp 7
 

Plus de Leonardo Soto

El arte oscuro de estimar v3
El arte oscuro de estimar v3El arte oscuro de estimar v3
El arte oscuro de estimar v3Leonardo Soto
 
Una historia de ds ls en ruby
Una historia de ds ls en rubyUna historia de ds ls en ruby
Una historia de ds ls en rubyLeonardo Soto
 
El Lado Cool de Java
El Lado Cool de JavaEl Lado Cool de Java
El Lado Cool de JavaLeonardo Soto
 
Mi Arsenal de Testing en Rails
Mi Arsenal de Testing en RailsMi Arsenal de Testing en Rails
Mi Arsenal de Testing en RailsLeonardo Soto
 
Mapas en la web con Cloudmade
Mapas en la web con CloudmadeMapas en la web con Cloudmade
Mapas en la web con CloudmadeLeonardo Soto
 
Decent exposure: Controladores sin @ivars
Decent exposure: Controladores sin @ivarsDecent exposure: Controladores sin @ivars
Decent exposure: Controladores sin @ivarsLeonardo Soto
 
Sounds.gd lighting talk (RubyConf Uruguay)
Sounds.gd lighting talk (RubyConf Uruguay)Sounds.gd lighting talk (RubyConf Uruguay)
Sounds.gd lighting talk (RubyConf Uruguay)Leonardo Soto
 
Un tour por Java, Scala, Python, Ruby y Javascript
Un tour por Java, Scala, Python, Ruby y JavascriptUn tour por Java, Scala, Python, Ruby y Javascript
Un tour por Java, Scala, Python, Ruby y JavascriptLeonardo Soto
 
Lo que odiamos de la agilidad
Lo que odiamos de la agilidadLo que odiamos de la agilidad
Lo que odiamos de la agilidadLeonardo Soto
 
Javascript funcional
Javascript funcionalJavascript funcional
Javascript funcionalLeonardo Soto
 
Jython: Python para la plataforma Java (EL2009)
Jython: Python para la plataforma Java (EL2009)Jython: Python para la plataforma Java (EL2009)
Jython: Python para la plataforma Java (EL2009)Leonardo Soto
 

Plus de Leonardo Soto (20)

El arte oscuro de estimar v3
El arte oscuro de estimar v3El arte oscuro de estimar v3
El arte oscuro de estimar v3
 
Caching tips
Caching tipsCaching tips
Caching tips
 
Una historia de ds ls en ruby
Una historia de ds ls en rubyUna historia de ds ls en ruby
Una historia de ds ls en ruby
 
El Lado Cool de Java
El Lado Cool de JavaEl Lado Cool de Java
El Lado Cool de Java
 
Dos Años de Rails
Dos Años de RailsDos Años de Rails
Dos Años de Rails
 
Dos años de Rails
Dos años de RailsDos años de Rails
Dos años de Rails
 
Mi Arsenal de Testing en Rails
Mi Arsenal de Testing en RailsMi Arsenal de Testing en Rails
Mi Arsenal de Testing en Rails
 
Mapas en la web con Cloudmade
Mapas en la web con CloudmadeMapas en la web con Cloudmade
Mapas en la web con Cloudmade
 
Startechconf
StartechconfStartechconf
Startechconf
 
RabbitMQ
RabbitMQRabbitMQ
RabbitMQ
 
Decent exposure: Controladores sin @ivars
Decent exposure: Controladores sin @ivarsDecent exposure: Controladores sin @ivars
Decent exposure: Controladores sin @ivars
 
The Hashrocket Way
The Hashrocket WayThe Hashrocket Way
The Hashrocket Way
 
Sounds.gd lighting talk (RubyConf Uruguay)
Sounds.gd lighting talk (RubyConf Uruguay)Sounds.gd lighting talk (RubyConf Uruguay)
Sounds.gd lighting talk (RubyConf Uruguay)
 
Un tour por Java, Scala, Python, Ruby y Javascript
Un tour por Java, Scala, Python, Ruby y JavascriptUn tour por Java, Scala, Python, Ruby y Javascript
Un tour por Java, Scala, Python, Ruby y Javascript
 
Lo que odiamos de la agilidad
Lo que odiamos de la agilidadLo que odiamos de la agilidad
Lo que odiamos de la agilidad
 
Oss
OssOss
Oss
 
Javascript funcional
Javascript funcionalJavascript funcional
Javascript funcional
 
App Engine
App EngineApp Engine
App Engine
 
Introducción a Git
Introducción a GitIntroducción a Git
Introducción a Git
 
Jython: Python para la plataforma Java (EL2009)
Jython: Python para la plataforma Java (EL2009)Jython: Python para la plataforma Java (EL2009)
Jython: Python para la plataforma Java (EL2009)
 

Dernier

A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 

Dernier (20)

A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 

Tres Gemas De Ruby

  • 1. Tres gemas de Ruby Leo Soto M. Lenguajes Dinámicos Chile
  • 4. ps: $(NAME).ps %.ps: %.dvi dvips $(DVIPSOPT) $< -o $@ hyper: $(NAME).dtx $(NAME).sty pdflatex "relaxletmakehyperrefactiveinput $(NAME).dtx" $(NAME).pdf: $(NAME).dtx $(NAME).sty pdflatex $(NAME).dtx archive: @ tar -czf $(ARCHNAME) $(ARCHIVE) @ echo $(ARCHNAME) clean: rm -f $(NAME). {log,toc,lot,lof,idx,ilg,ind,aux,blg,bbl,dvi,ins,out} distclean: clean rm -f $(NAME).{ps,sty,pdf} $(ARCHNAME)
  • 7. task :compile do mxmlc 'FlexApp', OUTPUT_FOLDER, ['libs/ThunderBoltAS3_Flex.swc'] end task :test do mxmlc 'TestRunner', '', ['libs/flexunit.swc'] run_swf 'TestRunner.swf' end task :copy_to_main_project => [:compile] do sh "cp -af #{FILES_TO_COPY} #{OUTPUT_FOLDER}" end task :clean do sh "rm -rf #{OUTPUT_FOLDER}/*" end task :default => [:compile, :copy_to_main_project]
  • 8. task :compile do mxmlc 'FlexApp', OUTPUT_FOLDER, ['libs/ThunderBoltAS3_Flex.swc'] end task :test do mxmlc 'TestRunner', '', ['libs/flexunit.swc'] run_swf 'TestRunner.swf' end task :copy_to_main_project => [:compile] do sh "cp -af #{FILES_TO_COPY} #{OUTPUT_FOLDER}" end task :clean do sh "rm -rf #{OUTPUT_FOLDER}/*" end task :default => [:compile, :copy_to_main_project]
  • 9. def mxmlc(file, output_folder, include_libraries=nil, warnings=false, debug=true) # Uses fcshd <http://code.google.com/p/flex-compiler-shell-daemon/> # if found: if command_exists? "fcshd.py" and not ENV['IGNORE_FCSH'] # fcshd wants absolute paths file = File.expand_path(file) output_folder = File.expand_path(output_folder) if include_libraries include_libraries = include_libraries.map { |x| File.expand_path(x) } end cmdline = mxmlc_cmdline(file, output_folder, include_libraries, warnings, debug) sh "fcshd.py "mxmlc #{cmdline}"" else cmdline = mxmlc_cmdline(file, output_folder, include_libraries, warnings, debug) sh "$FLEX_HOME/bin/mxmlc #{cmdline}" end end
  • 10. task :compile do mxmlc 'FlexApp', OUTPUT_FOLDER, ['libs/ThunderBoltAS3_Flex.swc'] end task :test do mxmlc 'TestRunner', '', ['libs/flexunit.swc'] run_swf 'TestRunner.swf' end task :copy_to_main_project => [:compile] do sh "cp -af #{FILES_TO_COPY} #{OUTPUT_FOLDER}" end task :clean do sh "rm -rf #{OUTPUT_FOLDER}/*" end task :default => [:compile, :copy_to_main_project]
  • 11. def run_swf(swf) FLASH_PLAYERS.each do |cmd| if command_exists? cmd sh "#{cmd} #{swf}" return end end end
  • 13. namespace :rpc do task :compile => [:bigflexlib, :semanticflash] do compile_sandbox "rpc" end task :run => [:compile] do run_sandbox "rpc" end end namespace :graph do task :compile => [:bigflexlib, :semanticflash] do compile_sandbox "graph" end task :run => [:compile] do run_sandbox "graph" end end namespace :lang do task :compile => [:bigflexlib, :semanticflash] do compile_sandbox "lang" end task :run => [:compile] do run_sandbox "lang" end end
  • 14. $ rake rpc:compile $ rake graph:compile
  • 15. namespace :rpc do task :compile => [:bigflexlib, :semanticflash] do compile_sandbox "rpc" end task :run => [:compile] do run_sandbox "rpc" end end namespace :graph do task :compile => [:bigflexlib, :semanticflash] do compile_sandbox "graph" end task :run => [:compile] do run_sandbox "graph" end end namespace :lang do task :compile => [:bigflexlib, :semanticflash] do compile_sandbox "lang" end task :run => [:compile] do run_sandbox "lang" end end
  • 16. def flex_sandbox(*names) names.each do |name| namespace name do task :compile => [:bigflexlib, :semanticflash] do compile_sandbox name end task :run => [:compile] do run_sandbox name end end end namespace :sandboxes do task :compile => names.map { |name| "#{name}:compile" } task :run => names.map { |name| "#{name}:run"} end end
  • 17. def flex_sandbox(*names) names.each do |name| namespace name do task :compile => [:bigflexlib, :semanticflash] do compile_sandbox name end task :run => [:compile] do run_sandbox name end end end namespace :sandboxes do task :compile => names.map { |name| "#{name}:compile" } task :run => names.map { |name| "#{name}:run"} end end flex_sandbox :rpc, :graph, :lang
  • 18. $ rake rpc:compile $ rake graph:compile
  • 19. $ rake rpc:compile $ rake graph:compile $ rake sandboxes:compile
  • 22. class FactorialTestCase < TestCase def test_factorial_method_added_to_integer_numbers assert_true 1.respond_to?(:factorial) end def test_factorial_of_zero assert_equals 0.factorial, 1 end def test_factorial_of_positives assert_equals 1.factorial, 1 assert_equals 2.factorial, 2 assert_equals 3.factorial, 6 assert_equals 20.factorial, 2432902008176640000 end def test_factorial_of_negatives assert_raises ArgumentError do -1.factorial end end end
  • 23. describe '#factorial' do it "adds a factorial method to integer numbers" do 1.respond_to?(:factorial).should be_true end it "defines the factorial of 0 as 1" do 0.factorial.should == 1 end it "calculates the factorial of any positive integer" do 1.factorial.should == 1 2.factorial.should == 2 3.factorial.should == 6 20.factorial.should == 2432902008176640000 end it "raises an exception when applied to negative numbers" do -1.factorial.should raise_error(ArgumentError) end end
  • 24. describe '#prime?' do it "adds a prime method to integer numbers" do 1.respond_to?(:prime?).should be_true end it "returns true for prime numbers" do 2.should be_prime 3.should be_prime 11.should be_prime 97.should be_prime 727.should be_prime end it "returns false for non prime numbers" do 20.should_not be_prime 999.should_not be_prime end end
  • 26. One more thing... 3. WebRat
  • 27. describe "creating a new CEO letter campaign" do before do click_link 'Campaigns' click_link 'New CEO Letter Campaign' end it "persists delivery method, start date and end date" do check 'Email' click_button 'Create campaign' response.body.should contain_text("1 Delivery method: Email") response.body.should contain("12/12/2009") response.body.should contain("6/12/2010") end it "allows an email campaign" do check 'Email' click_button 'Create campaign' response.body.should contain_text("1 Delivery method: Email") end end
  • 28. http://rake.rubyforge.org/ http://rspec.info/ http://gitrdoc.com/brynary/webrat/tree/master/
  • 29. http://rake.rubyforge.org/ http://rspec.info/ http://gitrdoc.com/brynary/webrat/tree/master/ ¡Gracias!