vk_music 4.1.3 → 4.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/.env.example +0 -0
  3. data/.github/workflows/ruby.yml +0 -0
  4. data/.gitignore +0 -0
  5. data/.rspec +0 -0
  6. data/.rubocop.yml +8 -0
  7. data/.ruby-version +1 -0
  8. data/Gemfile +13 -12
  9. data/Gemfile.lock +46 -45
  10. data/LICENSE.txt +0 -0
  11. data/README.md +0 -0
  12. data/Rakefile +16 -0
  13. data/lib/vk_music/audio.rb +0 -0
  14. data/lib/vk_music/client.rb +0 -0
  15. data/lib/vk_music/playlist.rb +0 -0
  16. data/lib/vk_music/request/artist.rb +0 -0
  17. data/lib/vk_music/request/audios_reload.rb +0 -0
  18. data/lib/vk_music/request/base.rb +0 -0
  19. data/lib/vk_music/request/login.rb +0 -0
  20. data/lib/vk_music/request/my_page.rb +0 -0
  21. data/lib/vk_music/request/playlist.rb +0 -0
  22. data/lib/vk_music/request/playlist_section.rb +0 -0
  23. data/lib/vk_music/request/post.rb +0 -0
  24. data/lib/vk_music/request/profile.rb +0 -0
  25. data/lib/vk_music/request/search.rb +0 -0
  26. data/lib/vk_music/request/wall_section.rb +0 -0
  27. data/lib/vk_music/request.rb +0 -0
  28. data/lib/vk_music/utility/artist_loader.rb +0 -0
  29. data/lib/vk_music/utility/artist_url_parser.rb +0 -0
  30. data/lib/vk_music/utility/audio_data_parser.rb +0 -0
  31. data/lib/vk_music/utility/audio_items_parser.rb +0 -0
  32. data/lib/vk_music/utility/audio_node_parser.rb +0 -0
  33. data/lib/vk_music/utility/audios_from_ids_loader.rb +0 -0
  34. data/lib/vk_music/utility/audios_ids_getter.rb +0 -0
  35. data/lib/vk_music/utility/audios_loader.rb +0 -0
  36. data/lib/vk_music/utility/data_type_guesser.rb +0 -0
  37. data/lib/vk_music/utility/duration_parser.rb +6 -4
  38. data/lib/vk_music/utility/last_profile_post_loader.rb +0 -0
  39. data/lib/vk_music/utility/link_decoder.rb +0 -0
  40. data/lib/vk_music/utility/node_text_children_reader.rb +0 -0
  41. data/lib/vk_music/utility/playlist_loader.rb +0 -0
  42. data/lib/vk_music/utility/playlist_node_parser.rb +0 -0
  43. data/lib/vk_music/utility/playlist_section_loader.rb +0 -0
  44. data/lib/vk_music/utility/playlist_url_parser.rb +0 -0
  45. data/lib/vk_music/utility/post_loader.rb +3 -1
  46. data/lib/vk_music/utility/post_url_parser.rb +0 -0
  47. data/lib/vk_music/utility/profile_id_resolver.rb +0 -0
  48. data/lib/vk_music/utility/wall_loader.rb +0 -0
  49. data/lib/vk_music/utility.rb +0 -0
  50. data/lib/vk_music/version.rb +1 -1
  51. data/lib/vk_music/web_parser/artist.rb +0 -0
  52. data/lib/vk_music/web_parser/audios_reload.rb +0 -0
  53. data/lib/vk_music/web_parser/base.rb +0 -0
  54. data/lib/vk_music/web_parser/login.rb +0 -0
  55. data/lib/vk_music/web_parser/my_page.rb +0 -0
  56. data/lib/vk_music/web_parser/playlist.rb +0 -0
  57. data/lib/vk_music/web_parser/playlist_section.rb +0 -0
  58. data/lib/vk_music/web_parser/post.rb +0 -0
  59. data/lib/vk_music/web_parser/profile.rb +0 -0
  60. data/lib/vk_music/web_parser/search.rb +0 -0
  61. data/lib/vk_music/web_parser/wall_section.rb +0 -0
  62. data/lib/vk_music/web_parser.rb +0 -0
  63. data/lib/vk_music.rb +0 -0
  64. data/vk_music.gemspec +0 -0
  65. metadata +4 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3c9b4724b7091c0d060e8ea09cf8ee5686f0b9dc62c912f121b35186ea096a3e
