Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updating to the latest choosy release.

  • Loading branch information...
commit 39cb1c503821d2bfb87bc04bbddbf877b40cfe55 1 parent 5a34ebe
Gabe McArthur authored
18 Gemfile
View
@@ -1,14 +1,6 @@
-source :rubygems
-
-gem 'log4r', '~> 1.1'
-gem 'savon', '~> 0.7.0'
-gem 'highline', '>= 1.6'
-gem 'choosy', '~> 0.2'
-gem 'json_pure', '~> 1.5.1', :require => 'json'
-
-group :development do
- gem 'rspec', :require => "spec"
- gem 'autotest'
- gem 'autotest-notification'
-end
+# So that the netscaler.gemspec will load
+require 'choosy'
+require 'rake'
+source :rubygems
+gemspec
21 Gemfile.lock
View
@@ -1,3 +1,13 @@
+PATH
+ remote: .
+ specs:
+ netscaler-cli (0.5.1)
+ choosy (>= 0.4.3)
+ highline (>= 1.6)
+ json_pure (>= 1.5.1)
+ log4r (>= 1.1.9)
+ savon (= 0.7.9)
+
GEM
remote: http://rubygems.org/
specs:
@@ -7,11 +17,10 @@ GEM
autotest-notification (2.3.1)
autotest (~> 4.3)
builder (3.0.0)
- choosy (0.2.5)
+ choosy (0.4.3)
crack (0.1.8)
diff-lcs (1.1.2)
highline (1.6.1)
- hirb (0.4.0)
json_pure (1.5.1)
log4r (1.1.9)
rspec (2.5.0)
@@ -30,12 +39,8 @@ PLATFORMS
ruby
DEPENDENCIES
+ ZenTest
autotest
autotest-notification
- choosy (~> 0.2)
- highline (>= 1.6)
- hirb (~> 0.4.0)
- json_pure (~> 1.5.1)
- log4r (~> 1.1)
+ netscaler-cli!
rspec
- savon (~> 0.7.0)
46 Rakefile
View
@@ -5,54 +5,12 @@ require 'fileutils'
require 'rake'
require 'rubygems'
require 'rspec/core/rake_task'
-require 'netscaler/version'
-
-include FileUtils
+require 'choosy/rake'
task :default => :spec
desc "Run the RSpec tests"
RSpec::Core::RakeTask.new :spec
-begin
- require 'jeweler'
- Jeweler::Tasks.new do |gem|
- gem.name = 'netscaler-cli'
- gem.version = Netscaler::Version.to_s
- gem.executables = %W{netscaler}
- gem.summary = 'Simple command line utilities for interacting remotely with a Netscaler load balancer.'
- gem.description = 'This gem installs several simple command line utilities locally. It uses the NSConfig.wsdl SOAP interface for remote access.'
- gem.email = ['madeonamac@gmail.com']
- gem.authors = ['Gabe McArthur']
- gem.homepage = 'http://github.com/gabemc/netscaler-cli'
- gem.files = FileList["[A-Z]*", "{bin,lib,spec}/**/*", "etc/Version"]
-
- gem.add_dependency 'log4r', '>=1.1.9'
- gem.add_dependency 'savon', '>=0.7.9'
- gem.add_dependency 'highline', '>=1.6'
- gem.add_dependency 'choosy', '>=0.2.4'
-
- gem.add_development_dependency 'rspec', '>=2.5.0'
- end
-rescue LoadError
- puts "Jeweler or dependencies are not available. Install it with: sudo gem install jeweler"
-end
-
-desc "Deploys the gem to rubygems.org"
-task :gem => :release do
- system("gem build netscaler-cli.gemspec")
- system("gem push netscaler-cli-#{Netscaler::Version.to_s}.gem")
-end
-
-desc "Does the full release cycle."
-task :deploy => [:gem, :clean] do
-end
-
desc "Cleans the gem files up."
-task :clean do
- rm(Dir.glob('*.gemspec'))
- rm(Dir.glob('*.gem'))
- if File.directory?('pkg')
- rm_rf('pkg')
- end
-end
+task :clean => ['gem:clean']
1  lib/VERSION
View
@@ -1 +0,0 @@
-0.5.1
6 lib/VERSION.yml
View
@@ -0,0 +1,6 @@
+---
+date: 30/03/2011
+version:
+ major: 0
+ minor: 5
+ tiny: 2
32 lib/netscaler/cli.rb
View
@@ -1,5 +1,4 @@
require 'netscaler/errors'
-require 'netscaler/version'
require 'netscaler/config'
require 'netscaler/executor'
require 'netscaler/server/request'
@@ -41,7 +40,7 @@ def command
printer :standard, :color => true, :headers => [:bold, :blue], :max_width => 80
summary "This is a command line tool for interacting with Netscaler load balancer"
- header 'Description:'
+ heading 'Description:'
para "There are several subcommands to do various things with the load balancer. Try 'netscaler help SUBCOMMAND' for more information about the particular command you want to use."
para "Note that you can supply a configuration file, which would normally be found under ~/.netscaler-cli.yml. That file describes the relationship between your Netscaler load balancers and the aliases, usernames, and passwords that you supply for them. The file is in the general format:"
para " netscaler.host.name.com:
@@ -50,15 +49,15 @@ def command
password: is_optional_but_querried_if_not_found"
# COMMANDS
- header 'Commands:'
+ heading 'Commands:'
cmds.each do |cmd|
command cmd
end
- para ''
- help
+ para
+ command :help
# OPTIONS
- header 'Global Options:'
+ heading 'Global Options:'
string :netscaler, "The IP Address, hostname, or alias in the config file of the Netscaler load balancer. This is required." do
depends_on :config
required
@@ -77,10 +76,11 @@ def command
default File.join(ENV['HOME'], '.netscaler-cli.yml')
end
- header 'Informative:'
+ heading 'Informative:'
boolean_ :debug, "Print extra debug information"
boolean_ :json, "Prints out JSON instead of textual data"
- version Netscaler::Version.to_s.chomp!
+ help
+ version Choosy::Version.load(:file => __FILE__, :relpath => '..')
end
end#command
@@ -88,12 +88,12 @@ def servers
Choosy::Command.new :server do |s|
executor Netscaler::Executor.new(Netscaler::Server::Request)
summary "Enables, disbles, or lists servers in the load balancer"
- header 'Description:'
+ heading 'Description:'
para "This is a tool for enabling and disabling a server in a Netscaler load balancer. The name of the server is required, as is the address of the Netscaler load balancer."
para "By default, this command will tell you what the current status of the server is."
para "If you want to list all of the services, use the --list flag."
- header 'Options:'
+ heading 'Options:'
enum :action, [:enable, :disable, :list, :status], "Either [enable, disable, list]. 'list' will ignore additional arguments. Default action is 'status'" do
default :status
end
@@ -113,12 +113,12 @@ def vservers
Choosy::Command.new :vserver do
executor Netscaler::Executor.new(Netscaler::VServer::Request)
summary "Enables, disables, binds or unbinds policies, or lists virtual servers."
- header 'Description:'
+ heading 'Description:'
para "This is a tool for acting upon virtual servers (VIPs) in a Netscaler load balancer. The name of the virtual server is required."
para "By default, this command will tell you what the current status of the server is."
para "If you want to list all of the virtual servers, use the --list flag."
- header 'Options:'
+ heading 'Options:'
enum :action, [:enable, :disable, :list, :bind, :unbind, :status], "Either [enable, disable, list, bind, unbind, status]. 'bind' and 'unbind' require the additional '--policy' flag. 'list' will ignore additional arguments. Default action is 'status'." do
default :status
end
@@ -162,10 +162,10 @@ def services
Choosy::Command.new :service do
executor Netscaler::Executor.new(Netscaler::Service::Request)
summary "Enables, disables, binds or unbinds from a virtual server, a given service."
- header 'Description:'
+ heading 'Description:'
para "This is a tool for enabling and disabling services in a Netscaler load balancer. The name of the service is required, as is the address of the Netscaler load balancer."
- header 'Options:'
+ heading 'Options:'
enum :action, [:enable, :disable, :bind, :unbind, :status], "Either [enable, disable, bind, unbind, status] of a service. 'bind' and 'unbind' require the '--vserver' flag. Default is 'status'." do
default :status
end
@@ -196,10 +196,10 @@ def servicegroups
Choosy::Command.new :servicegroup do
executor Netscaler::Executor.new(Netscaler::ServiceGroup::Request)
summary "Enables, disables, binds or unbinds from a virtual server, a given service group."
- header 'Description:'
+ heading 'Description:'
para "This is a tool for enabling and disabling service groups in a Netscaler load balancer. The name of the service group is required, as is the address of the Netscaler load balancer."
- header 'Options:'
+ heading 'Options:'
enum :action, [:enable, :disable, :bind, :unbind, :status], "Either [enable, disable, bind, unbind, status] of a service group. 'bind' and 'unbind' require the '--vserver' flag. Default is 'status'." do
default :status
end
12 lib/netscaler/version.rb
View
@@ -1,12 +0,0 @@
-require 'scanf'
-
-module Netscaler
- class Version
- CURRENT = File.read(File.join(File.dirname(__FILE__), '..', 'VERSION'))
- MAJOR, MINOR, TINY = CURRENT.scanf('%d.%d.%d')
-
- def self.to_s
- CURRENT
- end
- end
-end
Please sign in to comment.
Something went wrong with that request. Please try again.