Demystifying Rails Plugin Development

Size: px
Start display at page:

Download "Demystifying Rails Plugin Development"

Transcription

1 Demystifying Rails Plugin Development Nick Plante :: Voices That Matter Professional Ruby Conference November 18th, 2008

2 Obligatory Introduction Plugins are generalized, reusable code libraries Ext or override core functionality of Rails Can save you a lot of time Provide standard hooks, helpers Rails scripts, hooks Generators, etc

3 vs. core plugin

4 but more like

5 Plugin Examples User Authentication Restful Authentication, Closure Pagination Will Paginate, Paginating Find Asynchronous Processing Workling, Background Job, etc View Helpers Lightbox helper, Flash media player helper, etc

6 Why Develop Plugins? Internal re-use, productivity booster Opportunity to refactor, clean up project code is_rateable vs. gobs of in-line ratings code Contribute to the Ruby OSS ecosystem Get feedback, contributions, inspire others Profit^h^h^h^h^h^h Marketing

7 Is Plugin Development Hard? Is developing software in Ruby/Rails hard? Deps on what you re trying to accomplish, right? The plugins system itself is simple Writing plugins can be hard, but it doesn t have to be

8 Plugin Genesis: Extraction Most plugins don t start out as plugins Usually extracted & generalized from a useful feature created in a larger project What interesting problems have you solved lately?

9 Validating ISBNs How would we implement this in a Book model for a plain old Rails project? ISBN-13: ISBN-10:

10 class Book < ActiveRecord::Base validates_presence_of :title, :author, :isbn def validate unless self.isbn_valid? errors.add(:isbn, "is not a valid ISBN code") ISBN10_REGEX = /^(?:\d[\ -]?){9}[\d X]$/ ISBN13_REGEX = /^(?:\d[\ -]?){13}$/ def isbn_valid?!self.isbn.nil? && (self.isbn10_valid? self.isbn13_valid?) #...

11 Wait! There s More!

12 # more code in your model def isbn10_valid? if self.isbn.match(isbn10_regex) isbn_values = self.isbn.upcase.gsub(/\ -/, '').split('') check_digit = isbn_values.pop # last digit is check check_digit = (check_digit == 'X')? 10 : check_digit.to_i sum = 0 isbn_values.each_with_index do value, index sum += (index + 1) * value.to_i (sum % 11) == check_digit else false

13 # and yet more code in your model def isbn13_valid? if self.isbn.match(isbn13_regex) isbn_values = self.isbn.upcase.gsub(/\ -/, '').split('') check_digit = isbn_values.pop.to_i # last digit is check sum = 0 isbn_values.each_with_index do value, index multiplier = (index % 2 == 0)? 1 : 3 sum += multiplier * value.to_i (10 - (sum % 10)) == check_digit else false

14 Your Model Code

15 Either way, we need to build a validation module, right? Extract! Let s clean up that messy model Encapsulation & Information Hiding Makes our model easier to read We can move this code to a module in lib Or yank it all out into a plugin!

16 Encapsulation

17 Designing the Interface We need a clean interface DON T judge a book by its cover But DO judge a plugin by its interface KISS -- there is beauty in simplicity / minimalism Goal is often to ext the Rails DSL in a natural way We have pre-existing examples to guide our hand ActiveRecord::Validations (see api.rubyonrails.org)

