Class: UserAnnouncements::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- UserAnnouncements::Generators::InstallGenerator
- Extended by:
- ActiveRecord::Generators::Migration
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/user_announcements/install_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.next_migration_number(path) ⇒ Object
31 32 33 34 35 36 37 38 |
# File 'lib/generators/user_announcements/install_generator.rb', line 31 def self.next_migration_number(path) unless @prev_migration_nr @prev_migration_nr = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i else @prev_migration_nr += 1 end @prev_migration_nr.to_s end |
Instance Method Details
#copy_bootstrap_datetime_picker_assets ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/generators/user_announcements/install_generator.rb', line 22 def copy_bootstrap_datetime_picker_assets return if .readme? unless .no_bootstrap? || .no_bootstrap_dtp? copy_file 'app/assets/javascripts/user_announcements/bootstrap-datetimepicker.min.js' copy_file 'app/assets/stylesheets/user_announcements/bootstrap-datetimepicker.min.css' end end |
#install_base_files ⇒ Object
40 41 42 43 44 45 46 |
# File 'lib/generators/user_announcements/install_generator.rb', line 40 def install_base_files return if .readme? copy_file 'app/assets/stylesheets/user_announcements/user_announcements.css.scss' template 'config/initializers/user_announcements.rb' migration_template "migration.rb", "db/migrate/create_user_announcement_tables.rb" end |
#show_readme ⇒ Object
48 49 50 51 52 |
# File 'lib/generators/user_announcements/install_generator.rb', line 48 def show_readme if behavior == :invoke readme "README" end end |