Sha256: 4096c50b2c1f40246fe667d76451e7b039ef2740d7733e7ddafc2beacef5fa80

Contents?: true

Size: 1.15 KB

Versions: 12

Compression:

Stored size: 1.15 KB

Contents

module Lopata
  module Generators
    class App < Thor::Group
      include Thor::Actions
      argument :name

      def self.source_root
        File.join(File.dirname(__FILE__), 'templates')
      end

      def create_root_files
        template 'Lopatafile', "#{name}/Lopatafile"
        template 'Gemfile', "#{name}/Gemfile"
        template '.rspec', "#{name}/.rspec"
        template 'config/environments/qa.yml', "#{name}/config/environments/qa.yml"
        template 'config/initializers/capybara.rb', "#{name}/config/initializers/capybara.rb"
      end

      def init_dirs
        %w{models services pages}.each do |dir|
          empty_directory "#{name}/app/#{dir}"
        end

        %w{spec config/initializers}.each do |dir|
          empty_directory "#{name}/#{dir}"
        end
      end

      def bundle
        Dir.chdir name do
          _bundle_command = Gem.bin_path('bundler', 'bundle')

          require 'bundler'
          Bundler.with_clean_env do
            output = `"#{Gem.ruby}" "#{_bundle_command}"`
            print output # unless options[:quiet]
          end
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
lopata-0.0.16 lib/lopata/generators/app.rb
lopata-0.0.15 lib/lopata/generators/app.rb
lopata-0.0.14 lib/lopata/generators/app.rb
lopata-0.0.13 lib/lopata/generators/app.rb
lopata-0.0.12 lib/lopata/generators/app.rb
lopata-0.0.11 lib/lopata/generators/app.rb
lopata-0.0.10 lib/lopata/generators/app.rb
lopata-0.0.9 lib/lopata/generators/app.rb
lopata-0.0.8 lib/lopata/generators/app.rb
lopata-0.0.7 lib/lopata/generators/app.rb
lopata-0.0.6 lib/lopata/generators/app.rb
lopata-0.0.5 lib/lopata/generators/app.rb