18 ActiveRecord Examples acts_as_list :scope => :todo_list validates_http_url :link is_indexed :fields => ['created_at', 'title ] has_attached_file :cover_image, :styles => { :medium => "300x300>", :thumb => "100x100> }

19 ActionController Examples class BooksController < ApplicationController sidebar :login, :unless => :logged_in? permit "rubyists and wanna_be_rubyists" include SomePluginModule def = Book.paginate :page => params[:page], :per_page => 20

20 ActionView Examples (View Helpers) <%= lightbox_link_to My Link, image.png %>

21 A Little Cleaner, Right? Yeah. class Book < ActiveRecord::Base validates_isbn :isbn, :with => :isbn13, :unless => :skip_validation

22

23 validates_isbn We need to create a validates_isbn class method on ActiveRecord::Base Generalize our code a bit No longer married to a particular model attribute Hide it behind a Rails-ish DSL Ext AR::Base with our own module

24 module IsbnValidation # may want to namespace this def validates_isbn(*attr_names) config = { :message => "is not a valid ISBN code" } config.update(attr_names.extract_options!) validates_each(attr_names, config) do record,attr_name,value valid = case config[:with] when :isbn10; validate_with_isbn10(value) when :isbn13; validate_with_isbn13(value) else validate_with_isbn10(value) validate_with_isbn13(value) record.errors.add(attr_name, config[:message]) unless valid # other methods, constants go here too

25 Making of the Module Why is it a module, and not a class? A module is like a degenerate abstract class You can mix a module into a class Include with a module to add instance methods Ext with a module to add class methods Also use modules for organization Group similar things together, namespacing

26 Mixing It Up with Modules Don t have to stash this module in a plugin Can use it directly from lib, too require isbn_validation class Book < ActiveRecord::Base ext IsbnValidation validates_isbn :isbn

27 Pluginizing But why not go the extra step? So you can easily reuse it across projects And share with others

28 Generate a Plugin Skeleton Use the supplied plugin generator The less we have to do, the better!

29 $ ruby script/generate plugin isbn_validation in vor/plugins/isbn_validation: - lib/ - isbn_validation.rb - tasks/ - isbn_validation_tasks.rake - test/ - isbn_validation_test.rb - README - MIT-LICENSE - Rakefile - init.rb - install.rb - uninstall.rb

30 Plugin Hooks: Install.rb Auto-run when plugin is installed via script/plugin install Potential Uses Display README Copy needed images, styles, scripts Remove them with uninstall.rb

31 Plugin Hooks: Init.rb Runs whenever your application is started Use it to inject plugin code into the framework Add class methods in IsbnValidation module to AR::Base ActiveRecord::Base.class_eval do ext IsbnValidation

32 Adding Instance Methods? Use include instead of ext self.included class method is special Executed when the module is mixed in with include Gives us access to the including class Common Ruby idiom allows us to ext the base class with a new set of class methods here, too def self.included(base) base.ext(classmethods)

33 Should I Test My Plugin? If you re extracting a plugin, you probably already have tests for a lot of that functionality, right?

34 Testing Strategies Varies deping on the type of plugin Mock/stub out your environment if possible Test the behavior of the system with plugin installed Rather than the eccentricities of the plugin code itself For model plugins, consider creating an isolated in-memory database (sqlite3) Rake testing tasks already provided See Rakefile and sample test provided by generator rake test:plugins

35 Test Helper $:.unshift(file.dirname( FILE ) + '/../lib') RAILS_ROOT = File.dirname( FILE ) require 'rubygems' require 'test/unit' require 'active_record' require "#{File.dirname( FILE )}/../init" config = YAML::load(IO.read( File.dirname( FILE ) + '/database.yml')) ActiveRecord::Base.logger = Logger.new( File.dirname( FILE ) + "/debug.log") ActiveRecord::Base.establish_connection( config[env['db'] 'sqlite3']) load(file.dirname( FILE ) + "/schema.rb") if File.exist?( File.dirname( FILE ) + "/schema.rb")

36 Dummy Test Models (models.rb) class Book < ActiveRecord::Base validates_isbn :isbn, :message => 'is too fantastical!' class Book10 < ActiveRecord::Base set_table_name 'books' validates_isbn :isbn, :with => :isbn10 class Book13 < ActiveRecord::Base set_table_name 'books' validates_isbn :isbn, :with => :isbn13

37 Unit Testing require File.dirname( FILE ) + '/test_helper' require File.dirname( FILE ) + '/models' class IsbnValidationTest < Test::Unit::TestCase def = Book.new def = ' ' #...

38 Rspec fan? Use Pat Maddox s RSpec plugin generator Uses RSpec stubs instead of Test::Unit Also sets up isolated database for you! --with-database Install the plugin ruby script/generate rspec_plugin isbn_validation

39 Distributing Plugins Use a publicly visible Subversion or Git repository. It s that easy. Options: Google Code (Subversion) RubyForge (Subversion) GitHub (Git) <= Recommed!

40 ruby script/plugin install \ git://github.com/zapnap/isbn_validation.git

41 Distributing Plugins as Gems? Can also package plugins as RubyGems In environment.rb: config.gem isbn_validation, :source => gems.github.com, :version => >= Then, to install it in the project: rake gems:install rake gems:unpack rake gems:unpack:depencies

42 Gem Advantages Reasons to prefer Gems for packaging Proper versioning Depency management GitHub makes Gem creation easy Gems will be automatically created for you Installable via gems.github.com

43 Gemify! GitHub workflow Create a rails/init.rb file in your repository Change original init.rb to include only: require File.dirname( FILE ) + /rails/init.rb Create a Gemspec in the root of your repository Rake task to generate a Gemspec! Check RubyGem box on GitHub project edit page Can now install as either a RubyGem or a Plugin!

44 spec = Gem::Specification.new do s s.name = %q{isbn_validation} s.version = "0.1.0" s.summary = %q{adds an isbn validation...} s.description = %q{adds an isbn validation...} s.files = FileList['[A-Z]*', '{lib,test}/**/*.rb'] s.require_path = 'lib' s.test_files = Dir[*['test/**/*_test.rb']] s.authors = ["Nick Plante"] s. = %q{nap@zerosum.org} s.platform = Gem::Platform::RUBY s.add_depency(%q<activerecord>, [">= 2.1.2"]) desc "Generate a gemspec file" task :gemspec do File.open("#{spec.name}.gemspec", 'w') do f f.write spec.to_ruby

45 What Else? Rake tasks Put them in plugin tasks directory Note: this does not work for GemPlugins yet Namespace them appropriately namespace :isbn do Automatically made available in the host Rails project s list of Rake tasks Test and rdoc tasks are free

46 PDI Every plugin will require different strategies for development & testing Model, Controller, View Plugins Plugins that generate code Plugins that wrap third party daemons & libraries Fortunately, lots of OSS plugins to look to for examples -- no better way to learn! Good luck & don t forget to let us know about your new plugin!

47 Thanks! Nick Partner, Software Developer Ubikorp Internet Services

Extending Rails: Understanding and Building Plugins. Clinton R. Nixon

Extending Rails: Understanding and Building Plugins. Clinton R. Nixon Extending Rails: Understanding and Building Plugins Clinton R. Nixon Welcome! Welcoming robin by Ian-S (http://flickr.com/photos/ian-s/2301022466/) What are we going to talk about? The short How plugins

More information

The Dark Art. of Rails Plugins. James Adam. reevoo.com

The Dark Art. of Rails Plugins. James Adam. reevoo.com The Dark Art of Rails Plugins reevoo.com James Adam This could be you! I m hacking ur Railz appz!!1! Photo: http://flickr.com/photos/toddhiestand/197704394/ Anatomy of a plugin Photo: http://flickr.com/photos/guccibear2005/206352128/

More information

Ruby Gem Internals by Examples

Ruby Gem Internals by Examples SF Software Design in Ruby Meetup Group Ruby Gem Internals by Examples Ben Zhang, 1/14/2014 benzhangpro@gmail.com http://www.meetup.com/software-design-in-ruby-study-group/ Types of Ruby Gem Features Global

More information

Ruby on Rails 3. Robert Crida Stuart Corbishley. Clue Technologies

Ruby on Rails 3. Robert Crida Stuart Corbishley. Clue Technologies Ruby on Rails 3 Robert Crida Stuart Corbishley Clue Technologies Topic Overview What is Rails New in Rails 3 New Project Generators MVC Active Record UJS RVM Bundler Migrations Factory Girl RSpec haml

More information

Rails Engines. Use Case. The Implementation

Rails Engines. Use Case. The Implementation Rails Engines Rails engines range from simple plugins to powerful micro-applications. The discussions we ve had so far about Railties are closely related to the function of a Rails engine. One interesting

More information

test with :) chen songyong

test with :) chen songyong test with :) chen songyong about me about me Remote worker! Worked in start-ups, web consultancies, banks and digital agencies! @aquajach in Twitter & Github test in old days test in old days do you write

