From 54b0e813235b1873487464cb683e86c429ea37a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EB=B0=95=EB=8F=99=EC=B2=A0?= <36955431+dongcheolpark@users.noreply.github.com> Date: Mon, 19 Feb 2024 13:55:13 +0900 Subject: [PATCH] Add basic configure (#1) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit olive_branch는 API Response형식을 변환할 수 있게 해주는 middleware입니다. 원본 리포지토리 maintenance가 유지되지 않고 있어서 포크하여 사용하려 합니다. 리포지토리를 포크하고 간단한 수정 사항을 추가합니다. 프로젝트의 루비 버전을 업데이트하고 Readme를 간단하게 수정했습니다. gemspec을 적당하게 수정하였습니다. --- .ruby-version | 2 +- README.md | 15 ++++++++++++--- lib/olive_branch/version.rb | 2 +- olive_branch.gemspec | 11 +++++------ 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/.ruby-version b/.ruby-version index 6a6a3d8..ef538c2 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.6.1 +3.1.2 diff --git a/README.md b/README.md index 0e3d5ce..89a2385 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,14 @@ This gem lets your API users pass in and receive camelCased or dash-cased keys, while your Rails app receives and produces snake_cased ones. +## 📣 This repository is forked repo. + +The original repository is no longer actively maintained. (last updated on Nov 19, 2021) + +To prepare for problems that may arise, we decided to fork and use it. + +This forked repository is also under the MIT License same as original repository. + ## Install 1. Add this to your Gemfile and then `bundle install`: @@ -40,7 +48,7 @@ For more examples, see [our blog post](https://www.viget.com/articles/introducin ## Optimizations and configuration `OliveBranch` uses `multi_json`, which will automatically choose the fastest available JSON parsing library present in your application. - Most Ruby applications default to using the JSON library that ships with Ruby. However, by including a coder that `multi_json` considers faster, like [Oj](https://github.com/ohler55/oj) in your gemfile, you can potentially save up to ~20% response time. +Most Ruby applications default to using the JSON library that ships with Ruby. However, by including a coder that `multi_json` considers faster, like [Oj](https://github.com/ohler55/oj) in your gemfile, you can potentially save up to ~20% response time. The middleware can be initialized with custom camelize/dasherize implementations, so if you know you have a fixed size set of keys, you can save a considerable amount of time by providing a custom camelize that caches like so: @@ -110,6 +118,7 @@ config.middleware.use OliveBranch::Middleware, exclude_response: -> (env) { #### Rails routes & Action Text If you're using default inflection, exclude the routes that Rails uses + ```ruby rails_routes = -> (env) { env['PATH_INFO'].match(/^\/rails/) } config.middleware.use OliveBranch::Middleware, inflection: "camel", exclude_params: rails_routes, exclude_response: rails_routes @@ -131,11 +140,11 @@ You may choose to force inbound transformation on every request by overriding th config.middleware.use OliveBranch::Middleware, content_type_check: -> (content_type) { true } ``` -* * * +--- OliveBranch is released under the [MIT License](http://www.opensource.org/licenses/MIT). See MIT-LICENSE for further details. -* * * +--- Code At Viget diff --git a/lib/olive_branch/version.rb b/lib/olive_branch/version.rb index 39e951f..c87cb0e 100644 --- a/lib/olive_branch/version.rb +++ b/lib/olive_branch/version.rb @@ -1,3 +1,3 @@ module OliveBranch - VERSION = '4.0.1' + VERSION = '1.0.0' end diff --git a/olive_branch.gemspec b/olive_branch.gemspec index 20ee5bd..81a9589 100644 --- a/olive_branch.gemspec +++ b/olive_branch.gemspec @@ -3,17 +3,16 @@ $:.push File.expand_path("../lib", __FILE__) require "olive_branch/version" Gem::Specification.new do |s| - s.name = "olive_branch" + s.name = "privatenote_olive_branch" s.version = OliveBranch::VERSION s.summary = "Handle camel/snake/dash case conversion" - s.description = "Handle camel/snake/dash case conversion" - s.authors = ["Eli Fatsi", "David Eisinger"] - s.email = ["eli.fatsi@viget.com", "david.eisinger@viget.com"] + s.description = "Handle camel/snake/dash case conversion. forked from vigetlabs/olive_branch." + s.authors = ["Privatenote"] + s.email = ["dev@privatenote.co.kr"] s.files = Dir["lib/**/*"] + ["MIT-LICENSE", "README.md"] - s.homepage = "https://github.com/vigetlabs/olive_branch" + s.homepage = "https://github.com/privatenote/olive_branch" s.license = "MIT" - s.add_dependency "rails", ">= 4.0" s.add_dependency "multi_json" s.add_development_dependency "rspec", "~> 3.5.0"