netscaler 0.1.0 → 0.2.0
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 +8 -8
- data/Gemfile +2 -0
- data/Gemfile.lock +10 -0
- data/Rakefile +6 -4
- data/VERSION +1 -1
- data/lib/netscaler/connection.rb +6 -0
- data/lib/netscaler/mock_adapter.rb +19 -0
- data/lib/netscaler/monkey_patches.rb +1 -0
- data/lib/netscaler/policy.rb +30 -0
- data/lib/netscaler/policy/stringmap.rb +42 -0
- data/netscaler.gemspec +88 -0
- data/spec/policy_stringmap_spec.rb +78 -0
- data/spec/spec_helper.rb +18 -1
- metadata +35 -3
    
        checksums.yaml
    CHANGED
    
    | @@ -1,15 +1,15 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            !binary "U0hBMQ==":
         | 
| 3 3 | 
             
              metadata.gz: !binary |-
         | 
| 4 | 
            -
                 | 
| 4 | 
            +
                NGQ5ZjU2M2IyYWI3NDM4YWIxYmU1NWI3YjFlYzlmMDE2ODFkYTBkMA==
         | 
| 5 5 | 
             
              data.tar.gz: !binary |-
         | 
| 6 | 
            -
                 | 
| 6 | 
            +
                YWRlNGI3N2JhZGY0NmM3MWZiMWE0MjAyNDgyMWUzYzkxZjRiNGQ3Mw==
         | 
| 7 7 | 
             
            SHA512:
         | 
| 8 8 | 
             
              metadata.gz: !binary |-
         | 
| 9 | 
            -
                 | 
| 10 | 
            -
                 | 
| 11 | 
            -
                 | 
| 9 | 
            +
                ZDE4YTIyMTRiMjQ2Yzc3NmJjNTZiYTVjNGNjMmVhYmI5NzQ2N2M1ZTY5ZTY1
         | 
| 10 | 
            +
                YzMwODE3YzVmNDgwOWEyMGQyM2QwNTQwYzkyZTU4NmVlMTcyNWMxNTRiYTMy
         | 
| 11 | 
            +
                NjkwMThlNjVhOWJjMTlhYjhlYjhhOTIyZTZjMGYwZDllOTAzNTc=
         | 
| 12 12 | 
             
              data.tar.gz: !binary |-
         | 
| 13 | 
            -
                 | 
| 14 | 
            -
                 | 
| 15 | 
            -
                 | 
| 13 | 
            +
                NWM3NmNhOTJhMjY0M2ZjODJkNmJmYzhiMTViMmQ4MTg5ZjJiMmI0ODRkMmJl
         | 
| 14 | 
            +
                Nzc3YjBjZGNhZjMyMzY5YTAyMjU1NzE4NjIzNjNjYWJmZTA5Y2U0MTYyZWUw
         | 
| 15 | 
            +
                MTNmMjAzNjAyNWZiZWFmYmRjNDA0ZWYzMjU4MjZjNDFmMDc4Y2E=
         | 
    
        data/Gemfile
    CHANGED
    
    
    
        data/Gemfile.lock
    CHANGED
    
    | @@ -4,6 +4,7 @@ GEM | |
| 4 4 | 
             
                addressable (2.3.5)
         | 
| 5 5 | 
             
                builder (3.2.2)
         | 
| 6 6 | 
             
                diff-lcs (1.1.3)
         | 
| 7 | 
            +
                docile (1.1.2)
         | 
| 7 8 | 
             
                faraday (0.8.9)
         | 
| 8 9 | 
             
                  multipart-post (~> 1.2.0)
         | 
| 9 10 | 
             
                git (1.2.6)
         | 
| @@ -53,6 +54,13 @@ GEM | |
| 53 54 | 
             
                rspec-expectations (2.8.0)
         | 
| 54 55 | 
             
                  diff-lcs (~> 1.1.2)
         | 
| 55 56 | 
             
                rspec-mocks (2.8.0)
         | 
| 57 | 
            +
                simplecov (0.8.2)
         | 
| 58 | 
            +
                  docile (~> 1.1.0)
         | 
