<commit_before>def current_directory
  @current_directory ||=
      if __FILE__ =~ %r{\Ahttps?://}
        tempdir = Dir.mktmpdir("maestrano-connector-rails-")
        at_exit { FileUtils.remove_entry(tempdir) }
        git :clone => "--quiet https://github.com/berardpi/maestrano-connector-rails/tree/include-frontend #{tempdir}"

        "#{tempdir}/template"
      else
        File.expand_path(File.dirname(__FILE__))
      end
end

# def current_directory
#   File.expand_path(File.dirname(__FILE__))
# end

# Add the current directory to the path Thor uses
# to look up files
def source_paths
  Array(super) + [current_directory]
end

#
# Rebuild the Gemfile from scratch
#
remove_file 'Gemfile'
run 'touch Gemfile'

add_source 'https://rubygems.org'

gem 'rails', '4.2.4'
gem 'turbolinks'
gem 'jquery-rails'
gem 'puma'
gem 'figaro'
gem 'tzinfo-data', platforms: [:mingw, :mswin, :jruby]

gem 'maestrano-connector-rails'

gem 'sqlite3'

gem_group :test do
  gem 'simplecov'
  gem 'rspec-rails'
  gem 'factory_girl_rails'
  gem 'shoulda-matchers'
  gem 'timecop'
end

remove_file '.gitignore'
copy_file 'gitignore', '.gitignore'


#
# Cleanup
#
after_bundle do
  remove_dir 'app/mailers'
  remove_dir 'test'
  remove_file 'app/views/layouts/application.html.erb'
  copy_file 'spec_helper.rb', 'spec/spec_helper.rb'
  copy_file 'factories.rb', 'spec/factories.rb'
  copy_file 'routes.rb', 'config/routes.rb'

  application do <<-RUBY
    config.generators do |g|
      g.test_framework :rspec, fixture: false
      g.view_specs false
      g.helper_specs false
    end
  RUBY
  end

  run 'rails g connector:install'
  run 'bundle exec figaro install'
  run 'rake railties:install:migrations'
  run 'rake db:migrate'

  # Init repo and commit
  git :init
  git add: "."
  git commit: "-a -m 'Initial commit'"
end<commit_msg>updates template to remve application css<commit_after>def current_directory
  @current_directory ||=
      if __FILE__ =~ %r{\Ahttps?://}
        tempdir = Dir.mktmpdir("maestrano-connector-rails-")
        at_exit { FileUtils.remove_entry(tempdir) }
        git :clone => "--quiet https://github.com/berardpi/maestrano-connector-rails/tree/include-frontend #{tempdir}"

        "#{tempdir}/template"
      else
        File.expand_path(File.dirname(__FILE__))
      end
end

# def current_directory
#   File.expand_path(File.dirname(__FILE__))
# end

# Add the current directory to the path Thor uses
# to look up files
def source_paths
  Array(super) + [current_directory]
end

#
# Rebuild the Gemfile from scratch
#
remove_file 'Gemfile'
run 'touch Gemfile'

add_source 'https://rubygems.org'

gem 'rails', '4.2.4'
gem 'turbolinks'
gem 'jquery-rails'
gem 'puma'
gem 'figaro'
gem 'tzinfo-data', platforms: [:mingw, :mswin, :jruby]

gem 'maestrano-connector-rails'

gem 'sqlite3'

gem_group :test do
  gem 'simplecov'
  gem 'rspec-rails'
  gem 'factory_girl_rails'
  gem 'shoulda-matchers'
  gem 'timecop'
end

remove_file '.gitignore'
copy_file 'gitignore', '.gitignore'


#
# Cleanup
#
after_bundle do
  remove_dir 'app/mailers'
  remove_dir 'test'
  remove_file 'app/views/layouts/application.html.erb'
  remove_file 'app/assets/stylesheets/application.css'
  copy_file 'spec_helper.rb', 'spec/spec_helper.rb'
  copy_file 'factories.rb', 'spec/factories.rb'
  copy_file 'routes.rb', 'config/routes.rb'

  application do <<-RUBY
    config.generators do |g|
      g.test_framework :rspec, fixture: false
      g.view_specs false
      g.helper_specs false
    end
  RUBY
  end

  run 'rails g connector:install'
  run 'bundle exec figaro install'
  run 'rake railties:install:migrations'
  run 'rake db:migrate'

  # Init repo and commit
  git :init
  git add: "."
  git commit: "-a -m 'Initial commit'"
end
{'fraction_non_alphanumeric': 0.12195774271195507, 'fraction_numerical': 0.0021396095212623694, 'mean_word_length': 3.7341772151898733, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 4, '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': '963652', 'n_tokens_mistral': 1368, 'n_tokens_neox': 1340, 'n_words': 324}