nfsadmin 0.0.2
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.
- checksums.yaml +7 -0
 - data/.gitignore +36 -0
 - data/.ruby-gemset +1 -0
 - data/.ruby-version +1 -0
 - data/Gemfile +2 -0
 - data/Gemfile.lock +44 -0
 - data/LICENSE +21 -0
 - data/README.md +41 -0
 - data/README.rdoc +6 -0
 - data/Rakefile +44 -0
 - data/bin/nfsadmin +119 -0
 - data/features/nfsadmin.feature +8 -0
 - data/features/step_definitions/nfsadmin_steps.rb +6 -0
 - data/features/support/env.rb +15 -0
 - data/lib/nfsadmin/tasks.rb +152 -0
 - data/lib/nfsadmin/version.rb +3 -0
 - data/lib/nfsadmin.rb +2 -0
 - data/nfsadmin.gemspec +29 -0
 - data/nfsadmin.rdoc +5 -0
 - data/test/default_test.rb +14 -0
 - data/test/test_helper.rb +9 -0
 - metadata +132 -0
 
    
        checksums.yaml
    ADDED
    
    | 
         @@ -0,0 +1,7 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            ---
         
     | 
| 
      
 2 
     | 
    
         
            +
            SHA1:
         
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 1b6408e762bae666a4ac9a02272fee6dfc83f036
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: e5569e448ff209e9c1e52b9ca3e725a8041a5ea4
         
     | 
| 
      
 5 
     | 
    
         
            +
            SHA512:
         
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: e96b2bcb0aedbd0c763390084c417bc80342a44faa97347bffc1492448e0292446c2495e65c4c09eda243215838e8f5d8baedefed2535765eb2e183c9c541d0f
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 429a729e61a58f0b4731bd0019dfc484f74a3eea385c5c1a1cbba77649ae695bf385e88f7d8c30514f130fa55fffb730595bd5cbe69ccf0ffa563b2226b0d695
         
     | 
    
        data/.gitignore
    ADDED
    
    | 
         @@ -0,0 +1,36 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            *.gem
         
     | 
| 
      
 2 
     | 
    
         
            +
            *.rbc
         
     | 
| 
      
 3 
     | 
    
         
            +
            *.html
         
     | 
| 
      
 4 
     | 
    
         
            +
            .idea
         
     | 
| 
      
 5 
     | 
    
         
            +
            /.config
         
     | 
| 
      
 6 
     | 
    
         
            +
            /coverage/
         
     | 
| 
      
 7 
     | 
    
         
            +
            /InstalledFiles
         
     | 
| 
      
 8 
     | 
    
         
            +
            /pkg/
         
     | 
| 
      
 9 
     | 
    
         
            +
            /spec/reports/
         
     | 
| 
      
 10 
     | 
    
         
            +
            /test/tmp/
         
     | 
| 
      
 11 
     | 
    
         
            +
            /test/version_tmp/
         
     | 
| 
      
 12 
     | 
    
         
            +
            /tmp/
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
            ## Specific to RubyMotion:
         
     | 
| 
      
 15 
     | 
    
         
            +
            .dat*
         
     | 
| 
      
 16 
     | 
    
         
            +
            .repl_history
         
     | 
| 
      
 17 
     | 
    
         
            +
            build/
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
            ## Documentation cache and generated files:
         
     | 
| 
      
 20 
     | 
    
         
            +
            /.yardoc/
         
     | 
| 
      
 21 
     | 
    
         
            +
            /_yardoc/
         
     | 
| 
      
 22 
     | 
    
         
            +
            /doc/
         
     | 
| 
      
 23 
     | 
    
         
            +
            /rdoc/
         
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
      
 25 
     | 
    
         
            +
            ## Environment normalisation:
         
     | 
| 
      
 26 
     | 
    
         
            +
            /.bundle/
         
     | 
| 
      
 27 
     | 
    
         
            +
            /lib/bundler/man/
         
     | 
| 
      
 28 
     | 
    
         
            +
             
     | 
| 
      
 29 
     | 
    
         
            +
            # for a library or gem, you might want to ignore these files since the code is
         
     | 
| 
      
 30 
     | 
    
         
            +
            # intended to run in multiple environments; otherwise, check them in:
         
     | 
| 
      
 31 
     | 
    
         
            +
            # Gemfile.lock
         
     | 
| 
      
 32 
     | 
    
         
            +
            # .ruby-version
         
     | 
| 
      
 33 
     | 
    
         
            +
            # .ruby-gemset
         
     | 
| 
      
 34 
     | 
    
         
            +
             
     | 
| 
      
 35 
     | 
    
         
            +
            # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
         
     | 
| 
      
 36 
     | 
    
         
            +
            .rvmrc
         
     | 
    
        data/.ruby-gemset
    ADDED
    
    | 
         @@ -0,0 +1 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            nfsadmin
         
     | 
    
        data/.ruby-version
    ADDED
    
    | 
         @@ -0,0 +1 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            ruby-2.1.1
         
     | 
    
        data/Gemfile
    ADDED
    
    
    
        data/Gemfile.lock
    ADDED
    
    | 
         @@ -0,0 +1,44 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            PATH
         
     | 
| 
      
 2 
     | 
    
         
            +
              remote: .
         
     | 
| 
      
 3 
     | 
    
         
            +
              specs:
         
     | 
| 
      
 4 
     | 
    
         
            +
                nfsadmin (0.0.2)
         
     | 
| 
      
 5 
     | 
    
         
            +
                  gli (~> 2.9)
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            GEM
         
     | 
| 
      
 8 
     | 
    
         
            +
              remote: https://rubygems.org/
         
     | 
| 
      
 9 
     | 
    
         
            +
              specs:
         
     | 
| 
      
 10 
     | 
    
         
            +
                aruba (0.5.4)
         
     | 
| 
      
 11 
     | 
    
         
            +
                  childprocess (>= 0.3.6)
         
     | 
| 
      
 12 
     | 
    
         
            +
                  cucumber (>= 1.1.1)
         
     | 
| 
      
 13 
     | 
    
         
            +
                  rspec-expectations (>= 2.7.0)
         
     | 
| 
      
 14 
     | 
    
         
            +
                builder (3.2.2)
         
     | 
| 
      
 15 
     | 
    
         
            +
                childprocess (0.5.2)
         
     | 
| 
      
 16 
     | 
    
         
            +
                  ffi (~> 1.0, >= 1.0.11)
         
     | 
| 
      
 17 
     | 
    
         
            +
                cucumber (1.3.14)
         
     | 
| 
      
 18 
     | 
    
         
            +
                  builder (>= 2.1.2)
         
     | 
| 
      
 19 
     | 
    
         
            +
                  diff-lcs (>= 1.1.3)
         
     | 
| 
      
 20 
     | 
    
         
            +
                  gherkin (~> 2.12)
         
     | 
