sendgrid-ruby 3.0.2 → 3.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5ee165cdc74cf8a9ac2aeedc52cea6a99c7c8877
4
- data.tar.gz: 96cb466d3c83640b210072ab4a45530ae690b1eb
3
+ metadata.gz: cf1a1f3164a5f6b1b0009b4c99cfb86e2fe57d5c
4
+ data.tar.gz: 980956fc2fefd6458d025fb8bcd9032ff2556195
5
5
  SHA512:
6
- metadata.gz: 00aba1d4ef01167d3266b0f75ab280f7d87dfba267ef7ef60c9a735cd67dc3382e32fd03de48161940a921f7d06ec15fd989246f832e8c9bee001b181cbf6b51
7
- data.tar.gz: 50da10d5775c3cb3c4f65e0a2cb153dbacaff0f607004429f20acaebff0b9ca85b81a86446b5b27efacc1140850795ca6645cf86989761c62dc8143d65b04700
6
+ metadata.gz: 024e2ec69046cf1e75509bca8298c83952f6445cd1aca58d174fae8b74e29c9d867b4a6502224654e845d5339dead0fcc12791839fec266c7651c386cfe55fc8
7
+ data.tar.gz: 4fe14bcdf32b5b96d1663ac88028fc636a159e9799f539eb0d81f9448eabe2dc810712a9a31ab0c5942acd5208cac33283d1795b5c7d5e88789b8eee6e9185f3
data/CHANGELOG.md CHANGED
@@ -1,6 +1,10 @@
1
1
  # Change Log
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
+ ## [3.0.3] - 2016-06-15 ##
5
+ ### Fixing
6
+ - Import structure
7
+
4
8
  ## [3.0.2] - 2016-06-15 ##
5
9
  ### Added
6
10
  - Relative import for mail/helper
data/Gemfile CHANGED
@@ -1,3 +1,3 @@
1
1
  source 'http://rubygems.org'
2
2
 
3
- gem "ruby_http_client"
3
+ gem 'ruby_http_client'
data/Rakefile CHANGED
@@ -2,7 +2,7 @@ require 'rake/testtask'
2
2
 
3
3
  Rake::TestTask.new do |t|
4
4
  t.libs << 'test'
5
- t.test_files = FileList['test/test*.rb', 'test/helpers/mail/test*.rb']
5
+ t.test_files = FileList['test/sendgrid/test*.rb', 'test/sendgrid/helpers/mail/test*.rb']
6
6
  t.verbose = true
7
7
  end
8
8
 
