lib/spectro/compiler.rb
def init options={}
    if File.exist?('.spectro/config') && !options[:f]
      abort "\n" + "Project already initialized. If you want to reset the curret setup you can run ".black.on_yellow + " spectro init -f ".white.on_light_black + "\n\n"
    end

    Dir.exist?('.spectro') || Dir.mkdir('.spectro')
    Dir.exist?('.spectro/cache') || Dir.mkdir('.spectro/cache')
    File.open('.spectro/config', 'w') do |file|
      file.write <<-CONFIG
#!/usr/bin/env ruby

Spectro.configure do |config|
# Sets a custom API Hostname if needed
# config.api_hostname = 'localhost:9292'
#
# Instead of failing in case of unfulfilled functions it will try to use the local specs to get a result
# config.enable_mocks!
end
      CONFIG
    end
    File.open('.spectro/index.yml', 'w') do |file|
    end
    File.open('.spectro/undefined.yml', 'w') do |file|
    end

    puts "\n" + "The project has been successfully initialized".black.on_blue + "\n\n"

    return self
  end
def init options={}
    if File.exist?('.spectro/config') && !options[:f]
      abort "\n" + "Project already initialized. If you want to reset the curret setup you can run ".black.on_yellow + " spectro init -f ".white.on_light_black + "\n\n"
    end

    Dir.exist?('.spectro') || Dir.mkdir('.spectro')
    Dir.exist?('.spectro/cache') || Dir.mkdir('.spectro/cache')
    File.open('.spectro/config', 'w') do |file|
      file.write <<-CONFIG
#!/usr/bin/env ruby

Spectro.configure do |config|
# Sets a custom API Hostname if needed
# config.api_hostname = 'localhost:9292'
#
# Instead of failing in case of unfulfilled functions it will try to use the local specs to get a result
# config.enable_mocks!
end
      CONFIG
    end
    File.open('.spectro/index.yml', 'w') do |file|
    end
    File.open('.spectro/undefined.yml', 'w') do |file|
    end

    puts "\n" + "The project has been successfully initialized".black.on_blue + "\n\n"

    return self
  end
def init options = { } if File . exist? ( '.spectro/config' ) && ! options [ :f ] abort "\n" + "Project already initialized. If you want to reset the curret setup you can run " . black . on_yellow + " spectro init -f " . white . on_light_black + "\n\n" end Dir . exist? ( '.spectro' ) || Dir . mkdir ( '.spectro' ) Dir . exist? ( '.spectro/cache' ) || Dir . mkdir ( '.spectro/cache' ) File . open ( '.spectro/config' , 'w' ) do | file | file . write <<-CONFIG CONFIG end File . open ( '.spectro/index.yml' , 'w' ) do | file | end File . open ( '.spectro/undefined.yml' , 'w' ) do | file | end puts "\n" + "The project has been successfully initialized" . black . on_blue + "\n\n" return self end
Init the current folder as an Spectro project, creating all the required files and folders
 `.spectro` confg file
 `.spectro/index.yml` which will hold the mappings between Files/Method names and defined lambdas
 `.spectro/undefined.yml` which will hold the collection of spec definitions not yet fulfilled
 `.spectro/cache` folder that will hold the source code of the retrieved lambdas

 @return [Spectro::Compiler] self
Init the current folder as an Spectro project creating all the required files and folders . spectro confg file . spectro / index . yml which will hold the mappings between Files / Method names and defined lambdas . spectro / undefined . yml which will hold the collection of spec definitions not yet fulfilled . spectro / cache folder that will hold the source code of the retrieved lambdas