| 
      
 21 
     | 
    
         
            +
                  multi_json (>= 1.7.5, < 2.0)
         
     | 
| 
      
 22 
     | 
    
         
            +
                  multi_test (>= 0.1.1)
         
     | 
| 
      
 23 
     | 
    
         
            +
                diff-lcs (1.2.5)
         
     | 
| 
      
 24 
     | 
    
         
            +
                ffi (1.9.3)
         
     | 
| 
      
 25 
     | 
    
         
            +
                gherkin (2.12.2)
         
     | 
| 
      
 26 
     | 
    
         
            +
                  multi_json (~> 1.3)
         
     | 
| 
      
 27 
     | 
    
         
            +
                gli (2.9.0)
         
     | 
| 
      
 28 
     | 
    
         
            +
                json (1.8.1)
         
     | 
| 
      
 29 
     | 
    
         
            +
                multi_json (1.9.2)
         
     | 
| 
      
 30 
     | 
    
         
            +
                multi_test (0.1.1)
         
     | 
| 
      
 31 
     | 
    
         
            +
                rake (10.2.2)
         
     | 
| 
      
 32 
     | 
    
         
            +
                rdoc (4.1.1)
         
     | 
| 
      
 33 
     | 
    
         
            +
                  json (~> 1.4)
         
     | 
| 
      
 34 
     | 
    
         
            +
                rspec-expectations (2.14.5)
         
     | 
| 
      
 35 
     | 
    
         
            +
                  diff-lcs (>= 1.1.3, < 2.0)
         
     | 
| 
      
 36 
     | 
    
         
            +
             
     | 
| 
      
 37 
     | 
    
         
            +
            PLATFORMS
         
     | 
| 
      
 38 
     | 
    
         
            +
              ruby
         
     | 
| 
      
 39 
     | 
    
         
            +
             
     | 
| 
      
 40 
     | 
    
         
            +
            DEPENDENCIES
         
     | 
| 
      
 41 
     | 
    
         
            +
              aruba (~> 0.5)
         
     | 
| 
      
 42 
     | 
    
         
            +
              nfsadmin!
         
     | 
| 
      
 43 
     | 
    
         
            +
              rake (~> 10.2)
         
     | 
| 
      
 44 
     | 
    
         
            +
              rdoc (~> 4.1)
         
     | 
    
        data/LICENSE
    ADDED
    
    | 
         @@ -0,0 +1,21 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            The MIT License (MIT)
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            Copyright (c) 2014 Siteminds B.V. - B.J.W. Schaap
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            Permission is hereby granted, free of charge, to any person obtaining a copy
         
     | 
| 
      
 6 
     | 
    
         
            +
            of this software and associated documentation files (the "Software"), to deal
         
     | 
| 
      
 7 
     | 
    
         
            +
            in the Software without restriction, including without limitation the rights
         
     | 
| 
      
 8 
     | 
    
         
            +
            to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
         
     | 
| 
      
 9 
     | 
    
         
            +
            copies of the Software, and to permit persons to whom the Software is
         
     | 
| 
      
 10 
     | 
    
         
            +
            furnished to do so, subject to the following conditions:
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
            The above copyright notice and this permission notice shall be included in all
         
     | 
| 
      
 13 
     | 
    
         
            +
            copies or substantial portions of the Software.
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
            THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
         
     | 
| 
      
 16 
     | 
    
         
            +
            IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
         
     | 
| 
      
 17 
     | 
    
         
            +
            FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
         
     | 
| 
      
 18 
     | 
    
         
            +
            AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
         
     | 
| 
      
 19 
     | 
    
         
            +
            LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
         
     | 
| 
      
 20 
     | 
    
         
            +
            OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
         
     | 
| 
      
 21 
     | 
    
         
            +
            SOFTWARE.
         
     | 
    
        data/README.md
    ADDED
    
    | 
         @@ -0,0 +1,41 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            nfsadmin
         
     | 
| 
      
 2 
     | 
    
         
            +
            ========
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            Nfsadmin is a Ruby Gem that allows for simple configuration of the NFS service and its exports.
         
     | 
| 
      
 5 
     | 
    
         
            +
            It consists of a library part that you can use in your own applications, and a CLI that allows 
         
     | 
| 
      
 6 
     | 
    
         
            +
            for using `nfsadmin` as a commandline tool.
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
            Library usage
         
     | 
| 
      
 9 
     | 
    
         
            +
            -------------
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
            Using the library is easy: just `require 'nfsadmin'` in your own Ruby code.
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
            CLI usage
         
     | 
| 
      
 14 
     | 
    
         
            +
            ---------
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
            The `nfsadmin` commandline binary comes with the gem. Type `nfsadmin help` to see how it works.
         
     | 
| 
      
 17 
     | 
    
         
            +
             
     | 
| 
      
 18 
     | 
    
         
            +
            License
         
     | 
| 
      
 19 
     | 
    
         
            +
            -------
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
            The MIT License (MIT)
         
     | 
| 
      
 22 
     | 
    
         
            +
             
     | 
| 
      
 23 
     | 
    
         
            +
            Copyright (c) 2014 Siteminds B.V. - B.J.W. Schaap
         
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
      
 25 
     | 
    
         
            +
            Permission is hereby granted, free of charge, to any person obtaining a copy
         
     | 
| 
      
 26 
     | 
    
         
            +
            of this software and associated documentation files (the "Software"), to deal
         
     | 
| 
      
 27 
     | 
    
         
            +
            in the Software without restriction, including without limitation the rights
         
     | 
| 
      
 28 
     | 
    
         
            +
            to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
         
     | 
| 
      
 29 
     | 
    
         
            +
            copies of the Software, and to permit persons to whom the Software is
         
     | 
| 
      
 30 
     | 
    
         
            +
            furnished to do so, subject to the following conditions:
         
     | 
| 
      
 31 
     | 
    
         
            +
             
     | 
| 
      
 32 
     | 
    
         
            +
            The above copyright notice and this permission notice shall be included in all
         
     | 
| 
      
 33 
     | 
    
         
            +
            copies or substantial portions of the Software.
         
     | 
| 
      
 34 
     | 
    
         
            +
             
     | 
| 
      
 35 
     | 
    
         
            +
            THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
         
     | 
| 
      
 36 
     | 
    
         
            +
            IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
         
     | 
| 
      
 37 
     | 
    
         
            +
            FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
         
     | 
| 
      
 38 
     | 
    
         
            +
            AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
         
     | 
| 
      
 39 
     | 
    
         
            +
            LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
         
     | 
| 
      
 40 
     | 
    
         
            +
            OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
         
     | 
| 
      
 41 
     | 
    
         
            +
            SOFTWARE.
         
     | 
    
        data/README.rdoc
    ADDED
    
    
    
        data/Rakefile
    ADDED
    
    | 
         @@ -0,0 +1,44 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'rake/clean'
         
     | 
| 
      
 2 
     | 
    
         
            +
            require 'rubygems'
         
     | 
| 
      
 3 
     | 
    
         
            +
            require 'rubygems/package_task'
         
     | 
| 
      
 4 
     | 
    
         
            +
            require 'rdoc/task'
         
     | 
| 
      
 5 
     | 
    
         
            +
            require 'cucumber'
         
     | 
| 
      
 6 
     | 
    
         
            +
            require 'cucumber/rake/task'
         
     | 
| 
      
 7 
     | 
    
         
            +
            Rake::RDocTask.new do |rd|
         
     | 
| 
      
 8 
     | 
    
         
            +
              rd.main = "README.rdoc"
         
     | 
| 
      
 9 
     | 
    
         
            +
              rd.rdoc_files.include("README.rdoc","lib/**/*.rb","bin/**/*")
         
     | 
| 
      
 10 
     | 
    
         
            +
              rd.title = 'Your application title'
         
     | 
| 
      
 11 
     | 
    
         
            +
            end
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
            spec = eval(File.read('nfsadmin.gemspec'))
         
     | 
| 
      
 14 
     | 
    
         
            +
             
     | 
| 
      
 15 
     | 
    
         
            +
            Gem::PackageTask.new(spec) do |pkg|
         
     | 
| 
      
 16 
     | 
    
         
            +
            end
         
     | 
| 
      
 17 
     | 
    
         
            +
            CUKE_RESULTS = 'results.html'
         
     | 
| 
      
 18 
     | 
    
         
            +
            CLEAN << CUKE_RESULTS
         
     | 
| 
      
 19 
     | 
    
         
            +
            desc 'Run features'
         
     | 
| 
      
 20 
     | 
    
         
            +
            Cucumber::Rake::Task.new(:features) do |t|
         
     | 
| 
      
 21 
     | 
    
         
            +
              opts = "features --format html -o #{CUKE_RESULTS} --format progress -x"
         
     | 
| 
      
 22 
     | 
    
         
            +
              opts += " --tags #{ENV['TAGS']}" if ENV['TAGS']
         
     | 
| 
      
 23 
     | 
    
         
            +
              t.cucumber_opts =  opts
         
     | 
| 
      
 24 
     | 
    
         
            +
              t.fork = false
         
     | 
| 
      
 25 
     | 
    
         
            +
            end
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
            desc 'Run features tagged as work-in-progress (@wip)'
         
     | 
| 
      
 28 
     | 
    
         
            +
            Cucumber::Rake::Task.new('features:wip') do |t|
         
     | 
| 
      
 29 
     | 
    
         
            +
              tag_opts = ' --tags ~@pending'
         
     | 
| 
      
 30 
     | 
    
         
            +
              tag_opts = ' --tags @wip'
         
     | 
| 
      
 31 
     | 
    
         
            +
              t.cucumber_opts = "features --format html -o #{CUKE_RESULTS} --format pretty -x -s#{tag_opts}"
         
     | 
| 
      
 32 
     | 
    
         
            +
              t.fork = false
         
     | 
| 
      
 33 
     | 
    
         
            +
            end
         
     | 
| 
      
 34 
     | 
    
         
            +
             
     | 
| 
      
 35 
     | 
    
         
            +
            task :cucumber => :features
         
     | 
| 
      
 36 
     | 
    
         
            +
            task 'cucumber:wip' => 'features:wip'
         
     | 
| 
      
 37 
     | 
    
         
            +
            task :wip => 'features:wip'
         
     | 
| 
      
 38 
     | 
    
         
            +
            require 'rake/testtask'
         
     | 
| 
      
 39 
     | 
    
         
            +
            Rake::TestTask.new do |t|
         
     | 
| 
      
 40 
     | 
    
         
            +
              t.libs << "test"
         
     | 
| 
      
 41 
     | 
    
         
            +
              t.test_files = FileList['test/*_test.rb']
         
     | 
| 
      
 42 
     | 
    
         
            +
            end
         
     | 
| 
      
 43 
     | 
    
         
            +
             
     | 
| 
      
 44 
     | 
    
         
            +
            task :default => [:test,:features]
         
     | 
    
        data/bin/nfsadmin
    ADDED
    
    | 
         @@ -0,0 +1,119 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            #!/usr/bin/env ruby
         
     | 
| 
      
 2 
     | 
    
         
            +
            require 'gli'
         
     | 
| 
      
 3 
     | 
    
         
            +
            require 'nfsadmin'
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            include GLI::App
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            program_desc 'nfsadmin is a CLI to manage the NFS service and its exports'
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
            version Nfsadmin::VERSION
         
     | 
| 
      
 10 
     | 
    
         
            +
             
     | 
| 
      
 11 
     | 
    
         
            +
            flag [:c,:config], :default_value => '/etc/exports'
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
            desc 'The export command manages exported NFS shares'
         
     | 
| 
      
 14 
     | 
    
         
            +
            command :export do |c|
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
              c.default_command :list
         
     | 
| 
      
 17 
     | 
    
         
            +
             
     | 
| 
      
 18 
     | 
    
         
            +
              c.desc 'List all NFS exported shares on this server'
         
     | 
| 
      
 19 
     | 
    
         
            +
              c.command :list do |list|
         
     | 
| 
      
 20 
     | 
    
         
            +
                list.desc 'Define output type. Valid types are: text, json'
         
     | 
| 
      
 21 
     | 
    
         
            +
                list.default_value 'text'
         
     | 
| 
      
 22 
     | 
    
         
            +
                list.flag [:f, :format]
         
     | 
| 
      
 23 
     | 
    
         
            +
                list.action do |global_options,options,args|
         
     | 
| 
      
 24 
     | 
    
         
            +
                  Nfsadmin::Tasks.list_shares(global_options[:c], options[:f])
         
     | 
| 
      
 25 
     | 
    
         
            +
                end
         
     | 
| 
      
 26 
     | 
    
         
            +
              end
         
     | 
| 
      
 27 
     | 
    
         
            +
             
     | 
| 
      
 28 
     | 
    
         
            +
              c.desc 'Add a new NFS export to be shared on this server'
         
     | 
| 
      
 29 
     | 
    
         
            +
              c.command :add do |add|
         
     | 
| 
      
 30 
     | 
    
         
            +
                add.desc 'The location to be exported as NFS share'
         
     | 
| 
      
 31 
     | 
    
         
            +
                add.flag [:l, :location]
         
     | 
| 
      
 32 
     | 
    
         
            +
                add.desc 'The network address (networks and wildcards allowed)'
         
     | 
| 
      
 33 
     | 
    
         
            +
                add.flag [:a, :address]
         
     | 
| 
      
 34 
     | 
    
         
            +
                add.desc 'The NFS options for this share, e.g. rw,sync,no_root_squash,no_subtree_check'
         
     | 
| 
      
 35 
     | 
    
         
            +
                add.flag [:o, :options]
         
     | 
