rom-mongodb 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
data/CONTRIBUTING.md DELETED
@@ -1,48 +0,0 @@
1
- # Contributing to rom-mongodb
2
-
3
- Please take a moment to review this document in order to make the contribution process easy and effective for everyone involved.
4
-
5
- Following these guidelines helps to communicate that you respect the time of the developers managing and developing this open source project. In return, they should reciprocate that respect in addressing your issue or assessing patches and features.
6
-
7
- ## Using the issue tracker
8
-
9
- The issue tracker is the preferred channel for [issue/bug reports](#issuebug-reports), [feature requests](#feature-requests), [questions](#questions) and submitting [pull requests](#pull-requests).
10
-
11
- ## Issue/bug reports
12
-
13
- A bug is a _demonstrable problem_ that is caused by the code in the repository. Good bug reports are extremely helpful - thank you!
14
-
15
- Guidelines for issue/bug reports:
16
-
17
- 1. **Use the GitHub issue search** — check if the issue has already been reported
18
- 2. **Check if the issue has been fixed** — try to reproduce it using the latest `master` or `develop` branch in the repository
19
- 3. rom-mongodb [issue template](.github/ISSUE_TEMPLATE/issue_report.md)/[bug template](.github/ISSUE_TEMPLATE/bug_report.md)
20
-
21
- A good bug report shouldn't leave others needing to chase you up for more information. Please try to be as detailed as possible in your report. What is your environment? What steps will reproduce the issue? What would you expect to be the outcome? All these details will help people to fix any potential bugs.
22
-
23
- ## Feature requests
24
-
25
- Feature requests are welcome. But take a moment to find out whether your idea fits with the scope and aims of the project. It's up to *you* to make a strong case to convince the project's developers of the merits of this feature. Please provide as much detail and context as possible.
26
-
27
- ## Questions
28
-
29
- We're always open to a new conversations. So if you have any questions just ask us.
30
-
31
- ## Pull requests
32
-
33
- Good pull requests - patches, improvements, new features - are a fantastic help. They should remain focused in scope and avoid containing unrelated commits.
34
-
35
- **Please ask first** before embarking on any significant pull request (e.g. implementing features, refactoring code, porting to a different language), otherwise you risk spending a lot of time working on something that the project's developers might not want to merge into the project.
36
-
37
- Please adhere to the coding conventions used throughout a project (indentation, accurate comments, etc.) and any other requirements (such as test coverage). Not all features proposed will be added but we are open to having a conversation about a feature you are championing.
38
-
39
- Guidelines for pull requests:
40
-
41
- 1. rom-mongodb [pull request template](.github/PULL_REQUEST_TEMPLATE.md)
42
- 2. Fork the repo, checkout to `develop` branch
43
- 3. Run the tests. This is to make sure your starting point works
44
- 4. Read our [branch naming convention](.github/BRANCH_NAMING_CONVENTION.md)
45
- 5. Create a new branch
46
- 6. Read our [setup development environment guide](.github/DEVELOPMENT_ENVIRONMENT_GUIDE.md)
47
- 7. Make your changes. Please note that your PR should include tests for the new codebase!
48
- 8. Push to your fork and submit a pull request to `develop` branch
data/Gemfile DELETED
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source 'https://rubygems.org'
4
- git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
5
- gemspec
data/README.md DELETED
@@ -1,111 +0,0 @@
1
- # MongoDB adapter for Ruby Object Mapper
2
-
3
- [![Maintainability](https://api.codeclimate.com/v1/badges/5b38ebba392bd37f166b/maintainability)](https://codeclimate.com/github/bestwebua/rom-mongo/maintainability)
4
- [![Test Coverage](https://api.codeclimate.com/v1/badges/5b38ebba392bd37f166b/test_coverage)](https://codeclimate.com/github/bestwebua/rom-mongo/test_coverage)
5
- [![CircleCI](https://circleci.com/gh/bestwebua/rom-mongo/tree/master.svg?style=svg)](https://circleci.com/gh/bestwebua/rom-mongo/tree/master)
6
- [![Gem Version](https://badge.fury.io/rb/rom-mongodb.svg)](https://badge.fury.io/rb/rom-mongodb)
7
- [![Downloads](https://img.shields.io/gem/dt/rom-mongodb.svg?colorA=004d99&colorB=0073e6)](https://rubygems.org/gems/rom-mongodb)
8
- [![GitHub](https://img.shields.io/github/license/bestwebua/rom-mongo)](LICENSE.txt)
9
- [![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v1.4%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md)
10
-
11
- `rom-mongodb` - MongoDB adapter for [ROM](https://rom-rb.org). What is ROM? It's a fast ruby persistence library with the goal of providing powerful object mapping capabilities without limiting the full power of the underlying datastore.
12
-
13
- ## Table of Contents
14
-
15
- - [Requirements](#requirements)
16
- - [Installation](#installation)
17
- - [Usage](#usage)
18
- - [Contributing](#contributing)
19
- - [License](#license)
20
- - [Code of Conduct](#code-of-conduct)
21
- - [Credits](#credits)
22
- - [Versioning](#versioning)
23
- - [Changelog](CHANGELOG.md)
24
-
25
- ## Requirements
26
-
27
- Ruby MRI 2.5.0+
28
-
29
- ## Installation
30
-
31
- Add this line to your application's `Gemfile`:
32
-
33
- ```ruby
34
- gem 'rom-mongodb'
35
- ```
36
-
37
- And then execute:
38
-
39
- $ bundle
40
-
41
- Or install it yourself as:
42
-
43
- $ gem install rom-mongodb
44
-
45
- ## Usage
46
-
47
- ```ruby
48
- # Define your container with mongo adapter
49
-
50
- require 'mongo'
51
- require 'rom'
52
- require 'rom/mongo'
53
-
54
- connection = Mongo::Client.new('mongodb://127.0.0.1:27017/your_db_name')
55
- container = ROM.container(:mongo, connection) do |config|
56
- config.relation(:users) do
57
- schema(:users) do
58
- attribute :_id, ROM::Types.Nominal(BSON::ObjectId)
59
- attribute :email, ROM::Types::String
60
- attribute :rating, ROM::Types::Integer
61
- attribute :status, ROM::Types::Bool
62
- attribute :orders?, ROM::Types::Array # optional attribute, if field does not exists will return nil
63
- end
64
- end
65
- end
66
-
67
- # Define your repository
68
-
69
- require 'rom/repository'
70
-
71
- UserRepository = ::Class.new(ROM::Repository[:users]) do
72
- commands(:create, :delete, update: :by_pk)
73
-
74
- def all
75
- users.to_a
76
- end
77
-
78
- def find(**options)
79
- users.find(options)
80
- end
81
- end
82
-
83
- user_repository = UserRepository.new(container)
84
-
85
- # Now you can do some manipulations with your repository
86
-
87
- user_repository.create({ email: 'olo@domain.com', rating: 42, status: true })
88
- user_repository.all
89
- user_repository.find(email: 'olo@domain.com')
90
- ```
91
-
92
- ## Contributing
93
-
94
- Bug reports and pull requests are welcome on GitHub at https://github.com/bestwebua/rom-mongo. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct. Please check the [open tickets](https://github.com/bestwebua/rom-mongo/issues). Be sure to follow Contributor Code of Conduct below and our [Contributing Guidelines](CONTRIBUTING.md).
95
-
96
- ## License
97
-
98
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
99
-
100
- ## Code of Conduct
101
-
102
- Everyone interacting in the rom-mongodb project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](CODE_OF_CONDUCT.md).
103
-
104
- ## Credits
105
-
106
- - [The Contributors](https://github.com/bestwebua/rom-mongo/graphs/contributors) for code and awesome suggestions
107
- - [The Stargazers](https://github.com/bestwebua/rom-mongo/stargazers) for showing their support
108
-
109
- ## Versioning
110
-
111
- rom-mongodb uses [Semantic Versioning 2.0.0](https://semver.org)
data/Rakefile DELETED
@@ -1,8 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'bundler/gem_tasks'
4
- require 'rspec/core/rake_task'
5
-
6
- RSpec::Core::RakeTask.new(:spec)
7
-
8
- task default: :spec