rack-environment 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -28,6 +28,12 @@ development.
28
28
  use RackEnvironment, :environment => { :ONE => 'one', 'two' => 'two' }
29
29
  use RackEnvironment, :file => 'config/environment.yml'
30
30
 
31
+ == Using outside the Rack stack (Rake tasks)
32
+
33
+ # Rakefile
34
+ require 'rack_environment_task'
35
+ RackEnvironment::Task.new(...) # accepts same options as RackEnvironment
36
+
31
37
  == Note on Patches/Pull Requests
32
38
 
33
39
  * Fork the project.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.0
1
+ 1.2.0
@@ -12,6 +12,12 @@ class RackEnvironment
12
12
  app.call(env)
13
13
  end
14
14
 
15
+ def update_environment!
16
+ environment.each do |key, value|
17
+ ENV[key] = value
18
+ end
19
+ end
20
+
15
21
  private ######################################################################
16
22
 
17
23
  def default_config_file
@@ -37,10 +43,4 @@ private ######################################################################
37
43
  config.is_a?(Hash) ? config : {}
38
44
  end
39
45
 
40
- def update_environment!
41
- environment.each do |key, value|
42
- ENV[key] = value
43
- end
44
- end
45
-
46
46
  end
@@ -0,0 +1,15 @@
1
+ require 'rake'
2
+ require 'rake/tasklib'
3
+ require 'rack_environment'
4
+
5
+ class RackEnvironment::Task < ::Rake::TaskLib
6
+
7
+ def initialize(options={})
8
+ rack_environment = RackEnvironment.new(options)
9
+
10
+ task :rack_environment do
11
+ rack_environment.update_environment!
12
+ end
13
+ end
14
+
15
+ end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rack-environment}
8
- s.version = "1.1.0"
8
+ s.version = "1.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["David Dollar"]
12
- s.date = %q{2009-11-08}
12
+ s.date = %q{2009-11-09}
13
13
  s.description = %q{Rack middleware to set ENVironment variables around your app.}
14
14
  s.email = %q{ddollar@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -25,6 +25,7 @@ Gem::Specification.new do |s|
25
25
  "VERSION",
26
26
  "lib/rack-environment.rb",
27
27
  "lib/rack_environment.rb",
28
+ "lib/rack_environment/task.rb",
28
29
  "rack-environment.gemspec",
29
30
  "spec/config/blank.yml",
30
31
  "spec/config/environment.yml",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-environment
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Dollar
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-11-08 00:00:00 -05:00
12
+ date: 2009-11-09 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -50,6 +50,7 @@ files:
50
50
  - VERSION
51
51
  - lib/rack-environment.rb
52
52
  - lib/rack_environment.rb
53
+ - lib/rack_environment/task.rb
53
54
  - rack-environment.gemspec
54
55
  - spec/config/blank.yml
55
56
  - spec/config/environment.yml