| 59 | 
            +
                  multi_json
         | 
| 60 | 
            +
                  simplecov-html (~> 0.8.0)
         | 
| 61 | 
            +
                simplecov-html (0.8.0)
         | 
| 62 | 
            +
                simplecov-rcov (0.2.3)
         | 
| 63 | 
            +
                  simplecov (>= 0.4.1)
         | 
| 56 64 |  | 
| 57 65 | 
             
            PLATFORMS
         | 
| 58 66 | 
             
              ruby
         | 
| @@ -64,3 +72,5 @@ DEPENDENCIES | |
| 64 72 | 
             
              rdoc (~> 3.12)
         | 
| 65 73 | 
             
              rest-client
         | 
| 66 74 | 
             
              rspec (~> 2.8.0)
         | 
| 75 | 
            +
              simplecov
         | 
| 76 | 
            +
              simplecov-rcov
         | 
    
        data/Rakefile
    CHANGED
    
    | @@ -33,10 +33,10 @@ RSpec::Core::RakeTask.new(:spec) do |spec| | |
| 33 33 | 
             
              spec.pattern = FileList['spec/**/*_spec.rb']
         | 
| 34 34 | 
             
            end
         | 
| 35 35 |  | 
| 36 | 
            -
            RSpec::Core::RakeTask.new(:rcov) do |spec|
         | 
| 37 | 
            -
             | 
| 38 | 
            -
             | 
| 39 | 
            -
            end
         | 
| 36 | 
            +
            # RSpec::Core::RakeTask.new(:rcov) do |spec|
         | 
| 37 | 
            +
            #   spec.pattern = 'spec/**/*_spec.rb'
         | 
| 38 | 
            +
            #   spec.rcov = true
         | 
| 39 | 
            +
            # end
         | 
| 40 40 |  | 
| 41 41 | 
             
            task :default => :spec
         | 
| 42 42 |  | 
| @@ -49,3 +49,5 @@ Rake::RDocTask.new do |rdoc| | |
| 49 49 | 
             
              rdoc.rdoc_files.include('README*')
         | 
| 50 50 | 
             
              rdoc.rdoc_files.include('lib/**/*.rb')
         | 
| 51 51 | 
             
            end
         | 
| 52 | 
            +
             | 
| 53 | 
            +
            CLOBBER.include('coverage')
         | 
    
        data/VERSION
    CHANGED
    
    | @@ -1 +1 @@ | |
| 1 | 
            -
            0. | 
| 1 | 
            +
            0.2.0
         | 
    
        data/lib/netscaler/connection.rb
    CHANGED
    
    | @@ -9,6 +9,7 @@ require 'netscaler/servicegroup' | |
| 9 9 | 
             
            require 'netscaler/load_balancing'
         | 
| 10 10 | 
             
            require 'netscaler/http_adapter'
         | 
| 11 11 | 
             
            require 'netscaler/adapter'
         | 
| 12 | 
            +
            require 'netscaler/policy'
         | 
| 12 13 |  | 
| 13 14 | 
             
            module Netscaler
         | 
| 14 15 | 
             
              class Connection
         | 
| @@ -28,6 +29,7 @@ module Netscaler | |
| 28 29 | 
             
                  @service = Service.new self
         | 
| 29 30 | 
             
                  @servicegroups = ServiceGroup.new self
         | 
| 30 31 | 
             
                  @servers = Server.new self
         | 
| 32 | 
            +
                  @policy = Policy.new self
         | 
| 31 33 | 
             
                end
         | 
| 32 34 |  | 
| 33 35 | 
             
                def adapter
         | 
| @@ -50,6 +52,10 @@ module Netscaler | |
| 50 52 | 
             
                  return @load_balancing
         | 
| 51 53 | 
             
                end
         | 
| 52 54 |  | 
| 55 | 
            +
                def policy
         | 
| 56 | 
            +
                  @policy
         | 
| 57 | 
            +
                end
         | 
| 58 | 
            +
             | 
| 53 59 | 
             
                def servers
         | 
| 54 60 | 
             
                  return @servers
         | 
