songle-song-uri-parser 1.0.0 → 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/CHANGELOG.md +4 -0
- data/Dockerfile +2 -2
- data/Gemfile.lock +1 -1
- data/lib/songle/song_uri/mp3_song_uri.rb +2 -2
- data/lib/songle/song_uri/nn_scheme_song_uri.rb +1 -1
- data/lib/songle/song_uri/nn_short_song_uri.rb +1 -1
- data/lib/songle/song_uri/nn_song_uri.rb +2 -2
- data/lib/songle/song_uri/numeric_song_uri.rb +41 -0
- data/lib/songle/song_uri/sc_scheme_song_uri.rb +1 -1
- data/lib/songle/song_uri/sc_song_uri.rb +2 -2
- data/lib/songle/song_uri/yt_scheme_song_uri.rb +1 -1
- data/lib/songle/song_uri/yt_short_song_uri.rb +1 -1
- data/lib/songle/song_uri/yt_song_uri.rb +2 -2
- data/lib/songle/song_uri.rb +8 -6
- data/lib/songle-song-uri-parser.rb +2 -1
- metadata +3 -3
- data/.gitlab-ci.yml +0 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51439885a41518b7959c19cae4bc9c32cd9efe73e29418210350edaee6c7d400
|
4
|
+
data.tar.gz: 53fa81ee144ca6e51dee68c8d10aade917b678879ef0cc79b05f14e35ab3209e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f86b90bc2139f1820b0cb23b463416b1a675ea1c1c3b46f3714557d5f62cf3deb82a9fd770b05797a3904161bacf3df39aac86414f458873a407a96966a8df32
|
7
|
+
data.tar.gz: 2928cb4c48b0b06c6eb1112e835598452302b8ad540324532fbf7c481a569fe7837dbc9a0ec39735af7cb78c63d939b84d396f067e434825f7fbd8becf85ba84
|
data/CHANGELOG.md
CHANGED
data/Dockerfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -0,0 +1,41 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
module ::Songle::SongURI
|
3
|
+
class NumericSongURI
|
4
|
+
include ::Songle::SongURI
|
5
|
+
|
6
|
+
##
|
7
|
+
# @constant
|
8
|
+
#
|
9
|
+
TYPE = "numeric"
|
10
|
+
|
11
|
+
##
|
12
|
+
# @constant
|
13
|
+
#
|
14
|
+
URI_REGEX = /^(|\/\/[\w.]+\/[\w.]+\/|http(|s):\/\/[\w.]+\/[\w.]+\/)(\d+)$/
|
15
|
+
|
16
|
+
##
|
17
|
+
# @constructor
|
18
|
+
#
|
19
|
+
def initialize string, options
|
20
|
+
super(string, options)
|
21
|
+
|
22
|
+
@source_host = nil
|
23
|
+
@source_path = nil
|
24
|
+
@source_id = $3 if string =~ URI_REGEX
|
25
|
+
end
|
26
|
+
|
27
|
+
##
|
28
|
+
# @method
|
29
|
+
#
|
30
|
+
def type
|
31
|
+
return TYPE
|
32
|
+
end
|
33
|
+
|
34
|
+
##
|
35
|
+
# @method
|
36
|
+
#
|
37
|
+
def to_s
|
38
|
+
return "#{ self.endpoint }#{ @source_id }"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
data/lib/songle/song_uri.rb
CHANGED
@@ -40,28 +40,28 @@ module ::Songle
|
|
40
40
|
end
|
41
41
|
|
42
42
|
##
|
43
|
-
# @
|
43
|
+
# @method
|
44
44
|
#
|
45
45
|
def endpoint
|
46
46
|
return "#{ self.endpoint_scheme }://#{ self.endpoint_host }#{ self.endpoint_path }"
|
47
47
|
end
|
48
48
|
|
49
49
|
##
|
50
|
-
# @
|
50
|
+
# @method
|
51
51
|
#
|
52
52
|
def permalink
|
53
53
|
return "http://#{ self.source_host }#{ self.source_path }"
|
54
54
|
end
|
55
55
|
|
56
56
|
##
|
57
|
-
# @
|
57
|
+
# @method
|
58
58
|
#
|
59
59
|
def type
|
60
60
|
return nil
|
61
61
|
end
|
62
62
|
|
63
63
|
##
|
64
|
-
# @
|
64
|
+
# @method
|
65
65
|
#
|
66
66
|
def to_s
|
67
67
|
encoded_source_host =
|
@@ -75,12 +75,12 @@ module ::Songle
|
|
75
75
|
|
76
76
|
class << self
|
77
77
|
##
|
78
|
-
# @
|
78
|
+
# @method
|
79
79
|
# @static
|
80
80
|
#
|
81
81
|
def parse string, options = nil
|
82
82
|
string =
|
83
|
-
::URI.decode_www_form_component(string)
|
83
|
+
::URI.decode_www_form_component(string.to_s)
|
84
84
|
|
85
85
|
case
|
86
86
|
when string =~ ::Songle::SongURI::NnSongURI::URI_REGEX
|
@@ -99,6 +99,8 @@ module ::Songle
|
|
99
99
|
return ::Songle::SongURI::YtSchemeSongURI.new(string, options)
|
100
100
|
when string =~ ::Songle::SongURI::YtShortSongURI::URI_REGEX
|
101
101
|
return ::Songle::SongURI::YtShortSongURI.new(string, options)
|
102
|
+
when string =~ ::Songle::SongURI::NumericSongURI::URI_REGEX
|
103
|
+
return ::Songle::SongURI::NumericSongURI.new(string, options)
|
102
104
|
else
|
103
105
|
return ::Songle::SongURI::Mp3SongURI.new(string, options)
|
104
106
|
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
require "songle/song_uri"
|
3
3
|
require "songle/song_uri/mp3_song_uri"
|
4
|
+
require "songle/song_uri/numeric_song_uri"
|
4
5
|
require "songle/song_uri/nn_song_uri"
|
5
6
|
require "songle/song_uri/nn_scheme_song_uri"
|
6
7
|
require "songle/song_uri/nn_short_song_uri"
|
@@ -12,5 +13,5 @@ require "songle/song_uri/yt_short_song_uri"
|
|
12
13
|
require "songle/song_uri/invalid_song_uri_error"
|
13
14
|
|
14
15
|
module ::SongleSongURIParser
|
15
|
-
VERSION = "1.
|
16
|
+
VERSION = "1.1.0"
|
16
17
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: songle-song-uri-parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takahiro INOUE
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-01-
|
11
|
+
date: 2019-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -60,7 +60,6 @@ extensions: []
|
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
62
|
- ".gitignore"
|
63
|
-
- ".gitlab-ci.yml"
|
64
63
|
- ".rspec"
|
65
64
|
- ".ruby-version"
|
66
65
|
- CHANGELOG.md
|
@@ -77,6 +76,7 @@ files:
|
|
77
76
|
- lib/songle/song_uri/nn_scheme_song_uri.rb
|
78
77
|
- lib/songle/song_uri/nn_short_song_uri.rb
|
79
78
|
- lib/songle/song_uri/nn_song_uri.rb
|
79
|
+
- lib/songle/song_uri/numeric_song_uri.rb
|
80
80
|
- lib/songle/song_uri/sc_scheme_song_uri.rb
|
81
81
|
- lib/songle/song_uri/sc_song_uri.rb
|
82
82
|
- lib/songle/song_uri/yt_scheme_song_uri.rb
|
data/.gitlab-ci.yml
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
####
|
2
|
-
## @see http://docs.gitlab.com/ce/ci/yaml/README.html
|
3
|
-
####
|
4
|
-
image: docker:git
|
5
|
-
|
6
|
-
stages:
|
7
|
-
- build_and_test
|
8
|
-
|
9
|
-
variables:
|
10
|
-
APP_ENV: develop
|
11
|
-
IMAGE_PATH: ${CI_REGISTRY}/${CI_PROJECT_NAMESPACE}/${CI_PROJECT_NAME}
|
12
|
-
|
13
|
-
build_and_test:
|
14
|
-
stage: build_and_test
|
15
|
-
script:
|
16
|
-
- docker build --build-arg RUBY_VERSION=2.3 -t ${IMAGE_PATH}:${APP_ENV} .
|
17
|
-
- docker run ${IMAGE_PATH}:${APP_ENV}
|
18
|
-
- docker build --build-arg RUBY_VERSION=2.4 -t ${IMAGE_PATH}:${APP_ENV} .
|
19
|
-
- docker run ${IMAGE_PATH}:${APP_ENV}
|
20
|
-
- docker build --build-arg RUBY_VERSION=2.5 -t ${IMAGE_PATH}:${APP_ENV} .
|
21
|
-
- docker run ${IMAGE_PATH}:${APP_ENV}
|
22
|
-
- docker build --build-arg RUBY_VERSION=2.6 -t ${IMAGE_PATH}:${APP_ENV} .
|
23
|
-
- docker run ${IMAGE_PATH}:${APP_ENV}
|
24
|
-
environment: ${APP_ENV}
|