background preloader

Gems (lib)

Facebook Twitter

AWS Developer Blog - Ruby. File: README — AWS SDK for Ruby. Stubbing AWS Responses - AWS Ruby Blog. Right_aws (3.0.4) README. Introduction to Rails Screencast. Isn't it funny how most "introduction to Ruby on Rails" screencasts are overly simplistic, and rely on generators like scaffolding? The teacher typically follows up the tutorial by stating that most Rails developer don't use scaffolding generators. Well that's not much help then! I'd like to give you the tutorial I wish I had. Along the way, we'll also rely heavily on test-driven development to build a simple app.

Create models and generatorsUse test-driven development to plan and test an application’s featuresWork with ActiveRecordAutotest with Guard Use Rspec and Capybara to simulate the user.Create partialsTake advantage of Flash notices…and plenty more If you watched the entire screencast, I hope you enjoyed it! [mocha-developer] A quick guide to Mocha. README - Mocha 0.13.3. Description A Ruby library for mocking and stubbing.A unified, simple and readable syntax for both full & partial mocking.Built-in support for MiniTest and Test::Unit.Supported by many other test frameworks. Installation Gem Install the latest version of the gem with the following command... $ gem install mocha Note: If you are intending to use Mocha with Test::Unit or MiniTest, you should only setup Mocha after loading the relevant test library...

Test::Unit require 'rubygems'gem 'mocha'require 'test/unit'require 'mocha/test_unit' MiniTest require 'rubygems'gem 'mocha'require 'minitest/unit'require 'mocha/mini_test' Bundler If you're using Bundler, include Mocha in the Gemfile and then setup Mocha later once you know the test library has been loaded... gem "mocha" require "test/unit"require "mocha/test_unit" gem "mocha" require "minitest/unit"require "mocha/mini_test" Rails gem 'mocha' require 'mocha/mini_test' Rails Plugin Install the Rails plugin... require 'mocha/mini_test' Know Issues Usage Quick Start. Mocha::API. User Guide | RubyGems Manuals. Frequently Asked Questions | RubyGems Manuals. Command Reference - RubyGems Guides. What each gem command does, and how to use it. This reference was automatically generated from RubyGems version 2.5.1. gem build Build a gem from a gemspec Usage gem build GEMSPEC_FILE [options] Options: -​-force - skip validation of the spec Common Options: -h, -​-help - Get help on this command -V, -​-[no-]verbose - Set the verbose level of output -q, -​-quiet - Silence commands -​-config-file FILE - Use this config file instead of default -​-backtrace - Show stack backtrace on errors -​-debug - Turn on Ruby debugging Arguments GEMSPEC_FILE - gemspec file name to build a gem for Description The build command allows you to create a gem from a ruby gemspec.

The best way to build a gem is to use a Rakefile and the Gem::PackageTask which ships with RubyGems. The gemspec can either be created by hand or extracted from an existing gem with gem spec: $ gem unpack my_gem-1.0.gem Unpacked gem: '... gem cert Manage RubyGems certificates and signing settings gem cert [options] gem cert --build you@example or: Gem Command Reference | RubyGems Manuals.

Cucumber Introduction (comprehensive) Or: How I Learned to Stop Worrying and Love Testing Start Behaving Introduction Cucumber is a tool that implements a Behaviour Driven Design (BDD) workflow. This document deals principally with initial set up and first use of the Cucumber-Rails and Cucumber Rubygems. It takes as its background the Ruby on Rails (RoR) web application framework. Detailed discussion of Behaviour Driven (BDD), Test Driven (TDD), and Panic Driven Development (SNAFU aka Cowboy Coding) can be found elsewhere.

Of course, there are still some skeptics on this whole Agile thing; not to mention heretics. But, if you are reading this then you probably are not one of them. You will find some familiarity with the Ruby language helpful and of the RoR framework somewhat less so. Details regarding installing the Cucumber Rubygem and its recommended support tools for RoR are found on this wiki under the heading Ruby on Rails. Where to Start? The foregoing gives a sample of the form that feature files often take ( sadly ). Cucumber/aruba step deffinitions. Rb is YAML for Ruby | Cookbook. At the YamlForRuby site Welcome to the Yaml Cookbook for Ruby. This version of the Yaml Cookbook focuses on the Ruby implementation of Yaml by comparing Yaml documents with their Ruby counterparts.

YAML(tm) is a readable text format for data structures. As you'll see below, YAML can handle many common data types and structures. And what YAML can't handle natively can be supported through flexible type families. For example, YAML for Ruby uses type families to support storage of regular expressions, ranges and object instances. You can learn more about YAML at YAML.org or the YAML WikiWiki. Simple Sequence Brief You can specify a list in YAML by placing each member of the list on a new line with an opening dash. Yaml Ruby Nested Sequences You can include a sequence within another sequence by giving the sequence an empty dash, followed by an indented list.

Mixed Sequences Sequences can contain any YAML data, including strings and other sequences. Deeply Nested Sequences Simple Mapping Nested Mappings. RubyBindings - selenium - Ruby bindings - Browser automation framework. The Ruby bindings for Selenium/WebDriver are available as the selenium-webdriver gem. The web page explains how to install the selenium-webdriver gem. On Mac OSX and linux you may need to prefix the rest of the command with the sudo command if the installation fails because of security restrictions on your computer.

There are many other Selenium gems out there, but this is the only official, maintained gem. If you're looking for a slightly higher level API built on the same technology, you may want to check out watir-webdriver or capybara. The bindings support Ruby 1.9.2 through 2.0.0, JRuby and Rubinius. The gem also includes the older selenium-client gem for use with Selenium RC. Selenium::WebDriver - the WebDriver API Selenium::Client - Selenium RC API (previously released as the selenium-client gem) The WebDriver API is the successor to the Selenium RC API. The bindings provide a slightly rubified version of the WebDriver API: require "selenium-webdriver" puts driver.title driver.quit. Savon: Heavy metal SOAP client. Do YOU know Resque? Do YOU know Resque? This guest post is by Dave Hoover, who authored the book Apprenticeship Patterns: Guidance for the Aspiring Software Craftsman for O’Reilly, instigated the Software Craftsmanship North America conference, and is the Chief Craftsman at Obtiva.

Dave began teaching himself to program in 2000, back when he was a family therapist. Dave lives near Chicago with his wife and three children. In his spare time, Dave competes in endurance sports. Web developers can sometimes forget the importance of doing as little work as possible during the HTTP request-response life-cycle. When we’re developing new features, the simplest thing to do is just handle all the work that has been requested before responding, making the user wait, patiently watching their browser spin. This is nearly always a bad idea, and for reasons beyond user experience, most notably, it ties up a web process, making your site more likely to experience outages as traffic spikes. Nice and simple. Stream Parsing with REXML. Hi (again, sort of) :) I am still on my quest to write a program that parses a large XML file. After having tried to do it in tree mode, I had to realize that the performance was simply abysmal. So back to the drawing board. But, and here is the thing...I could find a good straight-forward tutorial on how to write a stream parser using REXML.

The official tutorial is pretty much mute on that part and the only other example I found (or rather was pointed to - was way too complex for someone like me who is still pretty much a beginner in ruby. So, what I am looking for is either a brief description of how to write an event driven parser or else a link to a good and simple tutorial.

For the former, this is what the parser should do: Find the element "Gene-ref", allow me to access its children and then close and repeat for the next "Gene-ref entry. In xml code, that would look like <something here><Gene-ref><name>... dusty (Guest)