sinatra-bundles 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. data/Rakefile +2 -1
  2. data/VERSION +1 -1
  3. data/lib/sinatra/bundles/bundle.rb +36 -0
  4. data/lib/sinatra/bundles/helpers.rb +22 -0
  5. data/lib/sinatra/bundles/javascript_bundle.rb +37 -0
  6. data/lib/sinatra/bundles/stylesheet_bundle.rb +36 -0
  7. data/lib/sinatra/bundles.rb +4 -114
  8. data/sinatra-bundles.gemspec +11 -58
  9. data/spec/app.rb +1 -1
  10. data/spec/production_app.rb +1 -1
  11. data/spec/public/javascripts/eval.js +5 -0
  12. data/spec/sinatra-bundles_spec.rb +10 -1
  13. data/spec/spec_helper.rb +5 -6
  14. metadata +17 -57
  15. data/vendor/cache/sinatra-0.10.1.gem +0 -0
  16. data/vendor/gems/sinatra-0.10.1/AUTHORS +0 -43
  17. data/vendor/gems/sinatra-0.10.1/CHANGES +0 -467
  18. data/vendor/gems/sinatra-0.10.1/LICENSE +0 -22
  19. data/vendor/gems/sinatra-0.10.1/README.jp.rdoc +0 -552
  20. data/vendor/gems/sinatra-0.10.1/README.rdoc +0 -622
  21. data/vendor/gems/sinatra-0.10.1/Rakefile +0 -129
  22. data/vendor/gems/sinatra-0.10.1/lib/sinatra/base.rb +0 -1143
  23. data/vendor/gems/sinatra-0.10.1/lib/sinatra/images/404.png +0 -0
  24. data/vendor/gems/sinatra-0.10.1/lib/sinatra/images/500.png +0 -0
  25. data/vendor/gems/sinatra-0.10.1/lib/sinatra/main.rb +0 -28
  26. data/vendor/gems/sinatra-0.10.1/lib/sinatra/showexceptions.rb +0 -303
  27. data/vendor/gems/sinatra-0.10.1/lib/sinatra/tilt.rb +0 -509
  28. data/vendor/gems/sinatra-0.10.1/lib/sinatra.rb +0 -7
  29. data/vendor/gems/sinatra-0.10.1/sinatra.gemspec +0 -86
  30. data/vendor/gems/sinatra-0.10.1/test/base_test.rb +0 -160
  31. data/vendor/gems/sinatra-0.10.1/test/builder_test.rb +0 -65
  32. data/vendor/gems/sinatra-0.10.1/test/contest.rb +0 -64
  33. data/vendor/gems/sinatra-0.10.1/test/erb_test.rb +0 -81
  34. data/vendor/gems/sinatra-0.10.1/test/erubis_test.rb +0 -82
  35. data/vendor/gems/sinatra-0.10.1/test/extensions_test.rb +0 -100
  36. data/vendor/gems/sinatra-0.10.1/test/filter_test.rb +0 -195
  37. data/vendor/gems/sinatra-0.10.1/test/haml_test.rb +0 -90
  38. data/vendor/gems/sinatra-0.10.1/test/helper.rb +0 -76
  39. data/vendor/gems/sinatra-0.10.1/test/helpers_test.rb +0 -573
  40. data/vendor/gems/sinatra-0.10.1/test/mapped_error_test.rb +0 -186
  41. data/vendor/gems/sinatra-0.10.1/test/middleware_test.rb +0 -68
  42. data/vendor/gems/sinatra-0.10.1/test/request_test.rb +0 -33
  43. data/vendor/gems/sinatra-0.10.1/test/response_test.rb +0 -42
  44. data/vendor/gems/sinatra-0.10.1/test/result_test.rb +0 -98
  45. data/vendor/gems/sinatra-0.10.1/test/route_added_hook_test.rb +0 -59
  46. data/vendor/gems/sinatra-0.10.1/test/routing_test.rb +0 -878
  47. data/vendor/gems/sinatra-0.10.1/test/sass_test.rb +0 -79
  48. data/vendor/gems/sinatra-0.10.1/test/server_test.rb +0 -47
  49. data/vendor/gems/sinatra-0.10.1/test/sinatra_test.rb +0 -13
  50. data/vendor/gems/sinatra-0.10.1/test/static_test.rb +0 -87
  51. data/vendor/gems/sinatra-0.10.1/test/templates_test.rb +0 -155
  52. data/vendor/gems/sinatra-0.10.1/test/views/error.builder +0 -3
  53. data/vendor/gems/sinatra-0.10.1/test/views/error.erb +0 -3
  54. data/vendor/gems/sinatra-0.10.1/test/views/error.erubis +0 -3
  55. data/vendor/gems/sinatra-0.10.1/test/views/error.haml +0 -3
  56. data/vendor/gems/sinatra-0.10.1/test/views/error.sass +0 -2
  57. data/vendor/gems/sinatra-0.10.1/test/views/foo/hello.test +0 -1
  58. data/vendor/gems/sinatra-0.10.1/test/views/hello.builder +0 -1
  59. data/vendor/gems/sinatra-0.10.1/test/views/hello.erb +0 -1
  60. data/vendor/gems/sinatra-0.10.1/test/views/hello.erubis +0 -1
  61. data/vendor/gems/sinatra-0.10.1/test/views/hello.haml +0 -1
  62. data/vendor/gems/sinatra-0.10.1/test/views/hello.sass +0 -2
  63. data/vendor/gems/sinatra-0.10.1/test/views/hello.test +0 -1
  64. data/vendor/gems/sinatra-0.10.1/test/views/layout2.builder +0 -3
  65. data/vendor/gems/sinatra-0.10.1/test/views/layout2.erb +0 -2
  66. data/vendor/gems/sinatra-0.10.1/test/views/layout2.erubis +0 -2
  67. data/vendor/gems/sinatra-0.10.1/test/views/layout2.haml +0 -2
  68. data/vendor/gems/sinatra-0.10.1/test/views/layout2.test +0 -1
  69. data/vendor/specifications/sinatra-0.10.1.gemspec +0 -40
