gravatarify 2.1.0 → 2.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
1
  doc/
2
2
  pkg/
3
3
  .yardoc
4
+ *.rbc
data/Rakefile CHANGED
@@ -1,26 +1,31 @@
1
1
  require 'rake'
2
2
  require 'rake/testtask'
3
- require 'yard'
4
- require File.join(File.dirname(__FILE__), 'lib', 'gravatarify')
3
+
4
+ $: << File.join(File.dirname(__FILE__), 'lib')
5
+ require 'gravatarify'
5
6
 
6
7
  desc 'Default: run unit tests.'
7
8
  task :default => :test
8
9
 
9
10
  desc 'Test the gravatarify plugin.'
10
11
  Rake::TestTask.new(:test) do |t|
11
- t.libs << 'lib'
12
12
  t.libs << 'test'
13
13
  t.pattern = 'test/**/*_test.rb'
14
14
  t.verbose = true
15
15
  end
16
16
 
17
- desc 'Generate documentation for gravatarify. (requires yard)'
18
- YARD::Rake::YardocTask.new(:doc) do |t|
19
- t.files = ['lib/**/*.rb']
20
- t.options = [
21
- "--readme", "README.md",
22
- "--title", "gravatarify (v#{Gravatarify::VERSION}) API Documentation"
23
- ]
17
+ begin
18
+ require 'yard'
19
+ desc 'Generate documentation for gravatarify. (requires yard)'
20
+ YARD::Rake::YardocTask.new(:doc) do |t|
21
+ t.files = ['lib/**/*.rb']
22
+ t.options = [
23
+ "--readme", "README.md",
24
+ "--title", "gravatarify (v#{Gravatarify::VERSION}) API Documentation"
25
+ ]
26
+ end
27
+ rescue LoadError
28
+ puts "yard is required to build documentation: gem install yard"
24
29
  end
25
30
 
26
31
  begin
@@ -45,6 +50,8 @@ begin
45
50
  gemspec.add_development_dependency('shoulda', '>= 2.10.2')
46
51
  gemspec.add_development_dependency('rr', '>= 0.10.5')
47
52
  gemspec.add_development_dependency('activesupport', '>= 2.3.5')
53
+
54
+ gemspec.files.reject! { |file| file =~ /\.gemspec$/ }
48
55
  end
49
56
  Jeweler::GemcutterTasks.new
50
57
  rescue LoadError
@@ -55,8 +62,8 @@ desc 'Clean all generated files (.yardoc and doc/*)'
55
62
  task :clean do |t|
56
63
  FileUtils.rm_rf "doc"
57
64
  FileUtils.rm_rf "pkg"
58
- FileUtils.rm_rf "gravatarify.gemspec"
59
65
  FileUtils.rm_rf ".yardoc"
66
+ Dir['**/*.rbc'].each { |f| File.unlink(f) }
60
67
  end
61
68
 
62
69
  namespace :metrics do
data/init.rb ADDED
@@ -0,0 +1 @@
1
+ require 'gravatarify'
@@ -1,12 +1,17 @@
1
- # Loads all required submodules
1
+ require 'gravatarify/base'
2
+ require 'gravatarify/utils'
3
+ require 'gravatarify/helper'
4
+
2
5
  module Gravatarify
3
6
  # current API version, as defined by http://semver.org/
4
- VERSION = "2.1.0".freeze
5
-
6
- autoload :Base, 'gravatarify/base'
7
- autoload :Utils, 'gravatarify/utils'
8
- autoload :Helper, 'gravatarify/helper'
7
+ VERSION = "2.2.1".freeze
9
8
  end
10
9
 
11
- # and add HAML support (if defined)
12
- Haml::Helpers.send(:include, Gravatarify::Helper) if defined?(Haml)
10
+ if defined?(ActiveSupport) && ActiveSupport.respond_to?(:on_load)
11
+ # Support for rails 3
12
+ ActiveSupport.on_load(:action_view) { include Gravatarify::Helper }
13
+ else
14
+ # try to hook into HAML and ActionView
15
+ Haml::Helpers.send(:include, Gravatarify::Helper) if defined?(Haml)
16
+ ActionView::Base.send(:include, Gravatarify::Helper) if defined?(ActionView)
17
+ end
@@ -0,0 +1,14 @@
1
+ require 'gravatarify'
2
+ require 'rails'
3
+
4
+ module Gravatarify
5
+ class Railtie < Rails::Railtie
6
+ initialize 'gravatarify.extend.action_view' do
7
+ Rails.logger.error "[Gravatarify::Railtie] initialize('gravatarify.extend.action_view')"
8
+ ActiveSupport.on_load(:action_view) do
9
+ Rails.logger.error "[Gravatarify::Railtie] ActiveSupport.on_load(:action_view), #{self.class}"
10
+ include Gravatarify::Helper
11
+ end
12
+ end
13
+ end
14
+ end
@@ -1,5 +1,4 @@
1
1
  require 'test_helper'
2
- require 'gravatarify/helper'
3
2
 
4
3
  class GravatarifyHelpersTest < Test::Unit::TestCase
5
4
  include Gravatarify::Helper
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gravatarify
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 5
4
5
  prerelease: false
5
6
  segments:
6
7
  - 2
8
+ - 2
7
9
  - 1
8
- - 0
9
- version: 2.1.0
10
+ version: 2.2.1
10
11
  platform: ruby
11
12
  authors:
12
13
  - Lukas Westermann
@@ -14,16 +15,18 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-03-09 00:00:00 +01:00
18
+ date: 2010-08-30 00:00:00 +02:00
18
19
  default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
22
  name: shoulda
22
23
  prerelease: false
23
24
  requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
24
26
  requirements:
25
27
  - - ">="
26
28
  - !ruby/object:Gem::Version
29
+ hash: 35
27
30
  segments:
28
31
  - 2
29
32
  - 10
@@ -35,9 +38,11 @@ dependencies:
35
38
  name: rr
36
39
  prerelease: false
37
40
  requirement: &id002 !ruby/object:Gem::Requirement
41
+ none: false
38
42
  requirements:
39
43
  - - ">="
40
44
  - !ruby/object:Gem::Version
45
+ hash: 61
41
46
  segments:
42
47
  - 0
43
48
  - 10
@@ -49,9 +54,11 @@ dependencies:
49
54
  name: activesupport
50
55
  prerelease: false
51
56
  requirement: &id003 !ruby/object:Gem::Requirement
57
+ none: false
52
58
  requirements:
53
59
  - - ">="
54
60
  - !ruby/object:Gem::Version
61
+ hash: 9
55
62
  segments:
56
63
  - 2
57
64
  - 3
@@ -76,12 +83,12 @@ files:
76
83
  - LICENSE
77
84
  - README.md
78
85
  - Rakefile
79
- - gravatarify.gemspec
86
+ - init.rb
80
87
  - lib/gravatarify.rb
81
88
  - lib/gravatarify/base.rb
82
89
  - lib/gravatarify/helper.rb
90
+ - lib/gravatarify/railtie.rb
83
91
  - lib/gravatarify/utils.rb
84
- - rails/init.rb
85
92
  - test/benchmark/benchmark.rb
86
93
  - test/test_helper.rb
87
94
  - test/unit/gravatarify_base_test.rb
@@ -98,23 +105,27 @@ rdoc_options:
98
105
  require_paths:
99
106
  - lib
100
107
  required_ruby_version: !ruby/object:Gem::Requirement
108
+ none: false
101
109
  requirements:
102
110
  - - ">="
103
111
  - !ruby/object:Gem::Version
112
+ hash: 3
104
113
  segments:
105
114
  - 0
106
115
  version: "0"