| 55 61 | 
             
                end
         | 
| @@ -34,5 +34,24 @@ module Netscaler | |
| 34 34 | 
             
                  #  return process_result(result, response)
         | 
| 35 35 | 
             
                  #end
         | 
| 36 36 | 
             
                end
         | 
| 37 | 
            +
             | 
| 38 | 
            +
                def post_no_body(part, data, args={})
         | 
| 39 | 
            +
                  url = get_uri(part)
         | 
| 40 | 
            +
                  options = prepare_options(args)
         | 
| 41 | 
            +
                  options[:content_type] = :json #'application/x-www-form-urlencoded'
         | 
| 42 | 
            +
                  post_data = prepare_payload(data)
         | 
| 43 | 
            +
                  #@site[url].post post_data, options
         | 
| 44 | 
            +
                  #puts "POST /#{url}\n#{post_data}"
         | 
| 45 | 
            +
                  return process_result(@result, @response)
         | 
| 46 | 
            +
                end
         | 
| 47 | 
            +
             | 
| 48 | 
            +
                def get(part, args={})
         | 
| 49 | 
            +
                  url = get_uri(part)
         | 
| 50 | 
            +
                  options = prepare_options(args)
         | 
| 51 | 
            +
                  options[:content_type] = :json
         | 
| 52 | 
            +
                  #puts "GET /#{url}"
         | 
| 53 | 
            +
                  return process_result(@result, @response)
         | 
| 54 | 
            +
                end
         | 
| 55 | 
            +
             | 
| 37 56 | 
             
              end
         | 
| 38 57 | 
             
            end
         | 
| @@ -0,0 +1,30 @@ | |
| 1 | 
            +
            require 'netscaler/policy/stringmap'
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            module Netscaler
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            =begin
         | 
| 6 | 
            +
             | 
| 7 | 
            +
              Keeping with the command grouping in NSCLI, the Policy class is meant
         | 
| 8 | 
            +
              to be used as a place holder for all subcommands that belong under
         | 
| 9 | 
            +
              policy command group.  Ex.
         | 
| 10 | 
            +
             | 
| 11 | 
            +
              add policy expression
         | 
| 12 | 
            +
              add policy httpCallout
         | 
| 13 | 
            +
              add policy map
         | 
| 14 | 
            +
              add policy patset
         | 
| 15 | 
            +
              add policy stringmap
         | 
| 16 | 
            +
             | 
| 17 | 
            +
            =end
         | 
| 18 | 
            +
             | 
| 19 | 
            +
              class Policy
         | 
| 20 | 
            +
             | 
| 21 | 
            +
                def initialize(netscaler)
         | 
| 22 | 
            +
                  @netscaler = netscaler
         | 
| 23 | 
            +
                end
         | 
| 24 | 
            +
             | 
| 25 | 
            +
                def stringmap
         | 
| 26 | 
            +
                  Stringmap.new @netscaler
         | 
| 27 | 
            +
                end
         | 
| 28 | 
            +
             | 
| 29 | 
            +
              end
         | 
| 30 | 
            +
            end
         | 
| @@ -0,0 +1,42 @@ | |
| 1 | 
            +
            require 'netscaler/netscaler_service'
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            module Netscaler
         | 
| 4 | 
            +
              class Policy
         | 
| 5 | 
            +
                class Stringmap < NetscalerService
         | 
| 6 | 
            +
                  def initialize(netscaler)
         | 
| 7 | 
            +
                    @netscaler = netscaler
         | 
| 8 | 
            +
                  end
         | 
| 9 | 
            +
             | 
| 10 | 
            +
                  def list(payload = nil)
         | 
| 11 | 
            +
                    if payload !=nil then
         | 
| 12 | 
            +
                      payload = Netscaler.hash_hack(payload)
         | 
| 13 | 
            +
                      validate_payload(payload, [:name])
         | 
| 14 | 
            +
                      return @netscaler.adapter.get("config/policystringmap/#{payload[:name]}")
         | 
| 15 | 
            +
                    else
         | 
| 16 | 
            +
                      return @netscaler.adapter.get("config/policystringmap/")
         | 