| 
      
 36 
     | 
    
         
            +
                add.action do |global_options,options,args|
         
     | 
| 
      
 37 
     | 
    
         
            +
                  Nfsadmin::Tasks.create_share(global_options[:c], options[:l], options[:a], options[:o])
         
     | 
| 
      
 38 
     | 
    
         
            +
                end
         
     | 
| 
      
 39 
     | 
    
         
            +
              end
         
     | 
| 
      
 40 
     | 
    
         
            +
             
     | 
| 
      
 41 
     | 
    
         
            +
              c.desc 'Delete an NFS export from this server'
         
     | 
| 
      
 42 
     | 
    
         
            +
              c.command [:rm,:delete] do |delete|
         
     | 
| 
      
 43 
     | 
    
         
            +
                delete.action do |global_options,options,args|
         
     | 
| 
      
 44 
     | 
    
         
            +
                  Nfsadmin::Tasks.delete_share(global_options[:c], options[:l])
         
     | 
| 
      
 45 
     | 
    
         
            +
                end
         
     | 
| 
      
 46 
     | 
    
         
            +
              end
         
     | 
| 
      
 47 
     | 
    
         
            +
             
     | 
| 
      
 48 
     | 
    
         
            +
              c.desc 'Get information about a specific share'
         
     | 
| 
      
 49 
     | 
    
         
            +
              c.command [:get] do |get|
         
     | 
| 
      
 50 
     | 
    
         
            +
                get.action do |global_options,options,args|
         
     | 
| 
      
 51 
     | 
    
         
            +
                  Nfsadmin::Tasks.get_share(global_options[:c], options[:l], options[:f])
         
     | 
| 
      
 52 
     | 
    
         
            +
                end
         
     | 
| 
      
 53 
     | 
    
         
            +
              end
         
     | 
| 
      
 54 
     | 
    
         
            +
            end
         
     | 
| 
      
 55 
     | 
    
         
            +
             
     | 
| 
      
 56 
     | 
    
         
            +
            desc 'The service command manages the NFS service'
         
     | 
| 
      
 57 
     | 
    
         
            +
            arg_name 'Describe arguments to service here'
         
     | 
| 
      
 58 
     | 
    
         
            +
            command :service do |c|
         
     | 
| 
      
 59 
     | 
    
         
            +
             
     | 
| 
      
 60 
     | 
    
         
            +
              c.desc 'Return the status of the NFS service(s)'
         
     | 
| 
      
 61 
     | 
    
         
            +
              c.command :status do |status|
         
     | 
| 
      
 62 
     | 
    
         
            +
                status.action do
         
     | 
| 
      
 63 
     | 
    
         
            +
                  Nfsadmin::Tasks.show_status
         
     | 
| 
      
 64 
     | 
    
         
            +
                end
         
     | 
| 
      
 65 
     | 
    
         
            +
              end
         
     | 
| 
      
 66 
     | 
    
         
            +
             
     | 
| 
      
 67 
     | 
    
         
            +
              c.desc 'Start the NFS service(s)'
         
     | 
| 
      
 68 
     | 
    
         
            +
              c.command :start do |start|
         
     | 
| 
      
 69 
     | 
    
         
            +
                start.action do
         
     | 
| 
      
 70 
     | 
    
         
            +
                  Nfsadmin::Tasks.start_service
         
     | 
| 
      
 71 
     | 
    
         
            +
                end
         
     | 
| 
      
 72 
     | 
    
         
            +
              end
         
     | 
| 
      
 73 
     | 
    
         
            +
             
     | 
| 
      
 74 
     | 
    
         
            +
              c.desc 'Stop the NFS service(s)'
         
     | 
| 
      
 75 
     | 
    
         
            +
              c.command :stop do |stop|
         
     | 
| 
      
 76 
     | 
    
         
            +
                stop.action do
         
     | 
| 
      
 77 
     | 
    
         
            +
                  Nfsadmin::Tasks.stop_service
         
     | 
| 
      
 78 
     | 
    
         
            +
                end
         
     | 
| 
      
 79 
     | 
    
         
            +
              end
         
     | 
| 
      
 80 
     | 
    
         
            +
             
     | 
| 
      
 81 
     | 
    
         
            +
              c.desc 'Restart the NFS service(s)'
         
     | 
| 
      
 82 
     | 
    
         
            +
              c.command :start do |restart|
         
     | 
| 
      
 83 
     | 
    
         
            +
                restart.action do
         
     | 
| 
      
 84 
     | 
    
         
            +
                  Nfsadmin::Tasks.restart_service
         
     | 
| 
      
 85 
     | 
    
         
            +
                end
         
     | 
| 
      
 86 
     | 
    
         
            +
              end
         
     | 
| 
      
 87 
     | 
    
         
            +
             
     | 
| 
      
 88 
     | 
    
         
            +
              c.desc 'Reload the NFS exports configuration'
         
     | 
| 
      
 89 
     | 
    
         
            +
              c.command :reload do |reload|
         
     | 
| 
      
 90 
     | 
    
         
            +
                reload.action do
         
     | 
| 
      
 91 
     | 
    
         
            +
                  Nfsadmin::Tasks.reload_config
         
     | 
| 
      
 92 
     | 
    
         
            +
                end
         
     | 
| 
      
 93 
     | 
    
         
            +
              end
         
     | 
| 
      
 94 
     | 
    
         
            +
             
     | 
| 
      
 95 
     | 
    
         
            +
              c.default_command :status
         
     | 
| 
      
 96 
     | 
    
         
            +
            end
         
     | 
| 
      
 97 
     | 
    
         
            +
             
     | 
| 
      
 98 
     | 
    
         
            +
            pre do |global,command,options,args|
         
     | 
| 
      
 99 
     | 
    
         
            +
              # Pre logic here
         
     | 
| 
      
 100 
     | 
    
         
            +
              # Return true to proceed; false to abort and not call the
         
     | 
| 
      
 101 
     | 
    
         
            +
              # chosen command
         
     | 
| 
      
 102 
     | 
    
         
            +
              # Use skips_pre before a command to skip this block
         
     | 
| 
      
 103 
     | 
    
         
            +
              # on that command only
         
     | 
| 
      
 104 
     | 
    
         
            +
              true
         
     | 
| 
      
 105 
     | 
    
         
            +
            end
         
     | 
| 
      
 106 
     | 
    
         
            +
             
     | 
| 
      
 107 
     | 
    
         
            +
            post do |global,command,options,args|
         
     | 
| 
      
 108 
     | 
    
         
            +
              # Post logic here
         
     | 
| 
      
 109 
     | 
    
         
            +
              # Use skips_post before a command to skip this
         
     | 
| 
      
 110 
     | 
    
         
            +
              # block on that command only
         
     | 
| 
      
 111 
     | 
    
         
            +
            end
         
     | 
| 
      
 112 
     | 
    
         
            +
             
     | 
