dotconfig 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml ADDED
@@ -0,0 +1,6 @@
1
+ # Travis CI configuration:
2
+
3
+ language: ruby
4
+ rvm:
5
+ - 1.9.2
6
+ - 1.9.3
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  * Initial release
4
4
 
5
- ## Version 0.0.1
5
+ ## Version 0.0.2
6
6
 
7
7
  * Correcting the summary of the gem
8
+
9
+ ## Version 0.0.3
10
+
11
+ * Adding rake dependency
12
+ * Adding continuous integration with Travis CI
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # DotConfig
1
+ # DotConfig [![Build Status](https://travis-ci.org/GRoguelon/DotConfig.png?branch=master)](https://travis-ci.org/GRoguelon/DotConfig)
2
2
 
3
3
  The DotConfig gem give you access to your configuration via the dot syntax. You instantiate DotConfig::Configuration with a Hash and you will retrieve the values in calling the key as method name.
4
4
 
data/dotconfig.gemspec CHANGED
@@ -22,6 +22,7 @@ Gem::Specification.new do |gem|
22
22
  gem.require_paths = %w{lib}
23
23
 
24
24
  gem.add_development_dependency 'activesupport', '~> 3.0'
25
+ gem.add_development_dependency 'rake'
25
26
 
26
27
  gem.required_ruby_version = '>= 1.9.1'
27
28
  end
data/lib/dot_config.rb CHANGED
@@ -16,6 +16,12 @@ module DotConfig
16
16
  # which represent the YAML file to load.
17
17
  # @param [Boolean] writing Determines if the +Configuration+ is mutable.
18
18
  # @return [Configuration] The +Configuration+ instance.
19
+ # @example Generate a new instance of the +DotConfig::Configuration+ class with an initial hash:
20
+ # DotConfig.new(your_hash) #=> #<DotConfig::Configuration:0x007fa5d38f4fa0>
21
+ # DotConfig.new(your_hash, true) #=> #<DotConfig::Configuration:0x007fa5d38f4fa0>
22
+ # @example Generate a new instance of the +DotConfig::Configuration+ class with a YAML file:
23
+ # DotConfig.new(yaml_path) #=> #<DotConfig::Configuration:0x007fa5d38f4fa0>
24
+ # DotConfig.new(yaml_path, true) #=> #<DotConfig::Configuration:0x007fa5d38f4fa0>
19
25
  def self.new(config, writing = false)
20
26
  if config.is_a?(Hash)
21
27
  Configuration.new(config: config, writing: writing)
@@ -5,6 +5,17 @@ module DotConfig
5
5
  # This class gives you access to the configuration with dot syntax.
6
6
  #
7
7
  # @author {mailto:geoffrey.roguelon@gmail.com Geoffrey Roguelon}
8
+ # @example Using the dot syntax (readonly):
9
+ # app_config = DotConfig::Configuration.new #=> #<DotConfig::Configuration:0x007fa5d38f4fa0>
10
+ # app_config.config = { ruby: { rails => '4.0.0', sinatra: '1.3.3' } }
11
+ # app_config.ruby.rails #=> '4.0.0'
12
+ # app_config.python #=> NoMethodError: undefined method `python' for #<DotConfig::Configuration:0x007fa5d38c23c0>
13
+ # @example Using the dot syntax:
14
+ # app_config = DotConfig::Configuration.new(writing: true) #=> #<DotConfig::Configuration:0x007fa5d38f4fa0>
15
+ # app_config.config = { ruby: { rails => '4.0.0', sinatra: '1.3.3' } }
16
+ # app_config.ruby.rails #=> '4.0.0'
17
+ # app_config.ruby.rails = '3.2.9'
18
+ # app_config.ruby.rails #=> '3.2.9'
8
19
  class Configuration
9
20
 
10
21
  # @!attribute config [r]
@@ -12,7 +12,7 @@ module DotConfig
12
12
  # The minor number version.
13
13
  MINOR = 0
14
14
  # The tiny number version.
15
- TINY = 2
15
+ TINY = 3
16
16
  # The pre realese number version.
17
17
  PRE = nil
18
18
  # The complete number version.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dotconfig
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -27,6 +27,22 @@ dependencies:
27
27
  - - ~>
28
28
  - !ruby/object:Gem::Version
29
29
  version: '3.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'
30
46
  description: ! 'Simplify your configuration with: DotConfig.new(language: :ruby).language
31
47
  #=> ''Ruby''.'
32
48
  email: geoffrey.roguelon@gmail.com
@@ -35,6 +51,7 @@ extensions: []
35
51
  extra_rdoc_files: []
36
52
  files:
37
53
  - .gitignore
54
+ - .travis.yml
38
55
  - CHANGELOG.md
39
56
  - Gemfile
40
57
  - LICENSE.txt