@@ -1,129 +0,0 @@
1
- require 'rake/clean'
2
- require 'rake/testtask'
3
- require 'fileutils'
4
-
5
- task :default => :test
6
- task :spec => :test
7
-
8
- # SPECS ===============================================================
9
-
10
- Rake::TestTask.new(:test) do |t|
11
- t.test_files = FileList['test/*_test.rb']
12
- t.ruby_opts = ['-rubygems'] if defined? Gem
13
- end
14
-
15
- # PACKAGING ============================================================
16
-
17
- # Load the gemspec using the same limitations as github
18
- def spec
19
- @spec ||=
20
- begin
21
- require 'rubygems/specification'
22
- data = File.read('sinatra.gemspec')
23
- spec = nil
24
- Thread.new { spec = eval("$SAFE = 3\n#{data}") }.join
25
- spec
26
- end
27
- end
28
-
29
- def package(ext='')
30
- "pkg/sinatra-#{spec.version}" + ext
31
- end
32
-
33
- desc 'Build packages'
34
- task :package => %w[.gem .tar.gz].map {|e| package(e)}
35
-
36
- desc 'Build and install as local gem'
37
- task :install => package('.gem') do
38
- sh "gem install #{package('.gem')}"
39
- end
40
-
41
- directory 'pkg/'
42
- CLOBBER.include('pkg')
43
-
44
- file package('.gem') => %w[pkg/ sinatra.gemspec] + spec.files do |f|
45
- sh "gem build sinatra.gemspec"
46
- mv File.basename(f.name), f.name
47
- end
48
-
49
- file package('.tar.gz') => %w[pkg/] + spec.files do |f|
50
- sh <<-SH
51
- git archive \
52
- --prefix=sinatra-#{source_version}/ \
53
- --format=tar \
54
- HEAD | gzip > #{f.name}
55
- SH
56
- end
57
-
58
- # Rubyforge Release / Publish Tasks ==================================
59
-
60
- desc 'Publish gem and tarball to rubyforge'
61
- task 'release' => [package('.gem'), package('.tar.gz')] do |t|
62
- sh <<-end
63
- rubyforge add_release sinatra sinatra #{spec.version} #{package('.gem')} &&
64
- rubyforge add_file sinatra sinatra #{spec.version} #{package('.tar.gz')}
65
- end
66
- end
67
-
68
- # Website ============================================================
69
- # Building docs requires HAML and the hanna gem:
70
- # gem install mislav-hanna --source=http://gems.github.com
71
-
72
- task 'doc' => ['doc:api']
73
-
74
- desc 'Generate Hanna RDoc under doc/api'
75
- task 'doc:api' => ['doc/api/index.html']
76
-
77
- file 'doc/api/index.html' => FileList['lib/**/*.rb','README.rdoc'] do |f|
78
- rb_files = f.prerequisites
79
- sh((<<-end).gsub(/\s+/, ' '))
80
- hanna --charset utf8 \
81
- --fmt html \
82
- --inline-source \
83
- --line-numbers \
84
- --main README.rdoc \
85
- --op doc/api \
86
- --title 'Sinatra API Documentation' \
87
- #{rb_files.join(' ')}
88
- end
89
- end
90
- CLEAN.include 'doc/api'
91
-
92
- # Gemspec Helpers ====================================================
93
-
94
- def source_version
95
- line = File.read('lib/sinatra/base.rb')[/^\s*VERSION = .*/]
96
- line.match(/.*VERSION = '(.*)'/)[1]
97
- end
98
-
99
- task 'sinatra.gemspec' => FileList['{lib,test,compat}/**','Rakefile','CHANGES','*.rdoc'] do |f|
100
- # read spec file and split out manifest section
101
- spec = File.read(f.name)
102
- head, manifest, tail = spec.split(" # = MANIFEST =\n")
103
- # replace version and date
104
- head.sub!(/\.version = '.*'/, ".version = '#{source_version}'")
105
- head.sub!(/\.date = '.*'/, ".date = '#{Date.today.to_s}'")
106
- # determine file list from git ls-files
107
- files = `git ls-files`.
108
- split("\n").
109
- sort.
110
- reject{ |file| file =~ /^\./ }.
111
- reject { |file| file =~ /^doc/ }.
112
- map{ |file| " #{file}" }.
113
- join("\n")
114
- # piece file back together and write...
115
- manifest = " s.files = %w[\n#{files}\n ]\n"
116
- spec = [head,manifest,tail].join(" # = MANIFEST =\n")
117
- File.open(f.name, 'w') { |io| io.write(spec) }
118
- puts "updated #{f.name}"
119
- end
120
-
121
- # Rcov ==============================================================
122
- namespace :test do
123
- desc 'Mesures test coverage'
124
- task :coverage do
125
- rm_f "coverage"
126
- rcov = "rcov --text-summary --test-unit-only -Ilib"
127
- system("#{rcov} --no-html --no-color test/*_test.rb")
128
- end
129
- end