| 
      
 113 
     | 
    
         
            +
            on_error do |exception|
         
     | 
| 
      
 114 
     | 
    
         
            +
              # Error logic here
         
     | 
| 
      
 115 
     | 
    
         
            +
              # return false to skip default error handling
         
     | 
| 
      
 116 
     | 
    
         
            +
              true
         
     | 
| 
      
 117 
     | 
    
         
            +
            end
         
     | 
| 
      
 118 
     | 
    
         
            +
             
     | 
| 
      
 119 
     | 
    
         
            +
            exit run(ARGV)
         
     | 
| 
         @@ -0,0 +1,15 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'aruba/cucumber'
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            ENV['PATH'] = "#{File.expand_path(File.dirname(__FILE__) + '/../../bin')}#{File::PATH_SEPARATOR}#{ENV['PATH']}"
         
     | 
| 
      
 4 
     | 
    
         
            +
            LIB_DIR = File.join(File.expand_path(File.dirname(__FILE__)),'..','..','lib')
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            Before do
         
     | 
| 
      
 7 
     | 
    
         
            +
              # Using "announce" causes massive warnings on 1.9.2
         
     | 
| 
      
 8 
     | 
    
         
            +
              @puts = true
         
     | 
| 
      
 9 
     | 
    
         
            +
              @original_rubylib = ENV['RUBYLIB']
         
     | 
| 
      
 10 
     | 
    
         
            +
              ENV['RUBYLIB'] = LIB_DIR + File::PATH_SEPARATOR + ENV['RUBYLIB'].to_s
         
     | 
| 
      
 11 
     | 
    
         
            +
            end
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
            After do
         
     | 
| 
      
 14 
     | 
    
         
            +
              ENV['RUBYLIB'] = @original_rubylib
         
     | 
| 
      
 15 
     | 
    
         
            +
            end
         
     | 
| 
         @@ -0,0 +1,152 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'json'
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            module Nfsadmin
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
              class Tasks
         
     | 
| 
      
 6 
     | 
    
         
            +
                def self.get_shares(exportsfile)
         
     | 
| 
      
 7 
     | 
    
         
            +
                  shares = []
         
     | 
| 
      
 8 
     | 
    
         
            +
                  location = ''
         
     | 
| 
      
 9 
     | 
    
         
            +
                  begin
         
     | 
| 
      
 10 
     | 
    
         
            +
                    file = File.open(exportsfile, 'r')
         
     | 
| 
      
 11 
     | 
    
         
            +
                  rescue
         
     | 
| 
      
 12 
     | 
    
         
            +
                    fail 'No exports configuration could be found'
         
     | 
| 
      
 13 
     | 
    
         
            +
                  end
         
     | 
| 
      
 14 
     | 
    
         
            +
                  file.readlines.each do |line|
         
     | 
| 
      
 15 
     | 
    
         
            +
                    share = {}
         
     | 
| 
      
 16 
     | 
    
         
            +
                    acl = []
         
     | 
| 
      
 17 
     | 
    
         
            +
                    parts = line.split
         
     | 
| 
      
 18 
     | 
    
         
            +
                    parts.each do |part|
         
     | 
| 
      
 19 
     | 
    
         
            +
                      entry = {}
         
     | 
| 
      
 20 
     | 
    
         
            +
                      if (Pathname.new(part)).absolute?
         
     | 
| 
      
 21 
     | 
    
         
            +
                        location = part
         
     | 
| 
      
 22 
     | 
    
         
            +
                      else
         
     | 
| 
      
 23 
     | 
    
         
            +
                        subparts = part.split('(')
         
     | 
| 
      
 24 
     | 
    
         
            +
                        entry[:address] = subparts[0]
         
     | 
| 
      
 25 
     | 
    
         
            +
                        entry[:options] = subparts[1].sub!(/\)/, '')
         
     | 
| 
      
 26 
     | 
    
         
            +
                        acl << entry
         
     | 
| 
      
 27 
     | 
    
         
            +
                      end
         
     | 
| 
      
 28 
     | 
    
         
            +
                    end
         
     | 
| 
      
 29 
     | 
    
         
            +
                    share[:location] = location
         
     | 
| 
      
 30 
     | 
    
         
            +
                    share[:acl] = acl
         
     | 
| 
      
 31 
     | 
    
         
            +
                    shares << share
         
     | 
| 
      
 32 
     | 
    
         
            +
                  end
         
     | 
| 
      
 33 
     | 
    
         
            +
                  file.close
         
     | 
| 
      
 34 
     | 
    
         
            +
                  return shares
         
     | 
| 
      
 35 
     | 
    
         
            +
                end
         
     | 
| 
      
 36 
     | 
    
         
            +
             
     | 
| 
      
 37 
     | 
    
         
            +
                def self.write_exports(exportsfile, exports)
         
     | 
| 
      
 38 
     | 
    
         
            +
                  begin
         
     | 
| 
      
 39 
     | 
    
         
            +
                    file = File.open(exportsfile, File::WRONLY|File::CREAT)
         
     | 
| 
      
 40 
     | 
    
         
            +
                    file.truncate(0)
         
     | 
| 
      
 41 
     | 
    
         
            +
                  rescue
         
     | 
| 
      
 42 
     | 
    
         
            +
                    fail "Could not write to exports configuration #{exportsfile}"
         
     | 
| 
      
 43 
     | 
    
         
            +
                  end
         
     | 
| 
      
 44 
     | 
    
         
            +
                  exports.each do |share|
         
     | 
| 
      
 45 
     | 
    
         
            +
                    file.print(share[:location] + '   ')
         
     | 
| 
      
 46 
     | 
    
         
            +
                    share[:acl].each do |acl|
         
     | 
| 
      
 47 
     | 
    
         
            +
                      file.print acl[:address].to_s + '(' + acl[:options].to_s + ')' + ' '
         
     | 
| 
      
 48 
     | 
    
         
            +
                    end
         
     | 
| 
      
 49 
     | 
    
         
            +
                    file.print "\n"
         
     | 
| 
      
 50 
     | 
    
         
            +
                  end
         
     | 
| 
      
 51 
     | 
    
         
            +
                  file.flush
         
     | 
| 
      
 52 
     | 
    
         
            +
                  file.close
         
     | 
| 
      
 53 
     | 
    
         
            +
                end
         
     | 
| 
      
 54 
     | 
    
         
            +
             
     | 
| 
      
 55 
     | 
    
         
            +
                def self.list_shares(exportsfile, output_type)
         
     | 
| 
      
 56 
     | 
    
         
            +
                  exports = get_shares(exportsfile)
         
     | 
| 
      
 57 
     | 
    
         
            +
                  if output_type.downcase == 'text'
         
     | 
| 
      
 58 
     | 
    
         
            +
                    # Output plain text
         
     | 
| 
      
 59 
     | 
    
         
            +
                    exports.each do |share|
         
     | 