data/lib/sendgrid-ruby.rb CHANGED
@@ -1,34 +1,3 @@
1
- # Quickly and easily access the SendGrid API.
2
- require 'ruby_http_client'
3
- require_relative 'helpers/mail'
4
-
5
- module SendGrid
6
- # Initialize the HTTP client
7
- class API
8
- attr_accessor :client
9
- attr_reader :VERSION, :request_headers, :host, :version
10
- # * *Args* :
11
- # - +api_key+ -> your SendGrid API key
12
- # - +host+ -> the base URL for the API
13
- # - +request_headers+ -> any headers that you want to be globally applied
14
- # - +version+ -> the version of the API you wish to access,
15
- # currently only "v3" is supported
16
- #
17
- def initialize(api_key: nil, host: nil, request_headers: nil, version: nil)
18
- @VERSION = '3.0.2'
19
- @api_key = api_key
20
- @host = host ? host : 'https://api.sendgrid.com'
21
- @version = version ? version : 'v3'
22
- @user_agent = "sendgrid/#{@VERSION};ruby"
23
- @request_headers = JSON.parse('
24
- {
25
- "Authorization": "Bearer ' + @api_key + '"
26
- }
27
- ')
28
-
29
- @request_headers = @request_headers.merge(request_headers) if request_headers
30
- @client = Client.new(host: "#{@host}/#{@version}",
31
- request_headers: @request_headers)
32
- end
33
- end
34
- end
1
+ require_relative 'sendgrid/client'
2
+ require_relative 'sendgrid/version'
3
+ require_relative 'sendgrid/helpers/mail/mail'
@@ -0,0 +1,33 @@
1
+ # Quickly and easily access the SendGrid API.
2
+ require 'ruby_http_client'
3
+ require_relative 'version'
4
+
5
+ module SendGrid
6
+ # Initialize the HTTP client
7
+ class API
8
+ attr_accessor :client
9
+ attr_reader :request_headers, :host, :version
10
+ # * *Args* :
11
+ # - +api_key+ -> your SendGrid API key
12
+ # - +host+ -> the base URL for the API
13
+ # - +request_headers+ -> any headers that you want to be globally applied
14
+ # - +version+ -> the version of the API you wish to access,
15
+ # currently only "v3" is supported
16
+ #
17
+ def initialize(api_key: nil, host: nil, request_headers: nil, version: nil)
18
+ @api_key = api_key
19
+ @host = host ? host : 'https://api.sendgrid.com'
20
+ @version = version ? version : 'v3'
21
+ @user_agent = "sendgrid/#{SendGrid::VERSION};ruby"
22
+ @request_headers = JSON.parse('
23
+ {
24
+ "Authorization": "Bearer ' + @api_key + '"
25
+ }
26
+ ')
27
+
28
+ @request_headers = @request_headers.merge(request_headers) if request_headers
29
+ @client = Client.new(host: "#{@host}/#{@version}",
30
+ request_headers: @request_headers)
31
+ end
32
+ end
33
+ end
File without changes
File without changes
@@ -0,0 +1,3 @@
1
+ module SendGrid
2
+ VERSION = '3.0.3'
3
+ end
@@ -1,10 +1,11 @@
1
1
  # coding: utf-8
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'sendgrid/version'
4
5
 
5
6
  Gem::Specification.new do |spec|
6
7
  spec.name = 'sendgrid-ruby'
7
- spec.version = '3.0.2'
8
+ spec.version = SendGrid::VERSION
8
9
  spec.authors = ['Elmer Thomas', 'Robin Johnson', 'Eddie Zaneski']
9
10
  spec.email = 'dx@sendgrid.com'
10
11
  spec.summary = 'Official SendGrid Gem'
@@ -15,7 +16,7 @@ Gem::Specification.new do |spec|
15
16
  spec.files = `git ls-files -z`.split("\x0")
16
17
  spec.executables = spec.files.grep(/^bin/) { |f| File.basename(f) }
17
18
  spec.test_files = spec.files.grep(/^(test|spec|features)/)
18
- spec.require_paths = ['lib', 'lib/helpers/mail']
19
+ spec.require_paths = ['lib']
19
20
 
20
21
  spec.add_dependency 'ruby_http_client', '~> 2.1.2'
21
22
  spec.add_development_dependency 'rake', '~> 0'
@@ -1,5 +1,5 @@
1
- require_relative "../../../lib/helpers/mail/mail"
2
- require_relative "../../../lib/sendgrid-ruby"
1
+ require_relative "../../../../lib/sendgrid/helpers/mail/mail"
2
+ require_relative "../../../../lib/sendgrid/client"
3
3
  include SendGrid
4
4
  require "json"
5
5
  require 'minitest/autorun'
@@ -1,4 +1,4 @@
1
- require_relative '../lib/sendgrid-ruby.rb'
1
+ require_relative "../../lib/sendgrid/client"
2
2
  require 'ruby_http_client'
3
3
  require 'minitest/autorun'
4
4
 
@@ -29,7 +29,6 @@ class TestAPI < Minitest::Test
29
29
  ')
30
30
  assert_equal(test_headers, sg.request_headers)
31
31
  assert_equal("v3", sg.version)
32
- assert_equal("2.0.0", sg.VERSION)
33
32
  assert_instance_of(SendGrid::Client, sg.client)
34
33
  end
35
34
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sendgrid-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.2
4
+ version: 3.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elmer Thomas
@@ -80,12 +80,14 @@ files:
80
80
  - examples/trackingsettings/trackingsettings.rb
81
81
  - examples/user/user.rb
82
82
  - examples/whitelabel/whitelabel.rb
83
- - lib/helpers/mail/README.md
84
- - lib/helpers/mail/mail.rb
85
83
  - lib/sendgrid-ruby.rb
84
+ - lib/sendgrid/client.rb
85
+ - lib/sendgrid/helpers/mail/README.md
86
+ - lib/sendgrid/helpers/mail/mail.rb
87
+ - lib/sendgrid/version.rb
86
88
  - sendgrid-ruby.gemspec
87
- - test/helpers/mail/test_mail.rb
88
- - test/test_sendgrid-ruby.rb
89
+ - test/sendgrid/helpers/mail/test_mail.rb
90
+ - test/sendgrid/test_sendgrid-ruby.rb
89
91
  homepage: http://github.com/sendgrid/sendgrid-ruby
90
92
  licenses:
91
93
  - MIT
@@ -94,7 +96,6 @@ post_install_message:
94
96
  rdoc_options: []
95
97
  require_paths:
96
98
  - lib
97
- - lib/helpers/mail
98
99
  required_ruby_version: !ruby/object:Gem::Requirement
99
100
  requirements:
100
101
  - - ">="
@@ -112,5 +113,5 @@ signing_key:
112
113
  specification_version: 4
113
114
  summary: Official SendGrid Gem
114
115
  test_files:
115
- - test/helpers/mail/test_mail.rb
116
- - test/test_sendgrid-ruby.rb
116
+ - test/sendgrid/helpers/mail/test_mail.rb
117
+ - test/sendgrid/test_sendgrid-ruby.rb