fact_is_fact 1.2.0 → 1.2.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 +4 -4
- data/CHANGELOG.md +3 -0
- data/Gemfile.lock +2 -2
- data/README.md +22 -1
- data/lib/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e0669d6d8cc1793530b82447f4a2e1e897630cf30aa109fee1db3b851fcfb610
|
|
4
|
+
data.tar.gz: 700807423e7dc236871ab2e3eb70c72abe20cae79e7bb15d72e73b3180c01bb7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a57fbde7abf78ee497cc35f570f6061e07cc288ec1103529c957e15ae2531b2cb5728809db70dbc3c9aed97753c330ce5b06973e86b64bbaf5d0c1a01c0e6af2
|
|
7
|
+
data.tar.gz: aec7f4ffd41e7febd7908b5d3c8a9d23fbca1660b770e4a8d90287a46652e197a9bbd5a1963e110096896bc5d7e6402cbab24b05a5c516d6a4dcd733489a2e14
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -103,7 +103,7 @@ FactIsFact.return(type: 'math', number: '123123123', default: 'no facts found')
|
|
|
103
103
|
#=> "no facts found"
|
|
104
104
|
```
|
|
105
105
|
|
|
106
|
-
|
|
106
|
+
### MIN AND MAX
|
|
107
107
|
Restrict the range of values returned to the inclusive range [min, max] when random is given as the number.
|
|
108
108
|
|
|
109
109
|
```ruby
|
|
@@ -111,6 +111,27 @@ FactIsFact.return(type: 'trivia', number: 'random', min: 10, max: 20)
|
|
|
111
111
|
#=> "16 is the number of personality types in the Myers-Briggs classification system."
|
|
112
112
|
```
|
|
113
113
|
|
|
114
|
+
### BATCH REQUESTS
|
|
115
|
+
To get facts about multiple numbers in one request, specify ranges for number.
|
|
116
|
+
|
|
117
|
+
A number range (inclusive) is specified as min..max. Separate multiple ranges and individual numbers with , (a comma).
|
|
118
|
+
|
|
119
|
+
The response format will always be a JSON map from numbers to facts, of at most 100 numbers. The query parameter json may still be used to specify whether individual facts will be returned as string literals or JSON objects.
|
|
120
|
+
|
|
121
|
+
```ruby
|
|
122
|
+
FactIsFact.return(type: 'math', number: '1..3', json: '')
|
|
123
|
+
=> "{\n \"1\": \"1 is the most common leading digit in many sets of data, a consequence of Benford's law.\",\n \"2\": \"2 is a primorial, as well as its own factorial.\",\n \"3\": \"3 is the fourth open meandric number.\"\n}"
|
|
124
|
+
|
|
125
|
+
FactIsFact.return(type: 'math', number: '1..3,10,13,15', json: '')
|
|
126
|
+
=> "{\n \"1\": \"1 is also the first and second numbers in the Fibonacci sequence and is the first number in many other mathematical sequences.\",\n \"2\": \"2 is the number of n-Queens Problem solutions for n = 4.\",\n \"3\": \"3 is the first unique prime due to the properties of its reciprocal.\",\n \"10\": \"10 is the aliquot sum of only one number the discrete semiprime 14.\",\n \"13\": \"13 is the number of Archimedian solids.\",\n \"15\": \"15 is a triangular number, a hexagonal number, a pentatope number and the 4th Bell number.\"\n}"
|
|
127
|
+
|
|
128
|
+
FactIsFact.return(type: 'year', number: '1..3,10,13,15', json: '')
|
|
129
|
+
=> "{\n \"1\": \"1 is the year that Emperor Ping of Han China begins his reign and Wang Mang is re-instated as regent by Grand Empress Dowager Wang.\",\n \"2\": \"2 is the year that Cedeides becomes Archon of Athens.\",\n \"3\": \"3 is the year that Augustus adopts his grandson, Gaius Caesar, with the expectation that he will succeed him.\",\n \"10\": \"10 is the year that Ovid completes Tristia (the \\\"Sorrows\\\", 5 books) and Epistulae ex Ponto (Letters from the Black Sea, 4 books) describing the sadness of banishment.\",\n \"13\": \"13 is the year that Strabo publishes his book on the shape of the Earth.\",\n \"15\": \"15 is the year that Germanicus captures Thusnelda, the wife of Arminius.\"\n}"
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
114
135
|
## Development
|
|
115
136
|
|
|
116
137
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/lib/version.rb
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
VERSION = '1.2.
|
|
1
|
+
VERSION = '1.2.1'.freeze
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fact_is_fact
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Abhinay
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-
|
|
11
|
+
date: 2021-07-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -96,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
96
96
|
- !ruby/object:Gem::Version
|
|
97
97
|
version: '0'
|
|
98
98
|
requirements: []
|
|
99
|
-
rubygems_version: 3.1.
|
|
99
|
+
rubygems_version: 3.1.6
|
|
100
100
|
signing_key:
|
|
101
101
|
specification_version: 4
|
|
102
102
|
summary: This gem allows users to get a random trivia about a number or date or a
|