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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a29d42a7b0ace6b798f72492b21a5ee2612d1ad4a50b3c1cf1adf36672715701
4
- data.tar.gz: e64a07f2fa49f16a4b042ac5d9419cc606e36bfcd17115f98028d6274a0f471a
3
+ metadata.gz: 05566c56d5b8dbbc0d92dd534d4a7109396d0e9418d7ad3fc5870484fe0f4097
4
+ data.tar.gz: 04fa5008eb8f635a0af97d1df5123787f5c909d4579b203c79dc7e1816137630
5
5
  SHA512:
6
- metadata.gz: 892b8bea8706d7659c5ab440ee62fe0eae492193479e6bb47c838dfcf1b410ed19cda310b5cc94b50da5459dfad9803a8e4231926b009522caa6f85049f522fb
7
- data.tar.gz: 6e10cf4a9ee76d560379fcc619752db919741906aaffaf2aca808f10d280d4b3d34c066d037e26ac28aa6dde91bbb4c4b8f333dd17805c3db1445a531ae36ab7
6
+ metadata.gz: 72de7bea32014aa330ff0b3de1a6b27ad85ce864db5bbe38c3d672896f17f49f76a74bd60d1ae82ed1b33c088e149f927ca534f09e07f9bb8aedaa45c75041ab
7
+ data.tar.gz: 85b1b434d284780694f9acd3fec921f6faa0f1bf0e09047f173c5bfc161b59bfd2bb406d42d74ff24d74a4c3c135a980f8e4e093b8c25ecdc9c8f62f97887c0f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gifs_diana (0.1.1)
4
+ gifs_diana (0.2.0)
5
5
  httparty (= 0.17.3)
6
6
 
7
7
  GEM
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
@@ -1,3 +1,3 @@
1
1
  module GifsDiana
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
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.1.1
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-05 00:00:00.000000000 Z
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: []