dummy_files 0.0.2 → 0.0.3

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.2
1
+ 0.0.3
data/dummy_files.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{dummy_files}
8
- s.version = "0.0.2"
8
+ s.version = "0.0.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jordi Noguera"]
data/lib/dummy_files.rb CHANGED
@@ -7,9 +7,9 @@ module DummyFiles
7
7
  module Images
8
8
 
9
9
  def self.get(number = 100, keyword = "me", content = "face")
10
- max = [number / 20, 1].max
10
+ max = [number / 10, 1].max
11
11
  nokogiri = (1..max).map{ Nokogiri::HTML(open_page(keyword, content)) }
12
- nokogiri.map{ |n| n.search("img").map{ |x| x["src"] }.select{ |x| x.include?(":http://") }.map{ |x| "http://" + x.split(":http://")[1] } }.flatten
12
+ nokogiri.map{ |n| n.search("img").map{ |x| x["src"] }.select{ |x| x.include?(":http://") }.map{ |x| "http://" + x.split(":http://")[1] } }.flatten[0, number]
13
13
  end
14
14
 
15
15
  private
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dummy_files
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jordi Noguera