hydra-tutorial 0.0.9 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "hydra-tutorial"
3
- s.version = "0.0.9"
3
+ s.version = "0.1.0"
4
4
  s.platform = Gem::Platform::RUBY
5
5
  s.authors = ["Chris Beer"]
6
6
  s.email = ["hydra-tech@googlegroups.com"]
@@ -581,7 +581,7 @@ class HydraOpenRepositoriesTutorialApp < Thor::Group
581
581
  gem 'hydra-head', :git => "git://github.com/projecthydra/hydra-head.git"
582
582
  else
583
583
  gem 'blacklight'
584
- gem 'hydra-head'
584
+ gem 'hydra-head', ">= 4.1.1"
585
585
  end
586
586
  gem 'devise'
587
587
 
@@ -646,6 +646,11 @@ class HydraOpenRepositoriesTutorialApp < Thor::Group
646
646
  "
647
647
  end
648
648
 
649
+ insert_into_file "app/models/solr_document.rb", :after => "include Blacklight::Solr::Document\n" do
650
+ "
651
+ include Hydra::Solr::Document
652
+ "
653
+ end
649
654
  insert_into_file "app/assets/javascripts/application.js", :after => "//= require_tree .\n" do
650
655
  "Blacklight.do_search_context_behavior = function() { }\n"
651
656
  end
@@ -726,14 +731,22 @@ class HydraOpenRepositoriesTutorialApp < Thor::Group
726
731
 
727
732
  def an_integration_test
728
733
  copy_file 'integration_spec.rb', 'spec/integration/integration_spec.rb'
729
-
730
734
  end
731
735
 
732
736
  def run_tests_x3
737
+ say %Q{
738
+ Now that the integration spec is in place, when we try to run rspec,
739
+ we'll get a test failure because it can't connect to Fedora.
740
+ }, STATEMENT
733
741
  run 'rspec'
734
742
  end
735
743
 
736
744
  def add_jettywrapper_ci_task
745
+ say %Q{
746
+ Instead, we need to add a new Rake task that knows how to wrap the
747
+ test suite -- start jetty before running the tests and stop jetty
748
+ at the end. We can use a feature provided by jettywrapper to do this.
749
+ }
737
750
  copy_file 'ci.rake', 'lib/tasks/ci.rake'
738
751
  end
739
752
 
@@ -743,6 +756,44 @@ class HydraOpenRepositoriesTutorialApp < Thor::Group
743
756
  rake 'jetty:start'
744
757
  end
745
758
 
759
+ def add_coverage_stats
760
+ say %Q{
761
+ Now that we have tests, we also want to have some coverage statistics.
762
+ }, STATEMENT
763
+
764
+ gem_group :development, :test do
765
+ gem 'simplecov'
766
+ end
767
+
768
+ run 'bundle install'
769
+
770
+ copy_file 'ci_with_coverage.rake', 'lib/tasks/ci.rake'
771
+ insert_into_file "spec/spec_helper.rb", :after => "ENV[\"RAILS_ENV\"] ||= 'test'\n"do
772
+ %Q{
773
+ if ENV['COVERAGE'] == "true"
774
+ require 'simplecov'
775
+ SimpleCov.start do
776
+ add_filter "config/"
777
+ add_filter "spec/"
778
+ end
779
+ end
780
+ }
781
+ end
782
+ end
783
+
784
+ def run_ci_task_again
785
+ rake 'jetty:stop'
786
+ rake 'ci'
787
+ rake 'jetty:start'
788
+ end
789
+
790
+ def coverage_prompt
791
+ say %Q{
792
+ Go take a look at the coverage report, open the file ./coverage/index.html
793
+ in your browser.
794
+ }
795
+ continue_prompt
796
+ end
746
797
  end
747
798
 
748
799
  class SprinkeSomeStyling < Thor::Group
@@ -0,0 +1,22 @@
1
+ desc "Run Continuous Integration Suite (tests, coverage, docs)"
2
+ task :ci do
3
+ Rake::Task["hydra:jetty:config"].invoke
4
+
5
+ require 'jettywrapper'
6
+ jetty_params = Jettywrapper.load_config.merge({
7
+ :jetty_home => File.expand_path(File.dirname(__FILE__) + '/../../jetty'),
8
+ :jetty_port => 8983,
9
+ :startup_wait => 25
10
+ })
11
+
12
+ Jettywrapper.wrap(jetty_params) do
13
+ Rails.env = "test"
14
+ ENV['COVERAGE'] ||= 'true'
15
+ Rake::Task['rspec'].invoke
16
+ end
17
+ end
18
+
19
+ desc "Run all specs"
20
+ RSpec::Core::RakeTask.new(:rspec) do |spec|
21
+ spec.rspec_opts = ["-c", "-r ./spec/spec_helper.rb"]
22
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hydra-tutorial
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-12 00:00:00.000000000 Z
12
+ date: 2012-07-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
@@ -76,6 +76,7 @@ files:
76
76
  - open-repositories-tutorial.thor
77
77
  - or_templates/add_file_upload/_form.html.erb
78
78
  - or_templates/add_tests/ci.rake
79
+ - or_templates/add_tests/ci_with_coverage.rake
79
80
  - or_templates/add_tests/integration_spec.rb
80
81
  - or_templates/add_tests/records_controller_spec.rb
81
82
  - or_templates/adding_our_models/basic_af_model.rb
@@ -112,7 +113,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
112
113
  version: '0'
113
114
  segments:
114
115
  - 0
115
- hash: 2344410728046652505
116
+ hash: -1899556533464413574
116
117
  required_rubygems_version: !ruby/object:Gem::Requirement
117
118
  none: false
118
119
  requirements:
@@ -121,7 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
122
  version: '0'
122
123
  segments:
123
124
  - 0
124
- hash: 2344410728046652505
125
+ hash: -1899556533464413574
125
126
  requirements: []
126
127
  rubyforge_project:
127
128
  rubygems_version: 1.8.24