rom 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (9) hide show
  1. data/.gitignore +18 -0
  2. data/.gitmodules +9 -0
  3. data/Gemfile +5 -0
  4. data/LICENSE +1 -1
  5. data/README.md +66 -6
  6. data/lib/rom.rb +6 -0
  7. data/rom.gemspec +21 -0
  8. metadata +108 -30
  9. checksums.yaml +0 -7
data/.gitignore ADDED
@@ -0,0 +1,18 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ coverage
6
+ InstalledFiles
7
+ lib/bundler/man
8
+ pkg
9
+ rdoc
10
+ spec/reports
11
+ test/tmp
12
+ test/version_tmp
13
+ tmp
14
+
15
+ # YARD artifacts
16
+ .yardoc
17
+ _yardoc
18
+ doc/
data/.gitmodules ADDED
@@ -0,0 +1,9 @@
1
+ [submodule "rom-relation"]
2
+ path = rom-relation
3
+ url = git@github.com:rom-rb/rom-relation.git
4
+ [submodule "rom-mapper"]
5
+ path = rom-mapper
6
+ url = git@github.com:rom-rb/rom-mapper.git
7
+ [submodule "rom-session"]
8
+ path = rom-session
9
+ url = git@github.com:rom-rb/rom-session.git
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'rom-relation', :git => 'https://github.com/rom-rb/rom-relation.git'
4
+ gem 'rom-mapper', :git => 'https://github.com/rom-rb/rom-mapper.git'
5
+ gem 'rom-session', :git => 'https://github.com/rom-rb/rom-session.git'
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2013 Dan Kubb
1
+ Copyright (c) 2013 Ruby Object Mapper Team
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -1,9 +1,69 @@
1
- rom
2
- ===
1
+ # Ruby Object Mapper
3
2
 
4
- Ruby Object Manager
3
+ This is a meta-project grouping pieces of ROM's default stack:
5
4
 
