jarvisbot_songfinder 1.0.0 → 1.0.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 +4 -4
- data/Gemfile.lock +1 -1
- data/changelog.md +10 -0
- data/jarvisbot_songfinder.gemspec +1 -1
- data/lib/jarvisbot_songfinder/configuration.rb +1 -1
- data/lib/jarvisbot_songfinder/helpers/reply_message.rb +4 -0
- data/lib/jarvisbot_songfinder/providers/provider.rb +16 -2
- data/lib/jarvisbot_songfinder/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 543ff90128151a133dbe9f9008bf9ba4696d662cff37d469cfc65979cdfc4163
|
4
|
+
data.tar.gz: 20510dc8153d5d131d26f283fbcd6ce2d379d2bcd9c7be59a3fc4f0ea904428b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66fb3d2162978fe14d2aa71f1d0e14609308d756a4a3377eb36bdc1c07a027752649c0b930d2d6d783eba63309b4bf43c1647812b05ba15498d65eccb122f0c6
|
7
|
+
data.tar.gz: 0e7cfcee3d985a1acdc01819071070e1ca6a692c871948a4b7b86b0cc83e9b4a8c751221654d3abeb64ace58077b8f208ba357e714cd89e01b12a8ab6fa631ef
|
data/Gemfile.lock
CHANGED
data/changelog.md
ADDED
@@ -0,0 +1,10 @@
|
|
1
|
+
## [1.0.2] - February 01, 2019
|
2
|
+
### Changed
|
3
|
+
- Fixed changelog url in gemspec
|
4
|
+
|
5
|
+
## [1.0.1] - February 01, 2019
|
6
|
+
### Changed
|
7
|
+
- Track length restrictions can now be configured via config.length_max and config.length_min (in seconds);
|
8
|
+
|
9
|
+
## [1.0.0] - February 01, 2019
|
10
|
+
### Initial release
|
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
|
|
23
23
|
|
24
24
|
spec.metadata["homepage_uri"] = spec.homepage
|
25
25
|
spec.metadata["source_code_uri"] = "https://gitlab.com/DoubleJarvis/jarvisbot_songfinder"
|
26
|
-
spec.metadata["changelog_uri"] = "https://gitlab.com/DoubleJarvis/jarvisbot_songfinder/changelog.md"
|
26
|
+
spec.metadata["changelog_uri"] = "https://gitlab.com/DoubleJarvis/jarvisbot_songfinder/blob/master/changelog.md"
|
27
27
|
else
|
28
28
|
raise "RubyGems 2.0 or newer is required to protect against " \
|
29
29
|
"public gem pushes."
|
@@ -28,6 +28,10 @@ module JarvisbotSongfinder
|
|
28
28
|
def self.too_long
|
29
29
|
"Your request is too long, please stick to videos not longer than 10 minutes"
|
30
30
|
end
|
31
|
+
|
32
|
+
def self.too_short
|
33
|
+
"Your request is too short, troll requests or gnoming will not fly here"
|
34
|
+
end
|
31
35
|
|
32
36
|
def self.invalid_category
|
33
37
|
"Your request is not in Music category"
|
@@ -28,7 +28,7 @@ module JarvisbotSongfinder
|
|
28
28
|
|
29
29
|
def valid?
|
30
30
|
return false if @errors.any?
|
31
|
-
available_in_region? &&
|
31
|
+
available_in_region? && length_valid? && in_music_category?
|
32
32
|
end
|
33
33
|
|
34
34
|
def url
|
@@ -49,8 +49,22 @@ module JarvisbotSongfinder
|
|
49
49
|
raise NotImplementedError
|
50
50
|
end
|
51
51
|
|
52
|
+
def length_valid?
|
53
|
+
not_too_long? && not_too_short?
|
54
|
+
end
|
55
|
+
|
52
56
|
def not_too_long?
|
53
|
-
length <
|
57
|
+
unless length < JarvisbotSongfinder.configuration.length_max
|
58
|
+
add_error(JarvisbotSongfinder::ReplyMessage::Request.too_long)
|
59
|
+
end
|
60
|
+
length < JarvisbotSongfinder.configuration.length_max
|
61
|
+
end
|
62
|
+
|
63
|
+
def not_too_short?
|
64
|
+
unless length > JarvisbotSongfinder.configuration.length_min
|
65
|
+
add_error(JarvisbotSongfinder::ReplyMessage::Request.too_short)
|
66
|
+
end
|
67
|
+
length > JarvisbotSongfinder.configuration.length_min
|
54
68
|
end
|
55
69
|
|
56
70
|
def in_music_category?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jarvisbot_songfinder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-02-
|
11
|
+
date: 2019-02-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -168,6 +168,7 @@ files:
|
|
168
168
|
- Rakefile
|
169
169
|
- bin/console
|
170
170
|
- bin/setup
|
171
|
+
- changelog.md
|
171
172
|
- fixtures/vcr_cassettes/query_text.yml
|
172
173
|
- fixtures/vcr_cassettes/query_track_delegation.yml
|
173
174
|
- fixtures/vcr_cassettes/query_youtube_url.yml
|
@@ -213,7 +214,7 @@ licenses:
|
|
213
214
|
metadata:
|
214
215
|
homepage_uri: https://gitlab.com/DoubleJarvis/jarvisbot_songfinder
|
215
216
|
source_code_uri: https://gitlab.com/DoubleJarvis/jarvisbot_songfinder
|
216
|
-
changelog_uri: https://gitlab.com/DoubleJarvis/jarvisbot_songfinder/changelog.md
|
217
|
+
changelog_uri: https://gitlab.com/DoubleJarvis/jarvisbot_songfinder/blob/master/changelog.md
|
217
218
|
post_install_message:
|
218
219
|
rdoc_options: []
|
219
220
|
require_paths:
|