proximity 1.0.1 → 1.1.0
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 +4 -4
 - data/README.md +6 -0
 - data/lib/proximity/proxy_set.rb +1 -1
 - data/lib/proximity/version.rb +1 -1
 - data/spec/proximity/proxy_set_spec.rb +9 -9
 - data/spec/proximity/proxy_spec.rb +3 -3
 - data/spec/proximity/router_spec.rb +1 -1
 - data/spec/proximity_spec.rb +1 -1
 - metadata +20 -20
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: c7cd549ba8b17590588119a093d871c003f1b1bb
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 5fb1f99376199afa252649fdda8e7d0b9b656159
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 1e605a85eef67913e85e71f985a2051a632f6571f568648e70c77af2307f9803548014bea9c2e39cdf39558886e5ef091845bcc346f6c2e6160a066e7e7bcb9d
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 3d048665c3ac8ac3ce7d913f7e7f72d1e5d0216dbac18a5b175ebb5eb6b0ea6d8f7b50654d553da3ee4303899ecd68a83290164a8d1cb5f7f1288b1558dac21f
         
     | 
    
        data/README.md
    CHANGED
    
    | 
         @@ -59,3 +59,9 @@ Or install it yourself as: 
     | 
|
| 
       59 
59 
     | 
    
         
             
            3. Commit your changes (`git commit -am 'Add some feature'`)
         
     | 
| 
       60 
60 
     | 
    
         
             
            4. Push to the branch (`git push origin my-new-feature`)
         
     | 
| 
       61 
61 
     | 
    
         
             
            5. Create new Pull Request
         
     | 
| 
      
 62 
     | 
    
         
            +
             
     | 
| 
      
 63 
     | 
    
         
            +
            ## Thanks
         
     | 
| 
      
 64 
     | 
    
         
            +
             
     | 
