doctor_ipsum 0.3 → 0.3.1

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
  SHA1:
3
- metadata.gz: 45a2d19010791c5ebeed8a915e78f8738cf94191
4
- data.tar.gz: 68b900c59ba5dd11d66ad4106817c8ae809a01cc
3
+ metadata.gz: 3da65ed9f83690c5875dedcd8e3b8fd2daae7d3b
4
+ data.tar.gz: 22314f019df0062f5bd5974a9bb6643d13669316
5
5
  SHA512:
6
- metadata.gz: 953d4866e629db3374b986835a6ad2fb84057db71366e97d564a85f53a3a2854329b2dfec4354c8f58ca4fe8429b1fe228880c1a8449929115a64c85aa1606bc
7
- data.tar.gz: f2565ca4f2b24992bf94556c4ab212d0c0522c27e285392c95874842f05a33159409cf5de2fee8d3f9d83885b980745d176d64b438cf7166f4835160e16b62bd
6
+ metadata.gz: 6d12fd7efb78f9bbc7ff0d3802bd9cd8f4e664598af3c31cb357e0ae7d5a8a3d371020cc2d97c7bad614ca77a9b76c555f74d54ff7ef6af3b345775626cd228c
7
+ data.tar.gz: 767280b9c3e2ce61b0358e874dcd4adbf0654b23874e919622bee45f2ac6d1ae0729e0cbee584e68543403b49db91c93ce7f351deaf7be177d52bee2178bb2a8
@@ -42,7 +42,7 @@ module DoctorIpsum
42
42
  end
43
43
 
44
44
  # Images from placehold.it
45
- def image(width = rand(100..500), height = rand(100..500))
45
+ def image(width = rand(300..500), height = rand(300..500))
46
46
  url = 'placehold.it/'+width.to_s+'x'+height.to_s
47
47
  basic_format( nil, url, nil).prepend('!')
48
48
  end
@@ -51,10 +51,13 @@ module DoctorIpsum
51
51
  def entry(*args)
52
52
  out = []
53
53
  allowed = ["header","emphasis","paragraphs","blockquote",
54
- "horizontal","list","link","image"]
55
- args = ( nil ? allowed : filter(args.flatten,allowed) )
56
- out << header if args.include? 'header'
57
- rand(3..10).times { out << send(allowed.sample) << paragraphs }
54
+ "list","link","image"]
55
+ elements = ( args ? allowed : filter(args.flatten,allowed) )
56
+ out << header if elements.include? 'header'
57
+ rand(3..10).times do
58
+ cmd = elements.sample
59
+ out << (cmd == 'image' ? image(500,500) : send(cmd) ) << paragraphs
60
+ end
58
61
  out.join("\n\n")
59
62
  end
60
63
 
@@ -1,3 +1,3 @@
1
1
  module DoctorIpsum
2
- VERSION = "0.3"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: doctor_ipsum
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.3'
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicholas Hwang