Permalink
Browse files

initial commit

  • Loading branch information...
0 parents commit c691fe0b66e6ea17a4ad7d56ecf727d27c8526f5 @pengwynn committed Sep 25, 2011
Showing with 64 additions and 0 deletions.
  1. +4 −0 .gitignore
  2. +4 −0 Gemfile
  3. +1 −0 Rakefile
  4. +3 −0 lib/nesta-plugin-linkable.rb
  5. +23 −0 lib/nesta-plugin-linkable/init.rb
  6. +7 −0 lib/nesta-plugin-linkable/version.rb
  7. +22 −0 nesta-plugin-linkable.gemspec
@@ -0,0 +1,4 @@
+*.gem
+.bundle
+Gemfile.lock
+pkg/*
@@ -0,0 +1,4 @@
+source "http://rubygems.org"
+
+# Specify your gem's dependencies in nesta-plugin-linkable.gemspec
+gemspec
@@ -0,0 +1 @@
+require 'bundler/gem_tasks'
@@ -0,0 +1,3 @@
+require "nesta-plugin-linkable/version"
+
+Nesta::Plugin.register(__FILE__)
@@ -0,0 +1,23 @@
+module Nesta
+ module Plugin
+ module Linkable
+ module Helpers
+ def url_for(page)
+ page.is_linked? ? page.metadata('url') : super
+ end
+ end
+ end
+ end
+
+ class App
+ helpers Nesta::Plugin::Linkable::Helpers
+ end
+
+ class Page
+
+ def is_linked?
+ not self.metadata('url').nil?
+ end
+
+ end
+end
@@ -0,0 +1,7 @@
+module Nesta
+ module Plugin
+ module Linkable
+ VERSION = "0.0.1"
+ end
+ end
+end
@@ -0,0 +1,22 @@
+# -*- encoding: utf-8 -*-
+$:.push File.expand_path("../lib", __FILE__)
+require "nesta-plugin-linkable/version"
+
+Gem::Specification.new do |s|
+ s.name = "nesta-plugin-linkable"
+ s.version = Nesta::Plugin::Linkable::VERSION
+ s.authors = ["Wynn Netherland"]
+ s.email = ["wynn.netherland@gmail.com"]
+ s.homepage = ""
+ s.summary = %q{Link posts for Nesta}
+ s.description = %q{Link posts for Nesta CMS}
+
+ s.rubyforge_project = "nesta-plugin-linkable"
+
+ s.files = `git ls-files`.split("\n")
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
+ s.require_paths = ["lib"]
+ s.add_dependency("nesta", ">= 0.9.11")
+ s.add_development_dependency("rake")
+end

0 comments on commit c691fe0

Please sign in to comment.