lib/setup/configuration.rb in setup-5.0.1 vs lib/setup/configuration.rb in setup-5.1.0

- old
+ new

@@ -13,15 +13,15 @@ class Configuration # Ruby System Configuration RBCONFIG = ::Config::CONFIG - # Confgiuration file - CONFIG_FILE = 'SetupConfig' # '.cache/setup/config' + ## Confgiuration file + #CONFIG_FILE = 'SetupConfig' # '.cache/setup/config' # Custom configuration file. - META_CONFIG_FILE = META_EXTENSION_DIR + '/configuration.rb' + META_CONFIG_FILE = META_EXTENSION_DIR + '/metaconfig.rb' # def self.options @@options ||= [] end @@ -57,11 +57,12 @@ option :extconfopt , :opts, 'options to pass-thru to extconf.rb' option :shebang , :pick, 'shebang line (#!) editing mode (all,ruby,never)' option :no_test, :t , :bool, 'run pre-installation tests' - option :no_ri, :d , :bool, 'generate ri documentation' + # TODO: remove no_ri option in future version + #option :no_ri, :d , :bool, 'generate ri documentation (deprecated and ignored)' option :no_doc , :bool, 'install doc/ directory' option :no_ext , :bool, 'compile/install ruby extentions' #option :rdoc , :pick, 'generate rdoc documentation' #option :rdoc_template , :pick, 'rdoc document template to use' @@ -108,13 +109,14 @@ # New ConfigTable def initialize(values={}) initialize_metaconfig initialize_defaults initialize_environment - initialize_configfile + initialize_configfile unless values[:reset] + values.each{ |k,v| __send__("#{k}=", v) } - yeild(self) if block_given? + yield(self) if block_given? end # def initialize_metaconfig if File.exist?(META_CONFIG_FILE) @@ -128,11 +130,11 @@ # the +doc/+ directory will be installed. def initialize_defaults self.type = 'site' self.no_ri = true self.no_test = true - self.no_doc = false + self.no_doc = true self.no_ext = false #@rbdir = siterubyver #'$siterubyver' #@sodir = siterubyverarch #'$siterubyverarch' end @@ -145,11 +147,11 @@ end end # Load configuration. def initialize_configfile - if File.exist?(CONFIG_FILE) + if exist? erb = ERB.new(File.read(CONFIG_FILE)) txt = erb.result(binding) dat = YAML.load(txt) dat.each do |k, v| next if 'type' == k @@ -179,10 +181,12 @@ # rescue Errno::ENOENT # raise Error, $!.message + "\n#{File.basename($0)} config first" # end #end + attr_accessor :reset + # # B A S E D I R E C T O R I E S # # # #def base_libruby # "lib/ruby" @@ -264,17 +268,16 @@ else raise Error, "bad config: use type=(std|site|home) [#{val}]" end end - # + # Alias for `#type`. alias_method :installdirs, :type - # + # Alias for `#type=`. alias_method :installdirs=, :type= - # alias_method :install_prefix, :root # alias_method :install_prefix=, :root= @@ -527,20 +530,22 @@ # def no_doc=(val) @no_doc = boolean(val) end - # + + # @deprecated Will be remove in future version. Currently ignored. def no_ri @no_ri end - # + # @deprecated Will be remove in future version. Currently ignored. def no_ri=(val) @no_ri = boolean(val) end + #def rdoc = 'no' #def rdoctemplate = nil #def testrunner = 'auto' # needed? # Compile native extensions? @@ -552,12 +557,12 @@ def test? !no_test end # Generate ri documentation? - def ri? - !no_ri - end + #def ri? + # !no_ri + #end # Install doc directory? def doc? !no_doc end