Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start working on README #1

Merged
merged 4 commits into from
Jun 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Ruby
name: CI

on:
push:
Expand Down
44 changes: 35 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,48 @@
# Ar2dto
# AR2DTO ![AR2DTO](docs/images/logo.png)

Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/ar2dto`. To experiment with that code, run `bin/console` for an interactive prompt.
AR2DTO (ActiveRecord to DTO, pronounced R2-D2 or Artoo-Detoo) is a gem that lets you create DTOs (data transfer objects) from your ActiveRecord models. It is a simple and small gem with the goal of encouraging the usage of simpler objects across an app rather than ActiveRecord models, to help with coupling issues in large Rails apps.

TODO: Delete this and the text above, and describe your gem
![CI](https://github.com/santib/ar2dto/workflows/CI/badge.svg)

## Table of Contents

- [Motivation](#motivation)
- [Why AR2DTO?](#why-ar2dto)
- [Installation](#installation)
- [Usage](#usage)
- [Setting up your models](#setting-up-your-models)
- [Development](#development)
- [Contributing](#contributing)
- [License](#license)
- [Code of Conduct](#code-of-conduct)

## Motivation
TBD

### Why AR2DTO?
TBD

## Installation

Install the gem and add to the application's Gemfile by executing:
Add this line to your application's Gemfile:

```ruby
gem 'ar2dto'
```

And then execute:

$ bundle add ar2dto
$ bundle install

If bundler is not being used to manage dependencies, install the gem by executing:
Or install it yourself as:

$ gem install ar2dto

## Usage
TBD

TODO: Write usage instructions here
### Setting up your models
TBD

## Development

Expand All @@ -26,12 +52,12 @@ To install this gem onto your local machine, run `bundle exec rake install`. To

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/ar2dto. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/ar2dto/blob/main/CODE_OF_CONDUCT.md).
Bug reports and pull requests are welcome on GitHub at https://github.com/santib/ar2dto. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/santib/ar2dto/blob/main/CODE_OF_CONDUCT.md).

## License

The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).

## Code of Conduct

Everyone interacting in the Ar2dto project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/ar2dto/blob/main/CODE_OF_CONDUCT.md).
Everyone interacting in the AR2DTO project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/santib/ar2dto/blob/main/CODE_OF_CONDUCT.md).
32 changes: 9 additions & 23 deletions ar2dto.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,22 @@ require_relative "lib/ar2dto/version"

Gem::Specification.new do |spec|
spec.name = "ar2dto"
spec.version = Ar2dto::VERSION
spec.version = AR2DTO::VERSION
spec.authors = ["Santiago Bartesaghi"]
spec.email = ["santib@hey.com"]

spec.summary = "TODO: Write a short summary, because RubyGems requires one."
spec.description = "TODO: Write a longer description or delete this line."
spec.homepage = "TODO: Put your gem's website or public repo URL here."
spec.summary = "Easing the creation of DTOs from your ActiveRecord models."
spec.homepage = "https://github.com/santib/ar2dto"
spec.license = "MIT"
spec.required_ruby_version = ">= 2.6.0"

spec.metadata["allowed_push_host"] = "TODO: Set to your gem server 'https://example.com'"
spec.required_ruby_version = ">= 2.5.0"

spec.metadata["homepage_uri"] = spec.homepage
spec.metadata["source_code_uri"] = "TODO: Put your gem's public repo URL here."
spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
spec.metadata["source_code_uri"] = "https://github.com/santib/ar2dto"
spec.metadata["bug_tracker_uri"] = "https://github.com/santib/ar2dto/issues"
spec.metadata["changelog_uri"] = "https://github.com/santib/ar2dto/releases"

# Specify which files should be added to the gem when it is released.
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
spec.files = Dir.chdir(__dir__) do
`git ls-files -z`.split("\x0").reject do |f|
(f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
end
end
spec.bindir = "exe"
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
spec.files = Dir["LICENSE.txt", "README.md", "lib/**/*"]
spec.require_paths = ["lib"]

# Uncomment to register a new dependency of your gem
# spec.add_dependency "example-gem", "~> 1.0"

# For more information and examples about making a new gem, check out our
# guide at: https://bundler.io/guides/creating_gem.html
spec.add_dependency "activerecord", ">= 5.2"
end
Binary file added docs/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion lib/ar2dto.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require_relative "ar2dto/version"

module Ar2dto
module AR2DTO
class Error < StandardError; end
# Your code goes here...
end
2 changes: 1 addition & 1 deletion lib/ar2dto/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module Ar2dto
module AR2DTO
VERSION = "0.1.0"
end
2 changes: 1 addition & 1 deletion sig/ar2dto.rbs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module Ar2dto
module AR2DTO
VERSION: String
# See the writing guide of rbs: https://github.com/ruby/rbs#guides
end
4 changes: 2 additions & 2 deletions spec/ar2dto_spec.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# frozen_string_literal: true

RSpec.describe Ar2dto do
RSpec.describe AR2DTO do
it "has a version number" do
expect(Ar2dto::VERSION).not_to be nil
expect(AR2DTO::VERSION).not_to be nil
end

it "does something useful" do
Expand Down