shinybooru 1.1.0 → 1.2.0

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: a84d8967d4a77823969e563973a0d140ce497e1a
4
- data.tar.gz: 0c19188e275b6fd3f5a58a8ce7358f81bddc9268
3
+ metadata.gz: 78cf11085d91473d57ae2cb367f5b58bada57624
4
+ data.tar.gz: f3b443d517268036e7c4de330ac5cc82784e3acd
5
5
  SHA512:
6
- metadata.gz: ede56dfa3a8e6b3659d253efe979f48836348fa9293f821ea4e471b9000d8f5717f1055e08ecfbc869d7469dadf09f9c7ca46a03ca8e5029762a53d1c54cfb2f
7
- data.tar.gz: e0de153b4fb0b4d397e770bdbf57248a4dd1feaf20a92974b3824079242adcaa64d8a66095114a7fb7c33c5eab7d4c337dc8840f37c5ac0f81517c219d135b50
6
+ metadata.gz: d181725b2a01b3e0cd8c0c504350d78cea0624d6b08d4773c18244b53b67a6bd092b8aff112d0117117eef974fe97e2b7d3ca96c447bdacf5f399c8656e16505
7
+ data.tar.gz: ee55aabcc622c3175a954c6bfcdae72291fadeb5031403fca123c1876536196bf0ab42cf633669b678e403f1b61f8174e78509bc2ad8a02395a62b0cbe0d5352
@@ -28,13 +28,22 @@ module Shinybooru
28
28
  @booru.get '/index.php?page=dapi&s=post&q=index' + page
29
29
  end
30
30
 
31
- def posts (limit=1, nsfw=true, tags=[])
31
+ def posts (args=Hash.new)
32
+ limit = args[:limit]
33
+ limit = 1 if limit.nil?
34
+ nsfw = args[:nsfw]
35
+ nsfw = true if nsfw.nil?
36
+ tags = args[:tags]
37
+ tags = [] if tags.nil?
32
38
  if @online
33
39
  req = '&limit=' + limit.to_s
34
40
  if tags
35
- req += '&tags=' + tags.join('%20')
41
+ unless tags.is_a? String
42
+ tags = tags.join('%20')
43
+ end
44
+ req += '&tags=' + tags
36
45
  end
37
- if nsfw
46
+ unless nsfw
38
47
  explicit_tags = '-rating%3aquestionable%20-rating%3explicit'
39
48
  unless tags
40
49
  req += '&tags=' + explicit_tags
@@ -1,3 +1,3 @@
1
1
  module Shinybooru
2
- VERSION = "1.1.0"
2
+ VERSION = "1.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shinybooru
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Calv Collins