More information

Authentication in Rails

Authentication in Rails Authentication in Rails Aaron Mulder CTO Chariot Solutions Philly on Rails, October 2007 1 Agenda The problem Plugins in Rails, and the (many) solutions acts_as_authenticated Generated Code Custom Code

More information

Contents in Detail. Foreword by Xavier Noria

Contents in Detail. Foreword by Xavier Noria Contents in Detail Foreword by Xavier Noria Acknowledgments xv xvii Introduction xix Who This Book Is For................................................ xx Overview...xx Installation.... xxi Ruby, Rails,

More information

Where we are. For example. Extensions. Authorization and Testing

Where we are. For example. Extensions. Authorization and Testing Where we are Authorization and Testing Last time: We added the ability of users to log in, and made sure that we treated their passwords in a secure fashion. INFO 2310: Topics in Web Design and Programming

More information

RACK / SSO. and a little bit about the Bundler. Tuesday, December 1, 2009 hello hello

RACK / SSO. and a little bit about the Bundler. Tuesday, December 1, 2009 hello hello RACK / SSO and a little bit about the Bundler hello hello COREY DONOHOE @atmos / atmos@atmos.org i m a software developer and open source participant for a number of years this is me in hawaii last month

More information

This tutorial has been designed for beginners who would like to use the Ruby framework for developing database-backed web applications.

This tutorial has been designed for beginners who would like to use the Ruby framework for developing database-backed web applications. About the Tutorial Ruby on Rails is an extremely productive web application framework written in Ruby by David Heinemeier Hansson. This tutorial gives you a complete understanding on Ruby on Rails. Audience

More information

Introduction and first application. Luigi De Russis. Rails 101

Introduction and first application. Luigi De Russis. Rails 101 Introduction and first application Luigi De Russis 2 About Rails Ruby on Rails 3 Framework for making dynamic web applications created in 2003 Open Source (MIT License) for the Ruby programming language

More information

RSPec Documentation. 4. Scenario Testing Examples of OAR REST APIs using Rspec

RSPec Documentation. 4. Scenario Testing Examples of OAR REST APIs using Rspec RSPec Documentation Contents: 1. Introduction to Rspec - Installing Rspec Gem (Getting Started) - Terminology used in Rspec 2. Writing Simple Rspec Tests 3. Running Rspec Testfiles 4. Scenario Testing

More information

My First Three Weeks on Rails. Aaron Mulder Chariot Solutions

My First Three Weeks on Rails. Aaron Mulder Chariot Solutions My First Three Weeks on Rails Aaron Mulder Chariot Solutions Background J2EE developer Mac/Linux platform Have used dynamic languages before (mostly Perl, some P/Jython) Never used Ruby Suddenly found

More information

Watir-Webdriver Cucumber Automation Framework Setup Guide

Watir-Webdriver Cucumber Automation Framework Setup Guide Watir-Webdriver Cucumber Automation Framework Setup Guide Documentation version table: Document updating summary. Version Date Date Created 1.0 08/05/15 Index Page 1 November 18, 2015 Table of Contents

More information

Cheap, Fast, and Good You can have it all with Ruby on Rails

Cheap, Fast, and Good You can have it all with Ruby on Rails Cheap, Fast, and Good You can have it all with Ruby on Rails Brian McCallister brianm@ninginc.com http://www.ning.com/ What is Ruby? Dynamic and Interpreted Strong support for OO programming Everything

More information

Multitenancy with Rails

Multitenancy with Rails Multitenancy with Rails And subscriptions too! Ryan Bigg This book is for sale at http://leanpub.com/multi-tenancy-rails This version was published on 2015-11-24 This is a Leanpub book. Leanpub empowers

More information

RSpec Core Project: RSpec Core 2.11 Publisher: RSpec. Issues. Open Feedback Dialog. rspec-core provides the structure for RSpec code examples:

RSpec Core Project: RSpec Core 2.11 Publisher: RSpec. Issues. Open Feedback Dialog. rspec-core provides the structure for RSpec code examples: Open Feedback Dialog Project: RSpec Core 2.11 Publisher: RSpec RSpec Core 2.11 rspec-core provides the structure for RSpec code examples: describe Account do it "has a balance of zero when first opened"

More information

What's new in Rails 4. Lucas Caton

What's new in Rails 4. Lucas Caton What's new in Rails 4 Lucas Caton www.lucascaton.com.br 4 June 25, 2013 Rails 4.0: Final version released! Ruby 1.8.7 Ruby 1.9.2 Ruby 1.9.3 Ruby 2.0.0 RubyGems 2.x ThreadSafety memcache-client dalli =>

