[Pkg-puppet-devel] [facter] 117/352: (maint) clean up Facter::Application#run

Stig Sandbeck Mathisen ssm at debian.org
Sun Apr 6 22:21:37 UTC 2014


This is an automated email from the git hooks/post-receive script.

ssm pushed a commit to branch master
in repository facter.

commit 0850724e7a285e1b2d9e74048b9ea03677256021
Author: Adrien Thebo <git at somethingsinistral.net>
Date:   Mon Dec 16 10:33:57 2013 -0800

    (maint) clean up Facter::Application#run
    
    Move requires to top level, simplify how facts are sorted
---
 lib/facter/application.rb | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/facter/application.rb b/lib/facter/application.rb
index d94be0f..94268c2 100644
--- a/lib/facter/application.rb
+++ b/lib/facter/application.rb
@@ -1,3 +1,6 @@
+require 'optparse'
+require 'facter'
+
 module Facter
   module Application
 
@@ -17,9 +20,6 @@ module Facter
     end
 
     def self.run(argv)
-      require 'optparse'
-      require 'facter'
-
       options = parse(argv)
 
       # Accept fact names to return from the command line
@@ -70,7 +70,7 @@ module Facter
           puts value
         end
       else
-        facts.sort_by{ |fact| fact.first }.each do |name,value|
+        facts.sort_by { |(name, value)| name }.each do |name,value|
           puts "#{name} => #{value}"
         end
       end

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-puppet/facter.git



More information about the Pkg-puppet-devel mailing list