Sha256: ea6f5f94671e47c7920d56319c31d24b26face12964ab88d3d2f75f5640ef904

Contents?: true

Size: 758 Bytes

Versions: 4

Compression:

Stored size: 758 Bytes

Contents

module Ambient
  class Init
    attr_reader :path,
                :project_name,
                :project_prefix

    def initialize(path = nil, project_name = nil, project_prefix = nil)
      @path = path || Dir.pwd
      @project_name = project_name || "MyProject"
      @project_prefix = project_prefix || "com.#{@project_name.downcase}."
    end

    def create_ambientfile
      puts "# Creating Ambientfile..."
      write_file
      puts "File created at #{filepath}"
    end

    private

    def write_file
      File.open(filepath, 'w') { |file| file.write(contents) }
    end

    def filepath
      "#{path}/Ambientfile"
    end

    def contents
      "base_ios_settings! \"#{project_name}\", prefix: \"#{project_prefix}\"\n"
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ambient-xcode-0.8.1 lib/ambient/init.rb
ambient-xcode-0.8.0 lib/ambient/init.rb
ambient-xcode-0.7.1 lib/ambient/init.rb
ambient-xcode-0.7.0 lib/ambient/init.rb