playfair_app 0.0.1 → 0.0.2
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.
- data/lib/playfair/client.rb +6 -2
- data/lib/playfair/version.rb +1 -1
- data/spec/client_spec.rb +8 -0
- metadata +3 -3
data/lib/playfair/client.rb
CHANGED
@@ -2,14 +2,18 @@ module Playfair
|
|
2
2
|
class Client
|
3
3
|
include Singleton
|
4
4
|
|
5
|
-
attr_accessor :email, :password
|
5
|
+
attr_accessor :email, :password, :endpoint
|
6
6
|
attr_reader :api
|
7
7
|
|
8
|
+
def initialize
|
9
|
+
@endpoint = "https://playfairapp.com"
|
10
|
+
end
|
11
|
+
|
8
12
|
def configure
|
9
13
|
yield self
|
10
14
|
|
11
15
|
@api = Her::API.new
|
12
|
-
@api.setup url:
|
16
|
+
@api.setup url: @endpoint do |c|
|
13
17
|
c.basic_auth @email, @password
|
14
18
|
c.use Faraday::Request::UrlEncoded
|
15
19
|
c.use Her::Middleware::DefaultParseJSON
|
data/lib/playfair/version.rb
CHANGED
data/spec/client_spec.rb
CHANGED
@@ -15,4 +15,12 @@ describe Playfair::Client do
|
|
15
15
|
subject.api.should be_a(Her::API)
|
16
16
|
subject.api.base_uri.should == "https://playfairapp.com"
|
17
17
|
end
|
18
|
+
|
19
|
+
it 'should have a configurable endpoint' do
|
20
|
+
subject.configure do |c|
|
21
|
+
c.endpoint = "https://example.com"
|
22
|
+
end
|
23
|
+
|
24
|
+
subject.api.base_uri.should == "https://example.com"
|
25
|
+
end
|
18
26
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: playfair_app
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -116,7 +116,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
116
116
|
version: '0'
|
117
117
|
segments:
|
118
118
|
- 0
|
119
|
-
hash:
|
119
|
+
hash: -259808892599211816
|
120
120
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
121
121
|
none: false
|
122
122
|
requirements:
|
@@ -125,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
125
125
|
version: '0'
|
126
126
|
segments:
|
127
127
|
- 0
|
128
|
-
hash:
|
128
|
+
hash: -259808892599211816
|
129
129
|
requirements: []
|
130
130
|
rubyforge_project:
|
131
131
|
rubygems_version: 1.8.23
|