class Awspec::Setup
Public Class Methods
generate_dotgitignore()
click to toggle source
# File lib/awspec/setup.rb, line 57 def self.generate_dotgitignore content = <<-'EOF' secrets.yml EOF if File.exist? 'spec/.gitignore' warn '!! spec/.gitignore already exists' else File.open('spec/.gitignore', 'w') do |f| f.puts content end puts ' + spec/.gitignore' end end
generate_dotrspec()
click to toggle source
# File lib/awspec/setup.rb, line 71 def self.generate_dotrspec content = <<-'EOF' --color --format documentation EOF if File.exist? '.rspec' warn '!! .rspec already exists' else File.open('.rspec', 'w') do |f| f.puts content end puts ' + .rspec' end end
generate_rakefile()
click to toggle source
# File lib/awspec/setup.rb, line 40 def self.generate_rakefile content = <<-'EOF' require 'rspec/core/rake_task' RSpec::Core::RakeTask.new('spec') task :default => :spec EOF if File.exist? 'Rakefile' warn '!! Rakefile already exists' else File.open('Rakefile', 'w') do |f| f.puts content end puts ' + Rakefile' end end
generate_spec_helper()
click to toggle source
# File lib/awspec/setup.rb, line 15 def self.generate_spec_helper content = <<-'EOF' require 'awspec' Awsecrets.load(secrets_path: File.expand_path('./secrets.yml', File.dirname(__FILE__))) EOF dir = 'spec' if File.exist? dir unless File.directory? dir warn "!! #{dir} already exists and is not a directory" end else FileUtils.mkdir dir puts " + #{dir}/" end if File.exist? 'spec/spec_helper.rb' warn '!! spec/spec_helper.rb already exists' else File.open('spec/spec_helper.rb', 'w') do |f| f.puts content end puts ' + spec/spec_helper.rb' end end
run()
click to toggle source
# File lib/awspec/setup.rb, line 8 def self.run generate_spec_helper generate_rakefile generate_dotgitignore generate_dotrspec end