| 17 | 
            +
                    end
         | 
| 18 | 
            +
                  end
         | 
| 19 | 
            +
             | 
| 20 | 
            +
                  def add(payload)
         | 
| 21 | 
            +
                    raise ArgumentError, 'payload cannot be null' if payload.nil?
         | 
| 22 | 
            +
                    payload = Netscaler.hash_hack(payload)
         | 
| 23 | 
            +
                    validate_payload(payload, [:name])
         | 
| 24 | 
            +
                    return @netscaler.adapter.post_no_body('config/policystringmap/', 'policystringmap' => payload)
         | 
| 25 | 
            +
                  end
         | 
| 26 | 
            +
             | 
| 27 | 
            +
                  def get(payload)
         | 
| 28 | 
            +
                    raise ArgumentError, 'arg must contain name of policystringmap! :name => "foo"' if payload.nil?
         | 
| 29 | 
            +
                    payload = Netscaler.hash_hack(payload)
         | 
| 30 | 
            +
                    validate_payload(payload, [:name])
         | 
| 31 | 
            +
                    return @netscaler.adapter.get("config/policystringmap_pattern_binding/#{payload[:name]}")
         | 
| 32 | 
            +
                  end
         | 
| 33 | 
            +
             | 
| 34 | 
            +
                  def bind(payload)
         | 
| 35 | 
            +
                    raise ArgumentError, 'payload cannot be null' if payload.nil?
         | 
| 36 | 
            +
                    payload = Netscaler.hash_hack(payload)
         | 
| 37 | 
            +
                    validate_payload(payload, [:name, :key, :value])
         | 
| 38 | 
            +
                    return @netscaler.adapter.post_no_body('config/policystringmap_pattern_binding/', 'policystringmap_pattern_binding' => payload)
         | 
| 39 | 
            +
                  end
         | 
| 40 | 
            +
                end
         | 
| 41 | 
            +
              end
         | 
| 42 | 
            +
            end
         | 
    
        data/netscaler.gemspec
    ADDED
    
    | @@ -0,0 +1,88 @@ | |
| 1 | 
            +
            # Generated by jeweler
         | 
| 2 | 
            +
            # DO NOT EDIT THIS FILE DIRECTLY
         | 
| 3 | 
            +
            # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
         | 
| 4 | 
            +
            # -*- encoding: utf-8 -*-
         | 
| 5 | 
            +
            # stub: netscaler 0.2.0 ruby lib
         | 
| 6 | 
            +
             | 
| 7 | 
            +
            Gem::Specification.new do |s|
         | 
| 8 | 
            +
              s.name = "netscaler"
         | 
| 9 | 
            +
              s.version = "0.2.0"
         | 
| 10 | 
            +
             | 
| 11 | 
            +
              s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
         | 
| 12 | 
            +
              s.require_paths = ["lib"]
         | 
| 13 | 
            +
              s.authors = ["Jeremy Custenborder", "David Andrew", "Jarrett Irons"]
         | 
| 14 | 
            +
              s.date = "2014-07-21"
         | 
| 15 | 
            +
              s.description = "Netscaler api working against the Citrix Nitro api.  Currently supports Nitro 9.3.  Hope to add support for 10.X.  Currently has support for som basics such as adding servers/services/servicegroups."
         | 
| 16 | 
            +
              s.email = ["jeremy@scarcemedia.com", "david.andrew@webtrends.com", "jarrett.irons@gmail.com"]
         | 
| 17 | 
            +
              s.extra_rdoc_files = [
         | 
| 18 | 
            +
                "LICENSE.txt",
         | 
| 19 | 
            +
                "README.rdoc"
         | 
| 20 | 
            +
              ]
         | 
