devproxy 0.5.0 → 0.5.1

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.
@@ -23,7 +23,7 @@ module Devproxy
23
23
  end
24
24
 
25
25
  def on_connected(proxy)
26
- $stdout.puts "Tunneling requests from https://#{proxy}.#{options.host} to #{options.listen} port #{options.port}"
26
+ $stdout.puts "Tunneling requests from https://#{proxy}.#{options.app_host} to #{options.listen} port #{options.port}"
27
27
  end
28
28
 
29
29
  def on_heartbeat data
@@ -8,6 +8,9 @@ module Devproxy
8
8
  port.nil? || remote_port.nil? ||
9
9
  host.nil? || host.empty? )
10
10
  end
11
+ def app_host
12
+ host.split(".")[-2..-1].join(".")
13
+ end
11
14
  def self.default
12
15
  default = new
13
16
  default.host = "ssh.devproxy.io"
@@ -1,3 +1,3 @@
1
1
  module Devproxy
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
data/spec/options_spec.rb CHANGED
@@ -37,6 +37,15 @@ describe Devproxy::Options do
37
37
  end
38
38
  end
39
39
 
40
+ describe "app_host" do
41
+ it "should return the tld when a subdomain is not given" do
42
+ expect(default_options(:host=> "foo.com").app_host).to eq("foo.com")
43
+ end
44
+ it "should return the tld when a subdomain is given" do
45
+ expect(default_options(:host=> "bar.foo.com").app_host).to eq("foo.com")
46
+ end
47
+ end
48
+
40
49
  def default_options(options = {})
41
50
  default = Devproxy::Options.default
42
51
  options.each do |key,value|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devproxy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -86,7 +86,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
86
86
  version: '0'
87
87
  segments:
88
88
  - 0
89
- hash: -2796530892309419750
89
+ hash: -1682075030683773193
90
90
  required_rubygems_version: !ruby/object:Gem::Requirement
91
91
  none: false
92
92
  requirements:
@@ -95,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
95
  version: '0'
96
96
  segments:
97
97
  - 0
98
- hash: -2796530892309419750
98
+ hash: -1682075030683773193
99
99
  requirements: []
100
100
  rubyforge_project:
101
101
  rubygems_version: 1.8.25