web_stat 0.2.2 → 0.2.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
  SHA256:
3
- metadata.gz: f2eaf23097ccc295a0738b045d11652f1db3fdb1c1c373421a2c67d0e09d847c
4
- data.tar.gz: c68e883f51d19432ebd8f644c497043a3c7aef6c41a6029423cffe57271a1073
3
+ metadata.gz: 90030fe0082c3bd528c2a2dcec6d6539df7a42ca024c9710e110d42af56d0d49
4
+ data.tar.gz: 7ad6b5178e4892229623a5f5d89368ec4dd1e899ef501422bc3b3ff38c207154
5
5
  SHA512:
6
- metadata.gz: e779c1c8718b9460f9b5f9caf508e8291086fe6d17ba920af140c0db258f5835fc0f83e360c0cc18c822032a3185ae09b381fc7099ffd96cead65734fae6dc68
7
- data.tar.gz: 4e93cebd4ccbe0acd9f575a35d5b581fbb172aa0200186894eac9298ca7f0b45f047b3db85be00730f55fe5539e5c38abff14b321c7f8befc46364720afaee0d
6
+ metadata.gz: 5d2c7ac403071588b6f1e5e1afb62f7032c55736a23057d7bb4e2147d15935224f51b2ad74dc987c8f5e84166a2baae6565f207c32f3b3cdb88147183b29fcb0
7
+ data.tar.gz: d4774d7f3bb27c06c893d90fb1be43a52e3f0d9ed528854e3dadcdf49e122263abcfbca4a872ee30375c3a931de7b29678aa59b9a1656c9ccdd5ea9a803f2b09
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- web_stat (0.2.2)
4
+ web_stat (0.2.3)
5
5
  bundler (>= 2.0.2)
6
6
  cld (>= 0.8.0)
7
7
  final_redirect_url (>= 0.1.0)
data/README.md CHANGED
@@ -45,6 +45,10 @@ And then execute:
45
45
  ### spec
46
46
 
47
47
  $ bundle exec rake spec
48
+
49
+ or
50
+
51
+ $ bundle exec rspec
48
52
 
49
53
  Test a file
50
54
 
@@ -15,7 +15,7 @@ module WebStat
15
15
 
16
16
  # Validation url
17
17
  def url_valid?(url)
18
- regexp = Regexp.new("^https?://([a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9])\\\.([a-zA-Z]{2,})(/.*)?$", Regexp::IGNORECASE)
18
+ regexp = Regexp.new("^https?://([a-zA-Z0-9][a-zA-Z0-9\\\-\.]{1,61}[a-zA-Z0-9])\\\.([a-zA-Z]{2,})(.*)?$", Regexp::IGNORECASE)
19
19
  regexp.match?(url)
20
20
  end
21
21
  end
@@ -1,3 +1,3 @@
1
1
  module WebStat
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
@@ -94,4 +94,13 @@ RSpec.describe WebStat::Fetch do
94
94
  expect { WebStat.stat_by_url("http://newsdict/afsdafasdf") }.to raise_error(WebStat::INVALID_URL)
95
95
  expect { WebStat.stat_by_url("p://newsdict/afsdafasdf") }.to raise_error(WebStat::INVALID_URL)
96
96
  end
97
+
98
+ it "valid url" do
99
+ web_stat_fetch_web_class = WebStat::FetchAsWeb.new("https://newsdict.blog/content/images/size/w100/2019/03/facebook-3.jpg")
100
+ #expect(web_stat_fetch_web_class.url_valid?("http://status.aws.amazon.com/#cloudfront_12345")).to be true
101
+ #expect(web_stat_fetch_web_class.url_valid?("https://findy-code.io?h=NWsZey5UgJ51u&t=omikuji-22")).to be true
102
+ expect(web_stat_fetch_web_class.url_valid?("https://www.meetup.com/pro/docker")).to be true
103
+ expect(web_stat_fetch_web_class.url_valid?("https://gxyt4.app.goo.gl/Mn64U")).to be true
104
+ expect(web_stat_fetch_web_class.url_valid?("https://status.cloud.google.com/incident/cloud-functions/19010")).to be true
105
+ end
97
106
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: web_stat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - yusuke abe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-03 00:00:00.000000000 Z
11
+ date: 2020-01-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler