merb_gravatar 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +20 -0
- data/README +12 -0
- data/Rakefile +79 -0
- data/TODO +5 -0
- data/lib/merb_gravatar.rb +26 -0
- data/spec/merb_gravatar_spec.rb +7 -0
- data/spec/spec_helper.rb +1 -0
- metadata +70 -0
data/LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2009 Genki Takiuchi
|
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
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,79 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake/gempackagetask'
|
3
|
+
|
4
|
+
require 'merb-core'
|
5
|
+
require 'merb-core/tasks/merb'
|
6
|
+
|
7
|
+
GEM_NAME = "merb_gravatar"
|
8
|
+
GEM_VERSION = "0.1.0"
|
9
|
+
AUTHOR = "Genki Takiuchi"
|
10
|
+
EMAIL = "genki@s21g.com"
|
11
|
+
HOMEPAGE = "http://merbi.st/"
|
12
|
+
RUBYFORGE_PROJECT = 'asakusarb'
|
13
|
+
SUMMARY = "Merb plugin that provides a helper method for GRAVATAR"
|
14
|
+
|
15
|
+
spec = Gem::Specification.new do |s|
|
16
|
+
s.rubyforge_project = RUBYFORGE_PROJECT
|
17
|
+
s.name = GEM_NAME
|
18
|
+
s.version = GEM_VERSION
|
19
|
+
s.platform = Gem::Platform::RUBY
|
20
|
+
s.has_rdoc = true
|
21
|
+
s.extra_rdoc_files = ["README", "LICENSE", 'TODO']
|
22
|
+
s.summary = SUMMARY
|
23
|
+
s.description = s.summary
|
24
|
+
s.author = AUTHOR
|
25
|
+
s.email = EMAIL
|
26
|
+
s.homepage = HOMEPAGE
|
27
|
+
s.add_dependency('merb', '>= 1.0.9')
|
28
|
+
s.require_path = 'lib'
|
29
|
+
s.files = %w(LICENSE README Rakefile TODO) + Dir.glob("{lib,spec}/**/*")
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
Rake::GemPackageTask.new(spec) do |pkg|
|
34
|
+
pkg.need_tar = true
|
35
|
+
pkg.gem_spec = spec
|
36
|
+
end
|
37
|
+
|
38
|
+
desc "install the plugin as a gem"
|
39
|
+
task :install do
|
40
|
+
Merb::RakeHelper.install(GEM_NAME, :version => GEM_VERSION)
|
41
|
+
end
|
42
|
+
|
43
|
+
desc "Uninstall the gem"
|
44
|
+
task :uninstall do
|
45
|
+
Merb::RakeHelper.uninstall(GEM_NAME, :version => GEM_VERSION)
|
46
|
+
end
|
47
|
+
|
48
|
+
desc "Create a gemspec file"
|
49
|
+
task :gemspec do
|
50
|
+
File.open("#{GEM_NAME}.gemspec", "w") do |file|
|
51
|
+
file.puts spec.to_ruby
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
desc 'Package and upload the release to rubyforge.'
|
56
|
+
task :release => :package do |t|
|
57
|
+
require 'rubyforge'
|
58
|
+
v = ENV["VERSION"] or abort "Must supply VERSION=x.y.z"
|
59
|
+
abort "Versions don't match #{v} vs #{GEM_VERSION}" unless v == GEM_VERSION
|
60
|
+
pkg = "pkg/#{GEM_NAME}-#{GEM_VERSION}"
|
61
|
+
|
62
|
+
require 'rubyforge'
|
63
|
+
rf = RubyForge.new.configure
|
64
|
+
puts "Logging in"
|
65
|
+
rf.login
|
66
|
+
|
67
|
+
c = rf.userconfig
|
68
|
+
# c["release_notes"] = description if description
|
69
|
+
# c["release_changes"] = changes if changes
|
70
|
+
c["preformatted"] = true
|
71
|
+
|
72
|
+
files = [
|
73
|
+
"#{pkg}.tgz",
|
74
|
+
"#{pkg}.gem"
|
75
|
+
].compact
|
76
|
+
|
77
|
+
puts "Releasing #{GEM_NAME} v. #{GEM_VERSION}"
|
78
|
+
rf.add_release RUBYFORGE_PROJECT, GEM_NAME, GEM_VERSION, *files
|
79
|
+
end
|
data/TODO
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# make sure we're running inside Merb
|
2
|
+
if defined?(Merb::Plugins)
|
3
|
+
|
4
|
+
# Merb gives you a Merb::Plugins.config hash...feel free to put your stuff in your piece of it
|
5
|
+
Merb::Plugins.config[:merb_gravatar] = {
|
6
|
+
:chickens => false
|
7
|
+
}
|
8
|
+
|
9
|
+
Merb::BootLoader.before_app_loads do
|
10
|
+
# require code that must be loaded before the application
|
11
|
+
module Merb
|
12
|
+
module GlobalHelpers
|
13
|
+
def gravatar(email, size = 80, attrs = {})
|
14
|
+
id = Digest::MD5.hexdigest(email)
|
15
|
+
uri = "http://www.gravatar.com/avatar/#{id}?s=#{size}"
|
16
|
+
tag :img, nil, {:src => uri, :width => size,
|
17
|
+
:height => size, :border => 0}.merge(attrs)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
Merb::BootLoader.after_app_loads do
|
24
|
+
# code that can be required after the application loads
|
25
|
+
end
|
26
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
$:.push File.join(File.dirname(__FILE__), '..', 'lib')
|
metadata
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: merb_gravatar
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Genki Takiuchi
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-04-14 00:00:00 +09:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: merb
|
17
|
+
type: :runtime
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 1.0.9
|
24
|
+
version:
|
25
|
+
description: Merb plugin that provides a helper method for GRAVATAR
|
26
|
+
email: genki@s21g.com
|
27
|
+
executables: []
|
28
|
+
|
29
|
+
extensions: []
|
30
|
+
|
31
|
+
extra_rdoc_files:
|
32
|
+
- README
|
33
|
+
- LICENSE
|
34
|
+
- TODO
|
35
|
+
files:
|
36
|
+
- LICENSE
|
37
|
+
- README
|
38
|
+
- Rakefile
|
39
|
+
- TODO
|
40
|
+
- lib/merb_gravatar.rb
|
41
|
+
- spec/merb_gravatar_spec.rb
|
42
|
+
- spec/spec_helper.rb
|
43
|
+
has_rdoc: true
|
44
|
+
homepage: http://merbi.st/
|
45
|
+
post_install_message:
|
46
|
+
rdoc_options: []
|
47
|
+
|
48
|
+
require_paths:
|
49
|
+
- lib
|
50
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: "0"
|
55
|
+
version:
|
56
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: "0"
|
61
|
+
version:
|
62
|
+
requirements: []
|
63
|
+
|
64
|
+
rubyforge_project: asakusarb
|
65
|
+
rubygems_version: 1.3.1
|
66
|
+
signing_key:
|
67
|
+
specification_version: 2
|
68
|
+
summary: Merb plugin that provides a helper method for GRAVATAR
|
69
|
+
test_files: []
|
70
|
+
|