confection 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/.ruby CHANGED
@@ -11,6 +11,7 @@ copyrights:
11
11
  replacements: []
12
12
  alternatives: []
13
13
  requirements:
14
+ - name: blankslate
14
15
  - name: detroit
15
16
  groups:
16
17
  - build
@@ -27,6 +28,7 @@ repositories:
27
28
  name: upstream
28
29
  resources:
29
30
  home: http://rubyworks.github.com/confection
31
+ docs: http://rubydoc.info/gems/confection
30
32
  code: http://github.com/rubyworks/confection
31
33
  mail: http://groups.google.com/group/rubyworks-mailinglist
32
34
  extra: {}
@@ -36,7 +38,7 @@ revision: 0
36
38
  created: '2011-11-06'
37
39
  summary: Multi-tenant configuration for Ruby
38
40
  title: Confection
39
- version: 0.0.1
41
+ version: 0.0.2
40
42
  name: confection
41
43
  description: Confection is a multi-tenant configuration system for Ruby projects.
42
44
  organization: Rubyworks
data/.yardopts ADDED
@@ -0,0 +1,8 @@
1
+ --title "Confection"
2
+ --readme README.rdoc
3
+ --protected
4
+ --private
5
+ lib/**/*.rb
6
+ -
7
+ [A-Z]*.*
8
+
data/HISTORY.rdoc CHANGED
@@ -1,5 +1,18 @@
1
1
  = RELEASE HISTORY
2
2
 
3
+ == 0.0.2 / 2011-11-07
4
+
5
+ You can now use $CONFIG_FILE to change the default config file.
6
+ Just set the variable prior to using confection. Confection
7
+ should also work with Ruby 1.8.7 and older now.
8
+
9
+ Changes:
10
+
11
+ * Lazy load configuration, rather then loading upfront.
12
+ * Add dependency on blankslate gem for Ruby 1.8 and older.
13
+ * Add $CONFIG_FILE to allow default config file to be adjusted.
14
+
15
+
3
16
  == 0.0.1 / 2011-11-06
4
17
 
5
18
  This is the initial release of Confection.
data/README.rdoc CHANGED
@@ -17,10 +17,10 @@ and flexible in use.
17
17
 
18
18
  == Synopsis
19
19
 
20
- Create a file in you project called `.co.rb`. In it, add configuration blocks
20
+ Create a file in you project called `config.rb`. In it, add configuration blocks
21
21
  by name. As an example let's demonstrate how we could use this for Rake tasks.
22
22
 
23
- $ cat .co.rb
23
+ $ cat config.rb
24
24
  rake do
25
25
  desc 'generate yard docs'
26
26
  task :yard do
@@ -38,7 +38,7 @@ Now you might wonder why the heck you would do this. That's where the
38
38
  *multi-tenancy* comes into play. Let's add another configuration. This time
39
39
  for a tool that has native support for Confection.
40
40
 
41
- $ cat .confection
41
+ $ cat config.rb
42
42
  title = "myapp"
43
43
 
44
44
  rake do
@@ -0,0 +1,5 @@
1
+ if !defined?(BasicObject)
2
+ require 'blankslate'
3
+ ::BasicObject == ::BlankSlate
4
+ end
5
+
data/lib/confection.rb CHANGED
@@ -1,26 +1,34 @@
1
+ require 'confection/basic_object'
2
+
1
3
  # Welcome to Confection. Your easy means to tool configuration.
2
4
  #
3
5
  module Confection
4
6
 
5
7
  #
6
- FILENAMES = ['.config.rb', 'config.rb']
8
+ if $CONFIG_FILE
9
+ FILENAMES = [$CONFIG_FILE].flatten.compact
10
+ else
11
+ FILENAMES = ['.config.rb', 'config.rb']
12
+ end
7
13
 
8
14
  # Bootstrap the system, loading current configurations.
9
15
  #
10
16
  def self.bootstrap
17
+ @config = {}
11
18
  begin
12
19
  ::Kernel.eval(read, Evaluator.binding, file)
13
20
  rescue => e
14
21
  raise e if $DEBUG
15
22
  abort e.message
16
23
  end
24
+ @config
17
25
  end
18
26
 
19
27
  # Stores the configuration blocks.
20
28
  #
21
29
  # @return [Hash] configuration store
22
30
  def self.config
23
- @config ||= {}
31
+ @config ||= bootstrap
24
32
  end
25
33
 
26
34
  # Look-up configuration block.
@@ -133,7 +141,4 @@ def confection(name, *args)
133
141
  end
134
142
  end
135
143
 
136
- # Load configuration.
137
- Confection.bootstrap #(self)
138
-
139
144
  # Copyright (c) 2011 Rubyworks (BSD-2-Clause)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: confection
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,22 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-11-07 00:00:00.000000000 Z
12
+ date: 2011-11-08 00:00:00.000000000 Z
13
13
  dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: blankslate
16
+ requirement: &23201580 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *23201580
14
25
  - !ruby/object:Gem::Dependency
15
26
  name: detroit
16
- requirement: &26027680 !ruby/object:Gem::Requirement
27
+ requirement: &23200860 !ruby/object:Gem::Requirement
17
28
  none: false
18
29
  requirements:
19
30
  - - ! '>='
@@ -21,10 +32,10 @@ dependencies:
21
32
  version: '0'
22
33
  type: :development
23
34
  prerelease: false
24
- version_requirements: *26027680
35
+ version_requirements: *23200860
25
36
  - !ruby/object:Gem::Dependency
26
37
  name: qed
27
- requirement: &26026820 !ruby/object:Gem::Requirement
38
+ requirement: &23200280 !ruby/object:Gem::Requirement
28
39
  none: false
29
40
  requirements:
30
41
  - - ! '>='
@@ -32,7 +43,7 @@ dependencies:
32
43
  version: '0'
33
44
  type: :development
34
45
  prerelease: false
35
- version_requirements: *26026820
46
+ version_requirements: *23200280
36
47
  description: Confection is a multi-tenant configuration system for Ruby projects.
37
48
  email:
38
49
  - transfire@gmail.com
@@ -44,6 +55,8 @@ extra_rdoc_files:
44
55
  - COPYING.rdoc
45
56
  files:
46
57
  - .ruby
58
+ - .yardopts
59
+ - lib/confection/basic_object.rb
47
60
  - lib/confection.rb
48
61
  - HISTORY.rdoc
49
62
  - README.rdoc