Sha256: 548067f6bebb4d295d30b9655571cdd322c22d4b4a73ee7c4cf662cef5cbf263

Contents?: true

Size: 1.17 KB

Versions: 24

Compression:

Stored size: 1.17 KB

Contents

class PreCommit::Core < PreCommit
  def pre_commit
    rake_invoke :examples
    website
  end

  def website(run_webby=true)
    clobber
    rake_invoke :verify_rcov
    rake_invoke :spec_html
    webby
    rake_invoke :failing_examples_with_html
    rdoc
    rdoc_rails
  end

  def clobber
    rm_rf '../doc/output'
    rm_rf 'translated_specs'
  end

  def webby
    Dir.chdir '../doc' do
      output = silent_sh('rake rebuild 2>&1')
      if shell_error?(output)
        raise "ERROR while generating web site: #{output}"
      end

      spec_page = File.expand_path('output/documentation/tools/spec.html')
      spec_page_content = File.open(spec_page).read
      unless spec_page_content =~/\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\.\./m
        raise "#{'!'*400}\nIt seems like the output in the generated documentation is broken (no dots: ......)\n. Look in #{spec_page}"
      end
    end
  end

  def rdoc
    Dir.chdir '../rspec' do
      rake = (PLATFORM == "i386-mswin32") ? "rake.cmd" : "rake"
      `#{rake} rdoc`
    end
  end

  def rdoc_rails
    Dir.chdir '../rspec_on_rails' do
      rake = (PLATFORM == "i386-mswin32") ? "rake.cmd" : "rake"
      `#{rake} rdoc`
    end
  end
end

Version data entries

24 entries across 24 versions & 5 rubygems

Version Path
picolena-0.0.99 app_generators/picolena/templates/vendor/plugins/rspec/pre_commit/lib/pre_commit/core.rb
picolena-0.1.1 rails_plugins/rspec/pre_commit/lib/pre_commit/core.rb
picolena-0.1.0 rails_plugins/rspec/pre_commit/lib/pre_commit/core.rb
picolena-0.1.2 rails_plugins/rspec/pre_commit/lib/pre_commit/core.rb
picolena-0.1.4 rails_plugins/rspec/pre_commit/lib/pre_commit/core.rb
picolena-0.1.3 rails_plugins/rspec/pre_commit/lib/pre_commit/core.rb
picolena-0.1.6 rails_plugins/rspec/pre_commit/lib/pre_commit/core.rb
picolena-0.1.5 rails_plugins/rspec/pre_commit/lib/pre_commit/core.rb
picolena-0.1.7 rails_plugins/rspec/pre_commit/lib/pre_commit/core.rb
picolena-0.1.8 rails_plugins/rspec/pre_commit/lib/pre_commit/core.rb
radiant-0.6.5.1 vendor/plugins/rspec/pre_commit/lib/pre_commit/core.rb
radiant-0.6.5 vendor/plugins/rspec/pre_commit/lib/pre_commit/core.rb
radiant-0.6.7 vendor/plugins/rspec/pre_commit/lib/pre_commit/core.rb
radiant-0.6.6 vendor/plugins/rspec/pre_commit/lib/pre_commit/core.rb
radiant-0.6.8 vendor/plugins/rspec/pre_commit/lib/pre_commit/core.rb
radiant-0.6.9 vendor/plugins/rspec/pre_commit/lib/pre_commit/core.rb
rspec-1.1.3 pre_commit/lib/pre_commit/core.rb
spree-0.2.0 vendor/plugins/rspec/pre_commit/lib/pre_commit/core.rb
typo-5.0.3.98.1 vendor/plugins/rspec/pre_commit/lib/pre_commit/core.rb
typo-5.0.3.98 vendor/plugins/rspec/pre_commit/lib/pre_commit/core.rb