Module: Apitecto

Defined in:
lib/apitecto.rb,
lib/apitecto/version.rb

Constant Summary collapse

VERSION =
"0.0.1"

Class Method Summary collapse

Class Method Details

.blueprint_exists?(blueprint_name) ⇒ Boolean

Returns:

  • (Boolean)


9
# File 'lib/apitecto.rb', line 9

def self.blueprint_exists?(blueprint_name); blueprints.has_key?(blueprint_name); end

.blueprintsObject



8
# File 'lib/apitecto.rb', line 8

def self.blueprints; @@blueprints ||= {}; end

.get_lines_of_spec(spec_file_path) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/apitecto.rb', line 13

def self.get_lines_of_spec(spec_file_path)
  unless lines_of_spec[spec_file_path].present?
    lines_of_spec[spec_file_path] = File.read(spec_file_path).each_line.to_a.map(&:strip).inject({}) do |lines, line|
      lines[lines.values.count + 1] = (line =~ /\A#/i || line == "") ? (line == "" ? "" : line[1..-1]) : nil
      lines
    end
  end
  lines_of_spec[spec_file_path]
end

.lines_of_specObject



12
# File 'lib/apitecto.rb', line 12

def self.lines_of_spec; @@lines_of_spec ||= {}; end