ruby-montage 0.4.9 → 0.4.10

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: 56a16d2995f1bb8bd29e28bb1db0b6ca82f9dd80
4
- data.tar.gz: 290bef3cd74392163597e80650b66e9290c9497c
3
+ metadata.gz: be9281c779906527968d19f2fe3521d05c68074f
4
+ data.tar.gz: a923f4b02050d263425ab9b6b01500d47268d3d3
5
5
  SHA512:
6
- metadata.gz: 45fd279ec894cabd245e9a7e511b073e50a87eef8795cc7f9b47206e07ad6b3491aba45ae372134df86fee4248ce9f0c2590bf0ea8c41cf4c475f14472fee08c
7
- data.tar.gz: 6767767505651003a98157e9907545696984da8fc3b0acd4d44efacd772f27bb50c2d7b180eb5fe42bc7e12e58ee5679c7b46eb66747e9f166c7a6e474fde238
6
+ metadata.gz: e8a6333591feda7146fec9ad58524ad9151e166412926361972eaed3cbe4f4a981ab370b4567435c7f077f3a4c9b0a459dd0eccf1df64bb7ea8d028108317b12
7
+ data.tar.gz: 672a0e8c1b5025273163bf16959234847a06b8048dc0acd3161fdf2f907a743ac8e2d33fd0aa540e6e553e5ce960be4335ee077756a2f80e3af64a8ece655241
@@ -13,7 +13,7 @@ module Montage
13
13
  include Schemas
14
14
  include Documents
15
15
 
16
- attr_accessor :token, :username, :password, :domain, :api_version
16
+ attr_accessor :token, :username, :password, :domain, :api_version, :url_prefix
17
17
 
18
18
  def initialize
19
19
  @api_version = 1
@@ -21,6 +21,10 @@ module Montage
21
21
  raise MissingAttributeError, "You must declare the domain attribute" unless @domain
22
22
  end
23
23
 
24
+ def default_url_prefix
25
+ "http://#{domain}.dev.montagehot.club"
26
+ end
27
+
24
28
  def content_type
25
29
  "application/json"
26
30
  end
@@ -97,7 +101,7 @@ module Montage
97
101
  def connection
98
102
  @connect ||= Faraday.new do |f|
99
103
  f.adapter :net_http
100
- f.url_prefix = "http://#{domain}.dev.montagehot.club/api/v#{api_version}/"
104
+ f.url_prefix = "#{url_prefix || default_url_prefix}/api/v#{api_version}/"
101
105
  f.headers["User-Agent"] = "Montage Ruby v#{Montage::VERSION}"
102
106
  f.headers["Content-Type"] = content_type
103
107
  f.headers["Accept"] = "*/*"
@@ -1,3 +1,3 @@
1
1
  module Montage
2
- VERSION = "0.4.9"
2
+ VERSION = "0.4.10"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-montage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.9
4
+ version: 0.4.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - dphaener
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-06-22 00:00:00.000000000 Z
11
+ date: 2015-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler