Sha256: 7fcb7d9ba39ea525921a3505627fd9c3a65f73ee8d1d64fb192874e5cd58d21d

Contents?: true

Size: 1.63 KB

Versions: 79

Compression:

Stored size: 1.63 KB

Contents

#!/usr/bin/env ruby

ENV['RAILS_ENV'] ||= 'production'

$LOAD_PATH << File.join(File.dirname(__FILE__), '..')

require 'ruby_version_check'
Signal.trap('INT') { puts; exit }

require 'trusty_cms'
if ARGV.any? { |arg| %w(--version -v).any? { |flag| arg == flag } }
  puts "TrustyCms #{TrustyCms::VERSION}"
  exit 0
end

app_path = ARGV.first

require 'rails_generator'
require 'rails_generator/scripts/generate'

class Rails::Generator::Base
  def self.use_application_sources!
    reset_sources
    sources << Rails::Generator::PathSource.new(:builtin, "#{File.dirname(__FILE__)}/../lib/generators")
  end

  def add_general_options!(opt)
    opt.separator ''
    opt.separator 'TrustyCms Info:'
    opt.on('-v', '--version', 'Show the TrustyCms version number and quit.')
    opt.on('-h', '--help', 'Show this help message and quit.') { |v| options[:help] = v }

    opt.separator ''
    opt.separator 'General Options:'

    opt.on('-p', '--pretend', 'Run but do not make any changes.') { |v| options[:pretend] = v }
    opt.on('-f', '--force', 'Overwrite files that already exist.') { options[:collision] = :force }
    opt.on('-s', '--skip', 'Skip files that already exist.') { options[:collision] = :skip }
    opt.on('-q', '--quiet', 'Suppress normal output.') { |v| options[:quiet] = v }
    opt.on('-t', '--backtrace', 'Debugging: show backtrace on errors.') { |v| options[:backtrace] = v }
    opt.on('-c', '--svn', 'Modify files with subversion. (Note: svn must be in path)') do
      options[:svn] = `svn status`.inject({}) do |opt, e|
        opt[e.chomp[7..-1]] = true
        opt
      end
    end
  end
end

Rails::Generators.invoke('trusty_cms', [ARGV])

Version data entries

79 entries across 79 versions & 1 rubygems

Version Path
trusty-cms-5.0.1 bin/trusty_cms
trusty-cms-4.3.5 bin/trusty_cms
trusty-cms-5.0.0 bin/trusty_cms
trusty-cms-4.3.4 bin/trusty_cms
trusty-cms-4.3.3 bin/trusty_cms
trusty-cms-4.3.2 bin/trusty_cms
trusty-cms-4.3.1 bin/trusty_cms
trusty-cms-4.3 bin/trusty_cms
trusty-cms-4.2.3 bin/trusty_cms
trusty-cms-4.2.2 bin/trusty_cms
trusty-cms-4.2.1 bin/trusty_cms
trusty-cms-4.2 bin/trusty_cms
trusty-cms-4.1.9 bin/trusty_cms
trusty-cms-4.1.8 bin/trusty_cms
trusty-cms-4.1.7 bin/trusty_cms
trusty-cms-4.1.6 bin/trusty_cms
trusty-cms-4.1.5 bin/trusty_cms
trusty-cms-4.1.4 bin/trusty_cms
trusty-cms-4.1.3 bin/trusty_cms