vanntastic-imgur 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.gitignore +6 -0
- data/LICENSE +20 -0
- data/README.rdoc +38 -0
- data/Rakefile +55 -0
- data/VERSION +1 -0
- data/doc/Imgur/API.html +862 -0
- data/doc/Imgur/Image.html +245 -0
- data/doc/Imgur/ImgurError.html +80 -0
- data/doc/Imgur.html +30 -0
- data/doc/README.rdoc.html +54 -0
- data/doc/all-files.html +23 -0
- data/doc/all-methods.html +70 -0
- data/doc/all-namespaces.html +28 -0
- data/doc/app.js +18 -0
- data/doc/custom.css +1 -0
- data/doc/index.html +19 -0
- data/doc/jquery.js +11 -0
- data/doc/style.css +81 -0
- data/doc/syntax_highlight.css +24 -0
- data/doc/top-level-namespace.html +25 -0
- data/lib/imgur.rb +102 -0
- data/spec/cycle_spec.rb +37 -0
- data/spec/gallery_spec.rb +41 -0
- data/spec/image_stats_spec.rb +22 -0
- data/spec/spec_helper.rb +11 -0
- data/spec/spec_image.jpg +0 -0
- metadata +125 -0
data/.document
ADDED
data/.gitignore
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2009 jdp
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
= imgur
|
2
|
+
|
3
|
+
A simple ruby interface to the imgur image hosting service (http://imgur.com). This is a nice alternative to uploading images and not having to deal with RMagick bs.
|
4
|
+
|
5
|
+
== Requirements
|
6
|
+
|
7
|
+
* Grab a imgur api key : http://imgur.com/register/api/
|
8
|
+
|
9
|
+
== Examples
|
10
|
+
|
11
|
+
# Uploading an image to imgur from the filesystem
|
12
|
+
|
13
|
+
img = Imgur::API.new 'YOURAPIKEY'
|
14
|
+
uploaded_img = img.upload_file '/path/to/your/test.jpg'
|
15
|
+
# should return a hash like:
|
16
|
+
# => {"small_thumbnail"=>"http://imgur.com/NfuKFs.png",
|
17
|
+
"original_image"=>"http://imgur.com/NfuKF.png",
|
18
|
+
"large_thumbnail"=>"http://imgur.com/NfuKFl.png",
|
19
|
+
"delete_hash"=>"VAiPkk5NoQ", "imgur_page"=>"http://imgur.com/NfuKF",
|
20
|
+
"delete_page"=>"http://imgur.com/delete/VAiPkk5NoQ",
|
21
|
+
"image_hash"=>"NfuKF"}
|
22
|
+
# now you can do something like (if you're using rails):
|
23
|
+
<%= image_tag uploaded_img["small_thumbnail"] %>
|
24
|
+
|
25
|
+
== Note on Patches/Pull Requests
|
26
|
+
|
27
|
+
* Fork the project.
|
28
|
+
* Make your feature addition or bug fix.
|
29
|
+
* Add tests for it. This is important so I don't break it in a
|
30
|
+
future version unintentionally.
|
31
|
+
* Commit, do not mess with rakefile, version, or history.
|
32
|
+
(if you want to have your own version, that is fine but
|
33
|
+
bump version in a commit by itself I can ignore when I pull)
|
34
|
+
* Send me a pull request. Bonus points for topic branches.
|
35
|
+
|
36
|
+
== Copyright
|
37
|
+
|
38
|
+
Copyright (c) 2009 jdp. See LICENSE for details.
|
data/Rakefile
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'jeweler'
|
6
|
+
Jeweler::Tasks.new do |gem|
|
7
|
+
gem.name = "vanntastic-imgur"
|
8
|
+
gem.summary = %Q{Imgur API interface}
|
9
|
+
gem.description = %Q{An interface to the Imgur API}
|
10
|
+
gem.email = "jdp34@njit.edu"
|
11
|
+
gem.homepage = "http://github.com/jdp/imgur"
|
12
|
+
gem.authors = ["Justin Poliey","Vann Ek"]
|
13
|
+
gem.add_development_dependency "bacon", ">= 1.1.0"
|
14
|
+
gem.add_development_dependency "yard", ">= 0.2.3.5"
|
15
|
+
gem.add_development_dependency "curb", ">= 0.5.4.0"
|
16
|
+
gem.add_development_dependency "crack", ">= 0.1.4"
|
17
|
+
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
18
|
+
end
|
19
|
+
Jeweler::GemcutterTasks.new
|
20
|
+
rescue LoadError
|
21
|
+
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
|
22
|
+
end
|
23
|
+
|
24
|
+
require 'rake/testtask'
|
25
|
+
Rake::TestTask.new(:spec) do |spec|
|
26
|
+
spec.libs << 'lib' << 'spec'
|
27
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
28
|
+
spec.verbose = true
|
29
|
+
end
|
30
|
+
|
31
|
+
begin
|
32
|
+
require 'rcov/rcovtask'
|
33
|
+
Rcov::RcovTask.new do |spec|
|
34
|
+
spec.libs << 'spec'
|
35
|
+
spec.pattern = 'spec/**/*_spec.rb'
|
36
|
+
spec.verbose = true
|
37
|
+
end
|
38
|
+
rescue LoadError
|
39
|
+
task :rcov do
|
40
|
+
abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
task :spec => :check_dependencies
|
45
|
+
|
46
|
+
task :default => :spec
|
47
|
+
|
48
|
+
begin
|
49
|
+
require 'yard'
|
50
|
+
YARD::Rake::YardocTask.new
|
51
|
+
rescue LoadError
|
52
|
+
task :yardoc do
|
53
|
+
abort "YARD is not available. In order to run yardoc, you must: sudo gem install yard"
|
54
|
+
end
|
55
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.3.0
|