Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

removing unused generated files, and conditional rails 2 checks

  • Loading branch information...
commit 8bc766a005ef1fc750d54fd6574f58981265c38e 1 parent d05b820
@webandy webandy authored
View
49 generators/abingo_migration/abingo_migration_generator.rb
@@ -1,39 +1,24 @@
-if Rails::VERSION::MAJOR == 2
- class AbingoMigrationGenerator < Rails::Generator::Base
- def manifest
- record do |m|
- m.migration_template 'abingo_migration.rb', 'db/migrate',
- :assigns => {:version => Abingo.MAJOR_VERSION.gsub(".", "")}
- end
- end
-
- def file_name
- "abingo_migration_#{Abingo.MAJOR_VERSION.gsub(".", "_")}"
- end
- end
-else
- require 'rails/generators'
- require 'rails/generators/active_record'
- class AbingoMigrationGenerator < Rails::Generators::Base
- include Rails::Generators::Migration
+require 'rails/generators'
+require 'rails/generators/active_record'
+class AbingoMigrationGenerator < Rails::Generators::Base
+ include Rails::Generators::Migration
- source_root File.expand_path('../templates', __FILE__)
+ source_root File.expand_path('../templates', __FILE__)
- def self.next_migration_number(dirname) #:nodoc:
- next_migration_number = current_migration_number(dirname) + 1
- if ActiveRecord::Base.timestamped_migrations
- [Time.now.utc.strftime("%Y%m%d%H%M%S"), "%.14d" % next_migration_number].max
- else
- "%.3d" % next_migration_number
- end
+ def self.next_migration_number(dirname) #:nodoc:
+ next_migration_number = current_migration_number(dirname) + 1
+ if ActiveRecord::Base.timestamped_migrations
+ [Time.now.utc.strftime("%Y%m%d%H%M%S"), "%.14d" % next_migration_number].max
+ else
+ "%.3d" % next_migration_number
end
+ end
- def version
- Abingo.MAJOR_VERSION.gsub(".", "")
- end
+ def version
+ Abingo.MAJOR_VERSION.gsub(".", "")
+ end
- def copy_migration
- migration_template 'abingo_migration.rb', "db/migrate/abingo_migration#{version}"
- end
+ def copy_migration
+ migration_template 'abingo_migration.rb', "db/migrate/abingo_migration#{version}"
end
end
View
5 init.rb
@@ -1,8 +1,5 @@
require File.dirname(__FILE__) + '/lib/abingo'
-if Rails::VERSION::MAJOR >= 3
- require File.dirname(__FILE__) + '/generators/abingo_migration/abingo_migration_generator.rb'
-end
+require File.dirname(__FILE__) + '/generators/abingo_migration/abingo_migration_generator.rb'
ActionController::Base.send :include, AbingoSugar
-
ActionView::Base.send :include, AbingoViewHelper
View
1  install.rb
@@ -1 +0,0 @@
-# Install hook code here
View
6 lib/abingo/controller/dashboard.rb
@@ -2,11 +2,7 @@ class Abingo
module Controller
module Dashboard
- if Rails::VERSION::MAJOR <= 2
- ActionController::Base.view_paths.unshift File.join(File.dirname(__FILE__), "../views")
- else
- ActionController::Base.prepend_view_path File.join(File.dirname(__FILE__), "../views")
- end
+ ActionController::Base.prepend_view_path File.join(File.dirname(__FILE__), "../views")
def index
@experiments = Abingo::Experiment.all
View
11 strip.rb
@@ -1,11 +0,0 @@
-require 'find'
-require 'fileutils'
-def find_and_delete(path, pattern)
- Find.find(path) do |f|
- if !File.file?(f) and f[pattern]
- FileUtils.rm_rf(f)
- end
- end
-end
-# print all the ruby files
-find_and_delete(".", /\.svn$/)
View
1  uninstall.rb
@@ -1 +0,0 @@
-# Uninstall hook code here
Please sign in to comment.
Something went wrong with that request. Please try again.