songle-song-uri-parser 1.1.1 → 1.1.2

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: ef82000ae2c1b5a995b0b6f65116d9fc7a19f0f57c3fc081e2e2b2c9aa1f6258
4
- data.tar.gz: 0d0b079706f016d7ef9cab6d2b32f10836c802a3b4f3236e8381270e2deb9830
3
+ metadata.gz: f3d24947ddabd6ef501f43fba6935409860faa32dd1da2bbeeb626c4d5b7fbcb
4
+ data.tar.gz: 9d5e563fc6d919dc39b37d8c23039f95e7736f602c0afecf86bedc4705fe1bb1
5
5
  SHA512:
6
- metadata.gz: e1fc44fe2a80c7347d0fcd942b61ac28e3f73f8925ed3668848f92ab74e321a9363cee34264953c8a64bb49b8cc84a3294cae80f5d6a1058aa116866d52d70c3
7
- data.tar.gz: e7a08557f770347183a4d00ce670c5c92a3ae2add48a00ab8f9e92b7454ace1feeee4e069f20158f86d95293a3cfe810d504772842110f32078a344daf11adf4
6
+ metadata.gz: 9fe2886f06335dbf899df2145dc14a182fa460fe2f39e4e413fc082cdd7fefe810cae8ba61664d5f3b4a1c8254798667b792db3867e3de7ef1ac74efca129f81
7
+ data.tar.gz: d502d93ab14a84eb4b4c68811f37cf3cfe9ebe6440f552aa9a71461e805e56ff8c5168dbc685bcbbebf9932ba60bc62357489c7cfe423687b645192c97eb449d
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.6.0
1
+ 2.6.1
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG.md
2
2
 
3
+ ## v1.1.2 (2019-01-31)
4
+ - Changed constractor parameters in `::Songle::SongURI` class
5
+ - Improved about loading module
6
+
3
7
  ## v1.1.1 (2019-01-26)
4
8
  - Improved validation in constractor parameters
