multa_arcana 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +20 -0
- data/README.rdoc +2 -0
- data/Rakefile +27 -0
- data/lib/multa_arcana.rb +1 -0
- data/lib/multa_arcana/multa_arcana.rb +17 -0
- data/lib/multa_arcana/version.rb +3 -0
- data/spec/multa_arcana_spec.rb +20 -0
- data/spec/secrets.yml +3 -0
- data/spec/spec_helper.rb +15 -0
- metadata +128 -0
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2012 YOURNAME
|
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
data/Rakefile
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
begin
|
3
|
+
require 'bundler/setup'
|
4
|
+
rescue LoadError
|
5
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
6
|
+
end
|
7
|
+
|
8
|
+
require 'rdoc/task'
|
9
|
+
|
10
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
11
|
+
rdoc.rdoc_dir = 'rdoc'
|
12
|
+
rdoc.title = 'multa_arcana'
|
13
|
+
rdoc.options << '--line-numbers'
|
14
|
+
rdoc.rdoc_files.include('README.rdoc')
|
15
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
16
|
+
end
|
17
|
+
|
18
|
+
Bundler::GemHelper.install_tasks
|
19
|
+
|
20
|
+
require 'rake/testtask'
|
21
|
+
|
22
|
+
require 'rspec/core/rake_task'
|
23
|
+
RSpec::Core::RakeTask.new(:spec) do |t|
|
24
|
+
t.pattern = 'spec/**/*_spec.rb'
|
25
|
+
end
|
26
|
+
|
27
|
+
task :default => :spec
|
data/lib/multa_arcana.rb
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'multa_arcana/multa_arcana.rb'
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class MultaArcana
|
2
|
+
DEFAULT_SECRET_FILE = 'secrets.yml'
|
3
|
+
@@secrets = nil
|
4
|
+
|
5
|
+
def self.secret_for(tag, fname = nil)
|
6
|
+
load_file(fname)
|
7
|
+
@@secrets[tag.to_s]
|
8
|
+
end
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def self.load_file(fname)
|
13
|
+
@@secret_file ||= fname
|
14
|
+
@@secret_file ||= DEFAULT_SECRET_FILE
|
15
|
+
@@secrets ||= YAML::load(File.read(@@secret_file))
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe MultaArcana do
|
4
|
+
it "reports version" do
|
5
|
+
MultaArcana::VERSION.should_not be_nil
|
6
|
+
end
|
7
|
+
|
8
|
+
it "loads secrets manually" do
|
9
|
+
MultaArcana::load_file(File.expand_path('../secrets.yml', __FILE__))
|
10
|
+
MultaArcana::secret_for(:foo).should == "FooSecret"
|
11
|
+
MultaArcana::secret_for('foo').should == "FooSecret"
|
12
|
+
end
|
13
|
+
|
14
|
+
it "loads inline" do
|
15
|
+
fname = File.expand_path('../secrets.yml', __FILE__)
|
16
|
+
MultaArcana::secret_for(:bar, fname).should == "BarSecret"
|
17
|
+
MultaArcana::secret_for('bar').should == "BarSecret"
|
18
|
+
MultaArcana::secret_for('not_there').should == nil
|
19
|
+
end
|
20
|
+
end
|
data/spec/secrets.yml
ADDED
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler/setup'
|
3
|
+
require 'rspec/autorun'
|
4
|
+
|
5
|
+
require 'multa_arcana'
|
6
|
+
|
7
|
+
RSpec.configure do |config|
|
8
|
+
config.backtrace_clean_patterns = [
|
9
|
+
#/\/lib\d*\/ruby\//,
|
10
|
+
#/bin\//,
|
11
|
+
#/gems/,
|
12
|
+
#/spec\/spec_helper\.rb/,
|
13
|
+
/lib\/rspec\/(core|expectations|matchers|mocks)/
|
14
|
+
]
|
15
|
+
end
|
metadata
ADDED
@@ -0,0 +1,128 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: multa_arcana
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Michael Graff
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-02-21 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rspec
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rake
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: rdoc
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 2.4.2
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 2.4.2
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: debugger
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ~>
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: 1.1.2
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ~>
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 1.1.2
|
78
|
+
description: Store secrets in one file, and access them from anywhere inside a Rails
|
79
|
+
app (or any Ruby code).
|
80
|
+
email:
|
81
|
+
- explorer@flame.org
|
82
|
+
executables: []
|
83
|
+
extensions: []
|
84
|
+
extra_rdoc_files: []
|
85
|
+
files:
|
86
|
+
- lib/multa_arcana/multa_arcana.rb
|
87
|
+
- lib/multa_arcana/version.rb
|
88
|
+
- lib/multa_arcana.rb
|
89
|
+
- MIT-LICENSE
|
90
|
+
- Rakefile
|
91
|
+
- README.rdoc
|
92
|
+
- spec/multa_arcana_spec.rb
|
93
|
+
- spec/secrets.yml
|
94
|
+
- spec/spec_helper.rb
|
95
|
+
homepage: http://github.com/skandragon/multa_arcana
|
96
|
+
licenses: []
|
97
|
+
post_install_message:
|
98
|
+
rdoc_options: []
|
99
|
+
require_paths:
|
100
|
+
- lib
|
101
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
102
|
+
none: false
|
103
|
+
requirements:
|
104
|
+
- - ! '>='
|
105
|
+
- !ruby/object:Gem::Version
|
106
|
+
version: '0'
|
107
|
+
segments:
|
108
|
+
- 0
|
109
|
+
hash: -2306113203788297579
|
110
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
111
|
+
none: false
|
112
|
+
requirements:
|
113
|
+
- - ! '>='
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
version: '0'
|
116
|
+
segments:
|
117
|
+
- 0
|
118
|
+
hash: -2306113203788297579
|
119
|
+
requirements: []
|
120
|
+
rubyforge_project:
|
121
|
+
rubygems_version: 1.8.25
|
122
|
+
signing_key:
|
123
|
+
specification_version: 3
|
124
|
+
summary: Keep secrets secret
|
125
|
+
test_files:
|
126
|
+
- spec/multa_arcana_spec.rb
|
127
|
+
- spec/secrets.yml
|
128
|
+
- spec/spec_helper.rb
|