chatspry 0.0.1.pre2 → 0.0.1.pre3

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,8 +4,8 @@ module Chatspry
4
4
 
5
5
  module Default
6
6
 
7
- API_ENDPOINT = "http://api.chatspry.dev:8080".freeze
8
- WEB_ENDPOINT = "http://chatspry.dev:4200".freeze
7
+ API_ENDPOINT = "http://api.chatspry.com".freeze
8
+ WEB_ENDPOINT = "http://chatspry.com".freeze
9
9
 
10
10
  MEDIA_TYPE = "application/json".freeze
11
11
  USER_AGENT = "Chatspry Ruby Gem #{ Chatspry::VERSION }".freeze
@@ -1,3 +1,3 @@
1
1
  module Chatspry
2
- VERSION = "0.0.1.pre2"
2
+ VERSION = "0.0.1.pre3"
3
3
  end
@@ -1 +1 @@
1
- {"http_interactions":[{"request":{"method":"get","uri":"http://api.chatspry.dev:8080/?foo=bar","body":{"encoding":"US-ASCII","base64_string":""},"headers":{"Accept":["application/json"],"User-Agent":["Chatspry Ruby Gem 0.0.1.pre1"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"]}},"response":{"status":{"code":404,"message":"Not Found"},"headers":{"Date":["Wed, 18 Jun 2014 19:14:31 GMT"],"Status":["404 Not Found"],"Connection":["close"],"X-Frame-Options":["SAMEORIGIN"],"X-Xss-Protection":["1; mode=block"],"X-Content-Type-Options":["nosniff"],"Content-Type":["text/plain"],"Cache-Control":["no-cache"],"X-Request-Id":["b8fd7b27-8285-4f5c-83f2-ee46c7338393"],"X-Runtime":["0.009932"]},"body":{"encoding":"US-ASCII","base64_string":"IA==\n"},"http_version":null},"recorded_at":"Wed, 18 Jun 2014 19:14:31 GMT"}],"recorded_with":"VCR 2.9.2"}
1
+ {"http_interactions":[{"request":{"method":"get","uri":"http://api.chatspry.dev:8080/?foo=bar","body":{"encoding":"US-ASCII","base64_string":""},"headers":{"Accept":["application/json"],"User-Agent":["Chatspry Ruby Gem 0.0.1.pre2"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"]}},"response":{"status":{"code":404,"message":"Not Found"},"headers":{"Date":["Wed, 18 Jun 2014 19:45:11 GMT"],"Status":["404 Not Found"],"Connection":["close"],"X-Frame-Options":["SAMEORIGIN"],"X-Xss-Protection":["1; mode=block"],"X-Content-Type-Options":["nosniff"],"Content-Type":["text/plain"],"Cache-Control":["no-cache"],"X-Request-Id":["d306d0c0-e812-4ef5-8b8d-4577793b694c"],"X-Runtime":["0.009840"]},"body":{"encoding":"US-ASCII","base64_string":"IA==\n"},"http_version":null},"recorded_at":"Wed, 18 Jun 2014 19:45:11 GMT"}],"recorded_with":"VCR 2.9.2"}
@@ -1 +1 @@
1
- {"http_interactions":[{"request":{"method":"head","uri":"http://api.chatspry.dev:8080/?foo=bar","body":{"encoding":"US-ASCII","base64_string":""},"headers":{"Accept":["application/json"],"User-Agent":["Chatspry Ruby Gem 0.0.1.pre1"]}},"response":{"status":{"code":404,"message":"Not Found"},"headers":{"Date":["Wed, 18 Jun 2014 19:14:31 GMT"],"Status":["404 Not Found"],"Connection":["close"],"X-Frame-Options":["SAMEORIGIN"],"X-Xss-Protection":["1; mode=block"],"X-Content-Type-Options":["nosniff"],"Content-Type":["text/plain"],"Cache-Control":["no-cache"],"X-Request-Id":["3e2f3155-3f8d-4172-a3a6-794cc8c11e71"],"X-Runtime":["0.009586"]},"body":{"encoding":"US-ASCII","base64_string":""},"http_version":null},"recorded_at":"Wed, 18 Jun 2014 19:14:31 GMT"}],"recorded_with":"VCR 2.9.2"}
1
+ {"http_interactions":[{"request":{"method":"head","uri":"http://api.chatspry.dev:8080/?foo=bar","body":{"encoding":"US-ASCII","base64_string":""},"headers":{"Accept":["application/json"],"User-Agent":["Chatspry Ruby Gem 0.0.1.pre2"]}},"response":{"status":{"code":404,"message":"Not Found"},"headers":{"Date":["Wed, 18 Jun 2014 19:45:11 GMT"],"Status":["404 Not Found"],"Connection":["close"],"X-Frame-Options":["SAMEORIGIN"],"X-Xss-Protection":["1; mode=block"],"X-Content-Type-Options":["nosniff"],"Content-Type":["text/plain"],"Cache-Control":["no-cache"],"X-Request-Id":["d014269f-e902-405e-8d28-913f1cbfe36c"],"X-Runtime":["0.009593"]},"body":{"encoding":"US-ASCII","base64_string":""},"http_version":null},"recorded_at":"Wed, 18 Jun 2014 19:45:11 GMT"}],"recorded_with":"VCR 2.9.2"}
@@ -1 +1 @@
1
- {"http_interactions":[{"request":{"method":"get","uri":"http://api.chatspry.dev:8080/v1/user","body":{"encoding":"US-ASCII","base64_string":""},"headers":{"Accept":["application/json"],"User-Agent":["Chatspry Ruby Gem 0.0.1.pre1"],"Authorization":["Bearer <ACCESS_TOKEN>"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"Date":["Wed, 18 Jun 2014 19:14:31 GMT"],"Status":["200 OK"],"Connection":["close"],"X-Frame-Options":["SAMEORIGIN"],"X-Xss-Protection":["1; mode=block"],"X-Content-Type-Options":["nosniff"],"Access-Control-Allow-Credentials":["true"],"Access-Control-Allow-Methods":["GET,POST,PUT,DELETE,PATCH,OPTIONS"],"Access-Control-Allow-Headers":["*"],"Access-Control-Max-Age":["1728000"],"Content-Type":["application/json; charset=utf-8"],"Etag":["\"0a2327f04d9202b40e890296b3055c0f\""],"Cache-Control":["max-age=0, private, must-revalidate"],"X-Request-Id":["20e88c1c-e11b-496d-ae32-5344b27682a9"],"X-Runtime":["0.019083"]},"body":{"encoding":"US-ASCII","base64_string":"eyJ1c2VyIjp7ImlkIjoiN2EyYjI0MTktYzU5NC00MzU5LWFhMzUtMTVhNWJk\nNjMxOGRjIiwiaGFuZGxlIjoiPENIQVRTUFJZX0lERU5USUZJRVI+IiwibmFt\nZSI6IlBoaWxpcCBWaWVpcmEiLCJ1cGRhdGVkX2F0IjoxNDAzMDM2MjQ5LCJj\ncmVhdGVkX2F0IjoxNDAzMDM2MjQ5fX0=\n"},"http_version":null},"recorded_at":"Wed, 18 Jun 2014 19:14:31 GMT"}],"recorded_with":"VCR 2.9.2"}
1
+ {"http_interactions":[{"request":{"method":"get","uri":"http://api.chatspry.dev:8080/v1/user","body":{"encoding":"US-ASCII","base64_string":""},"headers":{"Accept":["application/json"],"User-Agent":["Chatspry Ruby Gem 0.0.1.pre2"],"Authorization":["Bearer <ACCESS_TOKEN>"],"Accept-Encoding":["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"]}},"response":{"status":{"code":200,"message":"OK"},"headers":{"Date":["Wed, 18 Jun 2014 19:45:11 GMT"],"Status":["200 OK"],"Connection":["close"],"X-Frame-Options":["SAMEORIGIN"],"X-Xss-Protection":["1; mode=block"],"X-Content-Type-Options":["nosniff"],"Access-Control-Allow-Credentials":["true"],"Access-Control-Allow-Methods":["GET,POST,PUT,DELETE,PATCH,OPTIONS"],"Access-Control-Allow-Headers":["*"],"Access-Control-Max-Age":["1728000"],"Content-Type":["application/json; charset=utf-8"],"Etag":["\"0a2327f04d9202b40e890296b3055c0f\""],"Cache-Control":["max-age=0, private, must-revalidate"],"X-Request-Id":["f4b0be17-33c0-4814-9a3e-a67d6f3d7509"],"X-Runtime":["0.014420"]},"body":{"encoding":"US-ASCII","base64_string":"eyJ1c2VyIjp7ImlkIjoiN2EyYjI0MTktYzU5NC00MzU5LWFhMzUtMTVhNWJk\nNjMxOGRjIiwiaGFuZGxlIjoiPENIQVRTUFJZX0lERU5USUZJRVI+IiwibmFt\nZSI6IlBoaWxpcCBWaWVpcmEiLCJ1cGRhdGVkX2F0IjoxNDAzMDM2MjQ5LCJj\ncmVhdGVkX2F0IjoxNDAzMDM2MjQ5fX0=\n"},"http_version":null},"recorded_at":"Wed, 18 Jun 2014 19:45:11 GMT"}],"recorded_with":"VCR 2.9.2"}
data/spec/helper.rb CHANGED
@@ -3,6 +3,12 @@ require "chatspry"
3
3
  require "rspec"
4
4
  require "webmock/rspec"
5
5
 
6
+ require "support/fixture_configuration"
7
+ require "support/environment_defaults"
8
+ require "support/request_stubs"
9
+
10
+ ENV["CHATSPRY_API_ENDPOINT"] = test_chatspry_api_endpoint
11
+
6
12
  RSpec.configure do |config|
7
13
 
8
14
  config.filter_run :focus
@@ -25,10 +31,6 @@ RSpec.configure do |config|
25
31
 
26
32
  end
27
33
 
28
- require "support/fixture_configuration"
29
- require "support/environment_defaults"
30
- require "support/request_stubs"
31
-
32
34
  def oauth_client
33
35
  Chatspry::Client.new(:access_token => test_chatspry_token)
34
36
  end
@@ -16,4 +16,8 @@ end
16
16
 
17
17
  def test_chatspry_client_secret
18
18
  ENV.fetch "CHATSPRY_TEST_CLIENT_SECRET", "x" * 32
19
+ end
20
+
21
+ def test_chatspry_api_endpoint
22
+ ENV.fetch "CHATSPRY_TEST_API_ENDPOINT", "http://api.chatspry.com"
19
23
  end
@@ -23,34 +23,20 @@ VCR.configure do |c|
23
23
  test_chatspry_client_secret
24
24
  end
25
25
 
26
- # c.before_http_request(:real?) do |request|
26
+ c.before_http_request(:real?) do |request|
27
27
 
28
- # next if request.headers['X-Vcr-Test-Repo-Setup']
29
- # next unless request.uri.include? test_github_repository
28
+ next if request.headers["X-Vcr-Test-Setup"]
30
29
 
31
- # options = {
32
- # :headers => {'X-Vcr-Test-Repo-Setup' => 'true'},
33
- # :auto_init => true
34
- # }
30
+ request_options = {
31
+ headers: { "X-Vcr-Test-Setup" => "true" },
32
+ auto_init: true
33
+ }
35
34
 
36
- # test_repo = "#{test_github_login}/#{test_github_repository}"
37
- # if !oauth_client.repository?(test_repo, options)
38
- # Octokit.octokit_warn "NOTICE: Creating #{test_repo} test repository."
39
- # oauth_client.create_repository(test_github_repository, options)
40
- # end
41
-
42
- # test_org_repo = "#{test_github_org}/#{test_github_repository}"
43
- # if !oauth_client.repository?(test_org_repo, options)
44
- # Octokit.octokit_warn "NOTICE: Creating #{test_org_repo} test repository."
45
- # options[:organization] = test_github_org
46
- # oauth_client.create_repository(test_github_repository, options)
47
- # end
48
-
49
- # end
35
+ end
50
36
 
51
- # c.ignore_request do |request|
52
- # !!request.headers['X-Vcr-Test-Repo-Setup']
53
- # end
37
+ c.ignore_request do |request|
38
+ !!request.headers["X-Vcr-Test-Setup"]
39
+ end
54
40
 
55
41
  c.default_cassette_options = {
56
42
  serialize_with: :json,
@@ -23,5 +23,5 @@ def stub_put(url)
23
23
  end
24
24
 
25
25
  def chatspry_url(url)
26
- url =~ /^http/ ? url : "http://api.chatspry.dev:8080#{url}"
26
+ url =~ /^http/ ? url : "#{test_chatspry_api_endpoint}#{url}"
27
27
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chatspry
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.pre2
4
+ version: 0.0.1.pre3
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors: