SlideShare ist ein Scribd-Unternehmen logo
1 von 98
Ruby-Fu!




http://www.flickr.com/photos/jackbrodus/258077303
Why Ruby On Rails?
http://www.flickr.com/photos/pagedooley/2511369048
Cloud-Friendly

            Open Source




Ruby on Rails
Fee, Turner and Mac.
http://www.flickr.com/photos/wwarby/2989238425/
(Cheezburger)
(Rails Hipster)

                  (Cheezburger)
Not Ruby 101…
just a quick history…
why’s (poignant)
guide to ruby
“matz”                           (not-“matz”)
http://mauthesis.com/me_and_matz1.jpg
The “dhh”




http://www.flickr.com/photos/jackbrodus/258077303
convention
    over
configuration
mad unit testing
  scaffolding
 db migrations
tons of libraries
Rails Apps Now!



http://www.flickr.com/photos/thedalogs/3302704209
Research Project

       Parcel Information App
       Search for Parcel
       Parcel Detail with Map

       Use ArcGIS Online
http://agsruby.heroku.com
Baking the Cake

http://www.flickr.com/photos/veganfeast/3845912356
Tooling

http://www.flickr.com/photos/denisecarbonell/3923601326
http://www.flickr.com/photos/ckelly/2693315769
TextMate on Mac

http://www.flickr.com/photos/m_uhlig/3556705107
RadRails on Windows
Fiddler
SoapUI
Ingredients

http://www.flickr.com/photos/vmiramontes/4073518788
ArcServer.rb
ArcServer.rb
gem install httparty
gem install handsoap
gem install shoulda
gem install mocha
gem install httpclient
gem install json
gem install test-unit
gem install nokogiri
Implemented
                    Not Implemented




SOAP & REST API’s
REST             SOAP
ExportMap   Get Default Map Name
               Get Legend Info
Cucumber
http://www.flickr.com/photos/derekgavey/4245269567
Gherkin
Gherkinz
Enuf! Show meh teh codez nao!
http://www.flickr.com/photos/kwl/4116389731
App
      Post to Search
      (Ajax request)




  REST API Query




       Resutls.rjs
Controllers   Views


                                  Home
                      Home
Request   Routing                           Response


                                  Results
                      Parcel

                                  Detail

                        lib
require 'arcserver'
require 'json
class HomeController < ApplicationController
 #Show the index page
 def index
 end

 #Show the about page
 def about
 end

 def search
  @searchType = params[:search_type]
  @searchCriteria = params[:search_criteria].upcase
  #calls to arcserver.rb to collect data and return to view
 end
end
require 'arcserver'
require 'json'
class ParcelController < ApplicationController

 def index
  @taxid = params[:id]
  #calls to arcserver.rb to collect data and return to view
 end
end
REST (kitteh) API

http://www.flickr.com/photos/pagedooley/4310765089
REST Query
def query(layerId, opts = {})
    query ={
     :f => opts[:f] || :json,
     :where => opts[:where],
     :returnGeometry => opts[:returnGeometry],
     :outFields => opts[:outFields]}

      HTTParty.get("#{url}/#{layerId}/query",
                                    :query => query)
