rackif 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,3 @@
1
+ Manifest
2
+ pkg/*
3
+ rackif.gemspec
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009 Sam Schenkman-Moore, David Dollar
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,45 @@
1
+ = Rack::If
2
+
3
+ Use or don't use rack apps based on a variety of environment variables.
4
+
5
+ == Use
6
+
7
+ gem install rackif
8
+
9
+ Example (in your config.ru):
10
+
11
+ require 'rackif'
12
+ use Rack::If, {:path => /\A\/protected.*/, :method => 'POST'}, :any do
13
+ use Rack::Auth::Basic, "Rack::If Example" do |username, password|
14
+ 'secret' == password
15
+ end
16
+ end
17
+
18
+ run MyApp.new # when above matches, this is protected
19
+
20
+ == Configuration
21
+
22
+ Rack::If, options, all_or_any
23
+
24
+ The third argument (:all or :any) is optional, defaults to :all.
25
+
26
+ With :all, all options must match for the block to get run. In the above example, the path would need to start with /protected AND the method would need to be POST. With :any, if ANY of the criteria match (either POST or the path), the block is run.
27
+
28
+ Options available are: path, method, user_agent, host, port, query_string, http_accept, and http_accept_encoding.
29
+
30
+ Values given can be strings or regex (=== used for comparison).
31
+
32
+ == Note on Patches/Pull Requests
33
+
34
+ * Fork the project.
35
+ * Make your feature addition or bug fix.
36
+ * Add tests for it. This is important so I don't break it in a
37
+ future version unintentionally.
38
+ * Commit, do not mess with rakefile, version, or history.
39
+ (if you want to have your own version, that is fine but
40
+ bump version in a commit by itself I can ignore when I pull)
41
+ * Send me a pull request. Bonus points for topic branches.
42
+
43
+ == Copyright
44
+
45
+ Copyright (c) 2009 Sam Schenkman-Moore. See LICENSE for details.
data/Rakefile CHANGED
@@ -1,16 +1,54 @@
1
1
  # Rakefile
2
2
  require 'rubygems'
3
3
  require 'rake'
4
- require 'echoe'
5
4
 
6
- Echoe.new('rackif', '0.0.2') do |p|
7
- p.summary = "Conditional use of rack apps"
8
- p.description = "Use or don't use Rack apps based on a variety of environment factors."
9
- # p.url = "http://samsm.com/"
10
- # p.author = "Sam Schenkman-Moore"
11
- # p.email = "samsm@samsm.com"
12
- p.ignore_pattern = ["tmp/*", "script/*"]
13
- p.runtime_dependencies = ['rack']
5
+ begin
6
+ require 'jeweler'
7
+ Jeweler::Tasks.new do |gem|
8
+ gem.name = "rackif"
9
+ gem.summary = "Conditional use of rack apps"
10
+ gem.description = "Use or don't use Rack apps based on a variety of environment factors."
11
+ gem.email = "samsm@samsm.com"
12
+ gem.homepage = "http://github.com/samsm/rack--if"
13
+ gem.authors = ["Sam Schenkman-Moore", "David Dollar"]
14
+ gem.add_development_dependency "yard", ">= 0"
15
+ gem.add_runtime_dependency 'rack', '> 0'
16
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
17
+ end
18
+ Jeweler::GemcutterTasks.new
19
+ rescue LoadError
20
+ puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
14
21
  end
15
22
 
16
- Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext| load ext }
23
+ require 'rake/testtask'
24
+ Rake::TestTask.new(:test) do |test|
25
+ test.libs << 'lib' << 'test'
26
+ test.pattern = 'test/**/test_*.rb'
27
+ test.verbose = true
28
+ end
29
+
30
+ begin
31
+ require 'rcov/rcovtask'
32
+ Rcov::RcovTask.new do |test|
33
+ test.libs << 'test'
34
+ test.pattern = 'test/**/test_*.rb'
35
+ test.verbose = true
36
+ end
37
+ rescue LoadError
38
+ task :rcov do
39
+ abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
40
+ end
41
+ end
42
+
43
+ task :test => :check_dependencies
44
+
45
+ task :default => :test
46
+
47
+ begin
48
+ require 'yard'
49
+ YARD::Rake::YardocTask.new
50
+ rescue LoadError
51
+ task :yardoc do
52
+ abort "YARD is not available. In order to run yardoc, you must: sudo gem install yard"
53
+ end
54
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.0.3
data/test/helper.rb ADDED
@@ -0,0 +1,9 @@
1
+ require 'rubygems'
2
+ require 'test/unit'
3
+
4
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
5
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
6
+ require 'rack--if'
7
+
8
+ class Test::Unit::TestCase
9
+ end
@@ -0,0 +1,7 @@
1
+ require 'helper'
2
+
3
+ class TestRackIf < Test::Unit::TestCase
4
+ def test_something_for_real
5
+ flunk "yes, I'm horrible about tests"
6
+ end
7
+ end
metadata CHANGED
@@ -1,57 +1,65 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rackif
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
- - ""
7
+ - Sam Schenkman-Moore
8
+ - David Dollar
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
12
 
