gravatar-api 0.1.6 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5ea875a42a9a1d62bef5e452a2b73807b8fd7eaf
4
- data.tar.gz: d360b2ccf4f7268495b5e8765f375f7e418b3ba2
3
+ metadata.gz: b0cb33f007f0aac1895d7e109baebf7e4a82652f
4
+ data.tar.gz: 6814d94a58e78bf71cc91a3dd89bd97be83b41b5
5
5
  SHA512:
6
- metadata.gz: f5204a3841dec142bbb5c6749f88c4555564d0e165c8a03bec966de3ff6c4289eacae5eec54409c4b64f8802a2bccb5d0589f2fbebba634c1b7b4d274a400122
7
- data.tar.gz: ec00883fccc6bbd30d29ce36ed9e7ce2b276bc59acfbbcb88311f02654d159e72fd44ca82f313c21bf29c506e5673d36de13271a1419385d940470de023d7495
6
+ metadata.gz: b693c8a8cd4027e5b58711fa618c362b8d2787ccf8edf7a533a7b9bb356c9bb8b062f5f78700c71ba47ecebc4803eddac4edf9a96e28061d5b92843b8eb6db2f
7
+ data.tar.gz: b8f6132e205ccb662a78f9b9eb6813177a3223118d7a10a9fb3ba37c0c8b0e4077967e2407ead9d5941e756be3c2fcb626733cf7836aff1dfa3f61d89ab476e6
data/.gitignore CHANGED
@@ -1,3 +1,2 @@
1
- test/
2
1
  *.gem
3
2
  *.swp
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source "https://rubygems.org/"
2
+ gemspec
data/README.md CHANGED
@@ -3,8 +3,13 @@ gravatar-api
3
3
 
4
4
  A library for easy, object oriented Gravatar API access.
5
5
 
6
+ [![Gem Version](https://badge.fury.io/rb/gravatar-api.png)](http://badge.fury.io/rb/gravatar-api)
7
+ [![Dependency Status](https://gemnasium.com/JesseHerrick/gravatar-api.png)](https://gemnasium.com/JesseHerrick/gravatar-api)
8
+
6
9
  # Using the Gem
7
- gravatar-api was designed to use the Gravatar API properly for easy use in web applications (and whatever else you want!).
10
+ gravatar-api was designed to use the Gravatar API properly for easy use in [web applications](http://gravatar.jessegrant.net/) (and whatever else you want!).
11
+
12
+ If you want to see an example of web app source code using gravatar-api check out [this.](https://github.com/JesseHerrick/gravatar-api-example)
8
13
 
9
14
  Examples:
10
15
  ```ruby
@@ -24,7 +29,7 @@ profile.hash!
24
29
  # => "9f3712c7a02579d7e50cb20d2680eb67"
25
30
  ```
26
31
 
27
- The hash!(email) method also works as a class method.
32
+ The `hash!(email)` method also works as a class method.
28
33
  ```ruby
29
34
  require 'gravatar-api'
30
35
 
data/Rakefile CHANGED
@@ -1,6 +1,11 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), *%w[lib]))
4
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), *%w[test]))
5
+
6
+ # Created by Jesse Herrick
7
+ # www.jessegrant.net
8
+ # jessegrantherrick@gmail.com
4
9
 
5
10
  # Lib Files
6
11
  require 'gravatar-api/version'
@@ -10,6 +15,11 @@ require "rubygems"
10
15
  require "rake"
11
16
  require "colorize"
12
17
 
18
+ # Helpers
19
+ def test(filename)
20
+ puts `ruby -I . test/test_#{filename}.rb`
21
+ end
22
+
13
23
  # Tasks
14
24
  desc "Gem version"
15
25
  task :version do
@@ -18,11 +28,18 @@ end
18
28
 
19
29
  desc "Default task."
20
30
  task :default do
31
+ puts `rake test`
21
32
  puts `rake version`
22
33
  puts "Gem seems to be in tip top shape!".green
23
34
  puts "Run: ".yellow + "`gravatar --help` to list all commands."
24
35
  end
25
36
 
37
+ desc "Run all tests."
38
+ task :test do
39
+ test("hash")
40
+ test("url")
41
+ end
42
+
26
43
  desc "Build gem."
27
44
  task :build do
28
45
  puts "Starting gem build...".yellow
@@ -1 +1 @@
1
- VERSION = "0.1.6"
1
+ VERSION = "0.2.0"
@@ -0,0 +1,10 @@
1
+ require 'test/unit'
2
+ require 'lib/gravatar-api'
3
+
4
+ class TestHash < Test::Unit::TestCase
5
+ def test_hash
6
+ profile = Gravatar.new("jessegrantherrick@gmail.com")
7
+ expected = profile.hash!
8
+ assert_equal(expected, "9f3712c7a02579d7e50cb20d2680eb67")
9
+ end
10
+ end
@@ -0,0 +1,16 @@
1
+ require 'test/unit'
2
+ require 'lib/gravatar-api.rb'
3
+
4
+ class TestUrl < Test::Unit::TestCase
5
+ def test_url
6
+ profile = Gravatar.new("jessegrantherrick@gmail.com")
7
+ expected = profile.url
8
+ assert_equal(expected, "http://www.gravatar.com/avatar/9f3712c7a02579d7e50cb20d2680eb67")
9
+ end
10
+
11
+ def test_url_size
12
+ profile = Gravatar.new("jessegrantherrick@gmail.com")
13
+ expected = profile.url(:size => 150)
14
+ assert_equal(expected, "http://www.gravatar.com/avatar/9f3712c7a02579d7e50cb20d2680eb67?s=150")
15
+ end
16
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gravatar-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jesse Herrick
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-22 00:00:00.000000000 Z
11
+ date: 2013-11-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -60,6 +60,7 @@ extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
62
  - .gitignore
63
+ - Gemfile
63
64
  - README.md
64
65
  - Rakefile
65
66
  - gravatar-api.gemspec
@@ -67,6 +68,8 @@ files:
67
68
  - lib/gravatar-api/hash.rb
68
69
  - lib/gravatar-api/url.rb
69
70
  - lib/gravatar-api/version.rb
71
+ - test/test_hash.rb
72
+ - test/test_url.rb
70
73
  homepage: https://github.com/JesseHerrick/gravatar-api
71
74
  licenses:
72
75
  - MIT
@@ -87,9 +90,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
90
  version: '0'
88
91
  requirements: []
89
92
  rubyforge_project:
90
- rubygems_version: 2.0.3
93
+ rubygems_version: 2.1.11
91
94
  signing_key:
92
95
  specification_version: 4
93
96
  summary: Easily access the Gravatar API in an object oriented way.
94
97
  test_files: []
95
- has_rdoc: