Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bundler-generated gem build infrastructure #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
*.gem
*.rbc
.bundle
.config
.yardoc
Gemfile.lock
InstalledFiles
_yardoc
coverage
doc/
lib/bundler/man
pkg
rdoc
spec/reports
test/tmp
test/version_tmp
tmp
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source 'http://rubygems.org'

# Specify your gem's dependencies in radiant-stereotype-extension.gemspec
gemspec
31 changes: 20 additions & 11 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/usr/bin/env rake
# -*- encoding: utf-8 -*-
require "bundler/gem_tasks"

# I think this is the one that should be moved to the extension Rakefile template

# In rails 1.2, plugins aren't available in the path until they're loaded.
Expand All @@ -7,28 +11,33 @@
# Determine where the RSpec plugin is by loading the boot
unless defined? RADIANT_ROOT
ENV["RAILS_ENV"] = "test"
case
when ENV["RADIANT_ENV_FILE"]
require File.dirname(ENV["RADIANT_ENV_FILE"]) + "/boot"
when File.dirname(__FILE__) =~ %r{vendor/radiant/vendor/extensions}
require "#{File.expand_path(File.dirname(__FILE__) + "/../../../../../")}/config/boot"
boot = if ENV["RADIANT_ENV_FILE"]
File.dirname(ENV["RADIANT_ENV_FILE"]) + "/boot"
elsif File.dirname(__FILE__) =~ %r{vendor/radiant/vendor/extensions}
"#{File.expand_path(File.dirname(__FILE__) + "/../../../../../")}/config/boot"
else
require "#{File.expand_path(File.dirname(__FILE__) + "/../../../")}/config/boot"
"#{File.expand_path(File.dirname(__FILE__) + "/../../../")}/config/boot"
end
begin
require boot
rescue LoadError => e
warn "Can’t boot radiant, #{e.message}"
end
end

require 'rake'
require 'rake/rdoctask'
require 'rake/testtask'

rspec_base = File.expand_path(RADIANT_ROOT + '/vendor/plugins/rspec/lib')
$LOAD_PATH.unshift(rspec_base) if File.exist?(rspec_base)
if defined? RADIANT_ROOT
rspec_base = File.expand_path(RADIANT_ROOT + '/vendor/plugins/rspec/lib')
$LOAD_PATH.unshift(rspec_base) if File.exist?(rspec_base)
# Cleanup the RADIANT_ROOT constant so specs will load the environment
Object.send(:remove_const, :RADIANT_ROOT)
end
require 'spec/rake/spectask'
# require 'spec/translator'

# Cleanup the RADIANT_ROOT constant so specs will load the environment
Object.send(:remove_const, :RADIANT_ROOT)

extension_root = File.expand_path(File.dirname(__FILE__))

task :default => :spec
Expand Down
9 changes: 9 additions & 0 deletions lib/radiant-stereotype-extension.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
require "radiant-stereotype-extension/version"

module Radiant
module Stereotype
module Extension
# Your code goes here...
end
end
end
7 changes: 7 additions & 0 deletions lib/radiant-stereotype-extension/version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module Radiant
module Stereotype
module Extension
VERSION = '0.9'
end
end
end
17 changes: 17 additions & 0 deletions radiant-stereotype-extension.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# -*- encoding: utf-8 -*-
require File.expand_path('../lib/radiant-stereotype-extension/version', __FILE__)

Gem::Specification.new do |gem|
gem.authors = ['Cristi Duma', 'Istvan Hoka']
gem.email = ['[email protected]']
gem.description = %q{Allows you to write code that determines default page types, layouts, filters etc. for newly created pages}
gem.summary = %q{Extension that adds templating support to Radiant CMS}
gem.homepage = "http://blog.aissac.ro/radiant/stereotype-extension/"

gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
gem.files = `git ls-files`.split("\n")
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
gem.name = "radiant-stereotype-extension"
gem.require_paths = ["lib"]
gem.version = Radiant::Stereotype::Extension::VERSION
end
3 changes: 2 additions & 1 deletion stereotype_extension.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
require_dependency 'application_controller'
require 'radiant-stereotype-extension/version'

class StereotypeExtension < Radiant::Extension
version "0.9" # this version is compatible with Radiant 0.9
version Radiant::Stereotype::Extension::VERSION
description "Define templates for Pages' children in Radiant CMS."
url "http://blog.aissac.ro/radiant/stereotype-extension/"

Expand Down