Browse files

Fix for already initialized constant (rails3) and rails/init.rb [GH-328]

  • Loading branch information...
1 parent 7b5ed06 commit a35c7a53c954d2a69ef671a721d1301ff9af3337 @yabawock yabawock committed Aug 6, 2010
Showing with 13 additions and 9 deletions.
  1. +1 −1 Rakefile
  2. +6 −3 formtastic.gemspec
  3. +5 −1 init.rb
  4. +1 −4 rails/init.rb
View
2 Rakefile
@@ -55,7 +55,7 @@ begin
s.post_install_message = INSTALL_MESSAGE
s.require_path = 'lib'
- s.files = %w(MIT-LICENSE README.textile Rakefile) + Dir.glob("{rails,lib,generators,spec}/**/*")
+ s.files = %w(MIT-LICENSE README.textile Rakefile init.rb) + Dir.glob("{rails,lib,generators,spec}/**/*")
# Runtime dependencies: When installing Formtastic these will be checked if they are installed.
# Will be offered to install these if they are not already installed.
View
9 formtastic.gemspec
@@ -9,7 +9,7 @@ Gem::Specification.new do |s|
s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
s.authors = ["Justin French"]
- s.date = %q{2010-08-01}
+ s.date = %q{2010-08-06}
s.description = %q{A Rails form builder plugin/gem with semantically rich and accessible markup}
s.email = %q{justin@indent.com.au}
s.extra_rdoc_files = [
@@ -28,6 +28,7 @@ Gem::Specification.new do |s|
"generators/formtastic/templates/formtastic.rb",
"generators/formtastic/templates/formtastic_changes.css",
"generators/formtastic_stylesheets/formtastic_stylesheets_generator.rb",
+ "init.rb",
"lib/formtastic.rb",
"lib/formtastic/i18n.rb",
"lib/formtastic/layout_helper.rb",
@@ -80,10 +81,12 @@ Gem::Specification.new do |s|
------------------------------------------------------------------------
You can now (optionally) run the generator to copy some stylesheets and
a config initializer into your application:
- ./script/generate formtastic
+ rails generator formastic:install # Rails 3
+ ./script/generate formtastic # Rails 2
To generate some semantic form markup for your existing models, just run:
- ./script/generate form MODEL_NAME
+ rails generate formtastic:form MODEL_NAME # Rails 3
+ ./script/generate form MODEL_NAME # Rails 2
Find out more and get involved:
http://github.com/justinfrench/formtastic
View
6 init.rb
@@ -1 +1,5 @@
-require File.join(File.dirname(__FILE__), 'rails', 'init')
+# coding: utf-8
+require 'formtastic'
+require 'formtastic/layout_helper'
+ActionView::Base.send :include, Formtastic::SemanticFormHelper
+ActionView::Base.send :include, Formtastic::LayoutHelper
View
5 rails/init.rb
@@ -1,5 +1,2 @@
# coding: utf-8
-require File.join(File.dirname(__FILE__), *%w[.. lib formtastic])
-require File.join(File.dirname(__FILE__), *%w[.. lib formtastic layout_helper])
-ActionView::Base.send :include, Formtastic::SemanticFormHelper
-ActionView::Base.send :include, Formtastic::LayoutHelper
+require File.expand_path(File.join(File.dirname(__FILE__), "..", "init"))

0 comments on commit a35c7a5

Please sign in to comment.