The NetBeans TM Ruby IDE: You Thought Rails Development Was Fun Before



Similar documents
Ruby on Rails in GlassFish Sun Microsystems

Evaluation. Chapter 1: An Overview Of Ruby Rails. Copy. 6) Static Pages Within a Rails Application

JRuby The enterprise ruby

Netbeans 6.0. José Maria Silveira Neto. Sun Campus Ambassador

Unlocking the Java EE Platform with HTML 5

Ruby on Rails is a web application framework written in Ruby, a dynamically typed programming language The amazing productivity claims of Rails is

Ruby On Rails. CSCI 5449 Submitted by: Bhaskar Vaish

Tutorial 5: Developing Java applications

Installing Ruby on Windows XP

GlassFish v3. Building an ex tensible modular Java EE application server. Jerome Dochez and Ludovic Champenois Sun Microsystems, Inc.

Java in Web 2.0. Alexis Roos Principal Field Technologist, CTO Office OEM SW Sales Sun Microsystems, Inc.

Rails Cookbook. Rob Orsini. O'REILLY 8 Beijing Cambridge Farnham Koln Paris Sebastopol Taipei Tokyo

Developing ASP.NET MVC 4 Web Applications MOC 20486

Introduction to Ruby on Rails

The Other mod_rails: Easy Rails Deployment with JRuby. Nick Sieger Sun Microsystems, Inc

Outline. Lecture 18: Ruby on Rails MVC. Introduction to Rails

JRuby Now and Future Charles Oliver Nutter JRuby Guy Sun Microsystems

10CS73:Web Programming

Glassfish, JAVA EE, Servlets, JSP, EJB

The Learn-Verified Full Stack Web Development Program

Developing XML Solutions with JavaServer Pages Technology

Developing ASP.NET MVC 4 Web Applications

Building and Deploying Web Scale Social Networking Applications Using Ruby on Rails and Oracle. Kuassi Mensah Group Product Manager

Web Development with the Eclipse Platform

NetBeans IDE Field Guide

Programming Fundamentals of Web Applications Course 10958A; 5 Days

Chapter 13 Computer Programs and Programming Languages. Discovering Computers Your Interactive Guide to the Digital World

Eclipse Web Tools Platform. Naci Dai (Eteration), WTP JST Lead

Project SailFin: Building and Hosting Your Own Communication Server.

Course Name: Course in JSP Course Code: P5

Building Web Applications, Servlets, JSP and JDBC

CSI 2132 Lab 8. Outline. Web Programming JSP 23/03/2012

Java Application Developer Certificate Program Competencies

Rational Application Developer Performance Tips Introduction

Pete Helgren Ruby On Rails on i

Tomcat 5 New Features

CS169.1x Lecture 5: SaaS Architecture and Introduction to Rails " Fall 2012"

2011 Marty Hall An Overview of Servlet & JSP Technology Customized Java EE Training:

Rake Task Management Essentials

Installing and using XAMPP with NetBeans PHP

Developing ASP.NET MVC 4 Web Applications Course 20486A; 5 Days, Instructor-led

WIRIS quizzes web services Getting started with PHP and Java

Server-Side Web Development JSP. Today. Web Servers. Static HTML Directives. Actions Comments Tag Libraries Implicit Objects. Apache.

A Tour of Ruby on Rails

