exportr 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,4 @@
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in export.gemspec
4
+ gemspec
data/README ADDED
@@ -0,0 +1,15 @@
1
+ Finally, you can configure local environment variables for each of your rails apps.
2
+
3
+ Simple.
4
+
5
+ Gemfile:
6
+
7
+ gem 'exportr', :git => 'git://github.com/richardcalahan/exportr.git'
8
+
9
+ CLI:
10
+
11
+ rails generate exportr
12
+
13
+ Add environment variables to config/exportr.yml:
14
+
15
+ FACEBOOK_APP_ID: '124323434564'
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/bin/exportr ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ lib = File.expand_path(File.dirname(__FILE__) + "/../lib")
4
+ $LOAD_PATH.unshift(lib) if File.directory?(lib) && !$LOAD_PATH.include?(lib)
5
+
6
+ require 'exportr'
7
+
8
+ puts "exportr rules"
data/exportr.gemspec ADDED
@@ -0,0 +1,24 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "exportr/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "exportr"
7
+ s.version = Exportr::VERSION
8
+ s.authors = ["Richard Calahan"]
9
+ s.email = ["richard@alldayeveryday.com"]
10
+ s.homepage = ""
11
+ s.summary = 'Rails environment variable manager'
12
+ s.description = 'Helps manage rails application specific environment variables for multiple apps in development.'
13
+
14
+ s.rubyforge_project = "exportr"
15
+
16
+ s.files = `git ls-files`.split("\n")
17
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
+ s.require_paths = ["lib"]
20
+
21
+ # specify any dependencies here; for example:
22
+ # s.add_development_dependency "rspec"
23
+ # s.add_runtime_dependency "rest-client"
24
+ end
@@ -0,0 +1,3 @@
1
+ module Exportr
2
+ VERSION = "0.0.3"
3
+ end
data/lib/exportr.rb ADDED
@@ -0,0 +1,3 @@
1
+ require "exportr/version"
2
+
3
+ module Exportr; end
@@ -0,0 +1,20 @@
1
+ class ExportrGenerator < Rails::Generators::Base
2
+
3
+ source_root File.expand_path('../templates', __FILE__)
4
+
5
+ def generate_initializer
6
+ copy_file 'exportr.yml', 'config/exportr.yml'
7
+ copy_file 'exportr.rb', 'config/initializers/exportr.rb'
8
+ end
9
+
10
+ def mod_gitignore
11
+ File.open("#{Rails.root}/.gitignore", 'a+') do |f|
12
+ f.puts
13
+ f.puts
14
+ f.puts '# Ignoring local env export'
15
+ f.puts 'config/exportr.yml'
16
+ f.puts
17
+ end
18
+ end
19
+
20
+ end
@@ -0,0 +1,6 @@
1
+ # Loads export.yml and sets key=value to the local environment
2
+
3
+ if File.exists? "#{Rails.root}/config/exportr.yml"
4
+ config = YAML.load(File.open("#{Rails.root}/config/exportr.yml"))
5
+ config.each_pair { |key,value| ENV[key] = value } if config
6
+ end
@@ -0,0 +1,8 @@
1
+ # This file is loaded at app initialization to set app specific environment variables
2
+ # set environment variables in the format [KEY]: [VALUE], each separated by a newline
3
+
4
+ # Examples:
5
+ # FACEBOOK_APP_KEY: '234443366312034'
6
+ # S3_BUCKET: 'myapp-production'
7
+
8
+ ---
metadata ADDED
@@ -0,0 +1,58 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: exportr
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Richard Calahan
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-03-29 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: Helps manage rails application specific environment variables for multiple
15
+ apps in development.
16
+ email:
17
+ - richard@alldayeveryday.com
18
+ executables:
19
+ - exportr
20
+ extensions: []
21
+ extra_rdoc_files: []
22
+ files:
23
+ - .gitignore
24
+ - Gemfile
25
+ - README
26
+ - Rakefile
27
+ - bin/exportr
28
+ - exportr.gemspec
29
+ - lib/exportr.rb
30
+ - lib/exportr/version.rb
31
+ - lib/generators/exportr/exportr_generator.rb
32
+ - lib/generators/exportr/templates/exportr.rb
33
+ - lib/generators/exportr/templates/exportr.yml
34
+ homepage: ''
35
+ licenses: []
36
+ post_install_message:
37
+ rdoc_options: []
38
+ require_paths:
39
+ - lib
40
+ required_ruby_version: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ required_rubygems_version: !ruby/object:Gem::Requirement
47
+ none: false
48
+ requirements:
49
+ - - ! '>='
50
+ - !ruby/object:Gem::Version
51
+ version: '0'
52
+ requirements: []
53
+ rubyforge_project: exportr
54
+ rubygems_version: 1.8.6
55
+ signing_key:
56
+ specification_version: 3
57
+ summary: Rails environment variable manager
58
+ test_files: []