| 
      
 60 
     | 
    
         
            +
                      printf('%-40s', share[:location])
         
     | 
| 
      
 61 
     | 
    
         
            +
                      share[:acl].each do |acl|
         
     | 
| 
      
 62 
     | 
    
         
            +
                        print acl[:address] + '(' + acl[:options] + ')' + ' '
         
     | 
| 
      
 63 
     | 
    
         
            +
                      end
         
     | 
| 
      
 64 
     | 
    
         
            +
                      print "\n"
         
     | 
| 
      
 65 
     | 
    
         
            +
                    end
         
     | 
| 
      
 66 
     | 
    
         
            +
                    STDOUT.flush
         
     | 
| 
      
 67 
     | 
    
         
            +
                  elsif output_type.downcase == 'json'
         
     | 
| 
      
 68 
     | 
    
         
            +
                    # Output JSON
         
     | 
| 
      
 69 
     | 
    
         
            +
                    puts JSON.generate({ :exports => exports })
         
     | 
| 
      
 70 
     | 
    
         
            +
                  else
         
     | 
| 
      
 71 
     | 
    
         
            +
                    fail "#{output_type} is an invalid output format. Must one of: text, json"
         
     | 
| 
      
 72 
     | 
    
         
            +
                  end
         
     | 
| 
      
 73 
     | 
    
         
            +
                end
         
     | 
| 
      
 74 
     | 
    
         
            +
             
     | 
| 
      
 75 
     | 
    
         
            +
                def self.create_share(exportsfile, location, address, options)
         
     | 
| 
      
 76 
     | 
    
         
            +
                  if location.nil?
         
     | 
| 
      
 77 
     | 
    
         
            +
                    fail 'Location must be specified'
         
     | 
| 
      
 78 
     | 
    
         
            +
                  end
         
     | 
| 
      
 79 
     | 
    
         
            +
                  if address.nil?
         
     | 
| 
      
 80 
     | 
    
         
            +
                    fail 'Address must be specified'
         
     | 
| 
      
 81 
     | 
    
         
            +
                  end
         
     | 
| 
      
 82 
     | 
    
         
            +
                  if options.nil?
         
     | 
| 
      
 83 
     | 
    
         
            +
                    fail 'Options must be specified'
         
     | 
| 
      
 84 
     | 
    
         
            +
                  end
         
     | 
| 
      
 85 
     | 
    
         
            +
                  share = { :location => location,
         
     | 
| 
      
 86 
     | 
    
         
            +
                            :acl => [{
         
     | 
| 
      
 87 
     | 
    
         
            +
                                :address => address,
         
     | 
| 
      
 88 
     | 
    
         
            +
                                :options => options
         
     | 
| 
      
 89 
     | 
    
         
            +
                            }]
         
     | 
| 
      
 90 
     | 
    
         
            +
                  }
         
     | 
| 
      
 91 
     | 
    
         
            +
                  shares = get_shares(exportsfile)
         
     | 
| 
      
 92 
     | 
    
         
            +
                  existingshare = shares.find { |s| s[:location] == location }
         
     | 
| 
      
 93 
     | 
    
         
            +
                  if existingshare.nil?
         
     | 
| 
      
 94 
     | 
    
         
            +
                    shares << share
         
     | 
| 
      
 95 
     | 
    
         
            +
                    write_exports(exportsfile, shares)
         
     | 
| 
      
 96 
     | 
    
         
            +
                  else
         
     | 
| 
      
 97 
     | 
    
         
            +
                    puts 'Share already exists. Use nfsadmin export modify to change it. Skipping'
         
     | 
| 
      
 98 
     | 
    
         
            +
                  end
         
     | 
| 
      
 99 
     | 
    
         
            +
                end
         
     | 
| 
      
 100 
     | 
    
         
            +
             
     | 
| 
      
 101 
     | 
    
         
            +
                def self.delete_share(exportsfile, location)
         
     | 
| 
      
 102 
     | 
    
         
            +
                  if location.nil?
         
     | 
| 
      
 103 
     | 
    
         
            +
                    fail 'Location must be specified with -l or --location='
         
     | 
| 
      
 104 
     | 
    
         
            +
                  end
         
     | 
| 
      
 105 
     | 
    
         
            +
                  shares = get_shares(exportsfile)
         
     | 
| 
      
 106 
     | 
    
         
            +
                  share = shares.find { |share| share[:location] == location }
         
     | 
| 
      
 107 
     | 
    
         
            +
                  shares.delete(share)
         
     | 
| 
      
 108 
     | 
    
         
            +
                  write_exports(exportsfile, shares)
         
     | 
| 
      
 109 
     | 
    
         
            +
                end
         
     | 
| 
      
 110 
     | 
    
         
            +
             
     | 
| 
      
 111 
     | 
    
         
            +
                def self.get_share(exportsfile, location, output_type)
         
     | 
| 
      
 112 
     | 
    
         
            +
                  if location.nil?
         
     | 
| 
      
 113 
     | 
    
         
            +
                    fail 'Location must be specified with -l or --location='
         
     | 
| 
      
 114 
     | 
    
         
            +
                  end
         
     | 
| 
      
 115 
     | 
    
         
            +
                  shares = get_shares(exportsfile)
         
     | 
| 
      
 116 
     | 
    
         
            +
                  share = shares.find { |share| share[:location] == location }
         
     | 
| 
      
 117 
     | 
    
         
            +
                  if output_type.downcase == 'text'
         
     | 
| 
      
 118 
     | 
    
         
            +
                    printf('%-40s', share[:location])
         
     | 
| 
      
 119 
     | 
    
         
            +
                    share[:acl].each do |acl|
         
     | 
| 
      
 120 
     | 
    
         
            +
                      print acl[:address] + '(' + acl[:options] + ')' + ' '
         
     | 
| 
      
 121 
     | 
    
         
            +
                    end
         
     | 
| 
      
 122 
     | 
    
         
            +
                    print "\n"
         
     | 
| 
      
 123 
     | 
    
         
            +
                    STDOUT.flush
         
     | 
| 
      
 124 
     | 
    
         
            +
                  elsif output_type.downcase == 'json'
         
     | 
| 
      
 125 
     | 
    
         
            +
                    puts JSON.generate(share)
         
     | 
| 
      
 126 
     | 
    
         
            +
                  else
         
     | 
| 
      
 127 
     | 
    
         
            +
                    fail "#{output_type} is an invalid output format. Must one of: text, json"
         
     | 
| 
      
 128 
     | 
    
         
            +
                  end
         
     | 
| 
      
 129 
     | 
    
         
            +
                end
         
     | 
| 
      
 130 
     | 
    
         
            +
             
     | 
| 
      
 131 
     | 
    
         
            +
                def self.show_status
         
     | 
| 
      
 132 
     | 
    
         
            +
                  `/usr/sbin/service nfs status`
         
     | 
| 
      
 133 
     | 
    
         
            +
                end
         
     | 
