plz 0.1.2 → 0.1.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: 563b65752c68fef28a7af0476353f50b787f005d
4
- data.tar.gz: 2d3b4defa4993fd73b8ce8f31c657eef5bfd9ea4
3
+ metadata.gz: 8b08b9335d71f78fcbc29c65cf2e34cf7fbb0058
4
+ data.tar.gz: af59355a377cd6df6bce02b1bcef3fdf1ffa0a7f
5
5
  SHA512:
6
- metadata.gz: 281b82b1fede8f9265ebb648d08363b491ab484c6928eee2557729be25cc9fd443eaf161195a5e9d427a1f233cfdde8d7becf475600b0dff83eca5dcc2a21775
7
- data.tar.gz: 4207525be60422943dd2cffe5980cc6b3ebe7b7031b4603f0f53e39040a5ded2bb30856a1cbaae50b3eb477c6d64982a8a0ca45ed8e7ca434463ee72394313c8
6
+ metadata.gz: 56d10de5ef2e4ed470e764f3016a0152fc93e3dc979ee122dd8033b0e9bc9130f5dfb17d5721b9dd52e0f53bb1fa6a7bd4b39abaffb751b21e6e3d5a6a9e6e94
7
+ data.tar.gz: 2072cdbf85fc7edd19e73a2641fc0d24d99b8fdcf763b201537ae987824e658ddf24891b7ae2d3b59d7332cf873550071f5b26f491bf34257a6b0a24f12a8890
@@ -1,3 +1,6 @@
1
+ ## 0.1.3
2
+ * Fix --host option
3
+
1
4
  ## 0.1.2
2
5
  * Provide --host option to change API host
3
6
 
@@ -185,8 +185,18 @@ module Plz
185
185
  end
186
186
 
187
187
  # @return [String, nil] Base URL of the API
188
+ # @example
189
+ # base_url #=> "http://localhost:8080"
188
190
  def base_url
189
- @base_url ||= options[:host] || base_url_from_schema
191
+ @base_url ||= begin
192
+ if url = (options[:host] || base_url_from_schema)
193
+ if url.start_with?("http")
194
+ url
195
+ else
196
+ "http://#{url}"
197
+ end
198
+ end
199
+ end
190
200
  end
191
201
 
192
202
  # Extracts the base url of the API from JSON Schema
@@ -1,3 +1,3 @@
1
1
  module Plz
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plz
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-17 00:00:00.000000000 Z
11
+ date: 2014-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport