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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 21139b3f22dc1c8599a285ff41ace1c8d26ad2ddf61f74d776dd5829bde25087
4
- data.tar.gz: '06839bbc5780913a08d4e36c738ae878dea8addeeb351aea1b154c27cd307b46'
3
+ metadata.gz: 543ff90128151a133dbe9f9008bf9ba4696d662cff37d469cfc65979cdfc4163
4
+ data.tar.gz: 20510dc8153d5d131d26f283fbcd6ce2d379d2bcd9c7be59a3fc4f0ea904428b
5
5
  SHA512:
6
- metadata.gz: e17f88a94acf2303a87dfc1c765ea6f80f4aeb233b00516098cef6634351178b06886c0908ab547539c47d1975c1301f0ff9b8011ec2c80119ac0ae062cc1e41
7
- data.tar.gz: e1c756aee8fc3b1a6cc971798da218bec91c33910e91f501e620b59863c2a87b98a2271a11122552df16475136fbf6b6a0cc536cbeeaea0873ad4710547f2d4d
6
+ metadata.gz: 66fb3d2162978fe14d2aa71f1d0e14609308d756a4a3377eb36bdc1c07a027752649c0b930d2d6d783eba63309b4bf43c1647812b05ba15498d65eccb122f0c6
7
+ data.tar.gz: 0e7cfcee3d985a1acdc01819071070e1ca6a692c871948a4b7b86b0cc83e9b4a8c751221654d3abeb64ace58077b8f208ba357e714cd89e01b12a8ab6fa631ef
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- jarvisbot_songfinder (0.1.0)
4
+ jarvisbot_songfinder (1.0.0)
5
5
  httparty (~> 0.16)
6
6
  rspotify (~> 2.4.0)
7
7
  yt (~> 0.29.1)
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."
@@ -25,4 +25,4 @@ module JarvisbotSongfinder
25
25
  @length_max = Float::INFINITY
26
26
  end
27
27
  end
28
- end
28
+ end
@@ -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? && not_too_long? && in_music_category?
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 < 600
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?
@@ -1,3 +1,3 @@
1
1
  module JarvisbotSongfinder
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.2"
3
3
  end
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.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-01 00:00:00.000000000 Z
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: