fact_is_fact 0.3.1 → 1.0.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
- SHA1:
3
- metadata.gz: d679bc6026279ca0869e80ea22433389a5ab0334
4
- data.tar.gz: 0d265bb4f2c53d7cbfb0f9fcd2c6e4fc3024b052
2
+ SHA256:
3
+ metadata.gz: dc48d93a01e894b9d9bfb586b5d746b280d9442eba9fb8ca98aed3cf4929ba9b
4
+ data.tar.gz: a7cf16c34b44a82b7452e27f3904f29bff439da81c25e1c39602f3aaa549dcd1
5
5
  SHA512:
6
- metadata.gz: a13695d311eb9e84e07bfe6477c849bf7c43636caefb15ba671f1a41dd5d1e222a916a1b1fc1adf64d0bfd890c4fcc161538f653be20a20851268c6f7255cfc7
7
- data.tar.gz: 16648b40306d77306ad35f4b55b06207ca585d3e5f8cd0a2662ef15d965a832adad257128ade3df86a99d54645328fb21873ee265f14dd2aef54cc5c6430b144
6
+ metadata.gz: 48d51934ae5b2aa3c6e887b4c8f39665872875b2adbc98d8896d8b37ccd6579c52c427f5a70b425abd439845c360248383c025aa3cf15a137108aed7e27559c9
7
+ data.tar.gz: ace65547c7f70afab343ce5bbada2347b2ee176a2735b6e63146534dc096cf212ce857281220db78227d6d4ebe33c03c6c5955ec61ba24a934cdb0b19a86913c
@@ -0,0 +1,4 @@
1
+ ## Version 1.0.0
2
+ Deprecating the old way calling the class method. With this version, you will be able to get trivia, math, year and date facts about the any number of a day.
3
+
4
+ ## Version 0.31.1
@@ -1,35 +1,35 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fact_is_fact (0.2.0)
4
+ fact_is_fact (1.0.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- diff-lcs (1.3)
10
- rake (10.5.0)
9
+ diff-lcs (1.4.4)
10
+ rake (13.0.1)
11
11
  rspec (3.8.0)
12
12
  rspec-core (~> 3.8.0)
13
13
  rspec-expectations (~> 3.8.0)
14
14
  rspec-mocks (~> 3.8.0)
15
- rspec-core (3.8.1)
15
+ rspec-core (3.8.2)
16
16
  rspec-support (~> 3.8.0)
17
- rspec-expectations (3.8.4)
17
+ rspec-expectations (3.8.6)
18
18
  diff-lcs (>= 1.2.0, < 2.0)
19
19
  rspec-support (~> 3.8.0)
20
- rspec-mocks (3.8.1)
20
+ rspec-mocks (3.8.2)
21
21
  diff-lcs (>= 1.2.0, < 2.0)
22
22
  rspec-support (~> 3.8.0)
23
- rspec-support (3.8.2)
23
+ rspec-support (3.8.3)
24
24
 
25
25
  PLATFORMS
26
26
  ruby
27
27
 
28
28
  DEPENDENCIES
29
- bundler (~> 1.17)
29
+ bundler (= 2.1.4)
30
30
  fact_is_fact!
31
- rake (~> 10.0)
31
+ rake (~> 13.0)
32
32
  rspec (~> 3.8.0)
33
33
 
34
34
  BUNDLED WITH
35
- 1.17.2
35
+ 2.1.4
@@ -1,27 +1,25 @@
1
-
2
- lib = File.expand_path("../lib", __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require "fact_is_fact/version"
1
+ require './lib/fact_is_fact'
2
+ require './lib/version'
5
3
 
6
4
  Gem::Specification.new do |spec|
7
- spec.name = "fact_is_fact"
8
- spec.version = FactIsFact::VERSION
9
- spec.authors = ["Aks"]
10
- spec.email = ["abhinay302@gmail.com"]
5
+ spec.name = 'fact_is_fact'
6
+ spec.version = VERSION
7
+ spec.authors = ['Abhinay']
8
+ spec.email = ['abhinay302@gmail.com']
11
9
 
12
- spec.summary = %q{Stating the fact with ease}
13
- spec.description = %q{library helps you display random facts}
14
- spec.homepage = "https://github.com/abhinaykumar/fact_is_fact"
15
- spec.license = "MIT"
10
+ spec.summary = 'This gem allows users to get a random trivia about a number or date or a year'
11
+ spec.description = 'library helps you display random facts about a number or date or a year.'
12
+ spec.homepage = 'https://github.com/abhinaykumar/fact_is_fact'
13
+ spec.license = 'MIT'
16
14
 
17
15
  # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
18
16
  # to allow pushing to a single host or delete this section to allow pushing to any host.
19
17
  if spec.respond_to?(:metadata)
20
18
  spec.metadata['allowed_push_host'] = 'https://rubygems.org'
21
19
 
22
- spec.metadata["homepage_uri"] = spec.homepage
23
- spec.metadata["source_code_uri"] = "https://github.com/abhinaykumar/fact_is_fact"
24
- spec.metadata["changelog_uri"] = "Put your gem's CHANGELOG.md URL here."
20
+ spec.metadata['homepage_uri'] = spec.homepage
21
+ spec.metadata['source_code_uri'] = 'https://github.com/abhinaykumar/fact_is_fact'
22
+ spec.metadata['changelog_uri'] = 'https://github.com/abhinaykumar/fact_is_fact/blob/master/CHANGELOG.md'
25
23
  else
26
24
  raise "RubyGems 2.0 or newer is required to protect against " \
27
25
  "public gem pushes."
@@ -36,7 +34,7 @@ Gem::Specification.new do |spec|
36
34
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
37
35
  spec.require_paths = ["lib"]
38
36
 
39
- spec.add_development_dependency 'bundler', '~> 1.17'
40
- spec.add_development_dependency 'rake', '~> 10.0'
37
+ spec.add_development_dependency 'bundler', '2.1.4'
38
+ spec.add_development_dependency 'rake', '~> 13.0'
41
39
  spec.add_development_dependency 'rspec', '~> 3.8.0'
42
40
  end
@@ -1,8 +1,17 @@
1
- require 'fact_is_fact/version'
1
+ require 'net/http'
2
2
 
3
- module FactIsFact
4
- require 'net/http'
5
- require 'fact_is_fact/random'
3
+ class FactIsFact
4
+ BASE_URI = 'http://numbersapi.com'.freeze
5
+ TYPE = %w[trivia math year date].freeze
6
+
7
+ class << self
8
+ def return(type:, number:)
9
+ return 'not a valid type' unless TYPE.include?(type)
10
+
11
+ number_facts_uri = URI("#{BASE_URI}/#{number}/#{type}")
12
+ Net::HTTP.get(number_facts_uri)
13
+ end
14
+ end
6
15
 
7
16
  class Error < StandardError; end
8
17
  end
@@ -0,0 +1 @@
1
+ VERSION = '1.0.0'.freeze
metadata CHANGED
@@ -1,43 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fact_is_fact
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
- - Aks
7
+ - Abhinay
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-06-14 00:00:00.000000000 Z
11
+ date: 2020-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: '1.17'
19
+ version: 2.1.4
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: '1.17'
26
+ version: 2.1.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: '13.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '10.0'
40
+ version: '13.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -52,7 +52,7 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: 3.8.0
55
- description: library helps you display random facts
55
+ description: library helps you display random facts about a number or date or a year.
56
56
  email:
57
57
  - abhinay302@gmail.com
58
58
  executables: []
@@ -61,6 +61,7 @@ extra_rdoc_files: []
61
61
  files:
62
62
  - ".gitignore"
63
63
  - ".travis.yml"
64
+ - CHANGELOG.md
64
65
  - CODE_OF_CONDUCT.md
65
66
  - Gemfile
66
67
  - Gemfile.lock
@@ -71,8 +72,7 @@ files:
71
72
  - bin/setup
72
73
  - fact_is_fact.gemspec
73
74
  - lib/fact_is_fact.rb
74
- - lib/fact_is_fact/random.rb
75
- - lib/fact_is_fact/version.rb
75
+ - lib/version.rb
76
76
  homepage: https://github.com/abhinaykumar/fact_is_fact
77
77
  licenses:
78
78
  - MIT
@@ -80,7 +80,7 @@ metadata:
80
80
  allowed_push_host: https://rubygems.org
81
81
  homepage_uri: https://github.com/abhinaykumar/fact_is_fact
82
82
  source_code_uri: https://github.com/abhinaykumar/fact_is_fact
83
- changelog_uri: Put your gem's CHANGELOG.md URL here.
83
+ changelog_uri: https://github.com/abhinaykumar/fact_is_fact/blob/master/CHANGELOG.md
84
84
  post_install_message:
85
85
  rdoc_options: []
86
86
  require_paths:
@@ -96,9 +96,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
96
96
  - !ruby/object:Gem::Version
97
97
  version: '0'
98
98
  requirements: []
99
- rubyforge_project:
100
- rubygems_version: 2.5.2.2
99
+ rubygems_version: 3.1.2
101
100
  signing_key:
102
101
  specification_version: 4
103
- summary: Stating the fact with ease
102
+ summary: This gem allows users to get a random trivia about a number or date or a
103
+ year
104
104
  test_files: []
@@ -1,15 +0,0 @@
1
- module FactIsFact
2
- class Random
3
-
4
- def initialize(args)
5
- @number = args[:number] || 'random'
6
- @fact_type = args[:fact_type]
7
- @base_uri = 'http://numbersapi.com'
8
- end
9
-
10
- def trivia
11
- number_facts_uri = URI("#{@base_uri}/#{@number}/#{@fact_type}")
12
- Net::HTTP.get(number_facts_uri)
13
- end
14
- end
15
- end
@@ -1,3 +0,0 @@
1
- module FactIsFact
2
- VERSION = "0.3.1"
3
- end