configliere 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,22 @@
1
- Note that while the version # is still in the 0.0.x range, the interface may change arbitrarily while we figure out the best simplest convenientest powerfullest way to arrange things
1
+ h2. Version 0.1.1 2010-08-17
2
+
3
+ * Settings.read now does expand_path on the file path
4
+
5
+ h2. Version 0.1.0 2010-07-24
6
+
7
+ * Version 0.1 !!!
8
+ * Single-letter option flags
9
+ * Can give a ':finally' proc (or hand a block to) Settings.define. Example:
10
+
11
+ <pre><code>
12
+ Settings.define :key_pair_file, :description => 'AWS Key pair file', :finally => lambda{ Settings.key_pair_file = File.expand_path(Settings.key_pair_file.to_s) if Settings.key_pair_file }
13
+ Settings.define :key_pair, :description => "AWS Key pair name. If not specified, it's taken from key_pair_file's basename", :finally => lambda{ Settings.key_pair ||= File.basename(Settings.key_pair_file.to_s, '.pem') if Settings.key_pair_file }
14
+ </code></pre>
15
+
16
+ h2. Version 0.0.8 2010-05-02
17
+
18
+ * Provisional implementation of git-style binaries (foo-ls and foo-chmod and so on)
19
+ * Minor fixes
2
20
 
3
21
  h2. Version 0.0.6 2010-04-05
4
22
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{configliere}
8
- s.version = "0.1.0"
8
+ s.version = "0.1.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-10}
12
+ s.date = %q{2010-08-19}
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
 
@@ -103,8 +103,13 @@ module Configliere
103
103
  # #=> --hello-friend=true
104
104
  #
105
105
  def dashed_flag_for setting_name, flag_name=nil
106
+ return unless Settings[setting_name]
106
107
  flag_name ||= setting_name
107
- "--#{flag_name.to_s.gsub(/_/,"-")}=#{Settings[setting_name]}"
108
+ (Settings[setting_name] == true ? "--#{flag_name.to_s.gsub(/_/,"-")}" : "--#{flag_name.to_s.gsub(/_/,"-")}=#{Settings[setting_name]}" )
109
+ end
110
+
111
+ def dashed_flags *settings_and_names
112
+ settings_and_names.map{|args| dashed_flag_for(*args) }
108
113
  end
109
114
 
110
115
  # Complain about bad flags?
@@ -63,8 +63,8 @@ module Configliere
63
63
  def filename_for_handle handle
64
64
  case
65
65
  when handle.is_a?(Symbol) then Configliere::DEFAULT_CONFIG_FILE
66
- when handle.to_s.include?('/') then handle
67
- else File.join(Configliere::DEFAULT_CONFIG_DIR, handle)
66
+ when handle.to_s.include?('/') then File.expand_path(handle)
67
+ else File.join(Configliere::DEFAULT_CONFIG_DIR, handle)
68
68
  end
69
69
  end
70
70
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: configliere
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 0
10
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - mrflip
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-08-10 00:00:00 -05:00
18
+ date: 2010-08-19 00:00:00 -05:00
19
19
  default_executable: configliere
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency