Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added code needed to build a fingerrails gem out of the template, not…

… sure about it yet...
  • Loading branch information...
commit 7cc15f098e51e405d25c47df606168d0d3446583 1 parent 6be3346
@alloy alloy authored
View
16 Rakefile
@@ -1,3 +1,17 @@
+begin
+ require 'jeweler'
+ Jeweler::Tasks.new do |s|
+ s.name = "fingerrails"
+ s.summary = s.description = "A self contained version of the Fingertips Rails template"
+ s.email = "eloy@fngtps.com"
+ s.homepage = "http://github.com/Fingertips/rails-template"
+ s.authors = ["Manfred Stienstra", "Eloy Duran"]
+
+ s.require_paths = ['bin']
+ end
+rescue LoadError
+end
+
desc 'Drops the databases and removes the test app.'
task :clean do
if File.exist? 'test_app'
@@ -8,7 +22,7 @@ end
desc 'Runs the template with the proper env so that it caches the rails checkout.'
task :test_template => :clean do
- sh 'env TEST_TEMPLATE=true rails -m fingertips.rb test_app'
+ sh 'env TEST_TEMPLATE=true ruby ./bin/fingerrails test_app'
end
task :default => :test_template
View
1  VERSION
@@ -0,0 +1 @@
+0.0.1
View
9 bin/fingerrails
@@ -0,0 +1,9 @@
+#!/usr/bin/env ruby
+
+if ARGV.empty?
+ puts "Usage: #{$0} /path/to/your/app [options]"
+else
+ ENV['TEMPLATE_HOME'] = File.expand_path('../../templates', __FILE__)
+ template = File.expand_path('../../fingertips.rb', __FILE__)
+ exec 'rails', '-m', template, *ARGV
+end
View
86 fingerrails.gemspec
@@ -0,0 +1,86 @@
+# Generated by jeweler
+# DO NOT EDIT THIS FILE
+# Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
+# -*- encoding: utf-8 -*-
+
+Gem::Specification.new do |s|
+ s.name = %q{fingerrails}
+ s.version = "0.0.1"
+
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
+ s.authors = ["Manfred Stienstra", "Eloy Duran"]
+ s.date = %q{2009-10-26}
+ s.default_executable = %q{fingerrails}
+ s.description = %q{A self contained version of the Fingertips Rails template}
+ s.email = %q{eloy@fngtps.com}
+ s.executables = ["fingerrails"]
+ s.extra_rdoc_files = [
+ "README.rdoc"
+ ]
+ s.files = [
+ ".gitignore",
+ "README.rdoc",
+ "Rakefile",
+ "fingertips.rb",
+ "templates/.kick",
+ "templates/Rakefile",
+ "templates/app/controllers/application_controller.rb",
+ "templates/app/controllers/members_controller.rb",
+ "templates/app/controllers/passwords_controller.rb",
+ "templates/app/controllers/sessions_controller.rb",
+ "templates/app/helpers/application_helper.rb",
+ "templates/app/models/mailer.rb",
+ "templates/app/models/member.rb",
+ "templates/app/models/member/authentication.rb",
+ "templates/app/views/layouts/_application_javascript_includes.html.erb",
+ "templates/app/views/layouts/_head.html.erb",
+ "templates/app/views/layouts/application.html.erb",
+ "templates/app/views/mailer/reset_password_message.erb",
+ "templates/app/views/members/edit.html.erb",
+ "templates/app/views/members/new.html.erb",
+ "templates/app/views/members/show.html.erb",
+ "templates/app/views/passwords/edit.html.erb",
+ "templates/app/views/passwords/new.html.erb",
+ "templates/app/views/passwords/reset.html.erb",
+ "templates/app/views/passwords/sent.html.erb",
+ "templates/app/views/sessions/_form.html.erb",
+ "templates/app/views/sessions/_status.html.erb",
+ "templates/app/views/sessions/new.html.erb",
+ "templates/config/database.yml",
+ "templates/lib/active_record_ext.rb",
+ "templates/lib/token.rb",
+ "templates/public/403.html",
+ "templates/public/javascripts/ready.js",
+ "templates/public/stylesheets/main.css",
+ "templates/test/ext/authentication.rb",
+ "templates/test/ext/file_fixtures.rb",
+ "templates/test/ext/time.rb",
+ "templates/test/fixtures/members.yml",
+ "templates/test/functional/application_controller_test.rb",
+ "templates/test/functional/members_controller_test.rb",
+ "templates/test/functional/passwords_controller_test.rb",
+ "templates/test/functional/sessions_controller_test.rb",
+ "templates/test/lib/active_record_ext_test.rb",
+ "templates/test/lib/token_test.rb",
+ "templates/test/test_helper.rb",
+ "templates/test/unit/helpers/application_helper_test.rb",
+ "templates/test/unit/mailer_test.rb",
+ "templates/test/unit/member/authentication_test.rb",
+ "templates/test/unit/member_test.rb"
+ ]
+ s.homepage = %q{http://github.com/Fingertips/rails-template}
+ s.rdoc_options = ["--charset=UTF-8"]
+ s.require_paths = ["bin"]
+ s.rubygems_version = %q{1.3.5}
+ s.summary = %q{A self contained version of the Fingertips Rails template}
+
+ if s.respond_to? :specification_version then
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
+ s.specification_version = 3
+
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
+ else
+ end
+ else
+ end
+end
View
6 fingertips.rb
@@ -3,6 +3,9 @@
require 'fileutils'
+TEMPLATE_HOME = ENV['TEMPLATE_HOME'] ||
+ 'http://github.com/Fingertips/rails-template/raw/master/templates/'
+
class Rails::TemplateRunner
def name
File.basename(root)
@@ -13,9 +16,8 @@ def yes?(question)
answer == 'y' || answer == 'yes' || answer.empty?
end
- TEMPLATE_HOME = ENV['TEST_TEMPLATE'] ? '../templates/' : 'http://github.com/Fingertips/rails-template/raw/master/templates/'
def template_file(template)
- contents = open(TEMPLATE_HOME + template).read
+ contents = open(File.join(TEMPLATE_HOME, template)).read
contents.gsub!('{{app_name}}', name)
contents.gsub!('{{AppName}}', name.camelize)
file template, contents
Please sign in to comment.
Something went wrong with that request. Please try again.