Java 7 Recipes. Freddy Guime. vk» (,\['«** g!p#« Carl Dea. Josh Juneau. John O'Conner

SAP's Integrated Development Environment for Java. Karl Kessler, SAP AG

HttpUnit Laboratorio di Sistemi Software - A.A. 2003/2004

Ruby on Rails. a high-productivity web application framework. blog.curthibbs.us/ Curt Hibbs <curt@hibbs.com>

VisualVM: Integrated and Extensible Troubleshooting Tool for the Java Platform

An introduction to creating Web 2.0 applications in Rational Application Developer Version 8.0

S3 Monitor Design and Implementation Plans

<Insert Picture Here> What's New in NetBeans IDE 7.2

Virtual Credit Card Processing System

AJAX Toolkit Framework

Sightly Component Development

Java the UML Way: Integrating Object-Oriented Design and Programming

In this chapter, we lay the foundation for all our further discussions. We start

Modern Software Development Tools on OpenVMS

Development. with NetBeans 5.0. A Quick Start in Basic Web and Struts Applications. Geertjan Wielenga

Oracle WebLogic Foundation of Oracle Fusion Middleware. Lawrence Manickam Toyork Systems Inc

Integrate Rails into an Existing IIS Web infrastructure using Mongrel

SSC - Web development Model-View-Controller for Java web application development

The Complete.NET Developer Productivity Pack

Outline. CS 112 Introduction to Programming. Recap: HTML/CSS/Javascript. Admin. Outline

What servlets and JSP are all about

JavaScript Testing. Beginner's Guide. Liang Yuxian Eugene. Test and debug JavaScript the easy way PUBLISHING MUMBAI BIRMINGHAM. k I I.

Java EE 6 development with Eclipse, Netbeans, IntelliJ and GlassFish. Ludovic Champenois Oracle Corporation

Web Applications and Struts 2

JSP Java Server Pages

Apache Jakarta Tomcat

An Overview of Java. overview-1

Hudson Continous Integration Server. Stefan Saasen,

What Is NetBeans? Free and open-source based > Open source since June, 2000 > Large community of users and developers

MASTERTAG DEVELOPER GUIDE

Creating Web Services Applications with IntelliJ IDEA

Crystal Reports for Borland JBuilder

Course Information Course Number: IWT 1229 Course Name: Web Development and Design Foundation

IBM Rational Web Developer for WebSphere Software Version 6.0

JavaScript By: A. Mousavi & P. Broomhead SERG, School of Engineering Design, Brunel University, UK

Single Page Web App Generator (SPWAG)

Ruby On Rails. James Reynolds

CrownPeak Java Web Hosting. Version 0.20

Link Analysis Tool Design Description Final Version

Hello World Portlet Rendered with JSP for WebSphere Portal Version 4.1

Application Notes for Packaging and Deploying Avaya Communications Process Manager Sample SDK Web Application on a JBoss Application Server Issue 1.

Migrating Applications From IBM WebSphere to Apache Tomcat

Niagara 4 The Next-Generation Open Platform

HTML5. Turn this page to see Quick Guide of CTTC

Power Tools for Pivotal Tracker

The IBM i on Rails + + Anthony Avison anthony@powerruby.com. Copyright 2014 PowerRuby, Inc.

VIRTUAL LABORATORY: MULTI-STYLE CODE EDITOR

Web and e-business Technologies

Volume 1: Core Technologies Marty Hall Larry Brown. An Overview of Servlet & JSP Technology

Web Design Specialist

BIRT Application and BIRT Report Deployment Functional Specification

Rails 4 Quickly. Bala Paranj.

This course provides students with the knowledge and skills to develop ASP.NET MVC 4 web applications.

Ruby on Rails. Object Oriented Analysis & Design CSCI-5448 University of Colorado, Boulder. -Dheeraj Potlapally

Installation Guide of the Change Management API Reference Implementation

Using Tomcat with CA Clarity PPM

Transcription:

The NetBeans TM Ruby IDE: You Thought Rails Development Was Fun Before Tor Norbye and Brian Leonard Sr. Software Engineers Sun Microsystems TS-5249

Learn how to jump-start your Ruby and Rails development using NetBeans software 2008 JavaOne SM Conference java.sun.com/javaone 2

Agenda Project Generation / Rails Generators Editing/Navigation Execution & Testing Debugging Rails + Java class library Deployment Futures 2008 JavaOne SM Conference java.sun.com/javaone 3

Project Creation / Rails Generators Start from scratch or work with existing sources Generate project artifacts Scaffolds Models Controllers Migrations Integration tests 2008 JavaOne SM Conference java.sun.com/javaone 4

Rails Project Creation 2008 JavaOne SM Conference java.sun.com/javaone 5

Agenda Project Generation / Rails Generators Editing/Navigation Execution & Testing Debugging Rails + Java class library Deployment Futures 2008 JavaOne SM Conference java.sun.com/javaone 6

Editing: Code Completion Code Completion for all the Rails APIs...and any custom Ruby Gems you've installed...and your own modules, classes and methods Parameter completion! On database table parameters in ActiveRecord calls Hash key completion: Known symbols like :order, :group and so on for the various methods that take options hashes Hash value completion: When the hash key is something like :controller, lists the available controller names; when the hash key is a boolean, lists :true and :false, and so on. 2008 JavaOne SM Conference java.sun.com/javaone 7

Editing: Active Record Code Completion NetBeans software studies your database migrations files If present, it also studies your schema dump file It builds up a logical model of your database models Code completion for your model classes will include the dynamic database properties Code completion will also include the dynamically added finder methods 2008 JavaOne SM Conference java.sun.com/javaone 8

Editing: Enhanced Documentation Custom RDoc rendering recognizes code samples and syntax highlights them not just for Ruby but for ERb as well RDoc handling supports reformatting comments as well Ctrl-Space to show the comment you're editing as RDoc RDoc NetBeans 2008 JavaOne SM Conference java.sun.com/javaone 9

Rails Quickfixes Quickfixes are integrated with the tasklist Open the tasklist to scan all files in your projects for problems Rails Deprecations Check Finds references to deprecated Rails functions and describes the suggested change Detects usages of fields when you should be using the attribute Actions without Views In controller files, it checks whether a method corresponds to a view, and if not, adds a quickfix to create a view for the method Ruby Quickfixes Detection of many common programming mistakes, deprecation checks for APIS outside of Rails, and various code transformations such as reversing double negatives, converting between {} and do/end blocks, etc. 2008 JavaOne SM Conference java.sun.com/javaone 10

ERb Editing ERb files are also known as RHTML files the JavaServer Pages (JSP ) technology of the Ruby world, with Ruby embedded inside <% %> tags All the Ruby editing features work in the Ruby scriptlets too Spell checking of your HTML (user visible) text Formatting, including compound indentation <h1>header</h1> <div> <%# This line was indented by the <div> block %> <span>html here</span> <% if true %> <span>html indented further by Ruby</span> <% end %> <span>more HTML here</span> </div> 2008 JavaOne SM Conference java.sun.com/javaone 11

ERb Editing: Other Languages Support for multiple embedded languages in your ERb: JavaScript programming language editing, CSS, HTML JavaScript programming language editing includes most of the same features we have for Ruby formatting, code completion, go to declaration, quickfixes,... YAML file editing HAML (experimental) 2008 JavaOne SM Conference java.sun.com/javaone 12

Editing: Type Analysis If NetBeans software IDE knows the types of your parameters, code completion etc. can be more accurate within the method If NetBeans software IDE knows the return types from your methods, it can do a better job with expressions calling your method Use Type Hints in your documentation to help the IDE #:arg:parametername=>type #:return:=>type The type information is also used for other IDE features, such as Go To Declaration. 2008 JavaOne SM Conference java.sun.com/javaone 13

Code Sample: Type Hints # # Creates an +n+ by +n+ identity matrix. # Matrix.identity(2) # => 1 0 # 0 1 # #:arg:n=>fixnum #:return:=>matrix def Matrix.identity(n) Matrix.scalar(n, 1) end 2008 JavaOne SM Conference java.sun.com/javaone 14

Navigation Go To Declaration: Ctrl-click on classes, methods, fields and variables to jump to its declaration (Ctrl-B) Also works for references in documentation Knows about Rails-style references like :partial =>, :controller=> and :action=> and takes those into account Ctrl-hover over symbols to read its documentation without jumping Jump between a file and its test (Ctrl-Shift-T) Knows about Rails, Rspec, ZenTest and Test::Unit conventions If filename based search fails, finds tests by class names regardless of where they are located Jump between a Controller and its View (Ctrl-Shift-A) Figures out which view to jump to in a controller based on the caret offset and parse information for the surrounding code Open Type (Ctrl-O) 2008 JavaOne SM Conference java.sun.com/javaone 15

Navigation: Open Type Jump to class Jump to methods by prefixing with #. Various search styles are available. Prefix: actionc => ActionController::Base Regular Expression: *Cach*r => ActionCacheFilter CamelCase (AC::B => ActionController::Base) #to_s (all methods named to_s across all the classes) #*load* => all_loaders 2008 JavaOne SM Conference java.sun.com/javaone 16

Editing/Navigation 2008 JavaOne SM Conference java.sun.com/javaone 17

Agenda Project Generation / Rails Generators Editing/Navigation Execution & Testing Debugging Rails + Java class library Deployment Futures 2008 JavaOne SM Conference java.sun.com/javaone 18

Execution and Testing Run File (Shift-F6). Performs context sensitive action for the current file For a controller or view or helper, fronts the browser and shows/reloads the URL corresponding to the given controller or view (starting the Rails server if necessary) For a test, runs the test For an RSpec file, runs the file under RSpec's runner For migration files, runs rake migration to the migration file's level For Rakefiles, runs rake on the given rake file For other files, runs the file using Ruby Test File (Ctrl-F6). Runs test for this file If this file is not a test/spec, finds the test for this file and runs that file instead Tests are run under test infrastructure, producing green/red summary results 2008 JavaOne SM Conference java.sun.com/javaone 19

Execution & Testing 2008 JavaOne SM Conference java.sun.com/javaone 20

Agenda Project Generation / Rails Generators Editing/Navigation Execution & Testing Debugging Rails + Java class library Deployment Futures 2008 JavaOne SM Conference java.sun.com/javaone 21

Source Level Debugging! Stepping Breakpoints Local Variables Call Stack Threads Watches Get it? Balloon-Evaluation 2008 JavaOne SM Conference java.sun.com/javaone 22

Debugging 2008 JavaOne SM Conference java.sun.com/javaone 23

Agenda Project Generation / Rails Generators Editing/Navigation Execution & Testing Debugging Rails + Java class library Deployment Futures 2008 JavaOne SM Conference java.sun.com/javaone 24

Java Integration Load the high-level Java support (using 'include') Import classes (as with Java class library) Use Java class library just like Ruby classes Set classpath to any 3 rd party Java class library 2008 JavaOne SM Conference java.sun.com/javaone 25

Code Sample # Load the high-level Java support include Java # Import the classes you want to use (Just as in Java) import java.util.random # Create an instance of java.util.random r = Random.new # Write a random integer to output puts r.nextint 2008 JavaOne SM Conference java.sun.com/javaone 26

Java Integrated development 2008 JavaOne SM Conference java.sun.com/javaone 27

Agenda Project Generation / Rails Generators Editing/Navigation Execution & Testing Debugging Rails + Java class library Deployment Futures 2008 JavaOne SM Conference java.sun.com/javaone 28

Deployment WEBrick is bundled with JRuby The popular Mongrel server is also supported Goldspike plugin allows for deployment to Java Servlet extension (Tomcat, GlassFish, etc.) 2008 JavaOne SM Conference java.sun.com/javaone 29

Deployment to Java TM Servlet extension 2008 JavaOne SM Conference java.sun.com/javaone 30

Agenda Project Generation / Rails Generators Editing/Navigation Execution & Testing Debugging Rails + Java class library Deployment Futures 2008 JavaOne SM Conference java.sun.com/javaone 31

Future Plans Better console integration Better test runner GUI Improved type analysis More refactorings and Quickfixes Better Java integrated development Support for additional Ruby frameworks 2008 JavaOne SM Conference java.sun.com/javaone 32

Summary NetBeans software IDE is a first class environment for Ruby and Rails development Everything comes bundled to begin developing in Ruby immediately With Ruby running on the Java VM (JRuby), Java integrated development is a snap 2008 JavaOne SM Conference java.sun.com/javaone 33

For More Information LAB-8400 Developing (J)Ruby on Rails Applications with the NetBeans TM IDE http://wiki.netbeans.org/ruby users@ruby.netbeans.org http://blogs.sun.com/tor/ http://weblogs.java/net/blog/bleonard 2008 JavaOne SM Conference java.sun.com/javaone 34

Tor Norbye and Brian Leonard Sr. Software Engineers Sun Microsystems, Inc. TS-5249 2008 JavaOne SM Conference java.sun.com/javaone 35