More information

FRONT USER GUIDE Getting Started with Front

FRONT USER GUIDE Getting Started with Front USER GUIDE USER GUIDE Getting Started with Front ESSENTIALS Teams That Use Front How To Roll Out Front Quick Start Productivity Tips Downloading Front Adding Your Team Inbox Add Your Own Work Email Update

More information

Instructions for the Day of Ruby Ruby on Rails Tutorial

Instructions for the Day of Ruby Ruby on Rails Tutorial Instructions for the Day of Ruby Ruby on Rails Tutorial 1. Make sure you have the vendor files from http://www.cornetdesign.com/files/dor.zip. 2. Open a terminal window and change to a project directory.

More information

Toby Crawley. Creative Commons BY-SA 3.0. Charlotte.rb May 2011

Toby Crawley. Creative Commons BY-SA 3.0. Charlotte.rb May 2011 Toby Crawley Creative Commons BY-SA 3.0 Charlotte.rb May 2011 whoami @tcrawley C > Java > PHP > Java > Ruby > Java? Red Hat Senior Engineer member of Goal To convert you all to TorqueBox users! TorqueBox

More information

Lab 5: Web Application Test Automation

Lab 5: Web Application Test Automation Software Testing MTAT.03.159 Lab 5: Web Application Test Automation Inst. of Comp. Science, University of Tartu Spring 2018 Instructions Submission deadline: Lab reports must be submitted within seven

More information

Fast, Sexy, and Svelte: Our Kind of Rails Testing. Dan Manges (ThoughtWorks) zak (unemployed)

Fast, Sexy, and Svelte: Our Kind of Rails Testing. Dan Manges (ThoughtWorks) zak (unemployed) Fast, Sexy, and Svelte: Our Kind of Rails Testing Dan Manges (ThoughtWorks) zak (unemployed) a translation without buzzwords notes short build times maintainable comprehensive coverage this talk: how to

More information

PDI Techniques Logging and Monitoring

PDI Techniques Logging and Monitoring PDI Techniques Logging and Monitoring Change log (if you want to use it): Date Version Author Changes Contents Overview... 1 Before You Begin... 1 Terms You Should Know... 1 Use Case: Setting Appropriate

More information

Courslets, a golf improvement web service. Peter Battaglia

Courslets, a golf improvement web service. Peter Battaglia Courslets, a golf improvement web service Peter Battaglia Discussion Project Overview Design and Technologies Utilized Rails and REST URLs, URLs, URLs Rails and Web Services What s s exposed as a service?

More information

Ruby on Rails. SITC Workshop Series American University of Nigeria FALL 2017

Ruby on Rails. SITC Workshop Series American University of Nigeria FALL 2017 Ruby on Rails SITC Workshop Series American University of Nigeria FALL 2017 1 Evolution of Web Web 1.x Web 1.0: user interaction == server roundtrip Other than filling out form fields Every user interaction

More information

DRYing Out MVC (ESaaS 5.1)"

DRYing Out MVC (ESaaS 5.1) DRYing Out MVC (ESaaS 5.1)" Armando Fox" 2013 Armando Fox & David Patterson, all rights reserved Don t Repeat Yourself but how?" Goal: enforce that movie names must be less than 40 characters" Call a check

More information

Typus Documentation. Release beta. Francesc Esplugas

Typus Documentation. Release beta. Francesc Esplugas Typus Documentation Release 4.0.0.beta Francesc Esplugas November 20, 2014 Contents 1 Key Features 3 2 Support 5 3 Installation 7 4 Configuration 9 4.1 Initializers................................................

More information

Keeping Rails on the Tracks

Keeping Rails on the Tracks Keeping Rails on the Tracks Mikel Lindsaar @raasdnil lindsaar.net Working in Rails & Ruby for 5+ Years http://lindsaar.net/ http://stillalive.com/ http://rubyx.com/ On the Rails? What do I mean by on the

More information

IronWASP (Iron Web application Advanced Security testing Platform)

IronWASP (Iron Web application Advanced Security testing Platform) IronWASP (Iron Web application Advanced Security testing Platform) 1. Introduction: IronWASP (Iron Web application Advanced Security testing Platform) is an open source system for web application vulnerability

More information

OpenProject AdminGuide

OpenProject AdminGuide OpenProject AdminGuide I. Contents I. Contents... 1 II. List of figures... 2 1 Administration... 2 1.1 Manage projects...2 1.2 Manage users...5 1.3 Manage groups...11 1.4 Manage roles and permissions...13

More information

Principles of Ruby Applica3on Design. Dean Wampler Senior Mentor and Consultant Object Mentor, Inc. Chicago, IL

Principles of Ruby Applica3on Design. Dean Wampler Senior Mentor and Consultant Object Mentor, Inc. Chicago, IL Principles of Ruby Applica3on Design Dean Wampler Senior Mentor and Consultant Object Mentor, Inc. Chicago, IL dean@objectmentor.com 1 Get the latest version of this talk: aspectprogramming.com/papers

More information

ChiliProject - Bug # 529: builder is not part of the bundle. Add it to Gemfile

ChiliProject - Bug # 529: builder is not part of the bundle. Add it to Gemfile ChiliProject - Bug # 529: builder is not part of the bundle. Add it to Gemfile Status: Closed Priority: Normal Author: Enno Grà per Category: Created: 2011-07-17 Assignee: Updated: 2012-06-23 Due date:

More information

The Rails Initialization Process

