:nth-child selector.
EG, a list of dates are in a <ul> with the id #dates:
page.should have_selector("ul#dates li:nth-child(1)", content: @date1.content)
page.should have_selector("ul#dates li:nth-child(2)", content: @date2.content)
| module Factorizer | |
| # `factorize` allows Classes to create new class methods it does this by | |
| # calling public_method(:new) on the class rather than directly calling new | |
| # therebye ensuring single responsibility is followed | |
| def factorize(klass, *attrs) | |
| klass = Object.const_get(klass) | |
| klass_source(klass).call(*attrs) | |
| end |
| module Decorator | |
| def initialize(component) | |
| @component = component | |
| end | |
| def method_missing(meth, *args) | |
| if @component.respond_to? meth | |
| @component.send(meth, *args) | |
| else |
| module Component | |
| def decorate_with(*decorators) | |
| decorators.inject(self) do |object, decorator| | |
| decorator.new(object) | |
| end | |
| end | |
| end |
| This file contains any messages produced by compilers while | |
| running configure, to aid debugging if configure makes a mistake. | |
| It was created by R configure 2.15.0, which was | |
| generated by GNU Autoconf 2.68. Invocation command line was | |
| $ ./configure --prefix=/usr/local/Cellar/r/2.15.0 --with-aqua --enable-R-framework --with-lapack | |
| ## --------- ## | |
| ## Platform. ## |
| ~/Desktop% brew install -v R | |
| ==> Downloading http://cran.r-project.org/src/base/R-2/R-2.15.0.tar.gz | |
| Already downloaded: /Library/Caches/Homebrew/r-2.15.0.tar.gz | |
| /usr/bin/tar xf /Library/Caches/Homebrew/r-2.15.0.tar.gz | |
| ==> Using Homebrew-provided fortran compiler. | |
| This may be changed by setting the FC environment variable. | |
| ==> ./configure --prefix=/usr/local/Cellar/r/2.15.0 --with-aqua --enable-R-framework --with-lapack | |
| ./configure --prefix=/usr/local/Cellar/r/2.15.0 --with-aqua --enable-R-framework --with-lapack | |
| checking build system type... x86_64-apple-darwin11.4.0 |
| % brew --config | |
| HOMEBREW_VERSION: 0.9 | |
| HEAD: 79772aa31d4af4247c08c647f76004b9f94d8d59 | |
| HOMEBREW_PREFIX: /usr/local | |
| HOMEBREW_CELLAR: /usr/local/Cellar | |
| CPU: dual-core 64-bit penryn | |
| OS X: 10.7.4 | |
| Kernel Architecture: x86_64 | |
| Xcode: 4.3.2 | |
| GCC-4.0: N/A |
:nth-child selector.
EG, a list of dates are in a <ul> with the id #dates:
page.should have_selector("ul#dates li:nth-child(1)", content: @date1.content)
page.should have_selector("ul#dates li:nth-child(2)", content: @date2.content)
| # https://github.com/eBioGit/R-by-example/blob/master/database%20interface/RpostgreSQL.R | |
| ############# EXEMPEL PostgreSQL ############## | |
| # Calling R in command mode | |
| # R --no-save < RpostgreSQL.R | |
| library("DBI") | |
| library("RPostgreSQL") | |
| ############## SETS LOGIN INFORMATION ############## |
| library(XML) | |
| # URL of interest: | |
| mps <- "http://news.bbc.co.uk/2/hi/uk_politics/8044207.stm" | |
| # parse the document for R representation: | |
| mps.doc <- htmlParse(mps) | |
| # get all the tables in mps.doc as data frames |
| listElement: function(value) { | |
| return $("<li>").attr("id", this.determineId("element_" + value)) | |
| .text(this.universe[value]); | |
| }, | |
| linkElement: function(value) { | |
| return $("<a href='#'>").addClass("delete-button") | |
| .attr("id", this.determineId("delete_" + value)) | |
| .text(" Delete"); | |
| }, |