rails_secret_token_env 0.1
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.
- checksums.yaml +15 -0
- data/CHANGELOG +1 -0
- data/Manifest +5 -0
- data/README +13 -0
- data/Rakefile +9 -0
- data/lib/rails_secret_token_env.rb +8 -0
- data/rails_secret_token_env.gemspec +32 -0
- metadata +72 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
!binary "U0hBMQ==":
|
|
3
|
+
metadata.gz: !binary |-
|
|
4
|
+
NjllMTAwNzYyMjJiOWM0NTJmOWMzYzY4ZmZkODAxNTZlNTUxNjgzYQ==
|
|
5
|
+
data.tar.gz: !binary |-
|
|
6
|
+
YTlhMjk0M2JiYTgxYWNkMWIzNjA0ZTYxMTdlZThiNmQ2NGViYTBiZQ==
|
|
7
|
+
!binary "U0hBNTEy":
|
|
8
|
+
metadata.gz: !binary |-
|
|
9
|
+
YWIyODY1YjFjYTMzODUxMWIzNzQwNGI5ZTQ0NGE1YzgxNzdkOGU1OWVhM2Qz
|
|
10
|
+
Y2RlYjllZjg1NTgzZWJkNGY4NDE0ZWM2NjA4MGMyZjBiZWU1NDc3M2ExYTMy
|
|
11
|
+
MTg1YmQwZjQzMDFkZjI1NGM3MDdlYmIzOTU5NTJiNDVkMWZkMzI=
|
|
12
|
+
data.tar.gz: !binary |-
|
|
13
|
+
ZGVjYzJiOTVjZGJkNWMxMWVmODk1MzBhYzhlODE4Mzk0MGJjMGE5MjhkNTZj
|
|
14
|
+
NjYxNDhhMzZiNjEyM2NkNjgwNTZkYzIzYWRmMTRjYjk3YjlkNTNhMjcxOGFk
|
|
15
|
+
YTRjNjI0N2Q0MWFlZmNjMTgxNjAzMzI5OWFiMDU3MzQ2NzQxMWY=
|
data/CHANGELOG
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
v0.1. first version
|
data/Manifest
ADDED
data/README
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
### Manage config.secret_token with environment variable
|
|
2
|
+
|
|
3
|
+
Put this in your rails app's Gemfile:
|
|
4
|
+
|
|
5
|
+
gem 'rails_secret_token_env'
|
|
6
|
+
|
|
7
|
+
This will set your app's config.secret_token to the SECRET_TOKEN environment
|
|
8
|
+
variable.
|
|
9
|
+
|
|
10
|
+
In production mode, it will raise an error if the variable is missing. (In
|
|
11
|
+
development mode, it will default to 'xxxxxx' if not found)
|
|
12
|
+
|
|
13
|
+
See also: gem 'dotenv'
|
data/Rakefile
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
require 'echoe'
|
|
2
|
+
|
|
3
|
+
Echoe.new("rails_secret_token_env") do |p|
|
|
4
|
+
p.author = "Andrew Snow"
|
|
5
|
+
p.email = 'andrew@modulus.org'
|
|
6
|
+
p.summary = "Ruby gem to initialize Rails config.secret_token from an environment variable"
|
|
7
|
+
p.url = "https://github.com/andys/rails_secret_token_env"
|
|
8
|
+
p.runtime_dependencies = ['railties']
|
|
9
|
+
end
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
require 'rails'
|
|
2
|
+
|
|
3
|
+
class RailsSecretTokenEnv < Rails::Railtie
|
|
4
|
+
initializer "my_railtie.configure_rails_initialization" do |app|
|
|
5
|
+
raise "Missing SECRET_TOKEN environment" if ENV['SECRET_TOKEN'].blank? && Rails.env.production?
|
|
6
|
+
app.config.secret_token = ENV['SECRET_TOKEN'] || ('x' * 30)
|
|
7
|
+
end
|
|
8
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
|
2
|
+
|
|
3
|
+
Gem::Specification.new do |s|
|
|
4
|
+
s.name = "rails_secret_token_env"
|
|
5
|
+
s.version = "0.1"
|
|
6
|
+
|
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
|
8
|
+
s.authors = ["Andrew Snow"]
|
|
9
|
+
s.date = "2013-06-23"
|
|
10
|
+
s.description = "Ruby gem to initialize Rails config.secret_token from an environment variable"
|
|
11
|
+
s.email = "andrew@modulus.org"
|
|
12
|
+
s.extra_rdoc_files = ["CHANGELOG", "README", "lib/rails_secret_token_env.rb"]
|
|
13
|
+
s.files = ["CHANGELOG", "README", "Rakefile", "lib/rails_secret_token_env.rb", "Manifest", "rails_secret_token_env.gemspec"]
|
|
14
|
+
s.homepage = "https://github.com/andys/rails_secret_token_env"
|
|
15
|
+
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Rails_secret_token_env", "--main", "README"]
|
|
16
|
+
s.require_paths = ["lib"]
|
|
17
|
+
s.rubyforge_project = "rails_secret_token_env"
|
|
18
|
+
s.rubygems_version = "2.0.3"
|
|
19
|
+
s.summary = "Ruby gem to initialize Rails config.secret_token from an environment variable"
|
|
20
|
+
|
|
21
|
+
if s.respond_to? :specification_version then
|
|
22
|
+
s.specification_version = 4
|
|
23
|
+
|
|
24
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
|
25
|
+
s.add_runtime_dependency(%q<railties>, [">= 0"])
|
|
26
|
+
else
|
|
27
|
+
s.add_dependency(%q<railties>, [">= 0"])
|
|
28
|
+
end
|
|
29
|
+
else
|
|
30
|
+
s.add_dependency(%q<railties>, [">= 0"])
|
|
31
|
+
end
|
|
32
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: rails_secret_token_env
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: '0.1'
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Andrew Snow
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2013-06-23 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
type: :runtime
|
|
15
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - ! '>='
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '0'
|
|
20
|
+
prerelease: false
|
|
21
|
+
name: railties
|
|
22
|
+
requirement: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - ! '>='
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '0'
|
|
27
|
+
description: Ruby gem to initialize Rails config.secret_token from an environment
|
|
28
|
+
variable
|
|
29
|
+
email: andrew@modulus.org
|
|
30
|
+
executables: []
|
|
31
|
+
extensions: []
|
|
32
|
+
extra_rdoc_files:
|
|
33
|
+
- CHANGELOG
|
|
34
|
+
- README
|
|
35
|
+
- lib/rails_secret_token_env.rb
|
|
36
|
+
files:
|
|
37
|
+
- CHANGELOG
|
|
38
|
+
- README
|
|
39
|
+
- Rakefile
|
|
40
|
+
- lib/rails_secret_token_env.rb
|
|
41
|
+
- Manifest
|
|
42
|
+
- rails_secret_token_env.gemspec
|
|
43
|
+
homepage: https://github.com/andys/rails_secret_token_env
|
|
44
|
+
licenses: []
|
|
45
|
+
metadata: {}
|
|
46
|
+
post_install_message:
|
|
47
|
+
rdoc_options:
|
|
48
|
+
- --line-numbers
|
|
49
|
+
- --inline-source
|
|
50
|
+
- --title
|
|
51
|
+
- Rails_secret_token_env
|
|
52
|
+
- --main
|
|
53
|
+
- README
|
|
54
|
+
require_paths:
|
|
55
|
+
- lib
|
|
56
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
57
|
+
requirements:
|
|
58
|
+
- - ! '>='
|
|
59
|
+
- !ruby/object:Gem::Version
|
|
60
|
+
version: '0'
|
|
61
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
62
|
+
requirements:
|
|
63
|
+
- - ! '>='
|
|
64
|
+
- !ruby/object:Gem::Version
|
|
65
|
+
version: '1.2'
|
|
66
|
+
requirements: []
|
|
67
|
+
rubyforge_project: rails_secret_token_env
|
|
68
|
+
rubygems_version: 2.0.3
|
|
69
|
+
signing_key:
|
|
70
|
+
specification_version: 4
|
|
71
|
+
summary: Ruby gem to initialize Rails config.secret_token from an environment variable
|
|
72
|
+
test_files: []
|