| 
      
 134 
     | 
    
         
            +
             
     | 
| 
      
 135 
     | 
    
         
            +
                def self.start_service
         
     | 
| 
      
 136 
     | 
    
         
            +
                  `/usr/sbin/service nfs start`
         
     | 
| 
      
 137 
     | 
    
         
            +
                end
         
     | 
| 
      
 138 
     | 
    
         
            +
             
     | 
| 
      
 139 
     | 
    
         
            +
                def self.stop_service
         
     | 
| 
      
 140 
     | 
    
         
            +
                  `/usr/sbin/service nfs stop`
         
     | 
| 
      
 141 
     | 
    
         
            +
                end
         
     | 
| 
      
 142 
     | 
    
         
            +
             
     | 
| 
      
 143 
     | 
    
         
            +
                def self.restart_service
         
     | 
| 
      
 144 
     | 
    
         
            +
                  `/usr/sbin/service nfd restart`
         
     | 
| 
      
 145 
     | 
    
         
            +
                end
         
     | 
| 
      
 146 
     | 
    
         
            +
             
     | 
| 
      
 147 
     | 
    
         
            +
                def self.reload_config
         
     | 
| 
      
 148 
     | 
    
         
            +
                  `/usr/sbin/service nfs reload`
         
     | 
| 
      
 149 
     | 
    
         
            +
                end
         
     | 
| 
      
 150 
     | 
    
         
            +
              end
         
     | 
| 
      
 151 
     | 
    
         
            +
             
     | 
| 
      
 152 
     | 
    
         
            +
            end
         
     | 
    
        data/lib/nfsadmin.rb
    ADDED
    
    
    
        data/nfsadmin.gemspec
    ADDED
    
    | 
         @@ -0,0 +1,29 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # Ensure we require the local version and not one we might have installed already
         
     | 
| 
      
 2 
     | 
    
         
            +
            require File.join([File.dirname(__FILE__),'lib','nfsadmin','version.rb'])
         
     | 
| 
      
 3 
     | 
    
         
            +
            spec = Gem::Specification.new do |s|
         
     | 
| 
      
 4 
     | 
    
         
            +
              s.name = 'nfsadmin'
         
     | 
| 
      
 5 
     | 
    
         
            +
              s.version = Nfsadmin::VERSION
         
     | 
| 
      
 6 
     | 
    
         
            +
              s.author = 'Bastiaan Schaap'
         
     | 
| 
      
 7 
     | 
    
         
            +
              s.email = 'b.schaap@siteminds.nl'
         
     | 
| 
      
 8 
     | 
    
         
            +
              s.homepage = 'https://github.com/bjwschaap/nfsadmin'
         
     | 
| 
      
 9 
     | 
    
         
            +
              s.platform = Gem::Platform::RUBY
         
     | 
| 
      
 10 
     | 
    
         
            +
              s.summary = 'This gem contains a library and CLI tool for managing the NFS service and exports'
         
     | 
| 
      
 11 
     | 
    
         
            +
              s.description = <<eos
         
     | 
| 
      
 12 
     | 
    
         
            +
                              This gem contains a library and CLI tool for managing the NFS service and exports. It depends on
         
     | 
| 
      
 13 
     | 
    
         
            +
                              autofs to be installed, and the service NFS to be available. This is my first attempt at a
         
     | 
| 
      
 14 
     | 
    
         
            +
                              RubyGem, and much still needs to be done. Only tested on Centos 6 at this time.
         
     | 
| 
      
 15 
     | 
    
         
            +
            eos
         
     | 
| 
      
 16 
     | 
    
         
            +
              s.license = 'MIT'
         
     | 
| 
      
 17 
     | 
    
         
            +
              s.files = `git ls-files`.split("\n")
         
     | 
| 
      
 18 
     | 
    
         
            +
              s.require_paths << 'lib'
         
     | 
| 
      
 19 
     | 
    
         
            +
              s.has_rdoc = true
         
     | 
| 
      
 20 
     | 
    
         
            +
              s.extra_rdoc_files = ['README.rdoc','nfsadmin.rdoc']
         
     | 
| 
      
 21 
     | 
    
         
            +
              s.rdoc_options << '--title' << 'nfsadmin' << '--main' << 'README.rdoc' << '-ri'
         
     | 
| 
      
 22 
     | 
    
         
            +
              s.bindir = 'bin'
         
     | 
| 
      
 23 
     | 
    
         
            +
              s.executables << 'nfsadmin'
         
     | 
| 
      
 24 
     | 
    
         
            +
              s.required_ruby_version = '~> 2.0'
         
     | 
| 
      
 25 
     | 
    
         
            +
              s.add_development_dependency('rake', '~> 10.2' )
         
     | 
| 
      
 26 
     | 
    
         
            +
              s.add_development_dependency('rdoc', '~> 4.1')
         
     | 
| 
      
 27 
     | 
    
         
            +
              s.add_development_dependency('aruba', '~> 0.5')
         
     | 
| 
      
 28 
     | 
    
         
            +
              s.add_runtime_dependency('gli','~> 2.9')
         
     | 
| 
      
 29 
     | 
    
         
            +
            end
         
     | 
    
        data/nfsadmin.rdoc
    ADDED
    
    
    
        data/test/test_helper.rb
    ADDED
    
    
    
        metadata
    ADDED
    
    | 
         @@ -0,0 +1,132 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            --- !ruby/object:Gem::Specification
         
     | 
| 
      
 2 
     | 
    
         
            +
            name: nfsadmin
         
     | 
| 
      
 3 
     | 
    
         
            +
            version: !ruby/object:Gem::Version
         
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.0.2
         
     | 
| 
      
 5 
     | 
    
         
            +
            platform: ruby
         
     | 
| 
      
 6 
     | 
    
         
            +
            authors:
         
     | 
| 
      
 7 
     | 
    
         
            +
            - Bastiaan Schaap
         
     | 
| 
      
 8 
     | 
    
         
            +
            autorequire: 
         
     | 
| 
      
 9 
     | 
    
         
            +
            bindir: bin
         
     | 
| 
      
 10 
     | 
    
         
            +
            cert_chain: []
         
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2014-04-09 00:00:00.000000000 Z
         
     | 
| 
      
 12 
     | 
    
         
            +
            dependencies:
         
     | 
| 
      
 13 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 14 
     | 
    
         
            +
              name: rake
         
     | 
| 
      
 15 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 16 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 17 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 18 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 19 
     | 
    
         
            +
                    version: '10.2'
         
     | 
| 
      
 20 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 21 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 22 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 23 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 24 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 25 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 26 
     | 
    
         
            +
                    version: '10.2'
         
     | 
| 
      
 27 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 28 
     | 
    
         
            +
              name: rdoc
         
     | 
| 
      
 29 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 30 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 31 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 32 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 33 
     | 
    
         
            +
                    version: '4.1'
         
     | 