107
116
  required_rubygems_version: !ruby/object:Gem::Requirement
117
+ none: false
108
118
  requirements:
109
119
  - - ">="
110
120
  - !ruby/object:Gem::Version
121
+ hash: 3
111
122
  segments:
112
123
  - 0
113
124
  version: "0"
114
125
  requirements: []
115
126
 
116
127
  rubyforge_project:
117
- rubygems_version: 1.3.6
128
+ rubygems_version: 1.3.7
118
129
  signing_key:
119
130
  specification_version: 3
120
131
  summary: Awesome gravatar support for Ruby (and Rails).
@@ -1,73 +0,0 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
- # -*- encoding: utf-8 -*-
5
-
6
- Gem::Specification.new do |s|
7
- s.name = %q{gravatarify}
8
- s.version = "2.1.0"
9
-
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Lukas Westermann"]
12
- s.date = %q{2010-03-09}
13
- s.description = %q{Awesome gravatar support for Ruby (and Rails) -
14
- with unique options like Proc's for default images,
15
- support for gravatar.com's multiple host names, ability to
16
- define reusable styles and much more...}
17
- s.email = %q{lukas.westermann@gmail.com}
18
- s.extra_rdoc_files = [
19
- "README.md"
20
- ]
21
- s.files = [
22
- ".gitignore",
23
- "LICENSE",
24
- "README.md",
25
- "Rakefile",
26
- "gravatarify.gemspec",
27
- "lib/gravatarify.rb",
28
- "lib/gravatarify/base.rb",
29
- "lib/gravatarify/helper.rb",
30
- "lib/gravatarify/utils.rb",
31
- "rails/init.rb",
32
- "test/benchmark/benchmark.rb",
33
- "test/test_helper.rb",
34
- "test/unit/gravatarify_base_test.rb",
35
- "test/unit/gravatarify_helper_test.rb",
36
- "test/unit/gravatarify_styles_test.rb",
37
- "test/unit/gravatarify_subdomain_test.rb"
38
- ]
39
- s.homepage = %q{http://github.com/lwe/gravatarify}
40
- s.licenses = ["LICENSE"]
41
- s.rdoc_options = ["--charset=UTF-8"]
42
- s.require_paths = ["lib"]
43
- s.rubygems_version = %q{1.3.6}
44
- s.summary = %q{Awesome gravatar support for Ruby (and Rails).}
45
- s.test_files = [
46
- "test/benchmark/benchmark.rb",
47
- "test/test_helper.rb",
48
- "test/unit/gravatarify_base_test.rb",
49
- "test/unit/gravatarify_helper_test.rb",
50
- "test/unit/gravatarify_styles_test.rb",
51
- "test/unit/gravatarify_subdomain_test.rb"
52
- ]
53
-
54
- if s.respond_to? :specification_version then
55
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
56
- s.specification_version = 3
57
-
58
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
59
- s.add_development_dependency(%q<shoulda>, [">= 2.10.2"])
60
- s.add_development_dependency(%q<rr>, [">= 0.10.5"])
61
- s.add_development_dependency(%q<activesupport>, [">= 2.3.5"])
62
- else
63
- s.add_dependency(%q<shoulda>, [">= 2.10.2"])
64
- s.add_dependency(%q<rr>, [">= 0.10.5"])
65
- s.add_dependency(%q<activesupport>, [">= 2.3.5"])
66
- end
67
- else
68
- s.add_dependency(%q<shoulda>, [">= 2.10.2"])
69
- s.add_dependency(%q<rr>, [">= 0.10.5"])
70
- s.add_dependency(%q<activesupport>, [">= 2.3.5"])
71
- end
72
- end
73
-
@@ -1,4 +0,0 @@
1
- require 'gravatarify'
2
-
3
- # include view helpers only if ActionView is available
4
- ActionView::Base.send(:include, Gravatarify::Helper) if defined?(ActionView)