design-quotes 0.0.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.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/design-quotes.rb +23 -0
  3. metadata +46 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 870b1cbf2f4155de07c5526e0c58274958165afcfe5160582629ceb2676f5964
4
+ data.tar.gz: 623e1e92d1f8f7af4cc84bfaf1eb053797a0b481fe597f0972b1259974e2f855
5
+ SHA512:
6
+ metadata.gz: 62793de83eb8315e01c1f21c032025f7adbdfab74d745226b2a422379272b28a8672d7fd7c59bca354befa0009be178837ecf300a6d9713c1d954f3bd5967156
7
+ data.tar.gz: 50f2607dede4f9d2b2498967a8175cfb1028627942bf7533bfcef52df99b705be793d75eb9f8284a495dda83c0221c3a434231a88a786765098bce78112e0239
@@ -0,0 +1,23 @@
1
+ require "rest-client"
2
+ require "JSON"
3
+ require "htmlentities"
4
+
5
+ class DesignQuotes
6
+
7
+ def self.show
8
+ gibberish = RestClient.get("http://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1")
9
+
10
+ arrhash = JSON.parse(gibberish)
11
+
12
+ hash = arrhash.first
13
+
14
+ author = hash["title"]
15
+ quote = HTMLEntities.new.decode(hash["content"]).gsub(/(<.{1,3}>)/, "").strip
16
+
17
+ quote = "\"#{quote}\""
18
+
19
+ puts quote
20
+ puts "-#{author}"
21
+ end
22
+
23
+ end
metadata ADDED
@@ -0,0 +1,46 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: design-quotes
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Ruby Coder
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-06-08 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: This gem prints out random quotes that will make you design better.
14
+ email: rubycoder@example.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/design-quotes.rb
20
+ homepage: https://rubygems.org/gems/example
21
+ licenses:
22
+ - MIT
23
+ metadata:
24
+ source_code_uri: https://github.com/example/example
25
+ post_install_message:
26
+ rdoc_options: []
27
+ require_paths:
28
+ - lib
29
+ required_ruby_version: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ required_rubygems_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ requirements:
40
+ - rest-client
41
+ - htmlentities
42
+ rubygems_version: 3.0.3
43
+ signing_key:
44
+ specification_version: 4
45
+ summary: Quotes on design.
46
+ test_files: []