| 21 | 
            +
              s.files = [
         | 
| 22 | 
            +
                ".document",
         | 
| 23 | 
            +
                ".rspec",
         | 
| 24 | 
            +
                "Gemfile",
         | 
| 25 | 
            +
                "Gemfile.lock",
         | 
| 26 | 
            +
                "LICENSE.txt",
         | 
| 27 | 
            +
                "README.rdoc",
         | 
| 28 | 
            +
                "Rakefile",
         | 
| 29 | 
            +
                "VERSION",
         | 
| 30 | 
            +
                "lib/netscaler.rb",
         | 
| 31 | 
            +
                "lib/netscaler/adapter.rb",
         | 
| 32 | 
            +
                "lib/netscaler/connection.rb",
         | 
| 33 | 
            +
                "lib/netscaler/http_adapter.rb",
         | 
| 34 | 
            +
                "lib/netscaler/load_balancing.rb",
         | 
| 35 | 
            +
                "lib/netscaler/mock_adapter.rb",
         | 
| 36 | 
            +
                "lib/netscaler/monkey_patches.rb",
         | 
| 37 | 
            +
                "lib/netscaler/netscaler_service.rb",
         | 
| 38 | 
            +
                "lib/netscaler/policy.rb",
         | 
| 39 | 
            +
                "lib/netscaler/policy/stringmap.rb",
         | 
| 40 | 
            +
                "lib/netscaler/server.rb",
         | 
| 41 | 
            +
                "lib/netscaler/service.rb",
         | 
| 42 | 
            +
                "lib/netscaler/servicegroup.rb",
         | 
| 43 | 
            +
                "netscaler.gemspec",
         | 
| 44 | 
            +
                "spec/netscaler_spec.rb",
         | 
| 45 | 
            +
                "spec/policy_stringmap_spec.rb",
         | 
| 46 | 
            +
                "spec/server_spec.rb",
         | 
| 47 | 
            +
                "spec/servicegroup_spec.rb",
         | 
| 48 | 
            +
                "spec/spec_helper.rb"
         | 
| 49 | 
            +
              ]
         | 
| 50 | 
            +
              s.homepage = "http://github.com/GravityLabs/netscaler"
         | 
| 51 | 
            +
              s.licenses = ["MIT"]
         | 
| 52 | 
            +
              s.rubygems_version = "2.2.2"
         | 
| 53 | 
            +
              s.summary = "Netscaler api working against the Citrix Nitro api."
         | 
| 54 | 
            +
             | 
| 55 | 
            +
              if s.respond_to? :specification_version then
         | 
| 56 | 
            +
                s.specification_version = 4
         | 
| 57 | 
            +
             | 
| 58 | 
            +
                if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
         | 
| 59 | 
            +
                  s.add_runtime_dependency(%q<rest-client>, [">= 0"])
         | 
| 60 | 
            +
                  s.add_runtime_dependency(%q<json>, [">= 0"])
         | 
| 61 | 
            +
                  s.add_development_dependency(%q<rspec>, ["~> 2.8.0"])
         | 
| 62 | 
            +
                  s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
         | 
| 63 | 
            +
                  s.add_development_dependency(%q<bundler>, [">= 0"])
         | 
| 64 | 
            +
                  s.add_development_dependency(%q<jeweler>, ["~> 1.8.8"])
         | 
| 65 | 
            +
                  s.add_development_dependency(%q<simplecov>, [">= 0"])
         | 
| 66 | 
            +
                  s.add_development_dependency(%q<simplecov-rcov>, [">= 0"])
         | 
| 67 | 
            +
                else
         | 
| 68 | 
            +
                  s.add_dependency(%q<rest-client>, [">= 0"])
         | 
| 69 | 
            +
                  s.add_dependency(%q<json>, [">= 0"])
         | 
| 70 | 
            +
                  s.add_dependency(%q<rspec>, ["~> 2.8.0"])
         | 
| 71 | 
            +
                  s.add_dependency(%q<rdoc>, ["~> 3.12"])
         | 
| 72 | 
            +
                  s.add_dependency(%q<bundler>, [">= 0"])
         | 
| 73 | 
            +
                  s.add_dependency(%q<jeweler>, ["~> 1.8.8"])
         | 
| 74 | 
            +
                  s.add_dependency(%q<simplecov>, [">= 0"])
         | 
| 75 | 
            +
                  s.add_dependency(%q<simplecov-rcov>, [">= 0"])
         | 
| 76 | 
            +
                end
         | 
