serve 1.5.0.pre5 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. data/CHANGELOG.rdoc +4 -2
  2. data/Gemfile +1 -1
  3. data/Gemfile.lock +13 -8
  4. data/VERSION +1 -1
  5. data/lib/serve/application.rb +34 -17
  6. data/lib/serve/{templates → bootstrap}/Gemfile +3 -3
  7. data/lib/serve/{templates/README.markdown → bootstrap/README.md} +0 -0
  8. data/lib/serve/{templates → bootstrap}/compass.config +0 -0
  9. data/lib/serve/{templates → bootstrap}/config.ru +1 -1
  10. data/lib/serve/{templates → bootstrap}/gitignore +0 -0
  11. data/lib/serve/export.rb +3 -12
  12. data/lib/serve/path.rb +24 -0
  13. data/lib/serve/project.rb +96 -53
  14. data/lib/serve/templates/default/public/images/serve-logo.png +0 -0
  15. data/lib/serve/templates/default/stylesheets/modules/_all.scss +3 -0
  16. data/lib/serve/templates/default/stylesheets/modules/_links.scss +15 -0
  17. data/lib/serve/templates/default/stylesheets/modules/_typography.scss +133 -0
  18. data/lib/serve/templates/default/stylesheets/modules/_utility.scss +15 -0
  19. data/lib/serve/templates/default/stylesheets/partials/_base.scss +47 -0
  20. data/lib/serve/templates/default/stylesheets/partials/_content.scss +37 -0
  21. data/lib/serve/templates/default/stylesheets/partials/_layout.scss +42 -0
  22. data/lib/serve/templates/default/stylesheets/screen.scss +7 -0
  23. data/lib/serve/templates/default/views/_layout.html.erb +1 -0
  24. data/lib/serve/templates/default/views/index.redirect +15 -0
  25. data/lib/serve/templates/default/views/layouts/default.html.erb +31 -0
  26. data/lib/serve/templates/default/views/view_helpers.rb +25 -0
  27. data/lib/serve/templates/default/views/welcome.html.erb +36 -0
  28. data/spec/application_spec.rb +21 -19
  29. data/spec/project_spec.rb +34 -34
  30. data/{lib/serve/templates → spec/stylesheets}/application.scss +0 -0
  31. data/{lib/serve/templates → spec/views}/_layout.html.erb +0 -0
  32. data/{lib/serve/templates → spec/views}/hello.html.erb +0 -0
  33. data/{lib/serve/templates → spec/views}/index.redirect +0 -0
  34. data/{lib/serve/templates → spec/views}/view_helpers.rb +0 -0
  35. metadata +31 -24
data/spec/project_spec.rb CHANGED
@@ -4,101 +4,101 @@ require 'fileutils'
4
4
 
5
5
  describe Serve::Project do
6
6
 
7
- describe "Creating a new serve project" do
7
+ describe "Creating a new Serve project" do
8
8
 
9
9
  class SilentOut
10
10
  def puts(*args); end
11
11
  def print(*args); end
12
12
  end
13
13
 
14
+ include Serve::Path
15
+
14
16
  before(:all) do
15
17
  @options = {
16
- :port => 4000,
17
- :address => '0.0.0.0',
18
-
19
- :name => 'test_mockup',
20
- :directory => File.dirname(__FILE__),
18
+ :port => 4000,
19
+ :address => '0.0.0.0',
20
+ :directory => 'serve_project_for_tests',
21
21
  :framework => 'jquery'
22
22
  }
23
23
 
24
- @mockup = Serve::Project.new(@options)
25
- @mockup.stdout = SilentOut.new
26
- @mockup.stderr = SilentOut.new
24
+ @project = Serve::Project.new(@options)
25
+ @project.stdout = SilentOut.new
26
+ @project.stderr = SilentOut.new
27
27
 
28
- @mockup_file = Pathname.new(File.expand_path(File.join(File.dirname(__FILE__), @options[:name]))).relative_path_from(Pathname.new(Dir.pwd)).to_s
29
- end
30
-
31
- after(:all) do
32
- FileUtils.rm_rf(@mockup_file)
28
+ @project_root = normalize_path(@options[:directory])
33
29
  end
