envious 0.2.0 → 0.3.0

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.
data/README.md CHANGED
@@ -51,6 +51,19 @@ The environment used is dependant on Heroku's `RAILS_ENV` configuration setting.
51
51
 
52
52
  $ heroku config:add RAILS_ENV=development
53
53
 
54
+ ## Using with Cloud66
55
+ Envious makes it easy to export environment variables to a file for used on Cloud66 using a rake task. To copy local settings to a file formatted for used in the Cloud66 stack environment variable window use:
56
+
57
+ $ rake envious:cloud66:export > vars.txt
58
+
59
+ This will export your settings in `config/environment_vars.yml` to a file called `vars.txt` in your current directory. This is formatted and ready to be uploaded to Cloud66. By default, this will export your production environment variables.
60
+
61
+ To export environment variables for other environments, you can use an optional argument to the rake task:
62
+
63
+ $ rake envious:cloud66:export[development] > vars.txt
64
+
65
+ The command above will export all your development environment variables in `config/environment_vars.yml` to a file called `vars.txt`. `development` can be replaced with any other environments to export those values.
66
+
54
67
 
55
68
  ## Questions or Problems?
56
69
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = "envious"
3
- gem.version = "0.2.0"
3
+ gem.version = "0.3.0"
4
4
  gem.authors = ["Ryan Nielson"]
5
5
  gem.email = ["ryan.nielson@gmail.com"]
6
6
  gem.description = %q{Easy Ruby on Rails application and environment configuration.}
@@ -3,11 +3,16 @@ require "pp"
3
3
  module Envious
4
4
  extend self
5
5
 
6
- def vars_for_heroku()
6
+ def vars_for_heroku
7
7
  env_vars = default_vars.merge(environment_vars)
8
8
  env_vars = env_vars.map { |k, v| "#{k}=#{v}"}.join(' ')
9
9
  end
10
10
 
11
+ def vars_for_cloud66
12
+ env_vars = default_vars.merge(environment_vars)
13
+ env_vars = env_vars.map { |k, v| "#{k}=#{v}"}.join("\n")
14
+ end
15
+
11
16
  def load_env()
12
17
  add_to_environment(default_vars.merge(environment_vars))
13
18
  end
@@ -6,6 +6,7 @@ module Envious
6
6
 
7
7
  rake_tasks do
8
8
  load 'tasks/heroku.rake'
9
+ load 'tasks/cloud66.rake'
9
10
  end
10
11
  end
11
12
  end
@@ -0,0 +1,10 @@
1
+ namespace :envious do
2
+ namespace :cloud66 do
3
+ desc "Export environment variables for Cloud66."
4
+ task :export, :env do |t, args|
5
+ args.with_defaults(:env => "production")
6
+ Rails.env = args.env
7
+ puts Envious.vars_for_cloud66
8
+ end
9
+ end
10
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: envious
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-05 00:00:00.000000000 Z
12
+ date: 2013-03-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -61,6 +61,7 @@ files:
61
61
  - lib/envious/railtie.rb
62
62
  - lib/generators/envious/setup_generator.rb
63
63
  - lib/generators/envious/templates/environment_vars.yml
64
+ - lib/tasks/cloud66.rake
64
65
  - lib/tasks/heroku.rake
65
66
  - spec/spec_helper.rb
66
67
  homepage: http://github.com/ryannielson/envious
@@ -75,12 +76,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
75
76
  - - ! '>='
76
77
  - !ruby/object:Gem::Version
77
78
  version: '0'
79
+ segments:
80
+ - 0
81
+ hash: -910274445455390227
78
82
  required_rubygems_version: !ruby/object:Gem::Requirement
79
83
  none: false
80
84
  requirements:
81
85
  - - ! '>='
82
86
  - !ruby/object:Gem::Version
83
87
  version: '0'
88
+ segments:
89
+ - 0
90
+ hash: -910274445455390227
84
91
  requirements: []
85
92
  rubyforge_project:
86
93
  rubygems_version: 1.8.24