4
- data.tar.gz: 38a52270b5b853898c9d7c0f6393c36bc1f2191df0b067659491308237fe7e27
3
+ metadata.gz: da1ad67eac04f82ada772151b2321b7eb598321f788d66d12b84e8d2f0475919
4
+ data.tar.gz: 6b8fd6e4ce0eacfdbcd94396dfe9fc56db2cff502188904dd2f991eabb33acc4
5
5
  SHA512:
6
- metadata.gz: cabca681df9bd70cb047d55172cea71ef1dd1db9fb57f94663a5a74e4223a7a732ee1ed6360119fd78da75aecedb8e00098cb82f6a911a26aec1dcb25af5f568
7
- data.tar.gz: a9e92369c0dc3525718aac77e5b1a2d68f74ff127cb9067d257c9cd32db7cac3d60d48800a4160d6968e9965ab1874c67c438bbd588a8b3fadf21290454ebda1
6
+ metadata.gz: 434e1461c9827ffaaeff46ef0f68d63495723947da530014a1da69d242c8601580c50325bfd6d245290e2420bb597196cc20198c1d9e03b754079ef316a46bfe
7
+ data.tar.gz: 87b875c18246bfffe3ab2d54f22bde6a56c3156d4abb5173dad174fe9d91d46513a66a754833cee40fea9df85f852f66ef8fc527fba8368a6ce6667026db28af
data/.env.example CHANGED
File without changes
File without changes
data/.gitignore CHANGED
File without changes
data/.rspec CHANGED
File without changes
data/.rubocop.yml CHANGED
@@ -54,3 +54,11 @@ Style/DisableCopsWithinSourceCodeDirective:
54
54
  Enabled: false
55
55
  Layout/MultilineHashKeyLineBreaks:
56
56
  Enabled: false
57
+ Layout/SingleLineBlockChain:
58
+ Exclude:
59
+ - 'spec/**/*_spec.rb'
60
+ Style/TopLevelMethodDefinition:
61
+ Exclude:
62
+ - 'spec/login_helper.rb'
63
+ Lint/NumberConversion:
64
+ Enabled: false
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ ruby-2.7.2
data/Gemfile CHANGED
@@ -6,33 +6,34 @@ source 'https://rubygems.org'
6
6
  gemspec
7
7
 
8
8
  group :test, :development do
9
- # Debugging console
10
- gem 'pry'
11
-
12
9
  # Another debugging console
13
- gem 'byebug'
10
+ gem 'byebug', '~> 11.1'
14
11
 
15
12
  # The thing, forcing you to write good code
16
- gem 'rubocop', require: false
13
+ gem 'rubocop', '~> 1.21', require: false
14
+ # Guidelines for writing RSpec tests
15
+ gem 'rubocop-rspec', '~> 2.4', require: false
16
+ # Guidelines for Rake tasks
17
+ gem 'rubocop-rake', '~> 0.6', require: false
17
18
 
18
19
  # Rake tasks
19
- gem 'rake', require: false
20
+ gem 'rake', '~> 13.0', require: false
20
21
 
21
22
  # Testing
22
- gem 'rspec', require: false
23
+ gem 'rspec', '~> 3.10', require: false
23
24
 
24
25
  # Docs
25
- gem 'yard', require: false
26
+ gem 'yard', '~> 0.9', require: false
26
27
 
27
28
  # .env support
28
- gem 'dotenv'
29
+ gem 'dotenv', '~> 2.7'
29
30
 
30
31
  # Save web requests for fast and reliable testing
31
- gem 'vcr'
32
+ gem 'vcr', '~> 6.0'
32
33
 
33
34
  # Stub web requests
34
- gem 'webmock'
35
+ gem 'webmock', '~> 3.14'
35
36
 
36
37
  # Test coverage
37
- gem 'simplecov', require: false, group: :test
38
+ gem 'simplecov', '~> 0.21', require: false, group: :test
38
39
  end
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- vk_music (4.1.3)
4
+ vk_music (4.1.4)
5
5
  execjs (~> 2.7)
6
6
  json (~> 2.3)
7
7
  logger (~> 1.4)
@@ -11,26 +11,25 @@ PATH
11
11
  GEM
12
12
  remote: https://rubygems.org/
13
13
  specs:
14
- addressable (2.7.0)
14
+ addressable (2.8.0)
15
15
  public_suffix (>= 2.0.2, < 5.0)
16
- ast (2.4.1)
16
+ ast (2.4.2)
17
17
  byebug (11.1.3)
18
- coderay (1.1.3)
19
18
  crack (0.4.5)
20
19
  rexml
21
20
  diff-lcs (1.4.4)
22
- docile (1.3.4)
21
+ docile (1.4.0)
23
22
  domain_name (0.5.20190701)
24
23
  unf (>= 0.0.5, < 1.0.0)
25
24
  dotenv (2.7.6)
26
- execjs (2.7.0)
25
+ execjs (2.8.1)
27
26
  hashdiff (1.0.1)
28
- http-cookie (1.0.3)
27
+ http-cookie (1.0.4)
29
28
  domain_name (~> 0.5)
30
29
  json (2.5.1)
31
30
  logger (1.4.3)
32
- mechanize (2.8.0)
33
- addressable (~> 2.7)
31
+ mechanize (2.8.2)
32
+ addressable (~> 2.8)
34
33
  domain_name (~> 0.5, >= 0.5.20190701)
35
34
  http-cookie (~> 1.0, >= 1.0.3)
36
35
  mime-types (~> 3.0)
@@ -40,27 +39,23 @@ GEM
40
39
  rubyntlm (~> 0.6, >= 0.6.3)
41
40
  webrick (~> 1.7)
42
41
  webrobots (~> 0.1.2)
43
- method_source (1.0.0)
44
42
  mime-types (3.3.1)
45
43
  mime-types-data (~> 3.2015)
46
- mime-types-data (3.2021.0225)
47
- mini_portile2 (2.5.1)
44
+ mime-types-data (3.2021.0901)
45
+ mini_portile2 (2.6.1)
48
46
  net-http-digest_auth (1.4.1)
49
47
  net-http-persistent (2.9.4)
50
- nokogiri (1.11.3)
51
- mini_portile2 (~> 2.5.0)
48
+ nokogiri (1.12.4)
49
+ mini_portile2 (~> 2.6.1)
52
50
  racc (~> 1.4)
53
- parallel (1.20.1)
54
- parser (3.0.0.0)
51
+ parallel (1.21.0)
52
+ parser (3.0.2.0)
55
53
  ast (~> 2.4.1)
56
- pry (0.13.1)
57
- coderay (~> 1.1)
58
- method_source (~> 1.0)
59
54
  public_suffix (4.0.6)
60
55
  racc (1.5.2)
61
56
  rainbow (3.0.0)
62
- rake (13.0.3)
63
- regexp_parser (2.0.3)
57
+ rake (13.0.6)
58
+ regexp_parser (2.1.1)
64
59
  rexml (3.2.5)
65
60
  rspec (3.10.0)
66
61
  rspec-core (~> 3.10.0)
@@ -71,36 +66,41 @@ GEM
71
66
  rspec-expectations (3.10.1)
72
67
  diff-lcs (>= 1.2.0, < 2.0)
73
68
  rspec-support (~> 3.10.0)
74
- rspec-mocks (3.10.1)
69
+ rspec-mocks (3.10.2)
75
70
  diff-lcs (>= 1.2.0, < 2.0)
76
71
  rspec-support (~> 3.10.0)
77
- rspec-support (3.10.1)
78
- rubocop (1.7.0)
72
+ rspec-support (3.10.2)
73
+ rubocop (1.21.0)
79
74
  parallel (~> 1.10)
80
- parser (>= 2.7.1.5)
75
+ parser (>= 3.0.0.0)
81
76
  rainbow (>= 2.2.2, < 4.0)
82
77
  regexp_parser (>= 1.8, < 3.0)
83
78
  rexml
84
- rubocop-ast (>= 1.2.0, < 2.0)
79
+ rubocop-ast (>= 1.9.1, < 2.0)
85
80
  ruby-progressbar (~> 1.7)
86
- unicode-display_width (>= 1.4.0, < 2.0)
87
- rubocop-ast (1.4.0)
88
- parser (>= 2.7.1.5)
81
+ unicode-display_width (>= 1.4.0, < 3.0)
82
+ rubocop-ast (1.11.0)
83
+ parser (>= 3.0.1.1)
84
+ rubocop-rake (0.6.0)
85
+ rubocop (~> 1.0)
86
+ rubocop-rspec (2.4.0)
87
+ rubocop (~> 1.0)
88
+ rubocop-ast (>= 1.1.0)
89
89
  ruby-progressbar (1.11.0)
90
90
  rubyntlm (0.6.3)
91
- simplecov (0.21.1)
91
+ simplecov (0.21.2)
92
92
  docile (~> 1.1)
93
93
  simplecov-html (~> 0.11)
94
94
  simplecov_json_formatter (~> 0.1)
95
95
  simplecov-html (0.12.3)
96
- simplecov_json_formatter (0.1.2)
96
+ simplecov_json_formatter (0.1.3)
97
97
  unf (0.1.4)
98
98
  unf_ext
99
- unf_ext (0.0.7.7)
100
- unicode-display_width (1.7.0)
99
+ unf_ext (0.0.8)
100
+ unicode-display_width (2.1.0)
101
101
  vcr (6.0.0)
102
- webmock (3.11.0)
103
- addressable (>= 2.3.6)
102
+ webmock (3.14.0)
103
+ addressable (>= 2.8.0)
104
104
  crack (>= 0.3.2)
105
105
  hashdiff (>= 0.4.0, < 2.0.0)
106
106
  webrick (1.7.0)
@@ -111,17 +111,18 @@ PLATFORMS
111
111
  ruby
112
112
 
113
113
  DEPENDENCIES
114
- byebug
115
- dotenv
116
- pry
117
- rake
118
- rspec
119
- rubocop
120
- simplecov
121
- vcr
114
+ byebug (~> 11.1)
115
+ dotenv (~> 2.7)
116
+ rake (~> 13.0)
117
+ rspec (~> 3.10)
118
+ rubocop (~> 1.21)
119
+ rubocop-rake (~> 0.6)
120
+ rubocop-rspec (~> 2.4)
121
+ simplecov (~> 0.21)
122
+ vcr (~> 6.0)
122
123
  vk_music!
123
- webmock
124
- yard
124
+ webmock (~> 3.14)
125
+ yard (~> 0.9)
125
126
 
126
127
  BUNDLED WITH
127
128
  2.2.4
data/LICENSE.txt CHANGED
File without changes
data/README.md CHANGED
File without changes
data/Rakefile CHANGED
@@ -16,3 +16,19 @@ YARD::Rake::YardocTask.new do |t|
16
16
  end
17
17
 
18
18
  task default: %i[rubocop spec yard]
19
+
20
+ namespace :clean do
21
+ desc 'Remove generated cassettes'
22
+ task :cassetes do
23
+ require 'fileutils'
24
+
25
+ FileUtils.rm_r Dir.glob('spec/cassetes/*/')
26
+ end
27
+
28
+ desc 'Remove generated cookies'
29
+ task :cookies do
30
+ require 'fileutils'
31
+
32
+ FileUtils.rm('spec/.cookies')
33
+ end
34
+ end
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -7,10 +7,12 @@ module VkMusic
7
7
  # @param str [String] string in format "HH:MM:SS" or something alike (+/d++ Regex selector is used)
8
8
  # @return [Integer] amount of seconds
9
9
  def self.call(str)
10
- str.scan(/\d+/)
11
- .map(&:to_i)
12
- .reverse
13
- .each_with_index.reduce(0) { |acc, (count, position)| acc + count * 60**position }
10
+ str
11
+ .scan(/\d+/)
12
+ .map { |i| Integer(i, 10) }
13
+ .reverse
14
+ .each_with_index
15
+ .reduce(0) { |acc, (count, position)| acc + (count * (60**position)) }
14
16
  end
15
17
  end
16
18
  end
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -16,7 +16,9 @@ module VkMusic
16
16
 
17
17
  wall_audios = WallLoader.call(agent, client_id, owner_id, post_id).audios
18
18
 
19
- urlles_audios.map { |urlles| wall_audios.find { |audio| audio.like?(urlles) } }.compact
19
+ urlles_audios
20
+ .map { |urlles| wall_audios.find { |audio| audio.like?(urlles) } }
21
+ .compact
20
22
  end
21
23
  end
22
24
  end
File without changes
File without changes
File without changes
File without changes
@@ -2,6 +2,6 @@
2
2
 
3
3
  module VkMusic
4
4
  # Library version.
5
- VERSION = '4.1.3'
5
+ VERSION = '4.1.4'
6
6
  public_constant :VERSION
7
7
  end
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
data/lib/vk_music.rb CHANGED
File without changes
data/vk_music.gemspec CHANGED
File without changes
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vk_music
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.3
4
+ version: 4.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fizvlad
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-04 00:00:00.000000000 Z
11
+ date: 2021-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: execjs
@@ -92,6 +92,7 @@ files:
92
92
  - ".gitignore"
93
93
  - ".rspec"
94
94
  - ".rubocop.yml"
95
+ - ".ruby-version"
95
96
  - Gemfile
96
97
  - Gemfile.lock
97
98
  - LICENSE.txt
@@ -172,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
172
173
  - !ruby/object:Gem::Version
173
174
  version: '0'
174
175
  requirements: []
175
- rubygems_version: 3.2.4
176
+ rubygems_version: 3.1.4
176
177
  signing_key:
177
178
  specification_version: 4
178
179
  summary: A library to work with audios on popular Russian social network