Skip to content
This repository was archived by the owner on Sep 21, 2021. It is now read-only.
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 .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
/tmp/
/spec/test_app/log/
.byebug_history
.ruby-version
Gemfile.lock
*.sqlite3
22 changes: 22 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
language: ruby
before_install:
- gem install bundler
script:
- bundle exec rspec
gemfile:
- gemfiles/rails_4.2.gemfile
- gemfiles/rails_5.0.gemfile
- gemfiles/rails_5.1.gemfile
rvm:
- 2.2
- 2.3
- 2.4
# - ruby-head

matrix:
fast_finish: true
allow_failures:
- rvm: 2.4
gemfile: gemfiles/rails_4.2.gemfile
- rvm: ruby-head
gemfile: gemfiles/rails_4.2.gemfile
23 changes: 3 additions & 20 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,31 +1,14 @@
appraise "faraday-0.13" do
gem "faraday", "~> 0.13.0"
end

appraise "faraday-0.12" do
gem "faraday", "~> 0.12.0"
end

appraise "faraday-0.11" do
gem "faraday", "~> 0.11.0"
end

appraise "faraday-0.10" do
gem "faraday", "~> 0.10.0"
end

appraise "faraday-0.9" do
gem "faraday", "~> 0.9.0"
end

appraise "rails-5.1" do
gem "rails", "~> 5.1.0"
gem "activesupport", "~> 5.1.0"
end

appraise "rails-5.0" do
gem "rails", "~> 5.0.0"
gem "activesupport", "~> 5.0.0"
end

appraise "rails-4.2" do
gem "rails", "~> 4.2.0"
gem "activesupport", "~> 4.2.0"
end
68 changes: 4 additions & 64 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,70 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## v0.6.1
### Fixed
- Required typhoeus in We::Call instead of connection, which loads it early enough for NewRelic tracing to kick in if you use that

### Changed
- Reduced open timeout default to 1 second

## v0.6.0
### Changed
- Use typhoeus instead of NetHTTP for a [series of reasons]

[typhoeus]: https://github.com/typhoeus/typhoeus
[series of reasons]: https://github.com/wework/we-call-gem/pull/7

## v0.5.4
### Fixed
- Connection checks `Rails.env` instead of `ENV['RAILS_ENV']` as most people dont have RAILS_ENV in their `.env` file

## v0.5.3

### Fixed
- Deprecations were calling a private method and failing

## v0.5.2

### Fixed
- Made Annotations require "ruby_decorators"

## v0.5.1

## [v0.1.0] - 2017-10-09
### Changed
- Switched `config.detect_deprecations` from bool to expect `:active_support` or logger instance
- Moved `We::Call::Middleware::Client::DetectDeprecations` into its own [faraday-sunset] gem (no BC breaks)

[faraday-sunset]: https://github.com/philsturgeon/faraday-sunset

## v0.5.0

### Added
- Configurable `We::Call.configure` which accepts a config block
- Config option `config.app_name` to avoid providing `app:` in every connection initializer
- Added the concept of Annotations. Simply `extend We::Call::Annotations` in a base controller to get cool stuff
- First annotation: `We::Call::Deprecated` added to mark controller methods as deprecated
- Added `We::Call::Middleware::Client::DetectDeprecations` that automatically registers as a faraday response middleware to report deprecated endpoints

### Changed
- Defaults to setting `X-App-Name` instead of `X-WeWork-App` (override with config.app_name_header)
- Defaults to setting `X-App-Env` instead of `X-WeWork-Env` (override with config.app_env_header)

### Fixed
- Switched from manually requiring to using module autoload to reduce memory footprint

## v0.4.2

### Fixed
- Manually setting `conn.adapter` would result in double adapters (two requests made!)

## v0.4.1

### Fixed
- Improved support for Faraday 0.8 - 0.9.

## v0.4.0
- link lambda/proc/whatever is now called in the scope of the instance, so any instance methods, params, etc will be available. E.g: `link: -> { foo_url(params['id']) }`

## [v0.1.0-alpha1] - 2017-10-07
### Added
- `We::Call::Connection.new` requires `timeout: 1` where 1 is seconds.
- `We::Call::Connection.new` accepts `open_timeout: 1` where 1 is seconds.
- Initial version. Pretty basic, but adds a `sunset` method to mark things as deprecated
6 changes: 5 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
source 'https://rubygems.org'

# Specify your gem's dependencies in we-call.gemspec
gemspec

group :development, :test do
gem "appraisal"
gem "wwtd"
end
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class FooController
sunset_method :create, DateTime.new(2019, 1, 1)

# Use a lambda instead of a string to inject params
sunset_method :destroy, DateTime.new(2019, 1, 1), link: lambda { |params| "https://api.example.com/v3/companies/#{params['id']}" }
sunset_method :destroy, DateTime.new(2019, 1, 1), link: -> { v3_company_url(params['id']) }
end
```

Expand All @@ -52,7 +52,7 @@ Literring your controllers with all those dates certainly doesn't seem ideal, it

One approach would be to make a `config/initializer/deprecations.rb` with some "milestones" like this:

```
``` ruby
# config/initializer/deprecations.rb

SUNSET_MILESTONES = {
Expand All @@ -74,11 +74,15 @@ Call em what you want, but something like this should keep things on track.
- **Ruby:** v2.2 - v2.4
- **Rails:** v4.2 - v5.2

_**Note:** Although we support Ruby v2.4 and Rails v4.2, they [don't really like each other][it-is-known] all that much. As such, expect failures on Travis for that combination._

[it-is-known]: https://stackoverflow.com/questions/41504106/ruby-2-4-and-rails-4-stack-level-too-deep-systemstackerror

## Testing

To run tests and modify locally, you'll want to `bundle install` in this directory.

```
``` shell
bundle exec appraisal rspec
```

Expand Down
5 changes: 3 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require "bundler/gem_tasks"
require "rubygems"
require "bundler/setup"
require "rspec/core/rake_task"

RSpec::Core::RakeTask.new(:spec)

task :default => :spec
task default: :spec
2 changes: 0 additions & 2 deletions gemfiles/.bundle/config

This file was deleted.

7 changes: 0 additions & 7 deletions gemfiles/faraday_0.10.gemfile

This file was deleted.

Loading