end
def search
 @searchType = params[:search_type]
 @searchCriteria = params[:search_criteria].upcase
 service = ArcServer::MapServer.new('http://sampleserver1.arcgisonline
 @jsonString = service.query(1,
       {:where=>"#{@searchType} like '%#{@searchCriteria}%'",
       :outFields=>'TLID, OWNER1,OWNER2,OWNER3,SITEADDR'
       })
 @json = JSON.parse(@jsonString)
 @results = @json['features']
 if @results.nil? || @results.length == 0
   flash[:notice] = 'No results found for search ' + @searchCriteria
       + ' Please try another search.'
 end
 respond_to do |format|
   format.js #  Search.js.rjs  _results.html.erb
 end
                                                          Usage
end
http://www.flickr.com/photos/soundfromwayout/143822346
Accessing the SOAP API
http://www.flickr.com/photos/fdecomite/2867929299
Ruby Hates SOAP.
It’s a Fact.
http://www.flickr.com/photos/ennuidesign/3023015424
soap4r
                                                    WSDL
                             savon
                             handsoap               ~ XML



http://www.flickr.com/photos/fdecomite/2867929299
Documentation Assumes Proxy
SoapUI!
Strip it down…
XML   Ruby
Argggh! How
Can I debug this!!
Unit Tests

C:hacking> ruby map_server_soap_test.rb
Edit
                 Request


Compare
w/ Good                            Run test
  Req




       Copy
                           View
      request
                           error
     to SoapUI
Data
Nested Hashes
Nested Hashes
Deployment
#add changes
git add .
#commit
git commit -m "the message"
#push to heroku
git push heroku master
#crack beer.
src: http://github.com/dbouwman/agsruby

demo app: http://agsruby.heroku.com
contact: dave@davebouwman.com
Conclusions:
I’s a n00b at teh rubees!!!!
Rails + REST API = ‘OK’
Rails + SOAP API = ‘uggh’




http://www.flickr.com/photos/fdecomite/2867929299
Ruby & Rails vs. .NET?
Waaaaaaaaaay better than
       webforms
Slightly less work than MVC
Never underestimate the power
       of a good proxy!
Questions?




http://www.flickr.com/photos/seannaber/4044012656
Using ArcGIS Server with Ruby on Rails
Using ArcGIS Server with Ruby on Rails
Using ArcGIS Server with Ruby on Rails
Using ArcGIS Server with Ruby on Rails
Using ArcGIS Server with Ruby on Rails
Using ArcGIS Server with Ruby on Rails
Using ArcGIS Server with Ruby on Rails
Using ArcGIS Server with Ruby on Rails
Using ArcGIS Server with Ruby on Rails
Using ArcGIS Server with Ruby on Rails
Using ArcGIS Server with Ruby on Rails
Using ArcGIS Server with Ruby on Rails
Using ArcGIS Server with Ruby on Rails
Using ArcGIS Server with Ruby on Rails
Using ArcGIS Server with Ruby on Rails
Using ArcGIS Server with Ruby on Rails

Weitere ähnliche Inhalte

Was ist angesagt?

Your first sinatra app
Your first sinatra appYour first sinatra app
Your first sinatra app
Rubyc Slides
 
Introduction tomongodb
Introduction tomongodbIntroduction tomongodb
Introduction tomongodb
Lee Theobald
 

Was ist angesagt? (20)

Adventurous Merb
Adventurous MerbAdventurous Merb
Adventurous Merb
 
A Tour of Wyriki
A Tour of WyrikiA Tour of Wyriki
A Tour of Wyriki
 
Intro to Rack
Intro to RackIntro to Rack
Intro to Rack
 
Your first sinatra app
Your first sinatra appYour first sinatra app
Your first sinatra app
 
Introduction à Ruby
Introduction à RubyIntroduction à Ruby
Introduction à Ruby
 
Selenium sandwich-3: Being where you aren't.
Selenium sandwich-3: Being where you aren't.Selenium sandwich-3: Being where you aren't.
Selenium sandwich-3: Being where you aren't.
 
Rails Sojourn: One Man's Journey - Wicked Good Ruby Conference 2013
Rails Sojourn: One Man's Journey - Wicked Good Ruby Conference 2013Rails Sojourn: One Man's Journey - Wicked Good Ruby Conference 2013
Rails Sojourn: One Man's Journey - Wicked Good Ruby Conference 2013
 
Introduction tomongodb
Introduction tomongodbIntroduction tomongodb
Introduction tomongodb
 
Austin cassandra meetup
Austin cassandra meetupAustin cassandra meetup
Austin cassandra meetup
 
Unleashing the Rails Asset Pipeline
Unleashing the Rails Asset PipelineUnleashing the Rails Asset Pipeline
Unleashing the Rails Asset Pipeline
 
From "rails" to "release" —Railsconf 2010
From "rails" to "release" —Railsconf 2010From "rails" to "release" —Railsconf 2010
From "rails" to "release" —Railsconf 2010
 
Tdc 2013 - Ecossistema Ruby
Tdc 2013 - Ecossistema RubyTdc 2013 - Ecossistema Ruby
Tdc 2013 - Ecossistema Ruby
 
Server Side Swift - AppBuilders 2017
Server Side Swift - AppBuilders 2017Server Side Swift - AppBuilders 2017
Server Side Swift - AppBuilders 2017
 
Rails 101
Rails 101Rails 101
Rails 101
 
Jedi Mind Tricks for Git
Jedi Mind Tricks for GitJedi Mind Tricks for Git
Jedi Mind Tricks for Git
 
Jedi Mind Tricks in Git
Jedi Mind Tricks in GitJedi Mind Tricks in Git
Jedi Mind Tricks in Git
 
Introduction to es6
Introduction to es6Introduction to es6
Introduction to es6
 
Foreman - Process manager for applications with multiple components
Foreman - Process manager for applications with multiple componentsForeman - Process manager for applications with multiple components
Foreman - Process manager for applications with multiple components
 
Build REST APIs like a Jedi with Symfony2
Build REST APIs like a Jedi with Symfony2Build REST APIs like a Jedi with Symfony2
Build REST APIs like a Jedi with Symfony2
 
A Debugging Adventure: Journey through Ember.js Glue
A Debugging Adventure: Journey through Ember.js GlueA Debugging Adventure: Journey through Ember.js Glue
A Debugging Adventure: Journey through Ember.js Glue
 

Ähnlich wie Using ArcGIS Server with Ruby on Rails

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
railsconf
 
Rails Presentation (Anton Dmitriyev)
Rails Presentation (Anton Dmitriyev)Rails Presentation (Anton Dmitriyev)
Rails Presentation (Anton Dmitriyev)
True-Vision
 
Socket applications
Socket applicationsSocket applications
Socket applications
João Moura
 
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
Nick Sieger
 

Ähnlich wie Using ArcGIS Server with Ruby on Rails (20)

JRuby, Ruby, Rails and You on the Cloud
JRuby, Ruby, Rails and You on the CloudJRuby, Ruby, Rails and You on the Cloud
JRuby, Ruby, Rails and You on the Cloud
 
Cross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App EngineCross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App Engine
 
Building Rackspace Cloud Monitoring
Building Rackspace Cloud MonitoringBuilding Rackspace Cloud Monitoring
Building Rackspace Cloud Monitoring
 
Rack is Spectacular
Rack is SpectacularRack is Spectacular
Rack is Spectacular
 
Consegi 2010 - Dicas de Desenvolvimento Web com Ruby
Consegi 2010 - Dicas de Desenvolvimento Web com RubyConsegi 2010 - Dicas de Desenvolvimento Web com Ruby
Consegi 2010 - Dicas de Desenvolvimento Web com Ruby
 
Fisl 11 - Dicas de Desenvolvimento Web com Ruby
Fisl 11 - Dicas de Desenvolvimento Web com RubyFisl 11 - Dicas de Desenvolvimento Web com Ruby
Fisl 11 - Dicas de Desenvolvimento Web com Ruby
 
Strangers In The Night: Ruby, Rack y Sinatra - Herramientas potentes para con...
Strangers In The Night: Ruby, Rack y Sinatra - Herramientas potentes para con...Strangers In The Night: Ruby, Rack y Sinatra - Herramientas potentes para con...
Strangers In The Night: Ruby, Rack y Sinatra - Herramientas potentes para con...
 
huhu
huhuhuhu
huhu
 
ApacheCon 2005
ApacheCon 2005ApacheCon 2005
ApacheCon 2005
 
Connecting the Worlds of Java and Ruby with JRuby
Connecting the Worlds of Java and Ruby with JRubyConnecting the Worlds of Java and Ruby with JRuby
Connecting the Worlds of Java and Ruby with JRuby
 
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
 
Rails Presentation (Anton Dmitriyev)
Rails Presentation (Anton Dmitriyev)Rails Presentation (Anton Dmitriyev)
Rails Presentation (Anton Dmitriyev)
 
Socket applications
Socket applicationsSocket applications
Socket applications
 
Speedy TDD with Rails
Speedy TDD with RailsSpeedy TDD with Rails
Speedy TDD with Rails
 
Scaling Mapufacture on Amazon Web Services
Scaling Mapufacture on Amazon Web ServicesScaling Mapufacture on Amazon Web Services
Scaling Mapufacture on Amazon Web Services
 
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
 
Ruby Kaigi 2008 LT
Ruby Kaigi 2008 LTRuby Kaigi 2008 LT
Ruby Kaigi 2008 LT
 
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
Comparing Hot JavaScript Frameworks: AngularJS, Ember.js and React.js - Sprin...
 
Testing ASP.net Web Applications using Ruby
Testing ASP.net Web Applications using RubyTesting ASP.net Web Applications using Ruby
Testing ASP.net Web Applications using Ruby
 

Mehr von Dave Bouwman

Using ArcGIS Server in EC
Using ArcGIS Server in ECUsing ArcGIS Server in EC
Using ArcGIS Server in EC
Dave Bouwman
 
Usability in the GeoWeb
Usability in the GeoWebUsability in the GeoWeb
Usability in the GeoWeb
Dave Bouwman
 

Mehr von Dave Bouwman (13)

HTML5: Not Just for Breakfast
HTML5: Not Just for BreakfastHTML5: Not Just for Breakfast
HTML5: Not Just for Breakfast
 
Client-Side Raster Modeling with PixelBender
Client-Side Raster Modeling with PixelBenderClient-Side Raster Modeling with PixelBender
Client-Side Raster Modeling with PixelBender
 
Vector Tile Caching: ArcStache
Vector Tile Caching: ArcStacheVector Tile Caching: ArcStache
Vector Tile Caching: ArcStache
 
ArcGIS Server in EC2
ArcGIS Server in EC2ArcGIS Server in EC2
ArcGIS Server in EC2
 
Using ArcGIS Server in EC
Using ArcGIS Server in ECUsing ArcGIS Server in EC
Using ArcGIS Server in EC
 
Using ArcGIS Server in EC2
Using ArcGIS Server in EC2Using ArcGIS Server in EC2
Using ArcGIS Server in EC2
 
Building Secure Systems with ArcGIS Server
Building Secure Systems with ArcGIS ServerBuilding Secure Systems with ArcGIS Server
Building Secure Systems with ArcGIS Server
 
Usability in Emergency Response Applications
Usability in Emergency Response ApplicationsUsability in Emergency Response Applications
Usability in Emergency Response Applications
 
Developing for the GeoWeb: Notes From The Field Dev Summit 2009
Developing for the GeoWeb: Notes From The Field Dev Summit 2009Developing for the GeoWeb: Notes From The Field Dev Summit 2009
Developing for the GeoWeb: Notes From The Field Dev Summit 2009
 
Unit Testing 101
Unit Testing 101Unit Testing 101
Unit Testing 101
 
Using Virtual Earth to Visualize Fire Risk (Sept 2008)
Using Virtual Earth to Visualize Fire Risk (Sept 2008)Using Virtual Earth to Visualize Fire Risk (Sept 2008)
Using Virtual Earth to Visualize Fire Risk (Sept 2008)
 
Rocky Mountain URISA Talk (June 2008)
Rocky Mountain URISA Talk (June 2008)Rocky Mountain URISA Talk (June 2008)
Rocky Mountain URISA Talk (June 2008)
 
Usability in the GeoWeb
Usability in the GeoWebUsability in the GeoWeb
Usability in the GeoWeb
 

Kürzlich hochgeladen

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Kürzlich hochgeladen (20)

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
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
 
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...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 

Using ArcGIS Server with Ruby on Rails