The Rails Initialization Process The Rails Initialization Process December 25, 2014 This guide explains the internals of the initialization process in Rails as of Rails 4. It is an extremely in-depth guide and recommed for advanced Rails

More information

Validations vs. Filters

Validations vs. Filters Validations vs. Filters Advice (DRYness) Validation Filter Check invariants on model Check conditions for allowing controller action to run Pointcut AR model lifecycle hooks Before and/or after any public

More information

Effective Rails Testing Practices

Effective Rails Testing Practices Effective Rails Testing Practices Mike Swieton atomicobject.com atomicobject.com 2007: 16,000 hours General testing strategies Integration tests View tests Controller tests Migration tests Test at a high

More information

Ruby on Rails 3.1 Release Notes

Ruby on Rails 3.1 Release Notes Ruby on Rails 3.1 Release Notes December 25, 2014 Highlights in Rails 3.1: Streaming Reversible Migrations Assets Pipeline jquery as the default JavaScript library These release notes cover only the major

More information

Rails: MVC in action

Rails: MVC in action Ruby on Rails Basic Facts 1. Rails is a web application framework built upon, and written in, the Ruby programming language. 2. Open source 3. Easy to learn; difficult to master. 4. Fun (and a time-saver)!

More information

Intermediate Cucumber. CSCI 5828: Foundations of Software Engineering Lecture 17 03/13/2012

Intermediate Cucumber. CSCI 5828: Foundations of Software Engineering Lecture 17 03/13/2012 Intermediate Cucumber CSCI 5828: Foundations of Software Engineering Lecture 17 03/13/2012 1 ReadyTalk Recruiting Event The ACM Student Chapter is hosting a recruiting event by a local Denver start-up

More information

Toby Crawley. Creative Commons BY-SA 3.0. Raleigh.rb April 2011

Toby Crawley. Creative Commons BY-SA 3.0. Raleigh.rb April 2011 Toby Crawley Creative Commons BY-SA 3.0 Raleigh.rb April 2011 whoami @tcrawley C > Java > PHP > Java > Ruby > Java? Red Hat Senior Engineer member of Goal To have you all downloading TorqueBox right after

More information

Unit Testing J2EE from JRuby. Evan Light

Unit Testing J2EE from JRuby. Evan Light Unit Testing J2EE from JRuby Evan Light http://evan.tiggerpalace.com Who I am Professional developer since 1996 Java since 1999 J2EE since 2000 Ruby since 2006 Some yutz with Keynote and a remote control

More information

GIT FOR SYSTEM ADMINS JUSTIN ELLIOTT PENN STATE UNIVERSITY

GIT FOR SYSTEM ADMINS JUSTIN ELLIOTT PENN STATE UNIVERSITY GIT FOR SYSTEM ADMINS JUSTIN ELLIOTT PENN STATE UNIVERSITY 1 WHAT IS VERSION CONTROL? Management of changes to documents like source code, scripts, text files Provides the ability to check documents in

More information

Git: Distributed Version Control

Git: Distributed Version Control Git: Distributed Version Control Computer Science and Engineering College of Engineering The Ohio State University Lecture 3 What Does "D" Stand For? Distributed version control Multiple people, distributed

More information

Git: Distributed Version Control

Git: Distributed Version Control Git: Distributed Version Control Computer Science and Engineering College of Engineering The Ohio State University Lecture 3 Demo Prep: Empty (but initialized) repo Linear development: Create, edit, rename,

More information

School of Computing Science Gitlab Platform - User Notes

School of Computing Science Gitlab Platform - User Notes School of Computing Science Gitlab Platform - User Notes Contents Using Git & Gitlab... 1 Introduction... 1 Access Methods... 2 Web Access... 2 Repository Access... 2 Creating a key pair... 2 Adding a

More information

Deploying Rails with Kubernetes

Deploying Rails with Kubernetes Deploying Rails with Kubernetes AWS Edition Pablo Acuña This book is for sale at http://leanpub.com/deploying-rails-with-kubernetes This version was published on 2016-05-21 This is a Leanpub book. Leanpub

More information

Web Application Expectations

Web Application Expectations Effective Ruby on Rails Development Using CodeGear s Ruby IDE Shelby Sanders Principal Engineer CodeGear Copyright 2007 CodeGear. All Rights Reserved. 2007/6/14 Web Application Expectations Dynamic Static

More information

Git! Fundamentals. IT Pro Roundtable! June 17, 2014!! Justin Elliott! ITS / TLT! Classroom and Lab Computing!! Michael Potter!

Git! Fundamentals. IT Pro Roundtable! June 17, 2014!! Justin Elliott! ITS / TLT! Classroom and Lab Computing!! Michael Potter! Git! Fundamentals IT Pro Roundtable! June 17, 2014!! Justin Elliott! ITS / TLT! Classroom and Lab Computing!! Michael Potter! IT Communications 1 What is Version Control? Version Control System (VCS)!

More information

nacelle Documentation

nacelle Documentation nacelle Documentation Release 0.4.1 Patrick Carey August 16, 2014 Contents 1 Standing on the shoulders of giants 3 2 Contents 5 2.1 Getting Started.............................................. 5 2.2

More information

Comprehensive AngularJS Programming (5 Days)

Comprehensive AngularJS Programming (5 Days) www.peaklearningllc.com S103 Comprehensive AngularJS Programming (5 Days) The AngularJS framework augments applications with the "model-view-controller" pattern which makes applications easier to develop

More information

Lecture 3. Miscellaneous Ruby and Testing 1 / 48

