gifs_diana 0.1.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 +7 -0
- data/.gitignore +8 -0
- data/.travis.yml +6 -0
- data/Gemfile +7 -0
- data/Gemfile.lock +29 -0
- data/README.md +34 -0
- data/Rakefile +10 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/gifs_diana.gemspec +31 -0
- data/lib/gifs_diana/version.rb +3 -0
- data/lib/gifs_diana.rb +26 -0
- metadata +70 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: a29d42a7b0ace6b798f72492b21a5ee2612d1ad4a50b3c1cf1adf36672715701
|
4
|
+
data.tar.gz: e64a07f2fa49f16a4b042ac5d9419cc606e36bfcd17115f98028d6274a0f471a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 892b8bea8706d7659c5ab440ee62fe0eae492193479e6bb47c838dfcf1b410ed19cda310b5cc94b50da5459dfad9803a8e4231926b009522caa6f85049f522fb
|
7
|
+
data.tar.gz: 6e10cf4a9ee76d560379fcc619752db919741906aaffaf2aca808f10d280d4b3d34c066d037e26ac28aa6dde91bbb4c4b8f333dd17805c3db1445a531ae36ab7
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
gifs_diana (0.1.1)
|
5
|
+
httparty (= 0.17.3)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
httparty (0.17.3)
|
11
|
+
mime-types (~> 3.0)
|
12
|
+
multi_xml (>= 0.5.2)
|
13
|
+
mime-types (3.3.1)
|
14
|
+
mime-types-data (~> 3.2015)
|
15
|
+
mime-types-data (3.2019.1009)
|
16
|
+
minitest (5.14.0)
|
17
|
+
multi_xml (0.6.0)
|
18
|
+
rake (12.3.3)
|
19
|
+
|
20
|
+
PLATFORMS
|
21
|
+
ruby
|
22
|
+
|
23
|
+
DEPENDENCIES
|
24
|
+
gifs_diana!
|
25
|
+
minitest (~> 5.0)
|
26
|
+
rake (~> 12.0)
|
27
|
+
|
28
|
+
BUNDLED WITH
|
29
|
+
2.1.4
|
data/README.md
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
# GifsDiana
|
2
|
+
|
3
|
+
A gem for getting random gifs :)
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'gifs_diana'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle install
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install gifs_diana
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
TODO: Write usage instructions here
|
24
|
+
|
25
|
+
## Development
|
26
|
+
|
27
|
+
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.
|
28
|
+
|
29
|
+
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).
|
30
|
+
|
31
|
+
## Contributing
|
32
|
+
|
33
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[dgarciaap]/gifs_diana.
|
34
|
+
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "gifs_diana"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
data/gifs_diana.gemspec
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
require_relative 'lib/gifs_diana/version'
|
2
|
+
|
3
|
+
Gem::Specification.new do |spec|
|
4
|
+
spec.name = "gifs_diana"
|
5
|
+
spec.version = GifsDiana::VERSION
|
6
|
+
spec.authors = ["dgarciaap"]
|
7
|
+
spec.email = ["dgarcia24@ucol.mx"]
|
8
|
+
|
9
|
+
spec.summary = %q{Gem for getting gifs from animatedgif.me}
|
10
|
+
spec.description = %q{Gem for getting random gifs}
|
11
|
+
spec.homepage = "https://github.com/dgarciaap/gifs_diana"
|
12
|
+
#spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
|
13
|
+
|
14
|
+
#spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
|
15
|
+
|
16
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
17
|
+
spec.metadata["source_code_uri"] = "https://github.com/dgarciaap"
|
18
|
+
spec.metadata["changelog_uri"] = "https://github.com/dgarciaap"
|
19
|
+
|
20
|
+
# Specify which files should be added to the gem when it is released.
|
21
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
22
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
23
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
24
|
+
end
|
25
|
+
spec.bindir = "exe"
|
26
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
27
|
+
spec.require_paths = ["lib"]
|
28
|
+
|
29
|
+
#Add dependency
|
30
|
+
spec.add_dependency "httparty", "0.17.3"
|
31
|
+
end
|
data/lib/gifs_diana.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
require "gifs_diana/version"
|
2
|
+
require "httparty"
|
3
|
+
|
4
|
+
module GifsDiana
|
5
|
+
class Error < StandardError; end
|
6
|
+
#makes consuming restful web services dead easy.
|
7
|
+
include HTTParty
|
8
|
+
|
9
|
+
base_uri "animatedgif.me"
|
10
|
+
|
11
|
+
#finding by id
|
12
|
+
def self.find_by_id(id)
|
13
|
+
get("/gifs/#{id}.json").parsed_response["url"]
|
14
|
+
end
|
15
|
+
|
16
|
+
#finding by tag
|
17
|
+
def self.find_by_tag(tag)
|
18
|
+
get("/#{tag}.json").parsed_response["url"]
|
19
|
+
end
|
20
|
+
|
21
|
+
#find a random kitty
|
22
|
+
def self.random(tag)
|
23
|
+
find_by_tag(tag)
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
metadata
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: gifs_diana
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- dgarciaap
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-02-05 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: httparty
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.17.3
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.17.3
|
27
|
+
description: Gem for getting random gifs
|
28
|
+
email:
|
29
|
+
- dgarcia24@ucol.mx
|
30
|
+
executables: []
|
31
|
+
extensions: []
|
32
|
+
extra_rdoc_files: []
|
33
|
+
files:
|
34
|
+
- ".gitignore"
|
35
|
+
- ".travis.yml"
|
36
|
+
- Gemfile
|
37
|
+
- Gemfile.lock
|
38
|
+
- README.md
|
39
|
+
- Rakefile
|
40
|
+
- bin/console
|
41
|
+
- bin/setup
|
42
|
+
- gifs_diana.gemspec
|
43
|
+
- lib/gifs_diana.rb
|
44
|
+
- lib/gifs_diana/version.rb
|
45
|
+
homepage: https://github.com/dgarciaap/gifs_diana
|
46
|
+
licenses: []
|
47
|
+
metadata:
|
48
|
+
homepage_uri: https://github.com/dgarciaap/gifs_diana
|
49
|
+
source_code_uri: https://github.com/dgarciaap
|
50
|
+
changelog_uri: https://github.com/dgarciaap
|
51
|
+
post_install_message:
|
52
|
+
rdoc_options: []
|
53
|
+
require_paths:
|
54
|
+
- lib
|
55
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '0'
|
60
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
61
|
+
requirements:
|
62
|
+
- - ">="
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: '0'
|
65
|
+
requirements: []
|
66
|
+
rubygems_version: 3.1.2
|
67
|
+
signing_key:
|
68
|
+
specification_version: 4
|
69
|
+
summary: Gem for getting gifs from animatedgif.me
|
70
|
+
test_files: []
|