34
30
 
35
- it "should have a project name" do
36
- @mockup.name.should == 'test_mockup'
31
+ after :all do
32
+ FileUtils.rm_rf @project_root
37
33
  end
38
34
 
39
35
  it "should have a project directory" do
40
- @mockup.location.should == @mockup_file
36
+ @project.location.should == 'serve_project_for_tests'
41
37
  end
42
38
 
43
39
  it "should have a framework" do
44
- @mockup.framework.should == 'jquery'
40
+ @project.framework.should == 'jquery'
41
+ end
42
+
43
+ it "should have a default template" do
44
+ @project.template.should == 'default'
45
45
  end
46
46
 
47
47
  describe "The created files" do
48
48
  before(:all) do
49
- @mockup.create
49
+ @project.create
50
50
  end
51
51
 
52
52
  it "should create a directory" do
53
- File.exists?(@mockup_file).should be_true
53
+ exists?('.').should be_true
54
54
  end
55
55
 
56
56
  it "should have a public directory" do
57
- File.exists?(File.join(@mockup_file, 'public')).should be_true
57
+ exists?('public').should be_true
58
58
  end
59
59
 
60
60
  it "should have a javascript directory" do
61
- File.exists?(File.join(@mockup_file, 'public/javascripts')).should be_true
61
+ exists?('public/javascripts').should be_true
62
62
  end
63
63
 
64
64
  it "should have a stylesheets directory" do
65
- File.exists?(File.join(@mockup_file, 'public/stylesheets')).should be_true
65
+ exists?('public/stylesheets').should be_true
66
66
  end
67
67
 
68
68
  it "should have an images directory" do
69
- File.exists?(File.join(@mockup_file, 'public/images')).should be_true
69
+ exists?('public/images').should be_true
70
70
  end
71
71
 
72
72
  it "should have a sass directory" do
73
- File.exists?(File.join(@mockup_file, 'stylesheets')).should be_true
73
+ exists?('stylesheets').should be_true
74
74
  end
75
75
 
76
76
  it "should have a tmp directory" do
77
- File.exists?(File.join(@mockup_file, 'tmp')).should be_true
77
+ exists?('tmp').should be_true
78
78
  end
79
79
 
80
80
  it "should have a views directory" do
81
- File.exists?(File.join(@mockup_file, 'views')).should be_true
81
+ exists?('views').should be_true
82
82
  end
83
83
 
84
84
  it "should have config.ru file" do
85
- File.exists?(File.join(@mockup_file, 'config.ru')).should be_true
85
+ exists?('config.ru').should be_true
86
86
  end
87
87
 
88
88
  it "should have a compass.config file" do
89
- File.exists?(File.join(@mockup_file, 'compass.config')).should be_true
89
+ exists?('compass.config').should be_true
90
90
  end
91
91
 
92
92
  it "should have a dot gitignore file" do
93
- File.exists?(File.join(@mockup_file, '.gitignore')).should be_true
93
+ exists?('.gitignore').should be_true
94
94
  end
95
95
 
96
- it "should have a README file" do
97
- File.exists?(File.join(@mockup_file, 'README.markdown')).should be_true
96
+ it "should have a restart file" do
97
+ exists?('tmp/restart.txt').should be_true
98
98
  end
99
99
 
100
- it "should have a restart file" do
101
- File.exists?(File.join(@mockup_file, 'tmp/restart.txt')).should be_true
100
+ def exists?(filename)
101
+ File.exists?(File.join(@project_root, filename))
102
102
  end
103
103
  end
104
104
 
File without changes
File without changes
File without changes
metadata CHANGED
@@ -1,8 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: serve
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: 6
5
- version: 1.5.0.pre5
4
+ prerelease:
5
+ version: 1.5.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - John W. Long
@@ -12,7 +12,7 @@ autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
14
 
15
- date: 2011-07-11 00:00:00 -04:00
15
+ date: 2011-07-12 00:00:00 -04:00
16
16
  default_executable: serve
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
@@ -255,6 +255,11 @@ files:
255
255
  - bin/serve