Lecture 3. Miscellaneous Ruby and Testing 1 / 48 Lecture 3 Miscellaneous Ruby and Testing 1 / 48 Homework 1 Grades were released! TAs provided feedback on best practices, but did not take off points Keep the comments in mind for future assignments! Any

More information

Active Model Basics. December 29, 2014

Active Model Basics. December 29, 2014 Active Model Basics December 29, 2014 This guide should provide you with all you need to get started using model classes. Active Model allows for Action Pack helpers to interact with plain Ruby objects.

More information

Ruby logistics. CSE341: Programming Languages Lecture 19 Introduction to Ruby and OOP. Ruby: Not our focus. Ruby: Our focus. A note on the homework

Ruby logistics. CSE341: Programming Languages Lecture 19 Introduction to Ruby and OOP. Ruby: Not our focus. Ruby: Our focus. A note on the homework Ruby logistics CSE341: Programming Languages Lecture 19 Introduction to Ruby and OOP Dan Grossman Autumn 2018 Next two sections use the Ruby language http://www.ruby-lang.org/ Installation / basic usage

More information

Overview of the Ruby Language. By Ron Haley

Overview of the Ruby Language. By Ron Haley Overview of the Ruby Language By Ron Haley Outline Ruby About Ruby Installation Basics Ruby Conventions Arrays and Hashes Symbols Control Structures Regular Expressions Class vs. Module Blocks, Procs,

More information

FUNCTIONAL BEST PRACTICES ORACLE USER PRODUCTIVITY KIT

FUNCTIONAL BEST PRACTICES ORACLE USER PRODUCTIVITY KIT FUNCTIONAL BEST PRACTICES ORACLE USER PRODUCTIVITY KIT Purpose Oracle s User Productivity Kit (UPK) provides functionality that enables content authors, subject matter experts, and other project members

More information

RubyMine, the most advanced Ruby and Rails IDE

RubyMine, the most advanced Ruby and Rails IDE RubyMine, the most advanced Ruby and Rails IDE JetBrains RubyMine is a powerful Integrated development environment (IDE) built specifically for Ruby and Rails developers. How does RubyMine match up against

More information

Databases - Have it your way

Databases - Have it your way Databases - Have it your way Frederick Cheung - kgb fred@texperts.com http://www.spacevatican.org 1 kgb Operates a number of Directory Enquiry type products in several countries Runs the 542542 Ask Us

More information

THOMAS LATOZA SWE 621 FALL 2018 DESIGN ECOSYSTEMS

THOMAS LATOZA SWE 621 FALL 2018 DESIGN ECOSYSTEMS THOMAS LATOZA SWE 621 FALL 2018 DESIGN ECOSYSTEMS LOGISTICS HW5 due today Project presentation on 12/6 Review for final on 12/6 2 EXAMPLE: NPM https://twitter.com/garybernhardt/status/1067111872225136640

More information

RailsConf Europe 2008 Juggernaut Realtime Rails. Alex MacCaw and Stuart Eccles

RailsConf Europe 2008 Juggernaut Realtime Rails. Alex MacCaw and Stuart Eccles RailsConf Europe 2008 Juggernaut Realtime Rails Alex MacCaw and Stuart Eccles RailsConf Europe 2008 Juggernaut Realtime Rails Alex MacCaw and Stuart Eccles http://www.madebymany.co.uk/ server push HTTP

More information

Dependency Injection (ESaaS 11.6)! 2013 Armando Fox & David Patterson, all rights reserved

Dependency Injection (ESaaS 11.6)! 2013 Armando Fox & David Patterson, all rights reserved Dependency Injection (ESaaS 11.6)! 2013 Armando Fox & David Patterson, all rights reserved Dependency Inversion & Dependency Injection" Problem: a depends on b, but b interface & implementation can change,

More information

Rails: Views and Controllers

Rails: Views and Controllers Rails: Views and Controllers Computer Science and Engineering College of Engineering The Ohio State University Lecture 18 Recall: Rails Architecture Wiring Views and Controllers A controller is just an

More information

Rails: Associations and Validation

Rails: Associations and Validation Rails: Associations and Validation Computer Science and Engineering College of Engineering The Ohio State University Lecture 17 Schemas, Migrations, Models migrations models database.yml db:migrate db:create

More information

Episode 298. Getting Started With Spree

Episode 298. Getting Started With Spree Episode 298 Getting Started With Spree Spree 1 is a fully-featured e-commerce solution that can be easily integrated into a Rails application. If you need to turn a Rails app into a store that sells products

More information

Object Visibility: Making the Necessary Connections

Object Visibility: Making the Necessary Connections Object Visibility: Making the Necessary Connections Reprinted from the October 1991 issue of The Smalltalk Report Vol. 2, No. 2 By: Rebecca J. Wirfs-Brock An exploratory design is by no means complete.

More information

Building a (resumable and extensible) DSL with Apache Groovy Jesse Glick CloudBees, Inc.

Building a (resumable and extensible) DSL with Apache Groovy Jesse Glick CloudBees, Inc. Building a (resumable and extensible) DSL with Apache Groovy Jesse Glick CloudBees, Inc. Introduction About Me Longtime Jenkins core contributor Primary developer on Jenkins Pipeline Meet Jenkins Pipeline

More information

We re working full time this summer alongside 3 UCOSP (project course) students (2 from Waterloo: Mark Rada & Su Zhang, 1 from UofT: Angelo Maralit)

We re working full time this summer alongside 3 UCOSP (project course) students (2 from Waterloo: Mark Rada & Su Zhang, 1 from UofT: Angelo Maralit) We re working full time this summer alongside 3 UCOSP (project course) students (2 from Waterloo: Mark Rada & Su Zhang, 1 from UofT: Angelo Maralit) Our supervisors: Karen: heads project, which has been

