mamajoke 0.1.0 → 1.1.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 +5 -5
- data/README.md +5 -4
- data/lib/mamajoke/version.rb +1 -1
- data/lib/tasks/joke.rake +16 -0
- data/mamajoke.gemspec +1 -1
- metadata +6 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: e4b5c339e545f120032fbfd3473f648755fc8452
|
|
4
|
+
data.tar.gz: 98d69d72864d2b63d2d81d3f362a0123721ae2ff
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5c3b43bc1b8ed8d331f5bdd238bfa15723e3813b8de2f9be276c75b9439776cab08d533486197545aba0cbd985014b70572c41fd03a3bd184f6530a8ed978e12
|
|
7
|
+
data.tar.gz: fb001e1a5eeb868567094b56a69a4ff4e54e977ba974db55834f58e73e19e23fc9626ea21df8ea283e9b5fcf76a126137715042d3002e6990a44364e34d8caaa
|
data/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# Mamajoke
|
|
2
|
+
|
|
2
3
|
We know that each developer need some laughter during code. So Gem is only for fun.
|
|
3
4
|
This Gem provide give a simple method get_mamajoke() which you can use in any view file. And this function return a random joke .
|
|
5
|
+
Also you can run command on command line to fetch random joke if you are getting bored during development : rails joke:random
|
|
4
6
|
|
|
5
7
|
|
|
6
8
|
## Installation
|
|
@@ -36,12 +38,11 @@ After installation just call get_mamajoke() function in your view and enjoy codi
|
|
|
36
38
|
<%= get_mamajoke() %>
|
|
37
39
|
</span>
|
|
38
40
|
|
|
41
|
+
Also you can run command on command line to fetch random joke if you are getting bored during development:
|
|
42
|
+
|
|
43
|
+
rails joke:random
|
|
39
44
|
|
|
40
|
-
## Development
|
|
41
|
-
|
|
42
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
43
45
|
|
|
44
|
-
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
|
45
46
|
|
|
46
47
|
## Contributing
|
|
47
48
|
|
data/lib/mamajoke/version.rb
CHANGED
data/lib/tasks/joke.rake
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
namespace :joke do
|
|
2
|
+
desc "Get Random Joke"
|
|
3
|
+
task random: :environment do
|
|
4
|
+
uri = URI.parse("https://icanhazdadjoke.com/")
|
|
5
|
+
request = Net::HTTP::Get.new(uri)
|
|
6
|
+
request["Accept"] = "application/json"
|
|
7
|
+
req_options = {
|
|
8
|
+
use_ssl: uri.scheme == "https",
|
|
9
|
+
}
|
|
10
|
+
response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
|
|
11
|
+
http.request(request)
|
|
12
|
+
end
|
|
13
|
+
parsed_json = JSON.parse(response.body)
|
|
14
|
+
puts parsed_json["joke"]
|
|
15
|
+
end
|
|
16
|
+
end
|
data/mamajoke.gemspec
CHANGED
|
@@ -3,7 +3,7 @@ require_relative 'lib/mamajoke/version'
|
|
|
3
3
|
Gem::Specification.new do |spec|
|
|
4
4
|
spec.name = "mamajoke"
|
|
5
5
|
spec.version = Mamajoke::VERSION
|
|
6
|
-
spec.authors = ["Vijay Verma"]
|
|
6
|
+
spec.authors = ["Vijay Verma - yuvasoftech.com"]
|
|
7
7
|
spec.email = ["vijayyuvasoft183@gmail.com"]
|
|
8
8
|
|
|
9
9
|
spec.summary = "This gem return a random joke for you"
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mamajoke
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 1.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
|
-
- Vijay Verma
|
|
7
|
+
- Vijay Verma - yuvasoftech.com
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-01-
|
|
11
|
+
date: 2021-01-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Each developer need some laughter during coding .. so this gem provide
|
|
14
14
|
a random joke for you :)
|
|
@@ -31,6 +31,7 @@ files:
|
|
|
31
31
|
- bin/setup
|
|
32
32
|
- lib/mamajoke.rb
|
|
33
33
|
- lib/mamajoke/version.rb
|
|
34
|
+
- lib/tasks/joke.rake
|
|
34
35
|
- mamajoke.gemspec
|
|
35
36
|
homepage: https://github.com/vijayyuvasoft/mamajoke
|
|
36
37
|
licenses:
|
|
@@ -53,7 +54,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
53
54
|
- !ruby/object:Gem::Version
|
|
54
55
|
version: '0'
|
|
55
56
|
requirements: []
|
|
56
|
-
|
|
57
|
+
rubyforge_project:
|
|
58
|
+
rubygems_version: 2.6.11
|
|
57
59
|
signing_key:
|
|
58
60
|
specification_version: 4
|
|
59
61
|
summary: This gem return a random joke for you
|