configliere 0.1.1 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.textile CHANGED
@@ -1,3 +1,6 @@
1
+
2
+ * finally{} blocks don't supply a parameter any more -- use self instead.
3
+
1
4
  h2. Version 0.1.1 2010-08-17
2
5
 
3
6
  * Settings.read now does expand_path on the file path
data/Rakefile CHANGED
@@ -25,19 +25,19 @@ rescue LoadError
25
25
  puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
26
26
  end
27
27
 
28
- require 'spec/rake/spectask'
29
- Spec::Rake::SpecTask.new(:spec) do |spec|
30
- spec.libs << 'lib' << 'spec'
31
- spec.spec_files = FileList['spec/**/*_spec.rb']
32
- end
33
-
34
- Spec::Rake::SpecTask.new(:rcov) do |spec|
35
- spec.libs << 'lib' << 'spec'
36
- spec.pattern = 'spec/**/*_spec.rb'
37
- spec.rcov = true
38
- end
39
-
40
- task :spec => :check_dependencies
28
+ # require 'spec/rake/spectask'
29
+ # Spec::Rake::SpecTask.new(:spec) do |spec|
30
+ # spec.libs << 'lib' << 'spec'
31
+ # spec.spec_files = FileList['spec/**/*_spec.rb']
32
+ # end
33
+ #
34
+ # Spec::Rake::SpecTask.new(:rcov) do |spec|
35
+ # spec.libs << 'lib' << 'spec'
36
+ # spec.pattern = 'spec/**/*_spec.rb'
37
+ # spec.rcov = true
38
+ # end
39
+ #
40
+ # task :spec => :check_dependencies
41
41
 
42
42
  begin
43
43
  require 'reek/adapters/rake_task'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.2.1
data/configliere.gemspec CHANGED
@@ -1,15 +1,15 @@
1
1
  # Generated by jeweler
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{configliere}
8
- s.version = "0.1.1"
8
+ s.version = "0.2.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["mrflip"]
12
- s.date = %q{2010-08-19}
12
+ s.date = %q{2011-01-15}
13
13
  s.default_executable = %q{configliere}
