vk_music 4.1.5 → 4.1.6

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: 328e99f052dc0b5088bfe6951340eddbd1d490e314eb87960d4c09567c321c38
4
- data.tar.gz: ee672cf125bce6abfd6269a2a2589c546db832334e7a748539834a82f7ad4d91
3
+ metadata.gz: 337cb0c1fa139bd4b9872dad678a25690ea46f8ef4f3699f5cc23917216e4bbd
4
+ data.tar.gz: 7aff1c6a20c69b353e3944016fab1023090d8f8976d887c9fb90bd675d19af3c
5
5
  SHA512:
6
- metadata.gz: c96731edad98d27948189374693b6852a46e035a8b4c6fbb76cfcc9b3c6db24d8859f5dd36dea5a071e79ddd9ff9e38a43737694e1499e7ad99a205f754c6fa6
7
- data.tar.gz: 1c0d2f09244dbbfa36a741bc384aea0f235c407e5ca718197617c138b47844b69f26e7734fa6fd2e837026f636418750333ff4cbb9652056bb05956f1ddd7179
6
+ metadata.gz: 859f932430130e9951b62861c10e3c7930dc0bcaa0249f3531609a235ea07004c9a4caa1e89c69b648ce26abc01d55f82a320cc4a7a759541cbfe07e607cb1cd
7
+ data.tar.gz: 13974cec16d21151b9462a400984f491a071a6cfb40861b9242e1d7557f370d4b0c65355055b9371a1bc4c308e39da589e1592b6923bc62f201b239ecf961691
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- vk_music (4.1.5)
4
+ vk_music (4.1.6)
5
5
  execjs (~> 2.7)
6
6
  json (~> 2.3)
7
7
  logger (~> 1.4)
data/bin/console CHANGED
@@ -13,7 +13,7 @@ Dotenv.load
13
13
  # Path to file where development cookies will be stored
14
14
  AGENT_COOKIES_PATH = '.cookies'
15
15
 
16
- agent = VkMusic::Utility::Authorizer.call(AGENT_COOKIES_PATH)
16
+ agent = VkMusic::Utility::Authorizer.call(ENV['VK_LOGIN'], ENV['VK_PASSWORD'], AGENT_COOKIES_PATH)
17
17
  @client = VkMusic::Client.new(agent: agent)
18
18
 
19
19
  IRB.start
@@ -7,12 +7,12 @@ module VkMusic
7
7
  class << self
8
8
  # @param cookie_path [string]
9
9
  # @return [Mechanize] logged in Mechanize client
10
- def call(cookie_path)
10
+ def call(login, password, cookie_path)
11
11
  agent = Mechanize.new
12
12
  if File.exist?(cookie_path)
13
13
  load_cookie_jar(agent.cookie_jar, cookie_path)
14
14
  else
15
- login_agent(agent)
15
+ login_agent(agent, login, password)
16
16
  end
17
17
  agent.cookie_jar.save(cookie_path, session: true)
18
18
  agent
@@ -34,10 +34,10 @@ module VkMusic
34
34
  end
35
35
 
36
36
  # Logs in provided agent
37
- def login_agent(agent)
38
- login = VkMusic::Request::Login.new
39
- login.call(agent)
40
- login.send_form(ENV['VK_LOGIN'], ENV['VK_PASSWORD'], agent)
37
+ def login_agent(agent, login, password)
38
+ login_request = VkMusic::Request::Login.new
39
+ login_request.call(agent)
40
+ login_request.send_form(login, password, agent)
41
41
  end
42
42
  end
43
43
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module VkMusic
4
4
  # Library version.
5
- VERSION = '4.1.5'
5
+ VERSION = '4.1.6'
6
6
  public_constant :VERSION
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vk_music
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.5
4
+ version: 4.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fizvlad