| 
      
 34 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 35 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 36 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 37 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 38 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 39 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 40 
     | 
    
         
            +
                    version: '4.1'
         
     | 
| 
      
 41 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 42 
     | 
    
         
            +
              name: aruba
         
     | 
| 
      
 43 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 44 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 45 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 46 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 47 
     | 
    
         
            +
                    version: '0.5'
         
     | 
| 
      
 48 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 49 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 50 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 51 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 52 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 53 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 54 
     | 
    
         
            +
                    version: '0.5'
         
     | 
| 
      
 55 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 56 
     | 
    
         
            +
              name: gli
         
     | 
| 
      
 57 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 58 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 59 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 60 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 61 
     | 
    
         
            +
                    version: '2.9'
         
     | 
| 
      
 62 
     | 
    
         
            +
              type: :runtime
         
     | 
| 
      
 63 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 64 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 65 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 66 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 67 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 68 
     | 
    
         
            +
                    version: '2.9'
         
     | 
| 
      
 69 
     | 
    
         
            +
            description: |2
         
     | 
| 
      
 70 
     | 
    
         
            +
                                This gem contains a library and CLI tool for managing the NFS service and exports. It depends on
         
     | 
| 
      
 71 
     | 
    
         
            +
                                autofs to be installed, and the service NFS to be available. This is my first attempt at a
         
     | 
| 
      
 72 
     | 
    
         
            +
                                RubyGem, and much still needs to be done. Only tested on Centos 6 at this time.
         
     | 
| 
      
 73 
     | 
    
         
            +
            email: b.schaap@siteminds.nl
         
     | 
| 
      
 74 
     | 
    
         
            +
            executables:
         
     | 
| 
      
 75 
     | 
    
         
            +
            - nfsadmin
         
     | 
| 
      
 76 
     | 
    
         
            +
            extensions: []
         
     | 
| 
      
 77 
     | 
    
         
            +
            extra_rdoc_files:
         
     | 
| 
      
 78 
     | 
    
         
            +
            - README.rdoc
         
     | 
| 
      
 79 
     | 
    
         
            +
            - nfsadmin.rdoc
         
     | 
| 
      
 80 
     | 
    
         
            +
            files:
         
     | 
| 
      
 81 
     | 
    
         
            +
            - ".gitignore"
         
     | 
| 
      
 82 
     | 
    
         
            +
            - ".ruby-gemset"
         
     | 
| 
      
 83 
     | 
    
         
            +
            - ".ruby-version"
         
     | 
| 
      
 84 
     | 
    
         
            +
            - Gemfile
         
     | 
| 
      
 85 
     | 
    
         
            +
            - Gemfile.lock
         
     | 
| 
      
 86 
     | 
    
         
            +
            - LICENSE
         
     | 
| 
      
 87 
     | 
    
         
            +
            - README.md
         
     | 
| 
      
 88 
     | 
    
         
            +
            - README.rdoc
         
     | 
| 
      
 89 
     | 
    
         
            +
            - Rakefile
         
     | 
| 
      
 90 
     | 
    
         
            +
            - bin/nfsadmin
         
     | 
| 
      
 91 
     | 
    
         
            +
            - features/nfsadmin.feature
         
     | 
| 
      
 92 
     | 
    
         
            +
            - features/step_definitions/nfsadmin_steps.rb
         
     | 
| 
      
 93 
     | 
    
         
            +
            - features/support/env.rb
         
     | 
| 
      
 94 
     | 
    
         
            +
            - lib/nfsadmin.rb
         
     | 
| 
      
 95 
     | 
    
         
            +
            - lib/nfsadmin/tasks.rb
         
     | 
| 
      
 96 
     | 
    
         
            +
            - lib/nfsadmin/version.rb
         
     | 
| 
      
 97 
     | 
    
         
            +
            - nfsadmin.gemspec
         
     | 
| 
      
 98 
     | 
    
         
            +
            - nfsadmin.rdoc
         
     | 
| 
      
 99 
     | 
    
         
            +
            - test/default_test.rb
         
     | 
| 
      
 100 
     | 
    
         
            +
            - test/test_helper.rb
         
     | 
| 
      
 101 
     | 
    
         
            +
            homepage: https://github.com/bjwschaap/nfsadmin
         
     | 
| 
      
 102 
     | 
    
         
            +
            licenses:
         
     | 
| 
      
 103 
     | 
    
         
            +
            - MIT
         
     | 
| 
      
 104 
     | 
    
         
            +
            metadata: {}
         
     | 
| 
      
 105 
     | 
    
         
            +
            post_install_message: 
         
     | 
| 
      
 106 
     | 
    
         
            +
            rdoc_options:
         
     | 
| 
      
 107 
     | 
    
         
            +
            - "--title"
         
     | 
| 
      
 108 
     | 
    
         
            +
            - nfsadmin
         
     | 
| 
      
 109 
     | 
    
         
            +
            - "--main"
         
     | 
| 
      
 110 
     | 
    
         
            +
            - README.rdoc
         
     | 
| 
      
 111 
     | 
    
         
            +
            - "-ri"
         
     | 
| 
      
 112 
     | 
    
         
            +
            require_paths:
         
     | 
| 
      
 113 
     | 
    
         
            +
            - lib
         
     | 
| 
      
 114 
     | 
    
         
            +
            - lib
         
     | 
| 
      
 115 
     | 
    
         
            +
            required_ruby_version: !ruby/object:Gem::Requirement
         
     | 
| 
      
 116 
     | 
    
         
            +
              requirements:
         
     | 
| 
      
 117 
     | 
    
         
            +
              - - "~>"
         
     | 
| 
      
 118 
     | 
    
         
            +
                - !ruby/object:Gem::Version
         
     | 
| 
      
 119 
     | 
    
         
            +
                  version: '2.0'
         
     | 
| 
      
 120 
     | 
    
         
            +
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
      
 121 
     | 
    
         
            +
              requirements:
         
     | 
| 
      
 122 
     | 
    
         
            +
              - - ">="
         
     | 
| 
      
 123 
     | 
    
         
            +
                - !ruby/object:Gem::Version
         
     | 
| 
      
 124 
     | 
    
         
            +
                  version: '0'
         
     | 
| 
      
 125 
     | 
    
         
            +
            requirements: []
         
     | 
| 
      
 126 
     | 
    
         
            +
            rubyforge_project: 
         
     | 
| 
      
 127 
     | 
    
         
            +
            rubygems_version: 2.2.2
         
     | 
| 
      
 128 
     | 
    
         
            +
            signing_key: 
         
     | 
| 
      
 129 
     | 
    
         
            +
            specification_version: 4
         
     | 
| 
      
 130 
     | 
    
         
            +
            summary: This gem contains a library and CLI tool for managing the NFS service and
         
     | 
| 
      
 131 
     | 
    
         
            +
              exports
         
     | 
| 
      
 132 
     | 
    
         
            +
            test_files: []
         
     |