gem install rails --pre
rails new my_app -T
| # config/locales/en.yml | |
| en: | |
| errors: | |
| messages: | |
| wrong_size: "is the wrong size (should be %{file_size})" | |
| size_too_small: "is too small (should be at least %{file_size})" | |
| size_too_big: "is too big (should be at most %{file_size})" |
| .fc { | |
| direction: ltr; | |
| text-align: left; } | |
| .fc table { | |
| border-collapse: collapse; | |
| border-spacing: 0; } | |
| .fc .btn { | |
| line-height: 1.2em; } | |
| html .fc { |
| module CapybaraWithPhantomJs | |
| include Capybara | |
| # Create a new PhantomJS session in Capybara | |
| def new_session | |
| # Register PhantomJS (aka poltergeist) as the driver to use | |
| Capybara.register_driver :poltergeist do |app| | |
| Capybara::Poltergeist::Driver.new(app) | |
| end |
| # Call scopes directly from your URL params: | |
| # | |
| # @products = Product.filter(params.slice(:status, :location, :starts_with)) | |
| module Filterable | |
| extend ActiveSupport::Concern | |
| module ClassMethods | |
| # Call the class methods with the same name as the keys in <tt>filtering_params</tt> | |
| # with their associated values. Most useful for calling named scopes from |
| # spec_helper.rb | |
| require 'rspec' | |
| require 'watir-webdriver' | |
| require 'page-object' | |
| require 'page-object/page_factory' | |
| require 'require_all' | |
| require_all 'lib/pages' | |
| RSpec.configure do |config| |
| <comment-box> | |
| <h1>{ opts.title }</h1> | |
| <comment-list url={ opts.url } comments={ comments } /> | |
| <comment-form url={ opts.url } /> | |
| this.comments = [] | |
| add(comment) { | |
| this.comments.push(comment) |
| source 'https://rubygems.org' | |
| gem 'mechanize' |
| import Ember from 'ember'; | |
| import hbs from 'htmlbars-inline-precompile'; | |
| import connect from 'ember-redux/components/connect'; | |
| var stateToComputed = (state) => { | |
| return { | |
| number: state.number | |
| }; | |
| }; |
| /* | |
| * Tiny tokenizer | |
| * | |
| * - Accepts a subject string and an object of regular expressions for parsing | |
| * - Returns an array of token objects | |
| * | |
| * tokenize('this is text.', { word:/\w+/, whitespace:/\s+/, punctuation:/[^\w\s]/ }, 'invalid'); | |
| * result => [{ token="this", type="word" },{ token=" ", type="whitespace" }, Object { token="is", type="word" }, ... ] | |
| * | |
| */ |