corundum 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
1
  require 'corundum/tasklib'
2
+ require 'corundum/configuration_store'
2
3
 
3
4
  #require 'rubygems'
4
5
  #require 'rubygems/installer'
@@ -13,7 +14,7 @@ module Corundum
13
14
  :finished_dir => "corundum",
14
15
  :package_dir => "pkg",
15
16
  :doc_dir => "rubydoc",
16
- :browser => "chromium",
17
+ :browser => Corundum.user_preferences["browser"],
17
18
  :finished_files => nested.nil_fields(:build, :qa, :package, :release, :press),
18
19
  :files => nested.nil_fields(:code, :test, :docs),
19
20
  :rubyforge => nested.nil_fields(:group_id, :package_id, :release_name, :home_page, :project_page),
@@ -0,0 +1,38 @@
1
+ require 'valise'
2
+
3
+ module Corundum
4
+ class ConfigurationStore
5
+ def initialize
6
+ @valise = Valise::Set.define do
7
+ rw "~/.corundum"
8
+ rw "/usr/share/corundum"
9
+ rw "/etc/corundum"
10
+ ro from_here("default_configuration")
11
+
12
+ handle "preferences.yaml", :yaml, :hash_merge
13
+ end
14
+
15
+ @loaded ||= Hash.new{|h,k| h[k] = @valise.find(k).contents}
16
+ end
17
+
18
+ attr_reader :loaded
19
+
20
+ def register_search_path(from_file)
21
+ directory = File::dirname(from_file)
22
+ @valise.prepend_search_root(Valise::SearchRoot.new(directory))
23
+ loaded.clear
24
+ end
25
+ end
26
+
27
+ def self.configuration_store
28
+ @configuration_store ||= ConfigurationStore.new
29
+ end
30
+
31
+ def self.register_project(rakefile)
32
+ configuration_store.register_search_path(rakefile)
33
+ end
34
+
35
+ def self.user_preferences
36
+ configuration_store.loaded["preferences.yaml"]
37
+ end
38
+ end
@@ -0,0 +1 @@
1
+ browser: chromium
@@ -70,8 +70,6 @@ module Corundum
70
70
  result.stdout.lines.to_a
71
71
  end
72
72
 
73
- $verbose = true
74
-
75
73
  def define
76
74
  in_namespace do
77
75
  InDirCommandTask.new(self) do |t|
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: corundum
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.7
5
+ version: 0.0.8
6
6
  platform: ruby
7
7
  authors:
8
8
  - Judson Lester
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-01-31 00:00:00 Z
13
+ date: 2012-02-01 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: corundum
@@ -211,6 +211,8 @@ files:
211
211
  - lib/corundum/version_control.rb
212
212
  - lib/corundum/version_control/monotone.rb
213
213
  - lib/corundum/version_control/git.rb
214
+ - lib/corundum/configuration_store.rb
215
+ - lib/corundum/default_configuration/preferences.yaml
214
216
  - lib/corundum.rb
215
217
  - README.md
216
218
  - spec/smoking_spec.rb
@@ -278,7 +280,7 @@ rdoc_options:
278
280
  - --main
279
281
  - doc/README
280
282
  - --title
281
- - corundum-0.0.7 RDoc
283
+ - corundum-0.0.8 RDoc
282
284
  require_paths:
283
285
  - lib/
284
286
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -286,7 +288,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
286
288
  requirements:
287
289
  - - ">="
288
290
  - !ruby/object:Gem::Version
289
- hash: -719336563
291
+ hash: 508057427
290
292
  segments:
291
293
  - 0
292
294
  version: "0"