More information

Rails: Associations and Validation

Rails: Associations and Validation Rails: Associations and Validation Computer Science and Engineering College of Engineering The Ohio State University Lecture 26 Schemas, Migrations, Models migrations models database.yml db:migrate db:create

More information

Welcome To Account Manager 2.0

Welcome To Account Manager 2.0 Account Manager 2.0 Manage Unlimited FileMaker Servers, Databases, Privileges, and Users Effortlessly! The ultimate tool for FileMaker Database Administrators. Welcome To Account Manager 2.0 What Is Account

More information

Ajax On Rails: Build Dynamic Web Applications With Ruby By Scott Raymond READ ONLINE

Ajax On Rails: Build Dynamic Web Applications With Ruby By Scott Raymond READ ONLINE Ajax On Rails: Build Dynamic Web Applications With Ruby By Scott Raymond READ ONLINE Let's take a look at how we can accomplish this with AJAX in Rails. Overall, I was quite surprised at how easy it is

More information

Write Your C Extension for Ruby. 簡煒航 (Jian

Write Your C Extension for Ruby. 簡煒航 (Jian Write Your C Extension for Ruby 簡煒航 (Jian Weihang) @tonytonyjan Bonjour 簡煒航 Jian, Weihang tonytonyjan.net tonytonyjan tonytonyjan tonytonyjan tonytonyjan tonytonyjan tonytonyjan Double Keyboard Player

More information

String Calculator TDD Kata

String Calculator TDD Kata String Calculator TDD Kata Created by Roy Osherove http://osherove.com/tdd-kata-1 Ruby Solution based on performance by Corey Haines http://katas.softwarecraftsmanship.org/?p=80 Basic Requirements Create

More information

USING GIT FOR AUTOMATION AND COLLABORATION JUSTIN ELLIOTT - MATT HANSEN PENN STATE UNIVERSITY

USING GIT FOR AUTOMATION AND COLLABORATION JUSTIN ELLIOTT - MATT HANSEN PENN STATE UNIVERSITY USING GIT FOR AUTOMATION AND COLLABORATION JUSTIN ELLIOTT - MATT HANSEN PENN STATE UNIVERSITY AGENDA Version control overview Introduction and basics of Git Advanced Git features Collaboration Automation

More information

Don t Repeat Yourself Repeat Others

Don t Repeat Yourself Repeat Others Don t Repeat Yourself Repeat Others RailsConf Baltimore, MD June 8, 2010 John Nunemaker Ordered List Why? Why? I am obsessed with improving Why? I am obsessed with improving I have learned a lot of late

More information

Copyright 2013 Avdi Grimm. All rights reserved.

Copyright 2013 Avdi Grimm. All rights reserved. Copyright 2013 Avdi Grimm. All rights reserved. Confident Ruby 4.17 Represent special cases as objects If it's possible to for a variable to be null, you have to remember to surround it with null test

More information

Crystal for Rubyists

Crystal for Rubyists Crystal for Rubyists Serdar Dogruyol Contents Preamble 2 Why Crystal? 3 Installing Crystal 5 Binary installers.............................. 5 From Source................................ 5 Future Proofing............................

More information

JRuby and Ioke. On Google AppEngine. Ola Bini

JRuby and Ioke. On Google AppEngine. Ola Bini JRuby and Ioke On Google AppEngine Ola Bini ola.bini@gmail.com http://olabini.com/blog Vanity slide ThoughtWorks consultant/developer/programming language geek JRuby Core Developer From Stockholm, Sweden

More information

Contributing to Insoshi with Git and GitHub. Michael Hartl

Contributing to Insoshi with Git and GitHub. Michael Hartl Contributing to Insoshi with Git and GitHub Michael Hartl + Winter 08 + Winter 08 + = Winter 08 Open-source social networking platform dogfood.insoshi.com #1 #1 #2 Common Contacts class Person

More information

Pragmatic Guide to Git

Pragmatic Guide to Git Extracted from: Pragmatic Guide to Git This PDF file contains pages extracted from Pragmatic Guide to Git, published by the Pragmatic Bookshelf. For more information or to purchase a paperback or PDF copy,

More information

CS169.1x Lecture 6: Basic Rails" Fall 2012"

CS169.1x Lecture 6: Basic Rails Fall 2012 CS169.1x Lecture 6: Basic Rails" Fall 2012" 1" The Database is Golden Contains valuable customer data don t want to test your app on that! Rails solution: development, production and test environments

More information

Submitting your Work using GIT

Submitting your Work using GIT Submitting your Work using GIT You will be using the git distributed source control system in order to manage and submit your assignments. Why? allows you to take snapshots of your project at safe points

More information

Installing Open Project on Ubuntu AWS with Apache and Postgesql

Installing Open Project on Ubuntu AWS with Apache and Postgesql Installing Open Project on Ubuntu AWS with Apache and Postgesql Contents Installing Open Project on Ubuntu AWS with Apache and Postgesql... 1 Add new ports to your security group... 2 Update your system...

More information

Windows. Everywhere else

Windows. Everywhere else Git version control Enable native scrolling Git is a tool to manage sourcecode Never lose your coding progress again An empty folder 1/30 Windows Go to your programs overview and start Git Bash Everywhere

More information

Tooling for Ajax-Based Development. Craig R. McClanahan Senior Staff Engineer Sun Microsystems, Inc.

Tooling for Ajax-Based Development. Craig R. McClanahan Senior Staff Engineer Sun Microsystems, Inc. Tooling for Ajax-Based Development Craig R. McClanahan Senior Staff Engineer Sun Microsystems, Inc. 1 Agenda In The Beginning Frameworks Tooling Architectural Approaches Resources 2 In The Beginning 3

More information

Seven Habits of Highly Effective Jenkins Users

Seven Habits of Highly Effective Jenkins Users Seven Habits of Highly Effective Jenkins Users What is this talk about? Lessons learned: Maintaining multiple large Jenkins instances. Working on Jenkins itself, and many of its plugins. Seeing customer

More information

Introduction to Ruby on Rails

Introduction to Ruby on Rails Introduction to Ruby on Rails Software Engineering II WS 2016/17 Arian Treffer arian.treffer@hpi.de Prof. Plattner, Dr. Uflacker Enterprise Platform and Integration Concepts group Introduction to Ruby

More information

classjs Documentation

classjs Documentation classjs Documentation Release 1.0 Angelo Dini December 30, 2015 Contents 1 Introduction 3 1.1 Why class.js............................................... 3 1.2 How to implement............................................

More information

Lecture 3. Miscellaneous Ruby and Testing 1 / 40

Lecture 3. Miscellaneous Ruby and Testing 1 / 40 Lecture 3 Miscellaneous Ruby and Testing 1 / 40 Homework 1 Grades were released! TAs provided feedback on best practices, but did not take off points Keep the comments in mind for future assignments! Any

More information

Intro Technical details Using vcsh Outlook Outro. vcsh. manage config files in $HOME via fake bare git repositories

Intro Technical details Using vcsh Outlook Outro. vcsh. manage config files in $HOME via fake bare git repositories Intro Technical details Using Outlook Outro manage config files in $HOME via fake bare git repositories Richard Hartmann, RichiH@{freenode,OFTC,IRCnet}, richih.mailinglist@gmail.com 2012-02-04 Intro Technical

More information

Lab 08. Command Line and Git

Lab 08. Command Line and Git Lab 08 Command Line and Git Agenda Final Project Information All Things Git! Make sure to come to lab next week for Python! Final Projects Connect 4 Arduino ios Creative AI Being on a Team - How To Maximize

More information

USING GIT WITH, AND AUTOMATING MUNKI. Adam Reed

USING GIT WITH, AND AUTOMATING MUNKI. Adam Reed USING GIT WITH, AND AUTOMATING MUNKI Adam Reed The Australian National University Hashtag : #xw13 Please leave comments on this talk at auc.edu.au/xworld/sessions 1 Git Powerful Version Control System

More information

Ruby on Rails TKK, Otto Hilska

Ruby on Rails TKK, Otto Hilska Ruby on Rails intro @ TKK, 25.5.2009 Otto Hilska 1 Today s agenda 1. The Ruby programming language 2. Ruby on Rails framework 3. An example project 2 About me Started Nodeta Oy in 2004 10+ employees always

More information

Smalltalk: developed at Xerox Palo Alto Research Center by the Learning Research Group in the 1970 s (Smalltalk-72, Smalltalk-76, Smalltalk-80)

Smalltalk: developed at Xerox Palo Alto Research Center by the Learning Research Group in the 1970 s (Smalltalk-72, Smalltalk-76, Smalltalk-80) A Bit of History Some notable examples of early object-oriented languages and systems: Sketchpad (Ivan Sutherland s 1963 PhD dissertation) was the first system to use classes and instances (although Sketchpad

More information

Using Git For Development. Shantanu Pavgi, UAB IT Research Computing

Using Git For Development. Shantanu Pavgi, UAB IT Research Computing Using Git For Development Shantanu Pavgi, pavgi@uab.edu UAB IT Research Computing Outline Version control system Git Branching and Merging Workflows Advantages Version Control System (VCS) Recording changes

More information

Continuous Delivery of your infrastructure. Christophe

Continuous Delivery of your infrastructure. Christophe Continuous Delivery of your infrastructure Christophe Vanlancker @Carroarmato0 Christophe Vanlancker Internal operations and consulting Mentor Kris couldn t make it so I s/kris/christophe/g Todays Goals

More information

User Plugins. About Plugins. Deploying Plugins

User Plugins. About Plugins. Deploying Plugins User Plugins About Plugins Artifactory Pro allows you to easily extend Artifactory's behavior with your own plugins written in Groovy. User plugins are used for running user's code in Artifactory. Plugins

More information

Ruby Primer and Review for Developers

Ruby Primer and Review for Developers A PPENDIX A Ruby Primer and Review for Developers This T appendix is designed to act as both a Ruby primer and review, useful both to developers who want to brush up rapidly on their Ruby knowledge, and

More information

Symfony is based on the classic web design pattern called the MVC pattern

Symfony is based on the classic web design pattern called the MVC pattern -Hemalatha What is Symfony Symfony is an Open source web application framework for PHP5 projects. PHP is a general purpose scripting language designed for web development The best use of PHP is in creating

More information

Lecture 3. Miscellaneous Ruby and Testing

Lecture 3. Miscellaneous Ruby and Testing Lecture 3 Miscellaneous Ruby and Testing 1 Sublime Text Guide I wrote a quick Sublime Text Guide that will help with Rubocop offenses It ll walk you through: Using spaces instead of tabs by default Using

More information

PUPPET MODULES: A HOLISTIC APPROACH

PUPPET MODULES: A HOLISTIC APPROACH PUPPET MODULES: A HOLISTIC APPROACH PuppetCamp Geneva 2012 Alessandro Franceschi PUPPET @ LAB 42 2007 - Meet Puppet. Managed the Bank of Italy webfarm 2008 - First generation of Lab42 Puppet Modules 2009

More information