5
9
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- songle-song-uri-parser (1.1.1)
4
+ songle-song-uri-parser (1.1.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,17 +1,19 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  require "songle/song_uri"
3
- require "songle/song_uri/mp3_song_uri"
4
- require "songle/song_uri/numeric_song_uri"
3
+
4
+ require "songle/song_uri/invalid_song_uri_error"
5
+
5
6
  require "songle/song_uri/nn_song_uri"
6
7
  require "songle/song_uri/nn_scheme_song_uri"
7
8
  require "songle/song_uri/nn_short_song_uri"
9
+
8
10
  require "songle/song_uri/sc_song_uri"
9
11
  require "songle/song_uri/sc_scheme_song_uri"
12
+
10
13
  require "songle/song_uri/yt_song_uri"
11
14
  require "songle/song_uri/yt_scheme_song_uri"
12
15
  require "songle/song_uri/yt_short_song_uri"
13
- require "songle/song_uri/invalid_song_uri_error"
14
16
 
15
- module ::SongleSongURIParser
16
- VERSION = "1.1.1"
17
- end
17
+ require "songle/song_uri/numeric_song_uri"
18
+
19
+ require "songle/song_uri/mp3_song_uri"
@@ -0,0 +1,4 @@
1
+ # -*- coding: utf-8 -*-
2
+ module ::SongleSongURIParser
3
+ VERSION = "1.1.2"
4
+ end
@@ -26,7 +26,7 @@ module ::Songle
26
26
  ##
27
27
  # @constructor
28
28
  #
29
- def initialize query, options = nil
29
+ def initialize options = nil
30
30
  options ||= {}
31
31
 
32
32
  @endpoint_scheme =
@@ -78,31 +78,31 @@ module ::Songle
78
78
  # @method
79
79
  # @static
80
80
  #
81
- def parse query, options = nil
82
- query =
83
- ::URI.decode_www_form_component(query.to_s)
81
+ def parse query_string, options = nil
82
+ query_string =
83
+ ::URI.decode_www_form_component(query_string.to_s)
84
84
 
85
85
  case
86
- when query =~ ::Songle::SongURI::NnSongURI::URI_REGEX
87
- return ::Songle::SongURI::NnSongURI.new(query, options)
88
- when query =~ ::Songle::SongURI::NnSchemeSongURI::URI_REGEX
89
- return ::Songle::SongURI::NnSchemeSongURI.new(query, options)
90
- when query =~ ::Songle::SongURI::NnShortSongURI::URI_REGEX
91
- return ::Songle::SongURI::NnShortSongURI.new(query, options)
92
- when query =~ ::Songle::SongURI::ScSongURI::URI_REGEX
93
- return ::Songle::SongURI::ScSongURI.new(query, options)
94
- when query =~ ::Songle::SongURI::ScSchemeSongURI::URI_REGEX
95
- return ::Songle::SongURI::ScSchemeSongURI.new(query, options)
96
- when query =~ ::Songle::SongURI::YtSongURI::URI_REGEX
97
- return ::Songle::SongURI::YtSongURI.new(query, options)
98
- when query =~ ::Songle::SongURI::YtSchemeSongURI::URI_REGEX
99
- return ::Songle::SongURI::YtSchemeSongURI.new(query, options)
100
- when query =~ ::Songle::SongURI::YtShortSongURI::URI_REGEX
101
- return ::Songle::SongURI::YtShortSongURI.new(query, options)
102
- when query =~ ::Songle::SongURI::NumericSongURI::URI_REGEX
103
- return ::Songle::SongURI::NumericSongURI.new(query, options)
86
+ when query_string =~ ::Songle::SongURI::NnSongURI::URI_REGEX
87
+ return ::Songle::SongURI::NnSongURI.new(query_string, options)
88
+ when query_string =~ ::Songle::SongURI::NnSchemeSongURI::URI_REGEX
89
+ return ::Songle::SongURI::NnSchemeSongURI.new(query_string, options)
90
+ when query_string =~ ::Songle::SongURI::NnShortSongURI::URI_REGEX
91
+ return ::Songle::SongURI::NnShortSongURI.new(query_string, options)
92
+ when query_string =~ ::Songle::SongURI::ScSongURI::URI_REGEX
93
+ return ::Songle::SongURI::ScSongURI.new(query_string, options)
94
+ when query_string =~ ::Songle::SongURI::ScSchemeSongURI::URI_REGEX
95
+ return ::Songle::SongURI::ScSchemeSongURI.new(query_string, options)
96
+ when query_string =~ ::Songle::SongURI::YtSongURI::URI_REGEX
97
+ return ::Songle::SongURI::YtSongURI.new(query_string, options)
98
+ when query_string =~ ::Songle::SongURI::YtSchemeSongURI::URI_REGEX
99
+ return ::Songle::SongURI::YtSchemeSongURI.new(query_string, options)
100
+ when query_string =~ ::Songle::SongURI::YtShortSongURI::URI_REGEX
101
+ return ::Songle::SongURI::YtShortSongURI.new(query_string, options)
102
+ when query_string =~ ::Songle::SongURI::NumericSongURI::URI_REGEX
103
+ return ::Songle::SongURI::NumericSongURI.new(query_string, options)
104
104
  else
105
- return ::Songle::SongURI::Mp3SongURI.new(query, options)
105
+ return ::Songle::SongURI::Mp3SongURI.new(query_string, options)
106
106
  end
107
107
  end
108
108
  end
@@ -4,8 +4,8 @@ module ::Songle::SongURI
4
4
  ##
5
5
  # @constructor
6
6
  #
7
- def initialize query
8
- super("'#{ query }' isn't song uri.")
7
+ def initialize query_string
8
+ super("'#{ query_string }' isn't song uri.")
9
9
  end
10
10
  end
11
11
  end
@@ -16,23 +16,23 @@ module ::Songle::SongURI
16
16
  ##
17
17
  # @constructor
18
18
  #
19
- def initialize query, options
20
- super(query, options)
19
+ def initialize query_string, options
20
+ super(options)
21
21
 
22
- if query =~ URI_REGEX
23
- query = $3
22
+ if query_string =~ URI_REGEX
23
+ query_string = $3
24
24
  end
25
25
 
26
- if query =~ /^#{ self.endpoint_host }(.+)$/
27
- query = $1
26
+ if query_string =~ /^#{ self.endpoint_host }(.+)$/
27
+ query_string = $1
28
28
  end
29
29
 
30
- if query =~ /^#{ self.endpoint_path }(.+)$/
31
- query = $1
30
+ if query_string =~ /^#{ self.endpoint_path }(.+)$/
31
+ query_string = $1
32
32
  end
33
33
 
34
34
  source_uri =
35
- ::URI.parse("//#{ query }")
35
+ ::URI.parse("//#{ query_string }")
36
36
 
37
37
  @source_host = source_uri.host
38
38
  @source_path = source_uri.path
@@ -26,15 +26,15 @@ module ::Songle::SongURI
26
26
  ##
27
27
  # @constructor
28
28
  #
29
- def initialize query, options
30
- super(query, options)
29
+ def initialize query_string, options
30
+ super(options)
31
31
 
32
32
  @source_host = SOURCE_HOST
33
33
  @source_path = SOURCE_PATH
34
- @source_id = $1 if query =~ URI_REGEX
34
+ @source_id = $1 if query_string =~ URI_REGEX
35
35
 
36
36
  if @source_id.nil? || @source_id.strip.empty?
37
- raise ::Songle::SongURI::InvalidSongURIError.new(query)
37
+ raise ::Songle::SongURI::InvalidSongURIError.new(query_string)
38
38
  end
39
39
 
40
40
  @source_path += @source_id
@@ -26,15 +26,15 @@ module ::Songle::SongURI
26
26
  ##
27
27
  # @constructor
28
28
  #
29
- def initialize query, options
30
- super(query, options)
29
+ def initialize query_string, options
30
+ super(options)
31
31
 
32
32
  @source_host = SOURCE_HOST
33
33
  @source_path = SOURCE_PATH
34
- @source_id = $1 if query =~ URI_REGEX
34
+ @source_id = $1 if query_string =~ URI_REGEX
35
35
 
36
36
  if @source_id.nil? || @source_id.strip.empty?
37
- raise ::Songle::SongURI::InvalidSongURIError.new(query)
37
+ raise ::Songle::SongURI::InvalidSongURIError.new(query_string)
38
38
  end
39
39
 
40
40
  @source_path += @source_id
@@ -26,15 +26,15 @@ module ::Songle::SongURI
26
26
  ##
27
27
  # @constructor
28
28
  #
29
- def initialize query, options
30
- super(query, options)
29
+ def initialize query_string, options
30
+ super(options)
31
31
 
32
32
  @source_host = SOURCE_HOST
33
- @source_path = $1 if query =~ URI_REGEX
34
- @source_id = $2 if query =~ URI_REGEX
33
+ @source_path = $1 if query_string =~ URI_REGEX
34
+ @source_id = $2 if query_string =~ URI_REGEX
35
35
 
36
36
  if @source_id.nil? || @source_id.strip.empty?
37
- raise ::Songle::SongURI::InvalidSongURIError.new(query)
37
+ raise ::Songle::SongURI::InvalidSongURIError.new(query_string)
38
38
  end
39
39
  end
40
40
 
@@ -16,12 +16,12 @@ module ::Songle::SongURI
16
16
  ##
17
17
  # @constructor
18
18
  #
19
- def initialize query, options
20
- super(query, options)
19
+ def initialize query_string, options
20
+ super(options)
21
21
 
22
22
  @source_host = nil
23
23
  @source_path = nil
24
- @source_id = $3 if query =~ URI_REGEX
24
+ @source_id = $3 if query_string =~ URI_REGEX
25
25
  end
26
26
 
27
27
  ##
@@ -26,15 +26,15 @@ module ::Songle::SongURI
26
26
  ##
27
27
  # @constructor
28
28
  #
29
- def initialize query, options
30
- super(query, options)
29
+ def initialize query_string, options
30
+ super(options)
31
31
 
32
32
  @source_host = SOURCE_HOST
33
33
  @source_path = SOURCE_PATH
34
- @source_id = $1 if query =~ URI_REGEX
34
+ @source_id = $1 if query_string =~ URI_REGEX
35
35
 
36
36
  if @source_id.nil? || @source_id.strip.empty?
37
- raise ::Songle::SongURI::InvalidSongURIError.new(query)
37
+ raise ::Songle::SongURI::InvalidSongURIError.new(query_string)
38
38
  end
39
39
 
40
40
  @source_path += @source_id
@@ -26,15 +26,15 @@ module ::Songle::SongURI
26
26
  ##
27
27
  # @constructor
28
28
  #
29
- def initialize query, options
30
- super(query, options)
29
+ def initialize query_string, options
30
+ super(options)
31
31
 
32
32
  @source_host = SOURCE_HOST
33
- @source_path = $1 if query =~ URI_REGEX
34
- @source_id = $2 if query =~ URI_REGEX
33
+ @source_path = $1 if query_string =~ URI_REGEX
34
+ @source_id = $2 if query_string =~ URI_REGEX
35
35
 
36
36
  if @source_id.nil? || @source_id.strip.empty?
37
- raise ::Songle::SongURI::InvalidSongURIError.new(query)
37
+ raise ::Songle::SongURI::InvalidSongURIError.new(query_string)
38
38
  end
39
39
  end
40
40
 
@@ -26,15 +26,15 @@ module ::Songle::SongURI
26
26
  ##
27
27
  # @constructor
28
28
  #
29
- def initialize query, options
30
- super(query, options)
29
+ def initialize query_string, options
30
+ super(options)
31
31
 
32
32
  @source_host = SOURCE_HOST
33
33
  @source_path = SOURCE_PATH
34
- @source_id = $1 if query =~ URI_REGEX
34
+ @source_id = $1 if query_string =~ URI_REGEX
35
35
 
36
36
  if @source_id.nil? || @source_id.strip.empty?
37
- raise ::Songle::SongURI::InvalidSongURIError.new(query)
37
+ raise ::Songle::SongURI::InvalidSongURIError.new(query_string)
38
38
  end
39
39
 
40
40
  @source_path += @source_id
@@ -26,15 +26,15 @@ module ::Songle::SongURI
26
26
  ##
27
27
  # @constructor
28
28
  #
29
- def initialize query, options
30
- super(query, options)
29
+ def initialize query_string, options
30
+ super(options)
31
31
 
32
32
  @source_host = SOURCE_HOST
33
33
  @source_path = SOURCE_PATH
34
- @source_id = $1 if query =~ URI_REGEX
34
+ @source_id = $1 if query_string =~ URI_REGEX
35
35
 
36
36
  if @source_id.nil? || @source_id.strip.empty?
37
- raise ::Songle::SongURI::InvalidSongURIError.new(query)
37
+ raise ::Songle::SongURI::InvalidSongURIError.new(query_string)
38
38
  end
39
39
 
40
40
  @source_path += @source_id
@@ -26,15 +26,15 @@ module ::Songle::SongURI
26
26
  ##
27
27
  # @constructor
28
28
  #
29
- def initialize query, options
30
- super(query, options)
29
+ def initialize query_string, options
30
+ super(options)
31
31
 
32
32
  @source_host = SOURCE_HOST
33
- @source_path = $1 if query =~ URI_REGEX
34
- @source_id = $2 if query =~ URI_REGEX
33
+ @source_path = $1 if query_string =~ URI_REGEX
34
+ @source_id = $2 if query_string =~ URI_REGEX
35
35
 
36
36
  if @source_id.nil? || @source_id.strip.empty?
37
- raise ::Songle::SongURI::InvalidSongURIError.new(query)
37
+ raise ::Songle::SongURI::InvalidSongURIError.new(query_string)
38
38
  end
39
39
  end
40
40
 
@@ -1,7 +1,7 @@
1
1
 
2
2
  lib = File.expand_path("../lib", __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require "songle-song-uri-parser"
4
+ require "songle-song-uri-parser/version"
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "songle-song-uri-parser"
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.1.1
4
+ version: 1.1.2
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-26 00:00:00.000000000 Z
11
+ date: 2019-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -70,6 +70,7 @@ files:
70
70
  - README.md
71
71
  - Rakefile
72
72
  - lib/songle-song-uri-parser.rb
73
+ - lib/songle-song-uri-parser/version.rb
73
74
  - lib/songle/song_uri.rb
74
75
  - lib/songle/song_uri/invalid_song_uri_error.rb
75
76
  - lib/songle/song_uri/mp3_song_uri.rb