picky-generators 3.0.0.pre1 → 3.0.0.pre2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. data/lib/picky-generators/generators/selector.rb +3 -4
  2. data/lib/picky-generators/generators/server/{unicorn.rb → classic.rb} +6 -6
  3. data/lib/picky-generators/generators/server/sinatra.rb +3 -2
  4. data/lib/picky-generators.rb +3 -2
  5. data/prototypes/server/classic/Gemfile +27 -0
  6. data/prototypes/server/classic/app/README +4 -0
  7. data/prototypes/server/{unicorn → classic}/app/application.rb +8 -3
  8. data/prototypes/server/{shared_unicorn → classic}/app/db.yml +0 -0
  9. data/prototypes/server/{shared_unicorn → classic}/app/logging.rb +7 -4
  10. data/prototypes/server/{shared_unicorn → classic}/config.ru +1 -7
  11. data/prototypes/server/{shared_unicorn → classic}/log/README +0 -0
  12. data/prototypes/server/{shared_unicorn → classic}/script/console +1 -1
  13. data/prototypes/server/classic/spec/spec_helper.rb +8 -0
  14. data/prototypes/server/{sinatra → shared}/Rakefile +0 -0
  15. data/prototypes/server/{sinatra → shared}/data/development/library.csv +0 -0
  16. data/prototypes/server/{sinatra → shared}/data/production/library.csv +0 -0
  17. data/prototypes/server/{sinatra → shared}/data/test/library.csv +0 -0
  18. data/prototypes/server/{sinatra → shared}/spec/integration_spec.rb +0 -0
  19. data/prototypes/server/{sinatra → shared}/tmp/pids/README +0 -0
  20. data/prototypes/server/{shared_unicorn → shared}/unicorn.rb +0 -0
  21. data/prototypes/server/sinatra/Gemfile +2 -3
  22. data/prototypes/server/sinatra/app.rb +5 -3
  23. data/prototypes/server/sinatra/logging.rb +24 -0
  24. data/spec/lib/picky-generators/generators/selector_spec.rb +2 -2
  25. data/spec/lib/picky-generators/generators/server/classic_spec.rb +35 -0
  26. data/spec/lib/picky-generators/generators/server/sinatra_spec.rb +1 -1
  27. metadata +24 -34
  28. data/lib/picky-generators/generators/server/empty_unicorn.rb +0 -40
  29. data/prototypes/server/empty_unicorn/app/application.rb +0 -10
  30. data/prototypes/server/shared_unicorn/Gemfile +0 -35
  31. data/prototypes/server/shared_unicorn/Rakefile +0 -1
  32. data/prototypes/server/shared_unicorn/app/README +0 -5
  33. data/prototypes/server/shared_unicorn/tmp/README +0 -0
  34. data/prototypes/server/shared_unicorn/tmp/pids/README +0 -0
  35. data/prototypes/server/sinatra/unicorn.rb +0 -17
  36. data/prototypes/server/unicorn/Rakefile +0 -6
  37. data/prototypes/server/unicorn/data/development/library.csv +0 -540
  38. data/prototypes/server/unicorn/data/production/library.csv +0 -540
  39. data/prototypes/server/unicorn/data/test/library.csv +0 -540
  40. data/prototypes/server/unicorn/spec/integration_spec.rb +0 -28
  41. data/prototypes/server/unicorn/spec/spec_helper.rb +0 -8
  42. data/spec/lib/picky-generators/generators/server/unicorn_spec.rb +0 -35
@@ -1,28 +0,0 @@
1
- # coding: utf-8
2
- #
3
- require 'spec_helper'
4
- require 'picky-client/spec'
5
-
6
- describe 'Integration Tests' do
7
-
8
- before(:all) do
9
- Picky::Indexes.index_for_tests
10
- Picky::Indexes.load_from_cache
11
- end
12
-
13
- let(:books) { Picky::TestClient.new(PickySearch, :path => '/books') }
14
-
15
- # Testing a count of results.
16
- #
17
- it { books.search('a s').total.should == 42 }
18
-
19
- # Testing a specific order of result ids.
20
- #
21
- it { books.search('alan').ids.should == [259, 307, 449] }
22
-
23
- # Testing an order of result categories.
24
- #
25
- it { books.search('alan').should have_categories(['author'], ['title']) }
26
- it { books.search('alan p').should have_categories(['author', 'title'], ['title', 'author']) }
27
-
28
- end
@@ -1,8 +0,0 @@
1
- ENV['PICKY_ENV'] = 'test'
2
-
3
- require 'picky'
4
-
5
- SearchLog = Picky::Loggers::Search.new ::Logger.new(STDOUT)
6
- puts "Using STDOUT as test log."
7
-
8
- Picky::Loader.load_application
@@ -1,35 +0,0 @@
1
- # encoding: utf-8
2
- #
3
- require 'spec_helper'
4
-
5
- describe Picky::Generators::Server::Unicorn do
6
-
7
- before(:each) do
8
- @unicorn = Picky::Generators::Server::Unicorn.new :unicorn_server, 'unicorn_server_dir_name'
9
- @unicorn.stub! :exclaim
10
- end
11
-
12
- context "after initialize" do
13
- it 'has the right identifier' do
14
- @unicorn.identifier.should == :unicorn_server
15
- end
16
- it 'has the right name' do
17
- @unicorn.name.should == 'unicorn_server_dir_name'
18
- end
19
- it 'has the right prototype dir' do
20
- @unicorn.prototype_basedir.should == File.expand_path('../../../../../../prototypes/server/unicorn', __FILE__)
21
- end
22
- end
23
-
24
- describe "generate" do
25
- it "should do things in order" do
26
- @unicorn.should_receive(:exclaim).once.ordered # Initial explanation
27
- @unicorn.should_receive(:create_target_directory).once.ordered
28
- @unicorn.should_receive(:copy_all_files).twice
29
- @unicorn.should_receive(:exclaim).at_least(9).times.ordered # Some user steps to do
30
-
31
- @unicorn.generate
32
- end
33
- end
34
-
35
- end