| 77 | 
            +
              else
         | 
| 78 | 
            +
                s.add_dependency(%q<rest-client>, [">= 0"])
         | 
| 79 | 
            +
                s.add_dependency(%q<json>, [">= 0"])
         | 
| 80 | 
            +
                s.add_dependency(%q<rspec>, ["~> 2.8.0"])
         | 
| 81 | 
            +
                s.add_dependency(%q<rdoc>, ["~> 3.12"])
         | 
| 82 | 
            +
                s.add_dependency(%q<bundler>, [">= 0"])
         | 
| 83 | 
            +
                s.add_dependency(%q<jeweler>, ["~> 1.8.8"])
         | 
| 84 | 
            +
                s.add_dependency(%q<simplecov>, [">= 0"])
         | 
| 85 | 
            +
                s.add_dependency(%q<simplecov-rcov>, [">= 0"])
         | 
| 86 | 
            +
              end
         | 
| 87 | 
            +
            end
         | 
| 88 | 
            +
             | 
| @@ -0,0 +1,78 @@ | |
| 1 | 
            +
            require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
         | 
| 2 | 
            +
            require 'netscaler'
         | 
| 3 | 
            +
            require 'netscaler/mock_adapter'
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            describe Netscaler::Policy::Stringmap do
         | 
| 6 | 
            +
              connection = Netscaler::Connection.new 'hostname'=> 'foo', 'password' => 'bar', 'username'=> 'bar'
         | 
| 7 | 
            +
              connection.adapter = Netscaler::MockAdapter.new :body => '{ "errorcode": 0, "message": "Done" }'
         | 
| 8 | 
            +
             | 
| 9 | 
            +
              context 'when adding a new stringmap' do
         | 
| 10 | 
            +
                specify 'a name is required' do
         | 
| 11 | 
            +
                  expect {
         | 
| 12 | 
            +
                    connection.policy.stringmap.add('test')
         | 
| 13 | 
            +
                  }.should raise_error(ArgumentError, /payload must be a hash\./)
         | 
| 14 | 
            +
                end
         | 
| 15 | 
            +
             | 
| 16 | 
            +
                it 'returns a hash if proper arguments are passed' do
         | 
| 17 | 
            +
                  result = connection.policy.stringmap.add(:name => 'test')
         | 
| 18 | 
            +
                  result.should be_kind_of(Hash)
         | 
| 19 | 
            +
                end
         | 
| 20 | 
            +
              end
         | 
| 21 | 
            +
             | 
| 22 | 
            +
              context 'when getting a list of stringmaps' do
         | 
| 23 | 
            +
                specify 'a name is optional' do
         | 
| 24 | 
            +
                  result = connection.policy.stringmap.list(:name => 'test')
         | 
| 25 | 
            +
                  result.should be_kind_of(Hash)
         | 
| 26 | 
            +
                end
         | 
| 27 | 
            +
             | 
| 28 | 
            +
                specify 'the arg should be a hash' do
         | 
| 29 | 
            +
                  expect {
         | 
| 30 | 
            +
                    connection.policy.stringmap.list('test')
         | 
| 31 | 
            +
                  }.should raise_error(ArgumentError, /payload must be a hash\./)
         | 
| 32 | 
            +
                end
         | 
| 33 | 
            +
             | 
| 34 | 
            +
                it 'returns a hash, listing stringmaps' do
         | 
| 35 | 
            +
                  result = connection.policy.stringmap.list
         | 
| 36 | 
            +
                  result.should be_kind_of(Hash)
         | 
| 37 | 
            +
                end
         | 
| 38 | 
            +
             | 
| 39 | 
            +
                it 'Method Get will take name parameter and return hash' do
         | 
| 40 | 
            +
                  result = connection.policy.stringmap.get(:name => 'test')
         | 
| 41 | 
            +
                  result.should be_kind_of(Hash)
         | 
| 42 | 
            +
                end
         | 
| 43 | 
            +
             | 
| 44 | 
            +
                specify 'Method Get, arg should be a hash' do
         | 