12
- date: 2009-11-18 00:00:00 -05:00
13
+ date: 2009-11-19 00:00:00 -05:00
13
14
  default_executable:
14
15
  dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: yard
18
+ type: :development
19
+ version_requirement:
20
+ version_requirements: !ruby/object:Gem::Requirement
21
+ requirements:
22
+ - - ">="
23
+ - !ruby/object:Gem::Version
24
+ version: "0"
25
+ version:
15
26
  - !ruby/object:Gem::Dependency
16
27
  name: rack
17
28
  type: :runtime
18
29
  version_requirement:
19
30
  version_requirements: !ruby/object:Gem::Requirement
20
31
  requirements:
21
- - - ">="
32
+ - - ">"
22
33
  - !ruby/object:Gem::Version
23
34
  version: "0"
24
35
  version:
25
36
  description: Use or don't use Rack apps based on a variety of environment factors.
26
- email: ""
37
+ email: samsm@samsm.com
27
38
  executables: []
28
39
 
29
40
  extensions: []
30
41
 
31
42
  extra_rdoc_files:
32
- - README
33
- - lib/if.rb
34
- - lib/rackif.rb
43
+ - LICENSE
44
+ - README.rdoc
35
45
  files:
36
- - Manifest
37
- - README
46
+ - .gitignore
47
+ - LICENSE
48
+ - README.rdoc
38
49
  - Rakefile
50
+ - VERSION
39
51
  - config.ru
40
52
  - lib/if.rb
41
53
  - lib/rackif.rb
42
- - rackif.gemspec
54
+ - test/helper.rb
55
+ - test/test_rack--if.rb
43
56
  has_rdoc: true
44
- homepage: ""
57
+ homepage: http://github.com/samsm/rack--if
45
58
  licenses: []
46
59
 
47
60
  post_install_message:
48
61
  rdoc_options:
49
- - --line-numbers
50
- - --inline-source
51
- - --title
52
- - Rackif
53
- - --main
54
- - README
62
+ - --charset=UTF-8
55
63
  require_paths:
56
64
  - lib
57
65
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -64,14 +72,15 @@ required_rubygems_version: !ruby/object:Gem::Requirement
64
72
  requirements:
65
73
  - - ">="
66
74
  - !ruby/object:Gem::Version
67
- version: "1.2"
75
+ version: "0"
68
76
  version:
69
77
  requirements: []
70
78
 
71
- rubyforge_project: rackif
79
+ rubyforge_project:
72
80
  rubygems_version: 1.3.5
73
81
  signing_key:
74
82
  specification_version: 3
75
83
  summary: Conditional use of rack apps
76
- test_files: []
77
-
84
+ test_files:
85
+ - test/helper.rb
86
+ - test/test_rack--if.rb
data/Manifest DELETED
@@ -1,6 +0,0 @@
1
- Manifest
2
- README
3
- Rakefile
4
- config.ru
5
- lib/if.rb
6
- lib/rackif.rb
data/README DELETED
@@ -1,20 +0,0 @@
1
- Use or don't use rack apps based on a variety of environment variables.
2
-
3
- gem install rackif --source http://gemcutter.org
4
-
5
- Example:
6
-
7
- require 'rackif'
8
- use Rack::If, {:path => /\A\/protected.*/, :method => 'POST'}, :any do
9
- use Rack::Auth::Basic, "Rack::If Example" do |username, password|
10
- 'secret' == password
11
- end
12
- end
13
-
14
- The third argument (:all or :any) is optional, defaults to :all.
15
-
16
- With :all, all options must match for the block to get run. In the above example, the path would need to start with /protected AND the method would need to be POST. With :any, if ANY of the criteria match (either POST or the path), the block is run.
17
-
18
- Options available are: path, method, user_agent, host, port, query_string, http_accept, and http_accept_encoding.
19
-
20
- Values given can be strings or regex (=== used for comparison).
data/rackif.gemspec DELETED
@@ -1,33 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
-
3
- Gem::Specification.new do |s|
4
- s.name = %q{rackif}
5
- s.version = "0.0.2"
6
-
7
- s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
- s.authors = [""]
9
- s.date = %q{2009-11-18}
10
- s.description = %q{Use or don't use Rack apps based on a variety of environment factors.}
11
- s.email = %q{}
12
- s.extra_rdoc_files = ["README", "lib/if.rb", "lib/rackif.rb"]
13
- s.files = ["Manifest", "README", "Rakefile", "config.ru", "lib/if.rb", "lib/rackif.rb", "rackif.gemspec"]
14
- s.homepage = %q{}
15
- s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Rackif", "--main", "README"]
16
- s.require_paths = ["lib"]
17
- s.rubyforge_project = %q{rackif}
18
- s.rubygems_version = %q{1.3.5}
19
- s.summary = %q{Conditional use of rack apps}
20
-
21
- if s.respond_to? :specification_version then
22
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
23
- s.specification_version = 3
24
-
25
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
26
- s.add_runtime_dependency(%q<rack>, [">= 0"])
27
- else
28
- s.add_dependency(%q<rack>, [">= 0"])
29
- end
30
- else
31
- s.add_dependency(%q<rack>, [">= 0"])
32
- end
33
- end