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

make inclusion of sinatra optional #284

Merged
merged 2 commits into from
Oct 23, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# Change Log
All notable changes to this project will be documented in this file.


## [6.0.0] - date TBD ##
### BREAKING CHANGE
- The sinatra gem is no longer specified as a dependency of this gem.
If you would like to use the inbound processing, you must add this gem
to your Gemfile. e.g. `gem 'sinatra', '>= 1.4.7', '< 3'`

## [5.2.0] - 2017-10-30 ##
### Added
- PR #234: Helpers for email statistics - global, category, subuser
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ gem install sendgrid-ruby
## Dependencies

- [Ruby-HTTP-Client](https://github.com/sendgrid/ruby-http-client)
- [Sinatra](http://www.sinatrarb.com/) - this is only needed if you plan to process [Inbound Email](#inbound).

<a name="quick-start"></a>
# Quick Start
Expand Down
13 changes: 13 additions & 0 deletions lib/sendgrid/helpers/inbound/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,19 @@
* [Contributing](#contributing)

<a name="quick_start_local_sample"></a>


# Installation

In addition to the installation instructions in
[the main readme](https://github.com/sendgrid/sendgrid-ruby/tree/master/#installation),
you must also add sinatra to your Gemfile:

```
gem 'sinatra', '>= 1.4.7', '< 3'
```


# Quick Start for Local Testing with Sample Data

```bash
Expand Down
14 changes: 13 additions & 1 deletion lib/sendgrid/helpers/inbound/app.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
require 'sinatra'
begin
require 'sinatra'
rescue LoadError
puts <<-NOTE
As of sengrid verison 6, sinatra is no longer specified as a dependency of
the sendgrid gem. All the functionality of the inbound server is still the same
and fully supported, but you just need to include the sinatra dependency in your gemfile
yourself, like so:

gem 'sinatra', '>= 1.4.7', '< 3'
NOTE
raise
end
require 'logger'
require 'json'
require 'yaml'
Expand Down
2 changes: 1 addition & 1 deletion sendgrid-ruby.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
spec.test_files = spec.files.grep(/^(test|spec|features)/)
spec.require_paths = ['lib']
spec.add_dependency 'ruby_http_client', '~> 3.3.0'
spec.add_dependency 'sinatra', '>= 1.4.7', '< 3'
spec.add_development_dependency 'sinatra', '>= 1.4.7', '< 3'
spec.add_development_dependency 'rake', '~> 0'
spec.add_development_dependency 'rspec'
spec.add_development_dependency 'pry'
Expand Down