shutl_yaml_properties 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +20 -0
- data/.rspec +2 -0
- data/.ruby-version +1 -0
- data/Gemfile +7 -0
- data/LICENSE.txt +22 -0
- data/README.md +54 -0
- data/Rakefile +1 -0
- data/bin/yaml_diff +7 -0
- data/config/license_finder.yml +20 -0
- data/config/properties.yml +0 -0
- data/doc/dependencies.csv +25 -0
- data/doc/dependencies.db +0 -0
- data/doc/dependencies.html +954 -0
- data/lib/yaml_properties/diff.rb +40 -0
- data/lib/yaml_properties/version.rb +3 -0
- data/lib/yaml_properties.rb +54 -0
- data/spec/diff_spec.rb +23 -0
- data/spec/fixtures/erb.yml +1 -0
- data/spec/fixtures/file1.yml +3 -0
- data/spec/fixtures/file2.yml +4 -0
- data/spec/fixtures/file3.yml +3 -0
- data/spec/fixtures/file4.yml +3 -0
- data/spec/fixtures/test.yml +1 -0
- data/spec/spec_helper.rb +17 -0
- data/spec/yaml_config_spec.rb +127 -0
- data/yaml_properties.gemspec +36 -0
- metadata +138 -0
data/.gitignore
ADDED
data/.rspec
ADDED
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
1.9.3
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 Mark Burns
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
# YamlProperties
|
2
|
+
|
3
|
+
If you find yourself often setting app config in yaml files for different
|
4
|
+
environments etc. Then this can be quite useful to simply access those variables.
|
5
|
+
|
6
|
+
## Examples
|
7
|
+
```ruby
|
8
|
+
#usual bundler install
|
9
|
+
gem 'yaml_config'
|
10
|
+
|
11
|
+
#usage in your code
|
12
|
+
YamlProperties.redis_port
|
13
|
+
YamlProperties.smtp_server
|
14
|
+
|
15
|
+
# data in config/properties.yml
|
16
|
+
redis_port: 1369
|
17
|
+
smtp_server: smtp.example.com
|
18
|
+
```
|
19
|
+
|
20
|
+
Also can be added to a module or class like
|
21
|
+
|
22
|
+
```ruby
|
23
|
+
module YourFunkyConfigThing
|
24
|
+
extend YamlProperties
|
25
|
+
|
26
|
+
#Override filename like this
|
27
|
+
def self.yaml_file
|
28
|
+
ENV['SINATRA_ENV'] == 'development' ? 'config/properties.yml' : 'config/properties_production.yml'
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
|
33
|
+
#Always reload e.g. in Rails dev environment
|
34
|
+
YamlProperties.dev_environment = Rails.env.development?
|
35
|
+
```
|
36
|
+
|
37
|
+
|
38
|
+
##For Cucumber etc
|
39
|
+
```ruby
|
40
|
+
|
41
|
+
#features/support/env.rb
|
42
|
+
After do |scenario|
|
43
|
+
YamlProperties.reset!
|
44
|
+
end
|
45
|
+
|
46
|
+
#features/step_definitions/egg_steps.rb
|
47
|
+
Given /\AThere are \d+ eggs in a dozen\z/ |dozen|
|
48
|
+
YamlProperties.override_attribute :egg, dozen
|
49
|
+
end
|
50
|
+
```
|
51
|
+
|
52
|
+
#Yadayada
|
53
|
+
|
54
|
+
Usual gem/bundler usage/contribution guidelines
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/bin/yaml_diff
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
---
|
2
|
+
whitelist:
|
3
|
+
- MIT
|
4
|
+
- Apache 2.0
|
5
|
+
- ruby
|
6
|
+
- BSD
|
7
|
+
- ISC
|
8
|
+
- LGPL-3
|
9
|
+
- GPLv2
|
10
|
+
- LGPL
|
11
|
+
- Apache License 2.0
|
12
|
+
- LGPL-3.0
|
13
|
+
- Apache License Version 2.0
|
14
|
+
- 2-clause BSDL
|
15
|
+
- New BSD
|
16
|
+
- commercial
|
17
|
+
ignore_groups: []
|
18
|
+
|
19
|
+
dependencies_file_dir: ./doc/
|
20
|
+
project_name: # project name
|
File without changes
|
@@ -0,0 +1,25 @@
|
|
1
|
+
activesupport, 4.0.0, MIT
|
2
|
+
atomic, 1.1.13, Apache-2.0
|
3
|
+
bundler, 1.3.5, MIT
|
4
|
+
columnize, 0.3.6, Ruby
|
5
|
+
debugger, 1.4.0, BSD
|
6
|
+
debugger-linecache, 1.1.2, MIT
|
7
|
+
debugger-ruby_core_source, 1.2.3, MIT
|
8
|
+
diff-lcs, 1.2.4, MIT
|
9
|
+
httparty, 0.11.0, MIT
|
10
|
+
i18n, 0.6.5, MIT
|
11
|
+
license_finder, 0.9.2, MIT
|
12
|
+
minitest, 4.7.5, MIT
|
13
|
+
multi_json, 1.8.0, MIT
|
14
|
+
multi_xml, 0.5.5, MIT
|
15
|
+
rake, 10.1.0, MIT
|
16
|
+
rspec, 2.14.1, MIT
|
17
|
+
rspec-core, 2.14.5, MIT
|
18
|
+
rspec-expectations, 2.14.2, MIT
|
19
|
+
rspec-mocks, 2.14.3, MIT
|
20
|
+
sequel, 4.2.0, MIT
|
21
|
+
sqlite3, 1.3.8, MIT
|
22
|
+
thor, 0.18.1, MIT
|
23
|
+
thread_safe, 0.1.2, Apache-2.0
|
24
|
+
tzinfo, 0.3.37, MIT
|
25
|
+
yaml_properties, 0.0.11, MIT
|
data/doc/dependencies.db
ADDED
Binary file
|