Skip to content

Instantly share code, notes, and snippets.

Then /response header (.*) should have value of "(*)"/ do |header_name, header_value|
response_headers[header_name].should == header_value
end
def options # :nodoc:
@options ||= begin
parser = ::Spec::Runner::OptionParser.new($stderr, $stdout)
parser.order!(ARGV)
parser.options
end
end
class ScheduledChemicalsOrderNotification
include ::DataMapper::Resource
#
# Properties
#
property :scheduled_at, DateTime
property :executed_at, DateTime
property :chemicals_order_id, Integer
Очередной деплой pump.kg 8 июля. Изменения:
* Лимит размера файна увеличен до 2.5Гб (чтобы @dmsoft наконец скачал образ Федоры :)). Наслаждайтесь :-)
* Таймаут скачивания увеличен до четырёх часов. Посколько ограничения количества потоков сейчас нет, таймаут нужен только для вычленения совсем безнадёжных ссылок.
* Сделано разбиение по страницам (по 50 ссылок). Уж больно быстро накидали ссылок :)
* Повторно постить ссылку теперь можно только если до этого скачивание оканчивалось только ошибкой (вчера вечером кто-то умудрился скачать образ Убунту 13 раз :-)) И ведь скачалось же :))
ActionController::Base.param_parsers[Mime::Type.lookup('application/atom+xml')] = Proc.new do |data|
{ :entry => Atom::Entry.load_entry(data) }
end
class ExtractAnswersTableMigration < ActiveRecord::Migration
def self.up
create_table :answers do |table|
table.string :body
table.integer :question_id
end
answers_strings = Question.all.map(&:answer)
answers_strings.each do |answer_string|
Answer.create! :body => answer_string
class Configuration
@@value = 1
def self.value
@@value
end
end
require 'sinatra'
require 'http_router'
require 'http_router/interface/sinatra'
class Application < Sinatra::Base
register HttpRouter::Interface::Sinatra::Extension
params_inspect = lambda { params.inspect + "\n" }
# These routes will work
Feature: Control access to datasets taking organizations into account
Scenario: User gets a dataset of his own organization
Given there is organization with following properties:
| name | Cucumber, Inc. |
| owner | Cucumber |
| identifier | organization_815 |
When I get /sdata/billingboss/crmErp/organization_815/tradingAccounts
Then response should contain Atom Feed
# Step 1. Setting up environment
class Government
def power
"belongs to government"
end
end
module People
def power