giphy 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +6 -14
- data/README.md +1 -2
- data/giphy.gemspec +1 -0
- data/lib/giphy/cli.rb +2 -1
- data/lib/giphy/version.rb +1 -1
- data/spec/giphy/cli_spec.rb +21 -5
- metadata +20 -5
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
metadata.gz: !binary |-
|
9
|
-
ZjI4ZmI2MzEwZDI3MzAyMTUzNGZkOWUwOTE2YTQ2MmVjMGNkZmYxODRmNWNh
|
10
|
-
OGJmOTFjNGU0MDhkOGY2ZTljZGUyNThmNzVlOTU0MTI2ZGNjMjQxOWQ0ODEy
|
11
|
-
M2I1NjM3ZWQ2MTdjMWY1ZmViMWRlOWQ2NjNiOGU5OGNiOWU2NDE=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
ZjFhMThjMjdiMzNkZGJjN2E5ZWI3Nzk2ZDM3YjkzZjE1ZGQxOGZlNTkwNzhj
|
14
|
-
MTQ3OTA3MjQ5ZDZlMDllN2ZkZjUzYTk0ZDA1NzM2NGYwNjdkY2JmMmIyOWQ1
|
15
|
-
NDY2Yjc4YTE5NDhjMDRlMTA0Y2JkNTRkMDE0ZjMwYTY0YWVlMDQ=
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 1dc3c8bc663e9f7f6cfabc13eb276c2aa5f983e3
|
4
|
+
data.tar.gz: ce1fcacf0e04f74760721602984fdab1f53bd8ac
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c9c91cc34f300e9e12d833126ab021668c6f6d64d9507ea40d202a8d23c3095ec1835136b4d89a6f9bf70a67deddacde35a456a1b8171019120630a40f944ea7
|
7
|
+
data.tar.gz: 252b9baa8601d0264aaf1b90f1b7b49d462f79b3e9ec07e8698546c1e2bd03a2bc06de6bb864f8919b357914d807bd14580fd08b6cd166c03d092825027ae6d3
|
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# Giphy
|
2
2
|
|
3
3
|
[![Build Status](https://travis-ci.org/sebasoga/giphy.png?branch=master)](https://travis-ci.org/sebasoga/giphy)
|
4
|
+
[![Code Climate](https://codeclimate.com/github/sebasoga/giphy.png)](https://codeclimate.com/github/sebasoga/giphy)
|
4
5
|
|
5
6
|
Because GIFs make life fun! Use [Giphy API](http://api.giphy.com) from your Ruby programs and
|
6
7
|
command line. Check out [Giphy Labs](http://labs.giphy.com/) for inspiration.
|
@@ -105,8 +106,6 @@ command line and opens it on your browser. Just for fun.
|
|
105
106
|
|
106
107
|
$ giphy 'dance'
|
107
108
|
|
108
|
-
*Currently only supported for Mac.*
|
109
|
-
|
110
109
|
## Supported Ruby Versions
|
111
110
|
This library aims to support and is tested against the following Ruby
|
112
111
|
implementations:
|
data/giphy.gemspec
CHANGED
data/lib/giphy/cli.rb
CHANGED
data/lib/giphy/version.rb
CHANGED
data/spec/giphy/cli_spec.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'spec_helper'
|
2
|
+
require 'launchy'
|
2
3
|
|
3
4
|
describe Giphy::CLI do
|
4
5
|
describe ".run" do
|
@@ -14,19 +15,34 @@ describe Giphy::CLI do
|
|
14
15
|
subject { Giphy::CLI.new('horse') }
|
15
16
|
|
16
17
|
context "when a gif is found" do
|
18
|
+
before { Giphy.stub(screensaver: double(id: 'OoFJ7iMGUBpiE')) }
|
19
|
+
|
17
20
|
it "echoes a message to the console and opens the url using Kernel#system" do
|
18
|
-
|
19
|
-
|
20
|
-
with("echo 'Showing the GIF on your
|
21
|
+
expect(subject).
|
22
|
+
to receive(:system).
|
23
|
+
with("echo 'Showing the GIF on your browser'")
|
24
|
+
subject.search
|
25
|
+
end
|
26
|
+
|
27
|
+
it "opens the url using Launchy" do
|
28
|
+
uri = URI("http://giphy.com/embed/OoFJ7iMGUBpiE")
|
29
|
+
expect(Launchy).to receive(:open).with(uri)
|
21
30
|
subject.search
|
22
31
|
end
|
23
32
|
end
|
24
33
|
|
25
34
|
context "when a Giphy::Errors:API error is raised" do
|
35
|
+
before { Giphy.stub(:screensaver).and_raise(Giphy::Errors::API) }
|
36
|
+
|
26
37
|
it "echoes a message to the console and opens the url using Kernel#system" do
|
27
|
-
Giphy.stub(:screensaver).and_raise(Giphy::Errors::API)
|
28
38
|
subject.should_receive(:system).
|
29
|
-
with("echo 'Showing the GIF on your
|
39
|
+
with("echo 'Showing the GIF on your browser'")
|
40
|
+
subject.search
|
41
|
+
end
|
42
|
+
|
43
|
+
it "opens the 404 gif url using Launchy" do
|
44
|
+
uri = URI("http://giphy.com/embed/YyKPbc5OOTSQE")
|
45
|
+
expect(Launchy).to receive(:open).with(uri)
|
30
46
|
subject.search
|
31
47
|
end
|
32
48
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: giphy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sebastian Sogamoso
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - ~>
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 0.2.1
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: launchy
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ~>
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: 2.4.2
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ~>
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 2.4.2
|
83
97
|
description: A Ruby interface to the Giphy API.
|
84
98
|
email:
|
85
99
|
- sebasoga@gmail.com
|
@@ -142,17 +156,17 @@ require_paths:
|
|
142
156
|
- lib
|
143
157
|
required_ruby_version: !ruby/object:Gem::Requirement
|
144
158
|
requirements:
|
145
|
-
- -
|
159
|
+
- - '>='
|
146
160
|
- !ruby/object:Gem::Version
|
147
161
|
version: '0'
|
148
162
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
149
163
|
requirements:
|
150
|
-
- -
|
164
|
+
- - '>='
|
151
165
|
- !ruby/object:Gem::Version
|
152
166
|
version: '0'
|
153
167
|
requirements: []
|
154
168
|
rubyforge_project:
|
155
|
-
rubygems_version: 2.
|
169
|
+
rubygems_version: 2.1.11
|
156
170
|
signing_key:
|
157
171
|
specification_version: 4
|
158
172
|
summary: Enjoy Giphy API from you Ruby programs and command line
|
@@ -174,3 +188,4 @@ test_files:
|
|
174
188
|
- spec/giphy/special_gif_spec.rb
|
175
189
|
- spec/shared_examples/special_gif_contract_spec.rb
|
176
190
|
- spec/spec_helper.rb
|
191
|
+
has_rdoc:
|