256
256
  - lib/serve.rb
257
257
  - lib/serve/application.rb
258
+ - lib/serve/bootstrap/Gemfile
259
+ - lib/serve/bootstrap/README.md
260
+ - lib/serve/bootstrap/compass.config
261
+ - lib/serve/bootstrap/config.ru
262
+ - lib/serve/bootstrap/gitignore
258
263
  - lib/serve/export.rb
259
264
  - lib/serve/handlers/dynamic_handler.rb
260
265
  - lib/serve/handlers/email_handler.rb
@@ -268,16 +273,20 @@ files:
268
273
  - lib/serve/project.rb
269
274
  - lib/serve/rack.rb
270
275
  - lib/serve/router.rb
271
- - lib/serve/templates/Gemfile
272
- - lib/serve/templates/README.markdown
273
- - lib/serve/templates/_layout.html.erb
274
- - lib/serve/templates/application.scss
275
- - lib/serve/templates/compass.config
276
- - lib/serve/templates/config.ru
277
- - lib/serve/templates/gitignore
278
- - lib/serve/templates/hello.html.erb
279
- - lib/serve/templates/index.redirect
280
- - lib/serve/templates/view_helpers.rb
276
+ - lib/serve/templates/default/public/images/serve-logo.png
277
+ - lib/serve/templates/default/stylesheets/modules/_all.scss
278
+ - lib/serve/templates/default/stylesheets/modules/_links.scss
279
+ - lib/serve/templates/default/stylesheets/modules/_typography.scss
280
+ - lib/serve/templates/default/stylesheets/modules/_utility.scss
281
+ - lib/serve/templates/default/stylesheets/partials/_base.scss
282
+ - lib/serve/templates/default/stylesheets/partials/_content.scss
283
+ - lib/serve/templates/default/stylesheets/partials/_layout.scss
284
+ - lib/serve/templates/default/stylesheets/screen.scss
285
+ - lib/serve/templates/default/views/_layout.html.erb
286
+ - lib/serve/templates/default/views/index.redirect
287
+ - lib/serve/templates/default/views/layouts/default.html.erb
288
+ - lib/serve/templates/default/views/view_helpers.rb
289
+ - lib/serve/templates/default/views/welcome.html.erb
281
290
  - lib/serve/version.rb
282
291
  - lib/serve/view_helpers.rb
283
292
  - spec/application_spec.rb
@@ -287,18 +296,16 @@ files:
287
296
  - spec/project_spec.rb
288
297
  - spec/router_spec.rb
289
298
  - spec/spec_helper.rb
299
+ - spec/stylesheets/application.scss
300
+ - spec/views/_layout.html.erb
301
+ - spec/views/hello.html.erb
302
+ - spec/views/index.redirect
303
+ - spec/views/view_helpers.rb
290
304
  has_rdoc: true
291
305
  homepage: http://get-serve.com
292
306
  licenses:
293
307
  - MIT
294
- post_install_message: |-
295
- Thanks for installing Serve! If you plan to use Serve with another
296
- template language (apart from ERB), don't forget to install it.
297
-
298
- If you want use Sass or Compass remember to install them, too!
299
-
300
- Serve doesn't install these dependencies by default, so that you can
301
- make your own decisions about what you want to use.
308
+ post_install_message:
302
309
  rdoc_options: []
303
310
 
304
311
  require_paths:
@@ -308,16 +315,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
308
315
  requirements:
309
316
  - - ">="
310
317
  - !ruby/object:Gem::Version
311
- hash: 1813519296002584178
318
+ hash: -400107684497950535
312
319
  segments:
313
320
  - 0
314
321
  version: "0"
315
322
  required_rubygems_version: !ruby/object:Gem::Requirement
316
323
  none: false
317
324
  requirements:
318
- - - ">"
325
+ - - ">="
319
326
  - !ruby/object:Gem::Version
320
- version: 1.3.1
327
+ version: "0"
321
328
  requirements: []
322
329
 
323
330
  rubyforge_project: