Module: Taza

Defined in:
lib/taza/flow.rb,
lib/taza/page.rb,
lib/taza/site.rb,
lib/taza/tasks.rb,
lib/taza/entity.rb,
lib/taza/options.rb,
lib/taza/browser.rb,
lib/taza/fixture.rb,
lib/taza/version.rb,
lib/taza/fixtures.rb,
lib/taza/settings.rb,
lib/taza/generators/flow_generator.rb,
lib/taza/generators/page_generator.rb,
lib/taza/generators/site_generator.rb,
lib/taza/generators/taza_generators.rb,
lib/taza/generators/project_generator.rb,
lib/taza/generators/partial_generator.rb

Defined Under Namespace

Modules: Rake Classes: Browser, BrowserUnsupportedError, ElementError, Entity, FilterError, Fixture, Flow, FlowGenerator, Options, Page, PageGenerator, PartialGenerator, ProjectGenerator, Settings, Site, SiteGenerator, TazaGenerators

Constant Summary

VERSION =
"0.9.2.0"

Class Method Summary collapse

Class Method Details

.load_fixturesObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/taza/fixtures.rb', line 4

def self.load_fixtures
  dirs = Dir.glob(File.join(Fixture.base_path,'*/'))
  dirs.unshift Fixture.base_path
  dirs.each do |dir|
    mod = dir.sub(Fixture.base_path,File.join(File.basename(Fixture.base_path),'')).camelize.sub(/::$/,'')
    self.class_eval <<-EOS
    module #{mod}
      def self.included(other_module) 
        fixture = Fixture.new
        fixture.load_fixtures_from('#{dir}')
        fixture.fixture_names.each do |fixture_name|
          self.class_eval do
            define_method(fixture_name) do |entity_key|
              fixture.get_fixture_entity(fixture_name,entity_key.to_s)
            end
          end
        end
      end
    end
    EOS
  end
end