| 
      
 65 
     | 
    
         
            +
            1. Much goes to [TMA](http://www.tma1.com) for many awesome projects
         
     | 
| 
      
 66 
     | 
    
         
            +
            2. [wzcolon](https://github.com/wzcolon) for pairing with when gemifying this
         
     | 
| 
      
 67 
     | 
    
         
            +
            3. [nathanl](https://github.com/nathanl) for encouraging me to gemify this
         
     | 
    
        data/lib/proximity/proxy_set.rb
    CHANGED
    
    
    
        data/lib/proximity/version.rb
    CHANGED
    
    
| 
         @@ -12,7 +12,7 @@ describe Proximity::ProxySet do 
     | 
|
| 
       12 
12 
     | 
    
         
             
              end
         
     | 
| 
       13 
13 
     | 
    
         | 
| 
       14 
14 
     | 
    
         
             
              it "will set the target prefix on the route set" do
         
     | 
| 
       15 
     | 
    
         
            -
                expect(proxy_set.target).to eq('http://example. 
     | 
| 
      
 15 
     | 
    
         
            +
                expect(proxy_set.target).to eq('http://example.dev/api')
         
     | 
| 
       16 
16 
     | 
    
         
             
              end
         
     | 
| 
       17 
17 
     | 
    
         | 
| 
       18 
18 
     | 
    
         
             
              it "will create a route with the given prefix for its source" do
         
     | 
| 
         @@ -20,17 +20,17 @@ describe Proximity::ProxySet do 
     | 
|
| 
       20 
20 
     | 
    
         
             
              end
         
     | 
| 
       21 
21 
     | 
    
         | 
| 
       22 
22 
     | 
    
         
             
              it "will map the given prefix to the target prefix" do
         
     | 
| 
       23 
     | 
    
         
            -
                expect(proxy.target).to eq('http://example. 
     | 
| 
      
 23 
     | 
    
         
            +
                expect(proxy.target).to eq('http://example.dev/api/are/you/active')
         
     | 
| 
       24 
24 
     | 
    
         
             
              end
         
     | 
| 
       25 
25 
     | 
    
         | 
| 
       26 
26 
     | 
    
         | 
| 
       27 
27 
     | 
    
         
             
              describe "protocol" do
         
     | 
| 
       28 
28 
     | 
    
         
             
                it "will be added to the target prefix if missing" do
         
     | 
| 
       29 
     | 
    
         
            -
                  expect(proxy_set.target).to eq('http://example. 
     | 
| 
      
 29 
     | 
    
         
            +
                  expect(proxy_set.target).to eq('http://example.dev/api')
         
     | 
| 
       30 
30 
     | 
    
         
             
                end
         
     | 
| 
       31 
31 
     | 
    
         | 
| 
       32 
32 
     | 
    
         
             
                it "will not add a protocol if provided in the target prefix" do
         
     | 
| 
       33 
     | 
    
         
            -
                  target    = 'ftp://example. 
     | 
| 
      
 33 
     | 
    
         
            +
                  target    = 'ftp://example.dev/api/' 
         
     | 
| 
       34 
34 
     | 
    
         
             
                  proxy_set = described_class.new(route_set, 'example', target)
         
     | 
| 
       35 
35 
     | 
    
         
             
                  expect(proxy_set.target).to eq(target)
         
     | 
| 
       36 
36 
     | 
    
         
             
                end
         
     | 
| 
         @@ -43,23 +43,23 @@ describe Proximity::ProxySet do 
     | 
|
| 
       43 
43 
     | 
    
         
             
                context 'develepment' do
         
     | 
| 
       44 
44 
     | 
    
         
             
                  let(:environment) { 'development' }
         
     | 
| 
       45 
45 
     | 
    
         | 
| 
       46 
     | 
    
         
            -
                  it "will convert .com into . 
     | 
| 
       47 
     | 
    
         
            -
                    expect(proxy_set.target).to eq('http://example. 
     | 
| 
      
 46 
     | 
    
         
            +
                  it "will convert .com into .dev" do
         
     | 
| 
      
 47 
     | 
    
         
            +
                    expect(proxy_set.target).to eq('http://example.dev/api')
         
     | 
| 
       48 
48 
     | 
    
         
             
                  end
         
     | 
| 
       49 
49 
     | 
    
         
             
                end
         
     | 
| 
       50 
50 
     | 
    
         | 
| 
       51 
51 
     | 
    
         
             
                context 'test' do
         
     | 
| 
       52 
52 
     | 
    
         
             
                  let(:environment) { 'test' }
         
     | 
| 
       53 
53 
     | 
    
         | 
| 
       54 
     | 
    
         
            -
                  it "will convert .com into . 
     | 
| 
       55 
     | 
    
         
            -
                    expect(proxy_set.target).to eq('http://example. 
     | 
| 
      
 54 
     | 
    
         
            +
                  it "will convert .com into .dev" do
         
     | 
| 
      
 55 
     | 
    
         
            +
                    expect(proxy_set.target).to eq('http://example.dev/api')
         
     | 
| 
       56 
56 
     | 
    
         
             
                  end
         
     | 
| 
       57 
57 
     | 
    
         
             
                end
         
     | 
| 
       58 
58 
     | 
    
         | 
| 
       59 
59 
     | 
    
         
             
                context 'production' do
         
     | 
| 
       60 
60 
     | 
    
         
             
                  let(:environment) { 'production' }
         
     | 
| 
       61 
61 
     | 
    
         | 
| 
       62 
     | 
    
         
            -
                  it "will not convert .com into . 
     | 
| 
      
 62 
     | 
    
         
            +
                  it "will not convert .com into .dev" do
         
     | 
| 
       63 
63 
     | 
    
         
             
                    expect(proxy_set.target).to eq('http://example.com/api')
         
     | 
| 
       64 
64 
     | 
    
         
             
                  end
         
     | 
| 
       65 
65 
     | 
    
         
             
                end
         
     | 
| 
         @@ -16,11 +16,11 @@ describe Proximity::Proxy do 
     | 
|
| 
       16 
16 
     | 
    
         
             
              end
         
     | 
| 
       17 
17 
     | 
    
         | 
| 
       18 
18 
     | 
    
         
             
              it "prefixes the target with the route set target" do
         
     | 
| 
       19 
     | 
    
         
            -
                expect(route.target).to eq('http://example. 
     | 
| 
      
 19 
     | 
    
         
            +
                expect(route.target).to eq('http://example.dev/api/are/you/active')
         
     | 
| 
       20 
20 
     | 
    
         
             
              end
         
     | 
| 
       21 
21 
     | 
    
         | 
| 
       22 
22 
     | 
    
         
             
              it "uses the source as the target if the target is Same" do
         
     | 
| 
       23 
     | 
    
         
            -
                expect(same.target).to eq('http://example. 
     | 
| 
      
 23 
     | 
    
         
            +
                expect(same.target).to eq('http://example.dev/api/count')
         
     | 
| 
       24 
24 
     | 
    
         
             
              end
         
     | 
| 
       25 
25 
     | 
    
         | 
| 
       26 
26 
     | 
    
         
             
              describe "formats" do
         
     | 
| 
         @@ -29,7 +29,7 @@ describe Proximity::Proxy do 
     | 
|
| 
       29 
29 
     | 
    
         
             
                end
         
     | 
| 
       30 
30 
     | 
    
         | 
| 
       31 
31 
     | 
    
         
             
                it "will add the format precceeded by a dot to the target" do
         
     | 
| 
       32 
     | 
    
         
            -
                  expect(format.target).to eq('http://example. 
     | 
| 
      
 32 
     | 
    
         
            +
                  expect(format.target).to eq('http://example.dev/api/accounts.json')
         
     | 
| 
       33 
33 
     | 
    
         
             
                end
         
     | 
| 
       34 
34 
     | 
    
         
             
              end
         
     | 
| 
       35 
35 
     | 
    
         | 
| 
         @@ -13,7 +13,7 @@ describe Proximity::Router do 
     | 
|
| 
       13 
13 
     | 
    
         
             
                end
         
     | 
| 
       14 
14 
     | 
    
         | 
| 
       15 
15 
     | 
    
         
             
                it "will properly bind path parameters to the output" do
         
     | 
| 
       16 
     | 
    
         
            -
                  expect(match.target).to eq('http://example. 
     | 
| 
      
 16 
     | 
    
         
            +
                  expect(match.target).to eq('http://example.dev/api/accounts-members/157-8932')
         
     | 
| 
       17 
17 
     | 
    
         
             
                end
         
     | 
| 
       18 
18 
     | 
    
         | 
| 
       19 
19 
     | 
    
         
             
                describe "that do not match" do
         
     | 
    
        data/spec/proximity_spec.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: proximity
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 1.0 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.1.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Adam Hunter
         
     | 
| 
         @@ -9,90 +9,90 @@ authors: 
     | 
|
| 
       9 
9 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       10 
10 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       11 
11 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       12 
     | 
    
         
            -
            date:  
     | 
| 
      
 12 
     | 
    
         
            +
            date: 2014-02-14 00:00:00.000000000 Z
         
     | 
| 
       13 
13 
     | 
    
         
             
            dependencies:
         
     | 
| 
       14 
14 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       15 
15 
     | 
    
         
             
              name: actionpack
         
     | 
| 
       16 
16 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       17 
17 
     | 
    
         
             
                requirements:
         
     | 
| 
       18 
     | 
    
         
            -
                - - ~>
         
     | 
| 
      
 18 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
       19 
19 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       20 
20 
     | 
    
         
             
                    version: '4.0'
         
     | 
| 
       21 
21 
     | 
    
         
             
              type: :runtime
         
     | 
| 
       22 
22 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       23 
23 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       24 
24 
     | 
    
         
             
                requirements:
         
     | 
| 
       25 
     | 
    
         
            -
                - - ~>
         
     | 
| 
      
 25 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
       26 
26 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       27 
27 
     | 
    
         
             
                    version: '4.0'
         
     | 
| 
       28 
28 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       29 
29 
     | 
    
         
             
              name: bundler
         
     | 
| 
       30 
30 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       31 
31 
     | 
    
         
             
                requirements:
         
     | 
| 
       32 
     | 
    
         
            -
                - - ~>
         
     | 
| 
      
 32 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
       33 
33 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       34 
34 
     | 
    
         
             
                    version: '1.3'
         
     | 
| 
       35 
35 
     | 
    
         
             
              type: :development
         
     | 
| 
       36 
36 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       37 
37 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       38 
38 
     | 
    
         
             
                requirements:
         
     | 
| 
       39 
     | 
    
         
            -
                - - ~>
         
     | 
| 
      
 39 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
       40 
40 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       41 
41 
     | 
    
         
             
                    version: '1.3'
         
     | 
| 
       42 
42 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       43 
43 
     | 
    
         
             
              name: rake
         
     | 
| 
       44 
44 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       45 
45 
     | 
    
         
             
                requirements:
         
     | 
| 
       46 
     | 
    
         
            -
                - -  
     | 
| 
      
 46 
     | 
    
         
            +
                - - ">="
         
     | 
| 
       47 
47 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       48 
48 
     | 
    
         
             
                    version: '0'
         
     | 
| 
       49 
49 
     | 
    
         
             
              type: :development
         
     | 
| 
       50 
50 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       51 
51 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       52 
52 
     | 
    
         
             
                requirements:
         
     | 
| 
       53 
     | 
    
         
            -
                - -  
     | 
| 
      
 53 
     | 
    
         
            +
                - - ">="
         
     | 
| 
       54 
54 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       55 
55 
     | 
    
         
             
                    version: '0'
         
     | 
| 
       56 
56 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       57 
57 
     | 
    
         
             
              name: rspec
         
     | 
| 
       58 
58 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       59 
59 
     | 
    
         
             
                requirements:
         
     | 
| 
       60 
     | 
    
         
            -
                - -  
     | 
| 
      
 60 
     | 
    
         
            +
                - - ">="
         
     | 
| 
       61 
61 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       62 
62 
     | 
    
         
             
                    version: '0'
         
     | 
| 
       63 
63 
     | 
    
         
             
              type: :development
         
     | 
| 
       64 
64 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       65 
65 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       66 
66 
     | 
    
         
             
                requirements:
         
     | 
| 
       67 
     | 
    
         
            -
                - -  
     | 
| 
      
 67 
     | 
    
         
            +
                - - ">="
         
     | 
| 
       68 
68 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       69 
69 
     | 
    
         
             
                    version: '0'
         
     | 
| 
       70 
70 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       71 
71 
     | 
    
         
             
              name: rack-proxy
         
     | 
| 
       72 
72 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       73 
73 
     | 
    
         
             
                requirements:
         
     | 
| 
       74 
     | 
    
         
            -
                - -  
     | 
| 
      
 74 
     | 
    
         
            +
                - - ">="
         
     | 
| 
       75 
75 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       76 
76 
     | 
    
         
             
                    version: '0'
         
     | 
| 
       77 
77 
     | 
    
         
             
              type: :development
         
     | 
| 
       78 
78 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       79 
79 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       80 
80 
     | 
    
         
             
                requirements:
         
     | 
| 
       81 
     | 
    
         
            -
                - -  
     | 
| 
      
 81 
     | 
    
         
            +
                - - ">="
         
     | 
| 
       82 
82 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       83 
83 
     | 
    
         
             
                    version: '0'
         
     | 
| 
       84 
84 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       85 
85 
     | 
    
         
             
              name: pry
         
     | 
| 
       86 
86 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       87 
87 
     | 
    
         
             
                requirements:
         
     | 
| 
       88 
     | 
    
         
            -
                - -  
     | 
| 
      
 88 
     | 
    
         
            +
                - - ">="
         
     | 
| 
       89 
89 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       90 
90 
     | 
    
         
             
                    version: '0'
         
     | 
| 
       91 
91 
     | 
    
         
             
              type: :development
         
     | 
| 
       92 
92 
     | 
    
         
             
              prerelease: false
         
     | 
| 
       93 
93 
     | 
    
         
             
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       94 
94 
     | 
    
         
             
                requirements:
         
     | 
| 
       95 
     | 
    
         
            -
                - -  
     | 
| 
      
 95 
     | 
    
         
            +
                - - ">="
         
     | 
| 
       96 
96 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       97 
97 
     | 
    
         
             
                    version: '0'
         
     | 
| 
       98 
98 
     | 
    
         
             
            description: Rack::Proxy router using Journey
         
     | 
| 
         @@ -103,9 +103,9 @@ executables: [] 
     | 
|
| 
       103 
103 
     | 
    
         
             
            extensions: []
         
     | 
| 
       104 
104 
     | 
    
         
             
            extra_rdoc_files: []
         
     | 
| 
       105 
105 
     | 
    
         
             
            files:
         
     | 
| 
       106 
     | 
    
         
            -
            - .gitignore
         
     | 
| 
       107 
     | 
    
         
            -
            - .rspec
         
     | 
| 
       108 
     | 
    
         
            -
            - .travis.yml
         
     | 
| 
      
 106 
     | 
    
         
            +
            - ".gitignore"
         
     | 
| 
      
 107 
     | 
    
         
            +
            - ".rspec"
         
     | 
| 
      
 108 
     | 
    
         
            +
            - ".travis.yml"
         
     | 
| 
       109 
109 
     | 
    
         
             
            - Gemfile
         
     | 
| 
       110 
110 
     | 
    
         
             
            - LICENSE.txt
         
     | 
| 
       111 
111 
     | 
    
         
             
            - README.md
         
     | 
| 
         @@ -138,17 +138,17 @@ require_paths: 
     | 
|
| 
       138 
138 
     | 
    
         
             
            - lib
         
     | 
| 
       139 
139 
     | 
    
         
             
            required_ruby_version: !ruby/object:Gem::Requirement
         
     | 
| 
       140 
140 
     | 
    
         
             
              requirements:
         
     | 
| 
       141 
     | 
    
         
            -
              - -  
     | 
| 
      
 141 
     | 
    
         
            +
              - - ">="
         
     | 
| 
       142 
142 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       143 
143 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       144 
144 
     | 
    
         
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
       145 
145 
     | 
    
         
             
              requirements:
         
     | 
| 
       146 
     | 
    
         
            -
              - -  
     | 
| 
      
 146 
     | 
    
         
            +
              - - ">="
         
     | 
| 
       147 
147 
     | 
    
         
             
                - !ruby/object:Gem::Version
         
     | 
| 
       148 
148 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       149 
149 
     | 
    
         
             
            requirements: []
         
     | 
| 
       150 
150 
     | 
    
         
             
            rubyforge_project: 
         
     | 
| 
       151 
     | 
    
         
            -
            rubygems_version: 2. 
     | 
| 
      
 151 
     | 
    
         
            +
            rubygems_version: 2.2.2
         
     | 
| 
       152 
152 
     | 
    
         
             
            signing_key: 
         
     | 
| 
       153 
153 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       154 
154 
     | 
    
         
             
            summary: Proximity provides a router to applications utilizing Rack::Proxy to coordinate
         
     |