looperman_samples 0.1.7 → 0.1.8

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: 15c67c7d616b9c5a0d129c5eb55659e5b83eae04e0aed89f62d6bf6f1379c696
4
- data.tar.gz: 224ed66eb02c6a081d403d1e5855fd0a2be0f813cac17666489b8560fc27fc73
3
+ metadata.gz: d51af276e38afab1a32be6c0f2ab825c2d86cfb9e5c3ab8f48635e7379c5c856
4
+ data.tar.gz: ad45e1aaa9a9849ef8e571c857f1caa05cecfece5403913e9c2f5805be8b24c7
5
5
  SHA512:
6
- metadata.gz: 24b77486a35e5eeca85d2f72946803e2e175612ac1ed7698d26a7a13ffecec072ac69bc8479a336c971a782ad76915b7e143b71978bba9e468d5359277961ac5
7
- data.tar.gz: 582c5130d0d461ad0f129b507040b8dac4ef828ce580e0930109d9ac4fd18b0f0f8637be4681b46ba0c13d17f4d9cb1008e4b18a4667a37833bb3492e6ceff85
6
+ metadata.gz: bcccd70885b93d959bb35df85577b7cb628cabc20512a8e208575bc13ef19675e03f7ad247b7dd30958d60efcead59df97f1671101078caef9b995754cae27bc
7
+ data.tar.gz: 0d6dc3e89fc29c1e497f5965e04cac6201f7cc4db97ce2dd7f55f41380ecdf331825fee35b6ba3bdfeec68ba821ec4c54cd66e171062511e380f42777462e7c3
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- looperman_samples (0.1.7)
4
+ looperman_samples (0.1.8)
5
5
  nokogiri
6
6
 
7
7
  GEM
@@ -62,6 +62,8 @@ class LoopermanSamples::CLI
62
62
  end
63
63
  elsif input.to_i > LoopermanSamples::Sample.all.size
64
64
  puts "please enter a lower number"
65
+ elsif input == "back"
66
+ main_menu
65
67
  else
66
68
  break
67
69
  end
@@ -1,8 +1,10 @@
1
1
  module CliMethods
2
-
2
+
3
3
  module Findable
4
4
  def find_all_by_creator(sample) #returns an array of sample objects
5
- LoopermanSamples::SampleScraper.scrape_more_samples_by_creator(sample.creator)
5
+ if !sample.creator.scraped
6
+ LoopermanSamples::SampleScraper.scrape_more_samples_by_creator(sample.creator)
7
+ end
6
8
  sample.creator.samples
7
9
  end
8
10
  end
@@ -27,6 +29,7 @@ module CliMethods
27
29
  end
28
30
 
29
31
  def list_all_samples_by_creator(sample_objects) #puts samples in numbered list
32
+ # creator = sample_objects.first.creator
30
33
  sample_objects.each_with_index do |sample, index|
31
34
  puts "#{index + 1}." + " #{sample.title}"
32
35
  end
@@ -1,7 +1,7 @@
1
1
  module LoopermanSamples
2
2
  class Creator
3
3
 
4
- attr_accessor :name, :samples
4
+ attr_accessor :name, :samples, :scraped
5
5
 
6
6
  @@creators = []
7
7
 
@@ -10,6 +10,7 @@ module LoopermanSamples
10
10
  end
11
11
 
12
12
  def initialize(name = nil)
13
+ self.scraped = false
13
14
  @name = name
14
15
  @samples = []
15
16
  @@creators << self
@@ -27,6 +27,7 @@ module LoopermanSamples
27
27
 
28
28
  def self.list_samples_by_key
29
29
  sort_by_key.each_with_index do |item, index|
30
+ #get rid of this! puts shouldn't be in sample class
30
31
  puts "#{index + 1}." + " #{item.title} - " + "#{item.key}"
31
32
  end
32
33
  end
@@ -37,6 +38,7 @@ module LoopermanSamples
37
38
 
38
39
  def self.list_samples_by_tempo
39
40
  sort_by_tempo.each_with_index do |item, index|
41
+ #get rid of this! puts shouldn't be in sample class
40
42
  puts "#{index + 1}." + " #{item.title}" + "- #{item.bpm}"
41
43
  end
42
44
  end
@@ -47,6 +49,7 @@ module LoopermanSamples
47
49
 
48
50
  def self.list_samples_by_download_count
49
51
  sort_by_download_count.each_with_index do |item, index|
52
+ #get rid of this! puts shouldn't be in sample class
50
53
  puts "#{index + 1}." + " #{item.title}" + " - #{item.download_count} downloads"
51
54
  end
52
55
  end
@@ -28,20 +28,22 @@ module LoopermanSamples
28
28
  the_sample.key = the_sample.key.sub(/(Key)\s[:]\s/, "")
29
29
  end
30
30
  #inserts the sample into the Sample.all array
31
- Sample.all << the_sample
31
+ Sample.all << the_sample #this should happen within initialize statement
32
32
  end
33
33
  #returns all the samples
34
- Sample.all
34
+ Sample.all #unnecessary...
35
35
  end
36
36
 
37
37
  def self.scrape_more_samples_by_creator(sample_creator) #dives into samples of a particular creator
38
38
  sample_creator.samples = []
39
+ puts "scraping more tracks by #{sample_creator.name} *********************"
39
40
  doc = Nokogiri::HTML(open("https://www.looperman.com/loops?mid=#{sample_creator.name}"))
40
41
  doc.css("div#body-content").css("div div.player-wrapper").each do |sample_bundle|
41
42
  the_sample = Sample.new
42
43
  the_sample.title = sample_bundle.css(".player-title").text
43
44
  the_sample.creator = sample_creator
44
45
  end
46
+ sample_creator.scraped = true
45
47
  end
46
48
 
47
49
  end
@@ -1,3 +1,3 @@
1
1
  module LoopermanSamples
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: looperman_samples
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - "'Harley Rayner'"