| 45 | 
            +
                  expect {
         | 
| 46 | 
            +
                    connection.policy.stringmap.get('test')
         | 
| 47 | 
            +
                  }.should raise_error(ArgumentError, /payload must be a hash\./)
         | 
| 48 | 
            +
                end
         | 
| 49 | 
            +
             | 
| 50 | 
            +
              end
         | 
| 51 | 
            +
             | 
| 52 | 
            +
              context 'when adding a binding a key value pair to a stringmap' do
         | 
| 53 | 
            +
                specify 'a name is required' do
         | 
| 54 | 
            +
                  expect {
         | 
| 55 | 
            +
                    connection.policy.stringmap.bind(:key => 'foo', :value => 'bar')
         | 
| 56 | 
            +
                  }.should raise_error(ArgumentError, /name/)
         | 
| 57 | 
            +
                end
         | 
| 58 | 
            +
             | 
| 59 | 
            +
                specify 'a key is required' do
         | 
| 60 | 
            +
                  expect {
         | 
| 61 | 
            +
                    connection.policy.stringmap.bind(:name => 'foo', :value => 'bar')
         | 
| 62 | 
            +
                  }.should raise_error(ArgumentError, /key/)
         | 
| 63 | 
            +
                end
         | 
| 64 | 
            +
             | 
| 65 | 
            +
                specify 'a value is required' do
         | 
| 66 | 
            +
                  expect {
         | 
| 67 | 
            +
                    connection.policy.stringmap.bind(:key => 'foo', :name => 'bar')
         | 
| 68 | 
            +
                  }.should raise_error(ArgumentError, /value/)
         | 
| 69 | 
            +
                end
         | 
| 70 | 
            +
             | 
| 71 | 
            +
                it 'returns a hash if proper arguments are passed' do
         | 
| 72 | 
            +
                  result = connection.policy.stringmap.bind(:name => 'test', :key => 'foo', :value => 'bar')
         | 
| 73 | 
            +
                  result.should be_kind_of(Hash)
         | 
| 74 | 
            +
                end
         | 
| 75 | 
            +
             end
         | 
| 76 | 
            +
             | 
| 77 | 
            +
             | 
| 78 | 
            +
            end
         | 
    
        data/spec/spec_helper.rb
    CHANGED
    
    | @@ -1,3 +1,20 @@ | |
| 1 | 
            +
            require 'simplecov'
         | 
| 2 | 
            +
            require 'simplecov-rcov'
         | 
| 3 | 
            +
             | 
| 4 | 
            +
            class SimpleCov::Formatter::MergedFormatter
         | 
| 5 | 
            +
              def format(result)
         | 
| 6 | 
            +
                SimpleCov::Formatter::HTMLFormatter.new.format(result)
         | 
| 7 | 
            +
                SimpleCov::Formatter::RcovFormatter.new.format(result)
         | 
| 8 | 
            +
              end
         | 
| 9 | 
            +
            end
         | 
| 10 | 
            +
             | 
| 11 | 
            +
            SimpleCov.formatter = SimpleCov::Formatter::MergedFormatter
         | 
| 12 | 
            +
             | 
| 13 | 
            +
            SimpleCov.start do
         | 
| 14 | 
            +
              add_filter '/vendor/'
         | 
| 15 | 
            +
              add_filter '/spec/'
         | 
| 16 | 
            +
            end
         | 
| 17 | 
            +
             | 
| 1 18 | 
             
            $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
         | 
| 2 19 | 
             
            $LOAD_PATH.unshift(File.dirname(__FILE__))
         | 
| 3 20 | 
             
            require 'rspec'
         | 
| @@ -8,5 +25,5 @@ require 'netscaler' | |
| 8 25 | 
             
            Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
         | 
| 9 26 |  | 
| 10 27 | 
             
            RSpec.configure do |config|
         | 
| 11 | 
            -
              
         | 
| 28 | 
            +
              #config.include RSpecMixin
         | 
| 12 29 | 
             
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: netscaler
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0. | 
| 4 | 
            +
              version: 0.2.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Jeremy Custenborder
         | 