14
14
  s.description = %q{ You've got a script. It's got some settings. Some settings are for this module, some are for that module. Most of them don't change. Except on your laptop, where the paths are different. Or when you're in production mode. Or when you're testing from the command line.
15
15
 
@@ -21,73 +21,71 @@ Configliere manage settings from many sources: static constants, simple config f
21
21
  s.executables = ["configliere"]
22
22
  s.extra_rdoc_files = [
23
23
  "LICENSE",
24
- "README.textile"
24
+ "README.textile"
25
25
  ]
26
26
  s.files = [
27
27
  ".document",
28
- ".gitignore",
29
- "CHANGELOG.textile",
30
- "LICENSE",
31
- "README.textile",
32
- "Rakefile",
33
- "VERSION",
34
- "bin/configliere",
35
- "configliere.gemspec",
36
- "examples/config_block_script.rb",
37
- "examples/encrypted_script.rb",
38
- "examples/env_var_script.rb",
39
- "examples/simple_script.rb",
40
- "examples/simple_script.yaml",
41
- "lib/configliere.rb",
42
- "lib/configliere/commandline.rb",
43
- "lib/configliere/config_block.rb",
44
- "lib/configliere/config_file.rb",
45
- "lib/configliere/core_ext.rb",
46
- "lib/configliere/core_ext/blank.rb",
47
- "lib/configliere/core_ext/hash.rb",
48
- "lib/configliere/core_ext/sash.rb",
49
- "lib/configliere/crypter.rb",
50
- "lib/configliere/define.rb",
51
- "lib/configliere/encrypted.rb",
52
- "lib/configliere/env_var.rb",
53
- "lib/configliere/git_style_binaries.rb",
54
- "lib/configliere/param.rb",
55
- "spec/configliere/commandline_spec.rb",
56
- "spec/configliere/config_block_spec.rb",
57
- "spec/configliere/config_file_spec.rb",
58
- "spec/configliere/core_ext/hash_spec.rb",
59
- "spec/configliere/core_ext/sash_spec.rb",
60
- "spec/configliere/crypter_spec.rb",
61
- "spec/configliere/define_spec.rb",
62
- "spec/configliere/encrypted_spec.rb",
63
- "spec/configliere/env_var_spec.rb",
64
- "spec/configliere/param_spec.rb",
65
- "spec/configliere_spec.rb",
66
- "spec/spec.opts",
67
- "spec/spec_helper.rb"
28
+ "CHANGELOG.textile",
29
+ "LICENSE",
30
+ "README.textile",
31
+ "Rakefile",
32
+ "VERSION",
33
+ "bin/configliere",
34
+ "configliere.gemspec",
35
+ "examples/config_block_script.rb",
36
+ "examples/encrypted_script.rb",
37
+ "examples/env_var_script.rb",
38
+ "examples/simple_script.rb",
39
+ "examples/simple_script.yaml",
40
+ "lib/configliere.rb",
41
+ "lib/configliere/commandline.rb",
42
+ "lib/configliere/config_block.rb",
43
+ "lib/configliere/config_file.rb",
44
+ "lib/configliere/core_ext.rb",
45
+ "lib/configliere/core_ext/blank.rb",
46
+ "lib/configliere/core_ext/hash.rb",
47
+ "lib/configliere/core_ext/sash.rb",
48
+ "lib/configliere/crypter.rb",
49
+ "lib/configliere/define.rb",
50
+ "lib/configliere/encrypted.rb",
51
+ "lib/configliere/env_var.rb",
52
+ "lib/configliere/git_style_binaries.rb",
53
+ "lib/configliere/param.rb",
54
+ "spec/configliere/commandline_spec.rb",
55
+ "spec/configliere/config_block_spec.rb",
56
+ "spec/configliere/config_file_spec.rb",
57
+ "spec/configliere/core_ext/hash_spec.rb",
58
+ "spec/configliere/core_ext/sash_spec.rb",
59
+ "spec/configliere/crypter_spec.rb",
60
+ "spec/configliere/define_spec.rb",
61
+ "spec/configliere/encrypted_spec.rb",
62
+ "spec/configliere/env_var_spec.rb",
63
+ "spec/configliere/param_spec.rb",
64
+ "spec/configliere_spec.rb",
65
+ "spec/spec.opts",
66
+ "spec/spec_helper.rb"
68
67
  ]
69
68
  s.homepage = %q{http://github.com/mrflip/configliere}
70
- s.rdoc_options = ["--charset=UTF-8"]
71
69
  s.require_paths = ["lib"]
72
70
  s.rubygems_version = %q{1.3.7}
73
71
  s.summary = %q{Wise, discreet configuration management}
74
72
  s.test_files = [
73
+ "examples/config_block_script.rb",
74
+ "examples/encrypted_script.rb",
75
+ "examples/env_var_script.rb",
76
+ "examples/simple_script.rb",
75
77
  "spec/configliere/commandline_spec.rb",
76
- "spec/configliere/config_block_spec.rb",
77
- "spec/configliere/config_file_spec.rb",
78
- "spec/configliere/core_ext/hash_spec.rb",
79
- "spec/configliere/core_ext/sash_spec.rb",
80
- "spec/configliere/crypter_spec.rb",
81
- "spec/configliere/define_spec.rb",
82
- "spec/configliere/encrypted_spec.rb",
83
- "spec/configliere/env_var_spec.rb",
84
- "spec/configliere/param_spec.rb",
85
- "spec/configliere_spec.rb",
86
- "spec/spec_helper.rb",
87
- "examples/config_block_script.rb",
88
- "examples/encrypted_script.rb",
89
- "examples/env_var_script.rb",
90
- "examples/simple_script.rb"
78
+ "spec/configliere/config_block_spec.rb",
79
+ "spec/configliere/config_file_spec.rb",
80
+ "spec/configliere/core_ext/hash_spec.rb",
81
+ "spec/configliere/core_ext/sash_spec.rb",
82
+ "spec/configliere/crypter_spec.rb",
83
+ "spec/configliere/define_spec.rb",
84
+ "spec/configliere/encrypted_spec.rb",
85
+ "spec/configliere/env_var_spec.rb",
86
+ "spec/configliere/param_spec.rb",
87
+ "spec/configliere_spec.rb",
88
+ "spec/spec_helper.rb"
91
89
  ]
92
90
 
93
91
  if s.respond_to? :specification_version then
@@ -46,7 +46,7 @@ module Configliere
46
46
  # call each +finally+ config block in the order it was defined
47
47
  def resolve_finally_blocks!
48
48
  final_blocks.each do |block|
49
- block.call(self)
49
+ block.call()
50
50
  end
51
51
  end
52
52
  end
@@ -93,20 +93,21 @@ module Configliere
93
93
  typed_params.each do |param, type|
94
94
  val = self[param]
95
95
  case
96
- when val.nil? then val = nil
97
- when (type == :boolean) then
96
+ when val.nil? then val = nil
97
+ when (type == :boolean) then
98
98
  if ['false', false, 0, '0', ''].include?(val) then val = false else val = true end
99
99
  when ((type == Array) && val.is_a?(String))
100
- val = val.split(",") rescue nil
100
+ val = val.split(",") rescue nil
101
101
  # following types map blank to nil
102
- when (val.blank?) then val = nil
103
- when (type == Float) then val = val.to_f
104
- when (type == Integer) then val = val.to_i
105
- when (type == Symbol) then val = val.to_s.to_sym rescue nil
102
+ when (val.blank?) then val = nil
103
+ when (type == :filename) then val = File.expand_path(val)
104
+ when (type == Float) then val = val.to_f
105
+ when (type == Integer) then val = val.to_i
106
+ when (type == Symbol) then val = val.to_s.to_sym rescue nil
106
107
  when ((val.to_s == 'now') && (type == Date)) then val = Date.today
107
108
  when ((val.to_s == 'now') && (type == DateTime)) then val = DateTime.now
108
- when (type == Date) then val = Date.parse(val) rescue nil
109
- when (type == DateTime) then val = DateTime.parse(val) rescue nil
109
+ when (type == Date) then val = Date.parse(val) rescue nil
110
+ when (type == DateTime) then val = DateTime.parse(val) rescue nil
110
111
  else # nothing
111
112
  end
112
113
  self[param] = val
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: configliere
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
5
4
  prerelease: false
6
5
  segments:
7
6
  - 0
7
+ - 2
8
8
  - 1
9
- - 1
10
- version: 0.1.1
9
+ version: 0.2.1
11
10
  platform: ruby
12
11
  authors:
13
12
  - mrflip
@@ -15,7 +14,7 @@ autorequire:
15
14
  bindir: bin
16
15
  cert_chain: []
17
16
 
18
- date: 2010-08-19 00:00:00 -05:00
17
+ date: 2011-01-15 00:00:00 -06:00
19
18
  default_executable: configliere
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
@@ -26,7 +25,6 @@ dependencies:
26
25
  requirements:
27
26
  - - ">="
28
27
  - !ruby/object:Gem::Version
29
- hash: 13
30
28
  segments:
31
29
  - 1
32
30
  - 2
@@ -42,7 +40,6 @@ dependencies:
42
40
  requirements:
43
41
  - - ">="
44
42
  - !ruby/object:Gem::Version
45
- hash: 3
46
43
  segments:
47
44
  - 0
48
45
  version: "0"
@@ -60,7 +57,6 @@ extra_rdoc_files:
60
57
  - README.textile
61
58
  files:
62
59
  - .document
63
- - .gitignore
64
60
  - CHANGELOG.textile
65
61
  - LICENSE
66
62
  - README.textile
@@ -105,8 +101,8 @@ homepage: http://github.com/mrflip/configliere
105
101
  licenses: []
106
102
 
107
103
  post_install_message:
108
- rdoc_options:
109
- - --charset=UTF-8
104
+ rdoc_options: []
105
+
110
106
  require_paths:
111
107
  - lib
112
108
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -114,7 +110,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
114
110
  requirements:
115
111
  - - ">="
116
112
  - !ruby/object:Gem::Version
117
- hash: 3
118
113
  segments:
119
114
  - 0
120
115
  version: "0"
@@ -123,7 +118,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
123
118
  requirements:
124
119
  - - ">="
125
120
  - !ruby/object:Gem::Version
126
- hash: 3
127
121
  segments:
128
122
  - 0
129
123
  version: "0"
@@ -135,6 +129,10 @@ signing_key:
135
129
  specification_version: 3
136
130
  summary: Wise, discreet configuration management
137
131
  test_files:
132
+ - examples/config_block_script.rb
133
+ - examples/encrypted_script.rb
134
+ - examples/env_var_script.rb
135
+ - examples/simple_script.rb
138
136
  - spec/configliere/commandline_spec.rb
139
137
  - spec/configliere/config_block_spec.rb
140
138
  - spec/configliere/config_file_spec.rb
@@ -147,7 +145,3 @@ test_files:
147
145
  - spec/configliere/param_spec.rb
148
146
  - spec/configliere_spec.rb
149
147
  - spec/spec_helper.rb
150
- - examples/config_block_script.rb
151
- - examples/encrypted_script.rb
152
- - examples/env_var_script.rb
153
- - examples/simple_script.rb
data/.gitignore DELETED
@@ -1,38 +0,0 @@
1
- ## OS
2
- .DS_Store
3
- Icon?
4
- nohup.out
5
-
6
- ## EDITORS
7
- *.tmproj
8
- tmtags
9
- *~
10
- \#*
11
- .\#*
12
- *.swp
13
- REVISION
14
- TAGS*
15
- *_flymake.*
16
- .project
17
- .settings
18
-
19
- ## COMPILED
20
- a.out
21
- *.o
22
- *.pyc
23
- *.so
24
-
25
- ## OTHER SCM
26
- .bzr
27
- .hg
28
- .svn
29
-
30
- ## PROJECT::GENERAL
31
- coverage
32
- rdoc
33
- doc
34
- pkg
35
- .yardoc
36
- *private*
37
-
38
- ## PROJECT::SPECIFIC