emagen 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e40e727e87e60794be14d4eddf8962f0f709e955
4
- data.tar.gz: 6ec99e35834f4f5fa692e0d0a26448f0f89ec283
3
+ metadata.gz: 9649fe664377a6570b6f4dbc5c72219cd34614ce
4
+ data.tar.gz: 1167365894ca4d919d5387e95911c45810003bac
5
5
  SHA512:
6
- metadata.gz: 8ec81b7d1aa64fc1715684832709110b195db2d69a5baab2cce6ed1b2589b0cd3f00f8e694a1f779ef1247842542a53fa4075187639ebfdec079aaffbdd6baed
7
- data.tar.gz: 55b50293006fb5347e4661d63a2d078782ec04b61851a58f0068cdb1df4315633827bc2a2f4281193aa77cfb4d91f1a3088be04a75809871266dac0e08638db6
6
+ metadata.gz: db18a3f602124160326a284bb389d0f8b2a41e98089796a40c5222a826a9cc4391cc3756186457c243722f8428bf757817465fde5bd423e095344dfcdecf0a11
7
+ data.tar.gz: 6f0b4d4fe91a66c7b49548e50964fd61d57a3cca9e85fafd91d393ed5f0984deea48dce9a9c7205c0723f3f2e3e60b37205a6d3f9b083555c07874890d0c1e77
@@ -1,3 +1,3 @@
1
1
  module Emagen
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -8,7 +8,7 @@ module Emagen
8
8
 
9
9
  private
10
10
  def domain_from(web_address)
11
- web_address.split('.').slice(-2..-1).join('.')
11
+ web_address.split(/(\/\/|\.)/).slice(-3..-1).join
12
12
  end
13
13
  end
14
14
  end
@@ -2,12 +2,21 @@ require 'spec_helper'
2
2
 
3
3
  describe Emagen::WebAddress do
4
4
  let(:subject) { Emagen::WebAddress }
5
- let(:web_address) { "http://www.domain.com" }
5
+ let(:domain) { 'domain.com' }
6
+ let(:web_addresses) do
7
+ %w{
8
+ http://www.domain.com http://domain.com
9
+ https://www.domain.com https://domain.com
10
+ www.domain.com domain.com
11
+ }
12
+ end
6
13
 
7
14
  describe '#domain' do
8
15
  it "should get the domain from a web address" do
9
- address = subject.new(web_address)
10
- expect(address.domain).to eq 'domain.com'
16
+ web_addresses.each do |web_address|
17
+ address = subject.new(web_address)
18
+ expect(address.domain).to eq domain
19
+ end
11
20
  end
12
21
  end
13
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: emagen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Louis Sayers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-01 00:00:00.000000000 Z
11
+ date: 2015-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler