<commit_before>#lib/generators/gemname/install_generator.rb
require 'rails/generators'
require File.expand_path('../template_generator', __FILE__) 

module TemplatorChabz
  module Generators
    class InstallGenerator < Rails::Generators::Base
      desc "Install TemplatorChabz"
      class_option :framework, :type => :string, :default => "foundation", 
        :desc => "Specify Front-End framework"
      class_option :haml, :type => :boolean
      class_option :fluid, :type => :boolean
      class_option :fixed, :type => :boolean

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

      def install
        say "Hello, Templator Chabz will help you set up your template"
        installed_gems = Gem::Specification.map { |g| g.name }
        if options[:framework] == "bootstrap"
          unless installed_gems.include?("twitter-bootstrap-rails")
            say "Adding bootstrap-rails gem to your Gemfile:"
            append_file "Gemfile", "\n", :force => true
            gem 'less-rails'
            gem 'twitter-bootstrap-rails', git: 'git://github.com/seyhunak/twitter-bootstrap-rails.git'
            begin
              Bundler.with_clean_env do
                run "bundle install"
                run "rails g bootstrap:install"
              end
            rescue RuntimeError => e
              raise "There was an error occurred", e.message
            end
          end
          say "Installing Bootstrap..."
        elsif options[:framework] == "foundation"
          unless installed_gems.include?("zurb-foundation")
            say "Adding foundation-rails gem to your Gemfile:"
            append_file "Gemfile", "\n", :force => true
            gem 'zurb-foundation'
            say "Installing Foundation..."
            begin
              Bundler.with_clean_env do<commit_msg>fix bug<commit_after>#lib/generators/gemname/install_generator.rb
require 'rails/generators'
require File.expand_path('../template_generator', __FILE__) 

module TemplatorChabz
  module Generators
    class InstallGenerator < Rails::Generators::Base
      desc "Install TemplatorChabz"
      class_option :framework, :type => :string, :default => "foundation", 
        :desc => "Specify Front-End framework"
      class_option :haml, :type => :boolean
      class_option :fluid, :type => :boolean
      class_option :fixed, :type => :boolean

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

      def install
        say "Hello, Templator Chabz will help you set up your template"
        installed_gems = Gem::Specification.map { |g| g.name }
        if options[:framework] == "bootstrap"
          unless installed_gems.include?("twitter-bootstrap-rails")
            say "Adding bootstrap-rails gem to your Gemfile:"
            append_file "Gemfile", "\n", :force => true
            gem 'therubyracer' if installed_gems.include?("therubyracer")
            gem 'less-rails' if installed_gems.include?("less-rails")
            gem 'twitter-bootstrap-rails', git: 'git://github.com/seyhunak/twitter-bootstrap-rails.git'
            begin
              Bundler.with_clean_env do
                run "bundle install"
                run "rails g bootstrap:install"
              end
            rescue RuntimeError => e
              raise "There was an error occurred", e.message
            end
          end
          say "Installing Bootstrap..."
        elsif options[:framework] == "foundation"
          unless installed_gems.include?("zurb-foundation")
            say "Adding foundation-rails gem to your Gemfile:"
            append_file "Gemfile", "\n", :force => true
            gem 'zurb-foundation'
            say "Installing Foundation..."
            begin
              Bundler.with_clean_env do
{'fraction_non_alphanumeric': 0.10418290465055859, 'fraction_numerical': 0.0, 'mean_word_length': 2.287788215200683, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5758503', 'n_tokens_mistral': 1073, 'n_tokens_neox': 1027, 'n_words': 276}