6
- Copyright
7
- ---------
5
+ * [rom-relation](https://github.com/rom-rb/rom-relation)
6
+ * [rom-mapper](https://github.com/rom-rb/rom-mapper)
7
+ * [rom-session](https://github.com/rom-rb/rom-session)
8
8
 
9
- Copyright © 2013 Dan Kubb. See LICENSE for details.
9
+ ## Getting started
10
+
11
+ ### 1. Set up environment and define schema
12
+
13
+ ```ruby
14
+ require 'rom'
15
+
16
+ env = ROM::Environment.coerce(memory: 'memory://test')
17
+
18
+ env.schema do
19
+ base_relation :users do
20
+ repository :memory
21
+
22
+ attribute :id, Serial
23
+ attribute :name, String
24
+
25
+ key :id
26
+ end
27
+ end
28
+ ```
29
+
30
+ ### 2. Set up mapping
31
+
32
+ ```ruby
33
+ class User
34
+ attr_reader :id, :name
35
+
36
+ def initialize(attributes)
37
+ @id, @name = attributes.values_at(:id, :name)
38
+ end
39
+ end
40
+
41
+ env.mapping do
42
+ users do
43
+ map :id, :name
44
+ model User
45
+ end
46
+ end
47
+ ```
48
+
49
+ ### 3. Work with Plain Old Ruby Objects
50
+
51
+ ```ruby
52
+ env.session do |session|
53
+ session[:users].save(User.new(id: 1, name: 'Jane'))
54
+ session.commit
55
+ end
56
+
57
+ jane = env[:users].restrict(name: 'Jane').one
58
+ ```
59
+
60
+ ## Authors
61
+
62
+ * [Dan Kubb](https://github.com/dkubb)
63
+ * [Markus Schirp](https://github.com/mbj)
64
+ * [Martin Gamsjaeger](https://github.com/snusnu)
65
+ * [Piotr Solnica](https://github.com/solnic)
66
+
67
+ ## Licence
68
+
69
+ See `LICENSE` file.
data/lib/rom.rb ADDED
@@ -0,0 +1,6 @@
1
+ module ROM
2
+ end
3
+
4
+ require 'rom-relation'
5
+ require 'rom-mapper'
6
+ require 'rom-session'
data/rom.gemspec ADDED
@@ -0,0 +1,21 @@
1
+ # encoding: utf-8
2
+
3
+ require File.expand_path('../lib/version', __FILE__)
4
+
5
+ Gem::Specification.new do |gem|
6
+ gem.name = 'rom'
7
+ gem.summary = 'Ruby Object Mapper'
8
+ gem.description = gem.summary
9
+ gem.authors = ['Piotr Solnica', 'Dan Kubb', 'Markus Schirp', 'Martin Gamsjaeger'].sort
10
+ gem.email = ['piotr.solnica@gmail.com', 'dan.kubb@gmail.com', 'mbj@schirp-dso.com', 'gamsnjaga@gmail.com'].sort
11
+ gem.homepage = 'http://rom-rb.org'
12
+ gem.require_paths = ['lib']
13
+ gem.version = ROM::VERSION
14
+ gem.files = `git ls-files`.split("\n")
15
+ gem.test_files = `git ls-files -- {spec}/*`.split("\n")
16
+ gem.license = 'MIT'
17
+
18
+ gem.add_dependency 'rom-relation', '~> 0.1.0'
19
+ gem.add_dependency 'rom-mapper', '~> 0.1.0'
20
+ gem.add_dependency 'rom-session', '~> 0.1.0'
21
+ end
metadata CHANGED
@@ -1,47 +1,125 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: rom
3
- version: !ruby/object:Gem::Version
4
- version: 0.0.1
3
+ version: !ruby/object:Gem::Version
4
+ hash: 27
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 1
9
+ - 0
10
+ version: 0.1.0
5
11
  platform: ruby
6
- authors:
12
+ authors:
7
13
  - Dan Kubb
14
+ - Markus Schirp
15
+ - Martin Gamsjaeger
16
+ - Piotr Solnica
8
17
  autorequire:
9
18
  bindir: bin
10
19
  cert_chain: []
11
- date: 2013-05-31 00:00:00.000000000 Z
12
- dependencies: []
13
- description: Ruby Object Manager
14
- email: dan.kubb@gmail.com
20
+
21
+ date: 2013-08-23 00:00:00 Z
22
+ dependencies:
23
+ - !ruby/object:Gem::Dependency
24
+ name: rom-relation
25
+ prerelease: false
26
+ requirement: &id001 !ruby/object:Gem::Requirement
27
+ none: false
28
+ requirements:
29
+ - - ~>
30
+ - !ruby/object:Gem::Version
31
+ hash: 27
32
+ segments:
33
+ - 0
34
+ - 1
35
+ - 0
36
+ version: 0.1.0
37
+ type: :runtime
38
+ version_requirements: *id001
39
+ - !ruby/object:Gem::Dependency
40
+ name: rom-mapper
41
+ prerelease: false
42
+ requirement: &id002 !ruby/object:Gem::Requirement
43
+ none: false
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ hash: 27
48
+ segments:
49
+ - 0
50
+ - 1
51
+ - 0
52
+ version: 0.1.0
53
+ type: :runtime
54
+ version_requirements: *id002
55
+ - !ruby/object:Gem::Dependency
56
+ name: rom-session
57
+ prerelease: false
58
+ requirement: &id003 !ruby/object:Gem::Requirement
59
+ none: false
60
+ requirements:
61
+ - - ~>
62
+ - !ruby/object:Gem::Version
63
+ hash: 27
64
+ segments:
65
+ - 0
66
+ - 1
67
+ - 0
68
+ version: 0.1.0
69
+ type: :runtime
70
+ version_requirements: *id003
71
+ description: Ruby Object Mapper
72
+ email:
73
+ - dan.kubb@gmail.com
74
+ - gamsnjaga@gmail.com
75
+ - mbj@schirp-dso.com
76
+ - piotr.solnica@gmail.com
15
77
  executables: []
78
+
16
79
  extensions: []
17
- extra_rdoc_files:
80
+
81
+ extra_rdoc_files: []
82
+
83
+ files:
84
+ - .gitignore
85
+ - .gitmodules
86
+ - Gemfile
18
87
  - LICENSE
19
88
  - README.md
20
- files:
21
- - LICENSE
22
- - README.md
23
- homepage:
24
- licenses: []
25
- metadata: {}
89
+ - lib/rom.rb
90
+ - rom.gemspec
91
+ homepage: http://rom-rb.org
92
+ licenses:
93
+ - MIT
26
94
  post_install_message:
27
95
  rdoc_options: []
28
- require_paths:
96
+
97
+ require_paths:
29
98
  - lib
30
- required_ruby_version: !ruby/object:Gem::Requirement
31
- requirements:
32
- - - '>='
33
- - !ruby/object:Gem::Version
34
- version: '0'
35
- required_rubygems_version: !ruby/object:Gem::Requirement
36
- requirements:
37
- - - '>='
38
- - !ruby/object:Gem::Version
39
- version: '0'
99
+ required_ruby_version: !ruby/object:Gem::Requirement
100
+ none: false
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ hash: 3
105
+ segments:
106
+ - 0
107
+ version: "0"
108
+ required_rubygems_version: !ruby/object:Gem::Requirement
109
+ none: false
110
+ requirements:
111
+ - - ">="
112
+ - !ruby/object:Gem::Version
113
+ hash: 3
114
+ segments:
115
+ - 0
116
+ version: "0"
40
117
  requirements: []
118
+
41
119
  rubyforge_project:
42
- rubygems_version: 2.0.3
120
+ rubygems_version: 1.8.15
43
121
  signing_key:
44
- specification_version: 4
45
- summary: Ruby Object Manager
122
+ specification_version: 3
123
+ summary: Ruby Object Mapper
46
124
  test_files: []
47
- has_rdoc:
125
+
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 8c063456f52dae7ca853f96c66fe95ba2d98071a
4
- data.tar.gz: f60cdf5815a6eb131c04a97db10bbc746d30d97f
5
- SHA512:
6
- metadata.gz: ded74cd17c38faffb6a65c3c5ed2f3da9dd708e970a5e3cfd941f7e896ea7762b5f96084a353da100ce681b032d2ef8a3c389734846e01b0511a64cad74cc0f8
7
- data.tar.gz: 597f44a2cce35ae01388ce8a1dd17004f227c29d48b6361ee96e7f3aef99b7b3ea90c319202632cd78f5a066c503e4bcb0b3db8473204bc4b30376b265ff69aa