Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

removed generators

  • Loading branch information...
commit 56ba38267d03cb3071e2d49ce8129f3306602cf9 1 parent d47ccf9
@logical42 authored
View
4 lib/badgeable/railtie.rb
@@ -4,10 +4,6 @@ module Badgeable
class Railtie < ::Rails::Railtie
include Rails::Generators
# AK - set the directory where badges description will appear
- generators do
- require "generators/badgeable/install"
- create_file "lib/badges.rb"
- end
initializer "badgeable.assign_badge_definitions_file" do
Badgeable::Config.badge_definitions = Pathname.new("#{Rails.root}/lib/badges.rb")
View
28 lib/generators/badgeable.rb
@@ -1,28 +0,0 @@
-require 'rails/generators/base'
-
-module Badgeable
- module Generators
- class Base < Rails::Generators::Base #:nodoc:
- def self.source_root
- @_badgeable_source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'badgeable', generator_name, 'templates'))
- end
-
- def self.banner
- "rails generate badgeable:#{generator_name} #{self.arguments.map{ |a| a.usage }.join(' ')} [options]"
- end
-
- private
-
- def add_gem(name, options = {})
- gemfile_content = File.read(destination_path("Gemfile"))
- File.open(destination_path("Gemfile"), 'a') { |f| f.write("\n") } unless gemfile_content =~ /\n\Z/
- gem name, options unless gemfile_content.include? name
- end
-
- def print_usage
- self.class.help(Thor::Base.shell.new)
- exit
- end
- end
- end
-end
View
19 lib/generators/badgeable/install/install_generator.rb
@@ -1,19 +0,0 @@
-require 'generators/badgeable'
-require 'rails/generators'
-require 'rails/generators/migration'
-
-module Badgeable
- module Generators
- class VoteGenerator < Base
- include Rails::Generators::Migration
- argument :user_model, :type => :string, :default => 'user', :banner => 'user_name'
- def create_badge_models
- create_file "lib/badges.rb"
- generate("migration", "Badge name:string description:text icon:string")
- generate("migration", "Badging badgeable_id:integer badgeable_type:string badge_id:integer")
-
- end
-
- end
- end
-end
View
22 lib/generators/templates/badge.rb
@@ -1,22 +0,0 @@
-# class BadgeCreate<%= table_name.camelize %> < ActiveRecord::Migration
-# def self.up
-# create_table(:<%= table_name %>) do |t|
-# t.name :string
-#
-# <% for attribute in attributes -%>
-# t.<%= attribute.type %> :<%= attribute.name %>
-# <% end -%>
-#
-# t.timestamps
-# end
-#
-# add_index :<%= table_name %>, :email, :unique => true
-# add_index :<%= table_name %>, :reset_password_token, :unique => true
-# # add_index :<%= table_name %>, :confirmation_token, :unique => true
-# # add_index :<%= table_name %>, :unlock_token, :unique => true
-# end
-#
-# def self.down
-# drop_table :<%= table_name %>
-# end
-# end
View
29 lib/generators/templates/badging.rb
@@ -1,29 +0,0 @@
-# class DeviseCreate<%= table_name.camelize %> < ActiveRecord::Migration
-# def self.up
-# create_table(:<%= table_name %>) do |t|
-# t.database_authenticatable :null => false
-# t.recoverable
-# t.rememberable
-# t.trackable
-#
-# # t.confirmable
-# # t.lockable :lock_strategy => :<%= Devise.lock_strategy %>, :unlock_strategy => :<%= Devise.unlock_strategy %>
-# # t.token_authenticatable
-#
-# <% for attribute in attributes -%>
-# t.<%= attribute.type %> :<%= attribute.name %>
-# <% end -%>
-#
-# t.timestamps
-# end
-#
-# add_index :<%= table_name %>, :email, :unique => true
-# add_index :<%= table_name %>, :reset_password_token, :unique => true
-# # add_index :<%= table_name %>, :confirmation_token, :unique => true
-# # add_index :<%= table_name %>, :unlock_token, :unique => true
-# end
-#
-# def self.down
-# drop_table :<%= table_name %>
-# end
-# end
Please sign in to comment.
Something went wrong with that request. Please try again.