gifs_diana 0.1.1 → 0.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 +4 -4
- data/Gemfile.lock +1 -1
- data/gifs_diana.gemspec +1 -1
- data/lib/gifs_diana.rb +19 -4
- data/lib/gifs_diana/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: 05566c56d5b8dbbc0d92dd534d4a7109396d0e9418d7ad3fc5870484fe0f4097
|
4
|
+
data.tar.gz: 04fa5008eb8f635a0af97d1df5123787f5c909d4579b203c79dc7e1816137630
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72de7bea32014aa330ff0b3de1a6b27ad85ce864db5bbe38c3d672896f17f49f76a74bd60d1ae82ed1b33c088e149f927ca534f09e07f9bb8aedaa45c75041ab
|
7
|
+
data.tar.gz: 85b1b434d284780694f9acd3fec921f6faa0f1bf0e09047f173c5bfc161b59bfd2bb406d42d74ff24d74a4c3c135a980f8e4e093b8c25ecdc9c8f62f97887c0f
|
data/Gemfile.lock
CHANGED
data/gifs_diana.gemspec
CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |spec|
|
|
7
7
|
spec.email = ["dgarcia24@ucol.mx"]
|
8
8
|
|
9
9
|
spec.summary = %q{Gem for getting gifs from animatedgif.me}
|
10
|
-
spec.description = %q{Gem for getting random gifs}
|
10
|
+
spec.description = %q{Gem for getting random gifs and a txt generated by each call}
|
11
11
|
spec.homepage = "https://github.com/dgarciaap/gifs_diana"
|
12
12
|
#spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
|
13
13
|
|
data/lib/gifs_diana.rb
CHANGED
@@ -7,20 +7,35 @@ module GifsDiana
|
|
7
7
|
include HTTParty
|
8
8
|
|
9
9
|
base_uri "animatedgif.me"
|
10
|
+
|
11
|
+
|
12
|
+
def self.generate_txt(petition)
|
13
|
+
begin
|
14
|
+
file = File.new("gifs_urls", "w")
|
15
|
+
file.puts petition
|
16
|
+
puts "Txt generated :)"
|
17
|
+
puts "Route = #{file.path}"
|
18
|
+
file.close
|
19
|
+
rescue Exception, "No jaló"
|
20
|
+
end
|
21
|
+
end
|
10
22
|
|
11
23
|
#finding by id
|
12
24
|
def self.find_by_id(id)
|
13
|
-
get("/gifs/#{id}.json").parsed_response["url"]
|
25
|
+
gifs_urls = get("/gifs/#{id}.json").parsed_response["url"]
|
26
|
+
self.generate_txt(gifs_urls)
|
14
27
|
end
|
15
28
|
|
16
29
|
#finding by tag
|
17
30
|
def self.find_by_tag(tag)
|
18
|
-
get("/#{tag}.json").parsed_response["url"]
|
31
|
+
gifs_urls = get("/#{tag}.json").parsed_response["url"]
|
32
|
+
generate_txt(gifs_urls)
|
19
33
|
end
|
20
34
|
|
21
35
|
#find a random kitty
|
22
36
|
def self.random(tag)
|
23
|
-
find_by_tag(tag)
|
37
|
+
gifs_url = find_by_tag(tag)
|
38
|
+
generate_txt(gifs_url)
|
24
39
|
end
|
25
|
-
|
40
|
+
|
26
41
|
end
|
data/lib/gifs_diana/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gifs_diana
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- dgarciaap
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-02-
|
11
|
+
date: 2020-02-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -24,7 +24,7 @@ dependencies:
|
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.17.3
|
27
|
-
description: Gem for getting random gifs
|
27
|
+
description: Gem for getting random gifs and a txt generated by each call
|
28
28
|
email:
|
29
29
|
- dgarcia24@ucol.mx
|
30
30
|
executables: []
|