yaml_config_file 0.2.0 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +11 -0
- data/VERSION +1 -1
- data/lib/generators/yaml_config_file/yaml_config_file_generator.rb +33 -2
- data/yaml_config_file.gemspec +4 -1
- metadata +20 -5
data/Rakefile
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'rake'
|
3
|
+
require 'rake/rdoctask'
|
3
4
|
|
4
5
|
begin
|
5
6
|
require 'jeweler'
|
@@ -10,6 +11,7 @@ begin
|
|
10
11
|
gem.email = "tcravit@taylored-software.com"
|
11
12
|
gem.homepage = "http://github.com/tammycravit/yaml_config_file"
|
12
13
|
gem.authors = ["Tammy Cravit"]
|
14
|
+
gem.add_dependency "rails", ">= 3.0.0"
|
13
15
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
14
16
|
end
|
15
17
|
Jeweler::GemcutterTasks.new
|
@@ -17,3 +19,12 @@ rescue LoadError
|
|
17
19
|
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
18
20
|
end
|
19
21
|
|
22
|
+
Rake::RDocTask.new do |rdoc|
|
23
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
24
|
+
|
25
|
+
rdoc.rdoc_dir = 'rdoc'
|
26
|
+
|
27
|
+
rdoc.title = "yaml_config_file #{version}"
|
28
|
+
rdoc.rdoc_files.include('README.rdoc')
|
29
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
30
|
+
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.2
|
@@ -1,17 +1,48 @@
|
|
1
|
+
# Generate a YAML configuration file, and an initializer to access the
|
2
|
+
# settings stored there.
|
3
|
+
#
|
4
|
+
# == Structure of the YAML Configuration File
|
5
|
+
#
|
6
|
+
# The YAML configuration file is a standard YAML file, similar to the
|
7
|
+
# standard Rails +database.yml+ file. It contains sections for each
|
8
|
+
# Rails environment, as well as a *global* section. The environment-specific
|
9
|
+
# section is parsed after the global section, so you can define settings
|
10
|
+
# and then override them on an environment-specific basis, like so:
|
11
|
+
#
|
12
|
+
# global:
|
13
|
+
# some_setting: false
|
14
|
+
# another_setting: 3
|
15
|
+
#
|
16
|
+
# development:
|
17
|
+
# some_setting: true # Will be true in development environment, false otherwise
|
18
|
+
#
|
19
|
+
# The YAML file is also evaluated through ERB, like Rails' database.yml,
|
20
|
+
# so you can use ERB blocks in your configuration file.
|
21
|
+
|
1
22
|
class YamlConfigFileGenerator < Rails::Generators::NamedBase
|
2
23
|
|
3
24
|
source_root File.expand_path('../templates', __FILE__)
|
4
25
|
|
26
|
+
# Option to skip generation of the YAML file
|
5
27
|
class_option :skip_yaml_file, :type => :boolean, :default => false, :description => "Skip generation of the YAML file"
|
28
|
+
|
29
|
+
# Option to skip generation of the initializer
|
6
30
|
class_option :skip_initializer, :type => :boolean, :default => false, :description => "Skip generation of the initializer"
|
7
31
|
|
32
|
+
# Generates the YAML configuration file.
|
8
33
|
def yaml_config_file
|
9
34
|
template "config_file.yml", "config/#{gen_file_name}.yml" unless options.skip_yaml_file?
|
10
|
-
template "config_file.rb", "config/initializers/#{gen_file_name}.rb" unless options.skip_initializer?
|
11
35
|
end
|
36
|
+
|
37
|
+
# Generates the initializer.
|
38
|
+
def initializer
|
39
|
+
template "config_file.rb", "config/initializers/#{gen_file_name}.rb" unless options.skip_initializer?
|
40
|
+
end
|
12
41
|
|
13
42
|
private
|
43
|
+
|
44
|
+
# Underscore the file name if it's provided CamelCased.
|
14
45
|
def gen_file_name
|
15
46
|
file_name.underscore
|
16
47
|
end
|
17
|
-
end
|
48
|
+
end
|
data/yaml_config_file.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{yaml_config_file}
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Tammy Cravit"]
|
@@ -42,9 +42,12 @@ Gem::Specification.new do |s|
|
|
42
42
|
s.specification_version = 3
|
43
43
|
|
44
44
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
45
|
+
s.add_runtime_dependency(%q<rails>, [">= 3.0.0"])
|
45
46
|
else
|
47
|
+
s.add_dependency(%q<rails>, [">= 3.0.0"])
|
46
48
|
end
|
47
49
|
else
|
50
|
+
s.add_dependency(%q<rails>, [">= 3.0.0"])
|
48
51
|
end
|
49
52
|
end
|
50
53
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yaml_config_file
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 2
|
10
|
+
version: 0.2.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Tammy Cravit
|
@@ -17,8 +17,23 @@ cert_chain: []
|
|
17
17
|
|
18
18
|
date: 2010-09-24 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
|
-
dependencies:
|
21
|
-
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: rails
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 7
|
30
|
+
segments:
|
31
|
+
- 3
|
32
|
+
- 0
|
33
|
+
- 0
|
34
|
+
version: 3.0.0
|
35
|
+
type: :runtime
|
36
|
+
version_requirements: *id001
|
22
37
|
description: YAML Configuration File generator for Rails 3
|
23
38
|
email: tcravit@taylored-software.com
|
24
39
|
executables: []
|