acts_as_linkable 0.0.1 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ gem 'da_huangs_ruby_extensions'
2
+
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2010 [name of plugin creator]
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/Rakefile CHANGED
@@ -1,58 +1,62 @@
1
+ require 'rubygems'
1
2
  require 'rake'
2
- require 'rake/testtask'
3
- require 'rake/rdoctask'
4
-
5
- VERSION = "0.0.1"
6
3
 
7
- desc 'Default: run unit tests.'
8
- task :default => :test
9
-
10
- desc 'Test the anaf_habtm plugin.'
11
- Rake::TestTask.new(:test) do |t|
12
- t.libs << 'lib'
13
- t.libs << 'test'
14
- t.pattern = 'test/**/*_test.rb'
15
- t.verbose = true
4
+ begin
5
+ require 'jeweler'
6
+ Jeweler::Tasks.new do |gem|
7
+ gem.name = "acts_as_linkable"
8
+ gem.summary = "Includes ability to just say link() for active records"
9
+ gem.description = <<END
10
+ Expects ActiveRecord models to call
11
+ acts_as_linkable :name => :link_name_method, :title => :link_title
12
+ the arguments should be methods on the class.
13
+
14
+ Once done you can just call link(Object) or link(Array) and it's all
15
+ taken care of.
16
+ END
17
+ gem.email = "tgannon@gmail.com"
18
+ gem.homepage = "http://github.com/tylergannon/acts_as_linkable"
19
+ gem.authors = ["Tyler Gannon"]
20
+ gem.add_development_dependency "thoughtbot-shoulda", ">= 0"
21
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
22
+ gem.files = FileList['lib/**/*.rb', 'test/**/*', 'rails/*.rb', 'Gemfile', 'MIT-LICENSE', 'Rakefile', 'README', 'VERSION'].to_a
23
+ end
24
+ Jeweler::GemcutterTasks.new
25
+ rescue LoadError
26
+ puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
16
27
  end
17
28
 
18
- desc 'Generate documentation for the anaf_habtm plugin.'
19
- Rake::RDocTask.new(:rdoc) do |rdoc|
20
- rdoc.rdoc_dir = 'rdoc'
21
- rdoc.title = 'AnafHabtm'
22
- rdoc.options << '--line-numbers' << '--inline-source'
23
- rdoc.rdoc_files.include('README')
24
- rdoc.rdoc_files.include('lib/**/*.rb')
29
+ require 'rake/testtask'
30
+ Rake::TestTask.new(:test) do |test|
31
+ test.libs << 'lib' << 'test'
32
+ test.pattern = 'test/**/test_*.rb'
33
+ test.verbose = true
25
34
  end
26
- PKG_FILES = FileList[
27
- 'acts_as_linkable.gemspec',
28
- 'Gemfile',
29
- 'install.rb',
30
- 'Rakefile', 'README', 'uninstall.rb',
31
- 'lib/**/*',
32
- 'rails/**/*',
33
- 'test/**/*'
34
- ]
35
35
 
36
36
  begin
37
- require 'jeweler'
38
- Jeweler::Tasks.new do |s|
39
- s.name = "acts_as_linkable"
40
- s.version = VERSION
41
- s.author = "Tyler Gannon"
42
- s.email = "t--g__a--nnon@gmail.com"
43
- s.homepage = "http://github.com/tylergannon/acts_as_linkable"
44
- s.platform = Gem::Platform::RUBY
45
- s.description = "Helper methods for defining link characteristics on objects."
46
- s.summary = "Acts As Linkable helper methods."
47
- s.files = PKG_FILES.to_a
48
- s.require_path = "lib"
49
- s.has_rdoc = false
50
- s.extra_rdoc_files = ["README"]
51
-
37
+ require 'rcov/rcovtask'
38
+ Rcov::RcovTask.new do |test|
39
+ test.libs << 'test'
40
+ test.pattern = 'test/**/test_*.rb'
41
+ test.verbose = true
52
42
  end
53
43
  rescue LoadError
54
- puts "Jeweler not available. Install it with: gem install jeweler"
44
+ task :rcov do
45
+ abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
46
+ end
55
47
  end
56
48
 
49
+ task :test => :check_dependencies
50
+
51
+ task :default => :test
57
52
 
53
+ require 'rake/rdoctask'
54
+ Rake::RDocTask.new do |rdoc|
55
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
56
+
57
+ rdoc.rdoc_dir = 'rdoc'
58
+ rdoc.title = "acts_as_linkable #{version}"
59
+ rdoc.rdoc_files.include('README*')
60
+ rdoc.rdoc_files.include('lib/**/*.rb')
61
+ end
58
62
 
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.3
@@ -4,12 +4,12 @@ module ActsAsLinkable
4
4
  class_eval "def link_attr; #{opts.inspect}; end;"
5
5
  end
6
6
  end
7
-
7
+
8
8
  module ActionViewExtensions
9
9
  def link(obj)
10
10
  return unless obj
11
11
  if (obj.class == Array) || (obj.class == ActiveRecord::Relation)
12
- obj.map{|v| link(v)}.join(", ")
12
+ obj.map{|v| link(v)}.to_sentence
13
13
  else
14
14
  p = obj.link_attr
15
15
  p[:partial] = "#{obj.class.name.tableize}/link" if p.empty?
@@ -29,3 +29,4 @@ module ActsAsLinkable
29
29
  end
30
30
  end
31
31
  end
32
+
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_as_linkable
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Tyler Gannon
@@ -15,12 +15,25 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-07-11 00:00:00 -07:00
18
+ date: 2010-07-15 00:00:00 -07:00
19
19
  default_executable:
20
- dependencies: []
21
-
22
- description: Helper methods for defining link characteristics on objects.
23
- email: t--g__a--nnon@gmail.com
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: thoughtbot-shoulda
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 3
30
+ segments:
31
+ - 0
32
+ version: "0"
33
+ type: :development
34
+ version_requirements: *id001
35
+ description: " Expects ActiveRecord models to call\n acts_as_linkable :name => :link_name_method, :title => :link_title\n the arguments should be methods on the class.\n\n Once done you can just call link(Object) or link(Array) and it's all\n taken care of.\n"
36
+ email: tgannon@gmail.com
24
37
  executables: []
25
38
 
26
39
  extensions: []
@@ -28,16 +41,16 @@ extensions: []
28
41
  extra_rdoc_files:
29
42
  - README
30
43
  files:
44
+ - Gemfile
45
+ - MIT-LICENSE
31
46
  - README
32
47
  - Rakefile
33
- - acts_as_linkable.gemspec
34
- - install.rb
48
+ - VERSION
35
49
  - lib/acts_as_linkable.rb
36
50
  - lib/acts_as_linkable_core.rb
37
51
  - rails/init.rb
38
52
  - test/acts_as_linkable_test.rb
39
53
  - test/test_helper.rb
40
- - uninstall.rb
41
54
  has_rdoc: true
42
55
  homepage: http://github.com/tylergannon/acts_as_linkable
43
56
  licenses: []
@@ -71,6 +84,7 @@ rubyforge_project:
71
84
  rubygems_version: 1.3.7
72
85
  signing_key:
73
86
  specification_version: 3
74
- summary: Acts As Linkable helper methods.
75
- test_files: []
76
-
87
+ summary: Includes ability to just say link() for active records
88
+ test_files:
89
+ - test/acts_as_linkable_test.rb
90
+ - test/test_helper.rb
@@ -1,46 +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{acts_as_linkable}
8
- s.version = "0.0.1"
9
-
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Tyler Gannon"]
12
- s.date = %q{2010-07-11}
13
- s.description = %q{Helper methods for defining link characteristics on objects.}
14
- s.email = %q{t--g__a--nnon@gmail.com}
15
- s.extra_rdoc_files = [
16
- "README"
17
- ]
18
- s.files = [
19
- "README",
20
- "Rakefile",
21
- "acts_as_linkable.gemspec",
22
- "install.rb",
23
- "lib/acts_as_linkable.rb",
24
- "lib/acts_as_linkable_core.rb",
25
- "rails/init.rb",
26
- "test/acts_as_linkable_test.rb",
27
- "test/test_helper.rb",
28
- "uninstall.rb"
29
- ]
30
- s.homepage = %q{http://github.com/tylergannon/acts_as_linkable}
31
- s.rdoc_options = ["--charset=UTF-8"]
32
- s.require_paths = ["lib"]
33
- s.rubygems_version = %q{1.3.7}
34
- s.summary = %q{Acts As Linkable helper methods.}
35
-
36
- if s.respond_to? :specification_version then
37
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
38
- s.specification_version = 3
39
-
40
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
41
- else
42
- end
43
- else
44
- end
45
- end
46
-
data/install.rb DELETED
@@ -1 +0,0 @@
1
- # Install hook code here
data/uninstall.rb DELETED
@@ -1 +0,0 @@
1
- # Uninstall hook code here