Sha256: a0b7b943c2d66c0a78ca462b0eac7c5a1bd01d9baee228e169b614ae9fe46971

Contents?: true

Size: 671 Bytes

Versions: 33

Compression:

Stored size: 671 Bytes

Contents

IRT::Directives.irt_at_exit {git_reset_app}

def invoke(*args)
  Rails::Generators.invoke *args
end

def files_exist?(paths)
  missing = paths.reject{|f| File.exists?(f)}
  missing.empty? || missing
end

def file_include?(path, *strings)
  file_content path, :select, *strings
end

def file_exclude?(path, *strings)
  file_content path, :reject, *strings
end

def file_content(path, action, *strings)
  f = File.read(path)
  wrong = strings.send(action) do |s|
            re = s.is_a?(Regexp) ? s : /#{Regexp.escape(s)}/m
            !(f =~ re)
          end
  wrong.empty? || wrong
end

def git_reset_app
  system %(cd #{Hobo.root} && rake test:prepare_testapp -q)
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
hobo-2.2.6 test/irt/generators/irt_helper.rb
hobo-2.2.5 test/irt/generators/irt_helper.rb
hobo-2.2.4 test/irt/generators/irt_helper.rb
hobo-2.2.3 test/irt/generators/irt_helper.rb
hobo-2.2.2 test/irt/generators/irt_helper.rb
hobo-2.2.1 test/irt/generators/irt_helper.rb
hobo-2.2.0 test/irt/generators/irt_helper.rb
hobo-2.1.2 test/irt/generators/irt_helper.rb
hobo-2.1.1 test/irt/generators/irt_helper.rb
hobo-2.1.0 test/irt/generators/irt_helper.rb
hobo-2.1.0.pre4 test/irt/generators/irt_helper.rb
hobo-2.1.0.pre3 test/irt/generators/irt_helper.rb
hobo-2.1.0.pre2 test/irt/generators/irt_helper.rb
hobo-2.1.0.pre1 test/irt/generators/irt_helper.rb
hobo-2.0.1 test/irt/generators/irt_helper.rb
hobo-2.0.0 test/irt/generators/irt_helper.rb
hobo-2.0.0.pre10 test/irt/generators/irt_helper.rb
hobo-2.0.0.pre9 test/irt/generators/irt_helper.rb
hobo-2.0.0.pre8 test/irt/generators/irt_helper.rb
hobo-2.0.0.pre7 test/irt/generators/irt_helper.rb