Skip to content

Instantly share code, notes, and snippets.

View rom-http-example.rb
require 'bundler/inline'
gemfile(true) do
source 'https://rubygems.org'
gem 'rom'
gem 'rom-http'
end
require 'rom'
View ex.rb
require 'bundler/inline'
gemfile(true) do
source 'https://rubygems.org'
gem 'rom', github: 'rom-rb/rom' do
gem 'rom-repository'
end
gem 'rom-sql', github: 'rom-rb/rom-sql'
gem 'sqlite3'
View rom-http-repo-aggregate.rb
require 'bundler/inline'
require 'json'
require 'uri'
require 'net/http'
gemfile(true) do
gem 'inflecto'
gem 'rom', github: 'rom-rb/rom'
gem 'rom-support', github: 'rom-rb/rom-support'
gem 'rom-http', github: 'rom-rb/rom-http'
View syncreport.log
This file has been truncated, but you can view the full file.
Player: Blue (Linux Unix 4.4.0.42 Mono 4.6.1 (Stable 4.6.1.5/ef43c15 Wed Oct 12 09:10:37 UTC 2016) CLR 4.0.30319.42000)
Game ID: 0a05e2cd-8206-4e48-a61a-713710fa0f7c (Mod: Red Alert at Version release-20161015)
Sync for net frame 8511 -------------
SharedRandom: 1791148093 (#805374)
Synced Traits:
1 player Neutral PlayerResources (39000)
Cash: 39000
Resources: 0
ResourceCapacity: 0
View rom-http-repo-with-mapper.rb
require 'json'
require 'uri'
require 'net/http'
gemfile(true) do
gem 'anima'
gem 'rom'
gem 'rom-http'
gem 'rom-repository'
end
View rom-repo-crud.rb
require 'bundler/inline'
gemfile(true) do
source 'https://rubygems.org'
gem 'rom', github: 'rom-rb/rom'
gem 'rom-sql', github: 'rom-rb/rom-sql'
gem 'rom-repository', github: 'rom-rb/rom-repository'
gem 'sqlite3'
end
View custom_predicate_with_dependency.rb
require 'dry-validation'
User = Struct.new(:name, :email)
class UserRepository
USERS = []
def create(attributes)
USERS << User.new(*attributes.values_at(:name, :email))
end
View repo_test.rb
require 'bundler/inline'
gemfile(true) do
source 'https://rubygems.org'
gem 'rom', github: 'rom-rb/rom'
gem 'rom-sql', github: 'rom-rb/rom-sql'
gem 'rom-repository', github: 'rom-rb/rom-repository'
gem 'sqlite3'
end
View rom-repo-starter.rb
require 'bundler/inline'
gemfile(true) do
source 'https://rubygems.org'
gem 'rom', github: 'rom-rb/rom'
gem 'rom-sql', github: 'rom-rb/rom-sql'
gem 'rom-repository', github: 'rom-rb/rom-repository'
gem 'sqlite3'
end
View dry-types-custom-classes.rb
require 'dry-types'
class Carrier
attr_reader :name
def initialize(attributes)
@name = attributes.fetch(:name)
end
end
You can’t perform that action at this time.