IronRuby - A brave new world for .Net (NDC2010)

1,745 views

Published on

Session given at NDC2010, Oslo, Norway on IronRuby.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,745
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • TwitterInnovation BDDHerokuSoftware discussions
  • More than a replacement for C#It’s an extensionIt’s a different way of thinkingIt’s a new way of solving problems
  • IronRuby - A brave new world for .Net (NDC2010)

    1. 1. IronRuby – A brave new world!<br />Meerkatalyst<br />@Ben_HallBen@BenHall.me.ukBlog.BenHall.me.ukCodeBetter.com/blogs/BenHall<br />
    2. 2. London (UK) based C# MVPWeb Developer @ 7digital.com Working on a number of Open Source Projects<br />Co-Author of <br />Testing ASP.net Web Applications<br />http://www.testingaspnet.com<br />
    3. 3. Today...<br />Intro to Ruby IronRuby<br />Taking advantage with existing frameworks<br />7digital, scripting, DSLs and the real world<br />Embedding IronRuby into C#<br />
    4. 4. Tomorrow...<br />Testing C# and ASP.net Applications using Ruby<br />Track 6 (Here)<br />13:40<br />Lunch-time Ruby meet-up <br />
    5. 5. Why are we here?<br />http://www.flickr.com/photos/wwworks/2222523486/sizes/l/<br />
    6. 6. Ruby implementation on top of .NET<br />
    7. 7. The right language for the right job<br />
    8. 8. Don’t think of this as a replacement<br />
    9. 9. DEMO<br />RUBY RUBYRUBY => IRONRUBY<br />
    10. 10. http://www.flickr.com/photos/vhanes/3053401272/<br />
    11. 11. Community<br />http://www.flickr.com/photos/tjflex/233574885/<br />
    12. 12. Learn at least one new language every year<br />The Pragmatic ProgrammerAndrew Hunt David Thomas<br />Invest Regularly in Your Knowledge Portfolio<br />
    13. 13. via @danrough<br />Continuous Improvement<br />
    14. 14. http://nickolai.tumblr.com/post/159823820/dilbert-cobol-programming-dinosaur<br />Programming Dinosaur<br />
    15. 15. Remote server setup and configuration<br />Real world example<br />
    16. 16. ir.exe installed onto every server via svn+teamcity<br />consts = “dns = 'ec2-127.0.0.1.amazon.com‘; file = ‘app.config’” command = “contents = System::IO::File.read_all_text(file); " + "contents = contents.replace(‘$(MACHINE_DNS)', dns); " + "System::IO::File.write_all_text(file, contents)"ir.exe -e ”#{consts}” -e ”#{command}”<br />
    17. 17. Ruby as a scripting language<br />
    18. 18. require 'win32ole'excel = WIN32OLE.new("excel.application")excel['Visible'] = true#Create a new sheetworkbook = excel.Workbooks.Addexcel.Range("a1")['Value'] = 3excel.Range("a2")['Value'] = 2excel.Range("a3")['Value'] = 1excel.Range("a1:a3").Select# Add a chartexcelchart = workbook.Charts.AddXL3D_COLUMN_CHART_TYPE = -4100excelchart['Type'] = XL3D_COLUMN_CHART_TYPE <br />Built-in to IronRuby & Excel<br />
    19. 19. DEMO<br />ADVANCED RUBYIRONRUBY<br />
    20. 20. Internal DSLs (Domain Specific Language)<br />
    21. 21. kill ‘ps aux | grepmongrel_rails | grep -v grep | cut -c 10-20’<br />Rush.processes.filter(:cmdline => /mongrel_rails/).kill<br />Created using Rush<br />Bash<br />Ruby<br />
    22. 22. Created using Rudy<br />defaults do<br />  color true<br />  environment :test<br />  role :windows<br />  zone :'eu-west-1b'<br />  bucket 'rudy-ami-eu'<br />end<br />machines do<br />  region :'us-east-1' do<br />    ami 'ami-de4daab7' # Amazon Windows Server 2003 (US)<br />    size 'm1.small'<br />  end<br />  region :'eu-west-1' do<br />    ami 'ami-8696bef2' # Rudy Windows 2009-08-24 (EU)<br />  end<br />end<br />
    23. 23. @hourly cd C:/temp/ && script/runner -e production "SomeModel.ladeeda" >> C:/temp/cron_log.log 2>&10 0,3,6,9,12,15,18,21 * * * cd C:/temp/ && script/runner -e production "MyModel.some_process" >> C:/temp/cron_log.log 2>&10 0,3,6,9,12,15,18,21 * * * cd C:/temp/ && RAILS_ENV=production /usr/bin/env rake my:rake:task >> C:/temp/cron_log.log 2>&10 0,3,6,9,12,15,18,21 * * * /usr/bin/my_great_command >> C:/temp/cron_log.log 2>&130 4 * * * cd C:/temp/ && script/runner -e production "MyModel.task_to_run_at_four_thirty_in_the_morning" >> C:/temp/cron_log.log 2>&10 12 * * 0 cd C:/temp/ && script/runner -e production "Task.do_something_great" >> C:/temp/cron_log.log 2>&1<br />Corn job ask<br />
    24. 24. set :path, 'C:/temp/‘set :output, "C:/temp/cron_log.log"every 3.hours do runner "MyModel.some_process" rake "my:rake:task" command "/usr/bin/my_great_command“endevery 1.day, :at => '4:30 am' do runner "MyModel.task_to_run_at_four_thirty_in_the_morning“endevery :hour do runner "SomeModel.ladeeda“endevery :sunday, :at => '12pm' do runner "Task.do_something_great“end<br />Created using Whenever<br />
    25. 25. http://albacorebuild.net/<br />Created using Albacore<br />desc "Run a sample build using the MSBuildTask" msbuild do |msb| msb.properties :configuration => :Debug msb.targets :Clean, :Build msb.solution = "spec/support/TestSolution/TestSolution.sln" enddesc "NUnit Test Runner Example" nunit do |nunit|nunit.path_to_command = "NUnit/nunit-console.exe" nunit.assemblies "assemblies/TestSolution.Tests.dll" end<br />
    26. 26. desc "Create Website" create_site :create => :delete do |w| w.name = 'Meerpush_Website' w.home = 'C:inetpubwwwroot' end desc "Start Website" start_site :start do |w| w.name = 'Meerpush_Website' end <br />http://www.github.com/benhall/meerpush<br />Created using Meerpush<br />
    27. 27. DEMO<br />EMBEDDING IRONRUBY<br />
    28. 28. Links<br />http://ironruby.codeplex.com/<br />http://twitter.com/#/list/casualjim/ironruby-community<br />http://blog.benhall.me.uk<br />
    29. 29. http://www.bennylingbling.com/2009/04/17/i-see-what-you-did-there/<br />SUMMARY<br />
    30. 30. How will IronRuby<br />change<br />your world?<br />
    31. 31. @Ben_Hall<br />Ben@BenHall.me.uk<br />Blog.BenHall.me.uk<br />http://lolcatgenerator.com/lolcat/120/<br />

    ×