| @@ -10,7 +10,7 @@ authors: | |
| 10 10 | 
             
            autorequire: 
         | 
| 11 11 | 
             
            bindir: bin
         | 
| 12 12 | 
             
            cert_chain: []
         | 
| 13 | 
            -
            date: 2014- | 
| 13 | 
            +
            date: 2014-07-21 00:00:00.000000000 Z
         | 
| 14 14 | 
             
            dependencies:
         | 
| 15 15 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 16 16 | 
             
              name: rest-client
         | 
| @@ -96,6 +96,34 @@ dependencies: | |
| 96 96 | 
             
                - - ~>
         | 
| 97 97 | 
             
                  - !ruby/object:Gem::Version
         | 
| 98 98 | 
             
                    version: 1.8.8
         | 
| 99 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 100 | 
            +
              name: simplecov
         | 
| 101 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 102 | 
            +
                requirements:
         | 
| 103 | 
            +
                - - ! '>='
         | 
| 104 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 105 | 
            +
                    version: '0'
         | 
| 106 | 
            +
              type: :development
         | 
| 107 | 
            +
              prerelease: false
         | 
| 108 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 109 | 
            +
                requirements:
         | 
| 110 | 
            +
                - - ! '>='
         | 
| 111 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 112 | 
            +
                    version: '0'
         | 
| 113 | 
            +
            - !ruby/object:Gem::Dependency
         | 
| 114 | 
            +
              name: simplecov-rcov
         | 
| 115 | 
            +
              requirement: !ruby/object:Gem::Requirement
         | 
| 116 | 
            +
                requirements:
         | 
| 117 | 
            +
                - - ! '>='
         | 
| 118 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 119 | 
            +
                    version: '0'
         | 
| 120 | 
            +
              type: :development
         | 
| 121 | 
            +
              prerelease: false
         | 
| 122 | 
            +
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 123 | 
            +
                requirements:
         | 
| 124 | 
            +
                - - ! '>='
         | 
| 125 | 
            +
                  - !ruby/object:Gem::Version
         | 
| 126 | 
            +
                    version: '0'
         | 
| 99 127 | 
             
            description: Netscaler api working against the Citrix Nitro api.  Currently supports
         | 
| 100 128 | 
             
              Nitro 9.3.  Hope to add support for 10.X.  Currently has support for som basics
         | 
| 101 129 | 
             
              such as adding servers/services/servicegroups.
         | 
| @@ -125,10 +153,14 @@ files: | |
| 125 153 | 
             
            - lib/netscaler/mock_adapter.rb
         | 
| 126 154 | 
             
            - lib/netscaler/monkey_patches.rb
         | 
| 127 155 | 
             
            - lib/netscaler/netscaler_service.rb
         | 
| 156 | 
            +
            - lib/netscaler/policy.rb
         | 
| 157 | 
            +
            - lib/netscaler/policy/stringmap.rb
         | 
| 128 158 | 
             
            - lib/netscaler/server.rb
         | 
| 129 159 | 
             
            - lib/netscaler/service.rb
         | 
| 130 160 | 
             
            - lib/netscaler/servicegroup.rb
         | 
| 161 | 
            +
            - netscaler.gemspec
         | 
| 131 162 | 
             
            - spec/netscaler_spec.rb
         | 
| 163 | 
            +
            - spec/policy_stringmap_spec.rb
         | 
| 132 164 | 
             
            - spec/server_spec.rb
         | 
| 133 165 | 
             
            - spec/servicegroup_spec.rb
         | 
| 134 166 | 
             
            - spec/spec_helper.rb
         | 
| @@ -152,7 +184,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 152 184 | 
             
                  version: '0'
         | 
| 153 185 | 
             
            requirements: []
         | 
| 154 186 | 
             
            rubyforge_project: 
         | 
| 155 | 
            -
            rubygems_version: 2. | 
| 187 | 
            +
            rubygems_version: 2.2.2
         | 
| 156 188 | 
             
            signing_key: 
         | 
| 157 189 | 
             
            specification_version: 4
         | 
| 158 190 | 
             
            summary: Netscaler api working against the Citrix Nitro api.
         |