relevance-sinatra 0.9.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. data/Rakefile +105 -0
  2. metadata +161 -0
data/Rakefile ADDED
@@ -0,0 +1,105 @@
1
+ # Copyright 2008 Relevance Inc.
2
+ # All rights reserved
3
+
4
+ # This file may be distributed under an MIT style license.
5
+ # See MIT-LICENSE for details.
6
+ require 'rubygems'
7
+ require 'rake'
8
+ require 'spec/rake/spectask'
9
+ require 'spec/rake/verify_rcov'
10
+ require "fileutils"
11
+
12
+ gem :flog
13
+
14
+ CURRENT_VERSION = '0.5.4'
15
+ $package_version = CURRENT_VERSION
16
+
17
+ desc "Run all examples with RCov"
18
+ Spec::Rake::SpecTask.new('specs_with_rcov') do |t|
19
+ ENV["test"] = "true"
20
+ t.spec_files = FileList['spec/**/*.rb']
21
+ t.rcov = true
22
+ t.rcov_opts = ['--text-report', '--exclude', "spec,Library,lib/castronaut/db,#{ENV['GEM_HOME']}", '--sort', 'coverage']
23
+ end
24
+
25
+ desc "Run all examples"
26
+ Spec::Rake::SpecTask.new('spec') do |t|
27
+ t.spec_files = FileList['spec/**/*.rb']
28
+ t.rcov = false
29
+ t.spec_opts = ['-cfn']
30
+ end
31
+
32
+ RCov::VerifyTask.new(:verify_coverage => :specs_with_rcov) do |t|
33
+ t.threshold = 97.0
34
+ t.index_html = 'coverage/index.html'
35
+ end
36
+
37
+ namespace :ssl do
38
+
39
+ desc "Generate a test SSL certificate for development"
40
+ task :generate do
41
+ FileUtils.mkdir_p('ssl') unless File.exist?('ssl')
42
+
43
+ if %x{which openssl}.strip.size == 0
44
+ puts "Unable to locate openssl, please make sure you have it installed and in your path."
45
+ else
46
+ system("openssl req -x509 -nodes -days 365 -subj '/C=US/ST=NC/L=CH/CN=localhost' -newkey rsa:1024 -keyout ssl/devcert.pem -out ssl/devcert.pem")
47
+ end
48
+ end
49
+
50
+ end
51
+
52
+ desc "Flog the code, keeping things under control by using a threshold"
53
+ task :flog do
54
+ threshold = 135.0
55
+
56
+ report_path = File.expand_path(File.join(File.dirname(__FILE__), 'coverage'))
57
+ FileUtils.mkdir_p(report_path)
58
+
59
+ system "echo '<pre>' > #{report_path}/flog.html"
60
+ system "flog -a app/ lib/ >> #{report_path}/flog.html" do |ok, response|
61
+ unless ok
62
+ puts "Flog failed with exit status: #{response.exitstatus}"
63
+ exit 1
64
+ end
65
+ end
66
+
67
+ flog_output = File.read("#{report_path}/flog.html")
68
+ output_lines = flog_output.split("\n")
69
+
70
+ total_score = output_lines[1].split("=").last.strip.to_f
71
+ all_scores = output_lines.select {|line| line =~ /#/ }
72
+ all_scores.reject { }
73
+ total_methods = all_scores.length
74
+ puts "Flog:"
75
+ puts "=" * 40
76
+ puts " Average Score Per Method: #{total_score / total_methods}"
77
+
78
+ top_methods = all_scores.first(3)
79
+
80
+ threshold_failed = false
81
+
82
+ top_methods.each_with_index do |score_with_name, index|
83
+ score_with_name =~ /\((.*)\)/
84
+ score = $1.to_f
85
+ score_with_name =~ /^(.*):/
86
+ method = $1
87
+
88
+ puts " #{index.next}) #{method} (#{score}) #{"(FAILED! Over threshold of #{threshold})" if score > threshold}"
89
+ unless threshold_failed
90
+ threshold_failed = score > threshold
91
+ end
92
+ end
93
+
94
+ exit(1) if threshold_failed
95
+
96
+ exit(0)
97
+ end
98
+
99
+ desc 'Build and install the gem'
100
+ task :gem do
101
+ sh 'gem build castronaut.gemspec'
102
+ sh 'sudo gem install castronaut*.gem'
103
+ end
104
+
105
+ task :default => [:verify_coverage]#, :flog]
metadata ADDED
@@ -0,0 +1,161 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: relevance-sinatra
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.9.0.2
5
+ platform: ruby
6
+ authors:
7
+ - Blake Mizerany
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-01-18 00:00:00 -08:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: rack
17
+ version_requirement:
18
+ version_requirements: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 0.9.1
23
+ version:
24
+ description: Classy web-development dressed in a DSL
25
+ email: sinatrarb@googlegroups.com
26
+ executables: []
27
+
28
+ extensions: []
29
+
30
+ extra_rdoc_files:
31
+ - README.rdoc
32
+ - LICENSE
33
+ files:
34
+ - AUTHORS
35
+ - CHANGES
36
+ - LICENSE
37
+ - README.rdoc
38
+ - Rakefile
39
+ - compat/app_test.rb
40
+ - compat/application_test.rb
41
+ - compat/builder_test.rb
42
+ - compat/custom_error_test.rb
43
+ - compat/erb_test.rb
44
+ - compat/events_test.rb
45
+ - compat/filter_test.rb
46
+ - compat/haml_test.rb
47
+ - compat/helper.rb
48
+ - compat/mapped_error_test.rb
49
+ - compat/pipeline_test.rb
50
+ - compat/public/foo.xml
51
+ - compat/sass_test.rb
52
+ - compat/sessions_test.rb
53
+ - compat/streaming_test.rb
54
+ - compat/sym_params_test.rb
55
+ - compat/template_test.rb
56
+ - compat/use_in_file_templates_test.rb
57
+ - compat/views/foo.builder
58
+ - compat/views/foo.erb
59
+ - compat/views/foo.haml
60
+ - compat/views/foo.sass
61
+ - compat/views/foo_layout.erb
62
+ - compat/views/foo_layout.haml
63
+ - compat/views/layout_test/foo.builder
64
+ - compat/views/layout_test/foo.erb
65
+ - compat/views/layout_test/foo.haml
66
+ - compat/views/layout_test/foo.sass
67
+ - compat/views/layout_test/layout.builder
68
+ - compat/views/layout_test/layout.erb
69
+ - compat/views/layout_test/layout.haml
70
+ - compat/views/layout_test/layout.sass
71
+ - compat/views/no_layout/no_layout.builder
72
+ - compat/views/no_layout/no_layout.haml
73
+ - lib/sinatra.rb
74
+ - lib/sinatra/base.rb
75
+ - lib/sinatra/compat.rb
76
+ - lib/sinatra/images/404.png
77
+ - lib/sinatra/images/500.png
78
+ - lib/sinatra/main.rb
79
+ - lib/sinatra/test.rb
80
+ - lib/sinatra/test/bacon.rb
81
+ - lib/sinatra/test/rspec.rb
82
+ - lib/sinatra/test/spec.rb
83
+ - lib/sinatra/test/unit.rb
84
+ - sinatra.gemspec
85
+ - test/base_test.rb
86
+ - test/builder_test.rb
87
+ - test/data/reload_app_file.rb
88
+ - test/erb_test.rb
89
+ - test/filter_test.rb
90
+ - test/haml_test.rb
91
+ - test/helper.rb
92
+ - test/helpers_test.rb
93
+ - test/mapped_error_test.rb
94
+ - test/middleware_test.rb
95
+ - test/options_test.rb
96
+ - test/reload_test.rb
97
+ - test/request_test.rb
98
+ - test/result_test.rb
99
+ - test/routing_test.rb
100
+ - test/sass_test.rb
101
+ - test/sinatra_test.rb
102
+ - test/static_test.rb
103
+ - test/templates_test.rb
104
+ - test/views/hello.builder
105
+ - test/views/hello.erb
106
+ - test/views/hello.haml
107
+ - test/views/hello.sass
108
+ - test/views/hello.test
109
+ - test/views/layout2.builder
110
+ - test/views/layout2.erb
111
+ - test/views/layout2.haml
112
+ - test/views/layout2.test
113
+ has_rdoc: true
114
+ homepage: http://sinatra.rubyforge.org
115
+ post_install_message:
116
+ rdoc_options:
117
+ - --line-numbers
118
+ - --inline-source
119
+ - --title
120
+ - Sinatra
121
+ - --main
122
+ - README.rdoc
123
+ require_paths:
124
+ - lib
125
+ required_ruby_version: !ruby/object:Gem::Requirement
126
+ requirements:
127
+ - - ">="
128
+ - !ruby/object:Gem::Version
129
+ version: "0"
130
+ version:
131
+ required_rubygems_version: !ruby/object:Gem::Requirement
132
+ requirements:
133
+ - - ">="
134
+ - !ruby/object:Gem::Version
135
+ version: "0"
136
+ version:
137
+ requirements: []
138
+
139
+ rubyforge_project: sinatra
140
+ rubygems_version: 1.2.0
141
+ signing_key:
142
+ specification_version: 2
143
+ summary: Classy web-development dressed in a DSL
144
+ test_files:
145
+ - test/base_test.rb
146
+ - test/builder_test.rb
147
+ - test/erb_test.rb
148
+ - test/filter_test.rb
149
+ - test/haml_test.rb
150
+ - test/helpers_test.rb
151
+ - test/mapped_error_test.rb
152
+ - test/middleware_test.rb
153
+ - test/options_test.rb
154
+ - test/reload_test.rb
155
+ - test/request_test.rb
156
+ - test/result_test.rb
157
+ - test/routing_test.rb
158
+ - test/sass_test.rb
159
+ - test/sinatra_test.rb
160
+ - test/static_test.rb
161
+ - test/templates_test.rb