skles 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,12 +1,10 @@
1
1
  source :rubygems
2
2
 
3
- # DEPENDENCIES
4
3
  gem 'savon'
5
4
 
6
- # DEVELOPMENT
7
- gem 'jeweler'
8
- gem 'yard'
9
- gem 'RedCloth', require: 'redcloth'
10
-
11
- # TEST
12
- gem 'rspec'
5
+ group :development do
6
+ gem 'jeweler'
7
+ gem 'yard'
8
+ gem 'RedCloth', require: 'redcloth'
9
+ gem 'rspec'
10
+ end
@@ -2,16 +2,15 @@ GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
4
  RedCloth (4.2.3)
5
- builder (2.1.2)
5
+ builder (3.0.0)
6
6
  crack (0.1.8)
7
7
  diff-lcs (1.1.2)
8
- gemcutter (0.6.1)
9
8
  git (1.2.5)
10
- jeweler (1.4.0)
11
- gemcutter (>= 0.1.0)
9
+ jeweler (1.5.1)
10
+ bundler (~> 1.0.0)
12
11
  git (>= 1.2.5)
13
- rubyforge (>= 2.0.0)
14
- json_pure (1.4.6)
12
+ rake
13
+ rake (0.8.7)
15
14
  rspec (2.1.0)
16
15
  rspec-core (~> 2.1.0)
17
16
  rspec-expectations (~> 2.1.0)
@@ -20,12 +19,10 @@ GEM
20
19
  rspec-expectations (2.1.0)
21
20
  diff-lcs (~> 1.1.2)
22
21
  rspec-mocks (2.1.0)
23
- rubyforge (2.0.4)
24
- json_pure (>= 1.1.7)
25
22
  savon (0.7.9)
26
23
  builder (>= 2.1.2)
27
24
  crack (>= 0.1.4)
28
- yard (0.6.1)
25
+ yard (0.6.2)
29
26
 
30
27
  PLATFORMS
31
28
  ruby
@@ -36,3 +33,6 @@ DEPENDENCIES
36
33
  rspec
37
34
  savon
38
35
  yard
36
+
37
+ METADATA
38
+ version: 1.0.6
@@ -1,7 +1,7 @@
1
1
  h1. SKLES: Ruby interface for StrongKey Lite boxes
2
2
 
3
3
  | *Author* | Tim Morgan |
4
- | *Version* | Version 1.0 (Nov 13, 2010) |
4
+ | *Version* | Version 1.0.1 (Nov 22, 2010) |
5
5
  | *License* | Released under the MIT license. |
6
6
 
7
7
  The SKLES gem is an interface to StrongAuth's StrongKey Lite credit card vault
data/Rakefile CHANGED
@@ -1,13 +1,15 @@
1
- require 'rake'
1
+ require 'rubygems'
2
+ require 'bundler'
2
3
  begin
3
- require 'bundler'
4
- rescue LoadError
5
- puts "Bundler is not installed; install with `gem install bundler`."
6
- exit 1
4
+ Bundler.setup(:default, :development)
5
+ rescue Bundler::BundlerError => e
6
+ $stderr.puts e.message
7
+ $stderr.puts "Run `bundle install` to install missing gems"
8
+ exit e.status_code
7
9
  end
10
+ require 'rake'
8
11
 
9
- Bundler.require :default
10
-
12
+ require 'jeweler'
11
13
  Jeweler::Tasks.new do |gem|
12
14
  gem.name = "skles"
13
15
  gem.summary = %Q{Ruby interface for SKLES (StrongKey Light Encryption System) boxes}
@@ -15,14 +17,14 @@ Jeweler::Tasks.new do |gem|
15
17
  gem.email = "git@timothymorgan.info"
16
18
  gem.homepage = "http://github.com/RISCfuture/skles"
17
19
  gem.authors = [ "Tim Morgan" ]
18
- gem.add_dependency 'savon'
19
20
  gem.required_ruby_version = '>= 1.9'
20
21
  end
21
- Jeweler::GemcutterTasks.new
22
+ Jeweler::RubygemsDotOrgTasks.new
22
23
 
23
24
  require 'rspec/core/rake_task'
24
25
  RSpec::Core::RakeTask.new
25
26
 
27
+ require 'yard'
26
28
  YARD::Rake::YardocTask.new('doc') do |doc|
27
29
  doc.options << "-m" << "textile"
28
30
  doc.options << "--protected"
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.0.1
@@ -3,6 +3,8 @@ require File.dirname(__FILE__) + '/skles_api'
3
3
 
4
4
  # can't have plaintext CC #s being logged
5
5
  Savon::Request.log = false
6
+ # We have our own error raising
7
+ Savon::Response.raise_errors = false
6
8
 
7
9
  # Client for the StrongKey Lite Encryption System (SKLES) SOAP-based API. An
8
10
  # instance of this API interfaces with your StrongKey Lite box to encrypt and
@@ -122,8 +124,8 @@ class StrongKeyLite
122
124
  password = @users[login]
123
125
 
124
126
  response = @client.send(meth) { |soap| soap.body = { did: domain_id, username: login, password: password }.merge(options) }
125
- raise SOAPError(response.soap_fault, response) if response.soap_fault?
126
- raise HTTPError(response.http_error, response) if response.http_error?
127
+ raise SOAPError.new(response.soap_fault, response) if response.soap_fault?
128
+ raise HTTPError.new(response.http_error, response) if response.http_error?
127
129
 
128
130
  return response.to_hash
129
131
  end
@@ -1,48 +1,46 @@
1
1
  # Generated by jeweler
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{skles}
8
- s.version = "1.0.0"
8
+ s.version = "1.0.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Tim Morgan"]
12
- s.date = %q{2010-11-13}
12
+ s.date = %q{2010-11-22}
13
13
  s.description = %q{A Ruby wrapper around the StrongKey Lite SOAP client API.}
14
14
  s.email = %q{git@timothymorgan.info}
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE",
17
- "README.textile"
17
+ "README.textile"
18
18
  ]
19
19
  s.files = [
20
20
  ".document",
21
- ".gitignore",
22
- ".rspec",
23
- "Gemfile",
24
- "Gemfile.lock",
25
- "LICENSE",
26
- "README.textile",
27
- "Rakefile",
28
- "VERSION",
29
- "lib/skles.rb",
30
- "lib/skles_api.rb",
31
- "skles.gemspec",
32
- "spec/skles_api_spec.rb",
33
- "spec/skles_spec.rb",
34
- "spec/spec_helper.rb"
21
+ ".rspec",
22
+ "Gemfile",
23
+ "Gemfile.lock",
24
+ "LICENSE",
25
+ "README.textile",
26
+ "Rakefile",
27
+ "VERSION",
28
+ "lib/skles.rb",
29
+ "lib/skles_api.rb",
30
+ "skles.gemspec",
31
+ "spec/skles_api_spec.rb",
32
+ "spec/skles_spec.rb",
33
+ "spec/spec_helper.rb"
35
34
  ]
36
35
  s.homepage = %q{http://github.com/RISCfuture/skles}
37
- s.rdoc_options = ["--charset=UTF-8"]
38
36
  s.require_paths = ["lib"]
39
37
  s.required_ruby_version = Gem::Requirement.new(">= 1.9")
40
38
  s.rubygems_version = %q{1.3.7}
41
39
  s.summary = %q{Ruby interface for SKLES (StrongKey Light Encryption System) boxes}
42
40
  s.test_files = [
43
41
  "spec/skles_api_spec.rb",
44
- "spec/skles_spec.rb",
45
- "spec/spec_helper.rb"
42
+ "spec/skles_spec.rb",
43
+ "spec/spec_helper.rb"
46
44
  ]
47
45
 
48
46
  if s.respond_to? :specification_version then
@@ -51,11 +49,23 @@ Gem::Specification.new do |s|
51
49
 
52
50
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
53
51
  s.add_runtime_dependency(%q<savon>, [">= 0"])
52
+ s.add_development_dependency(%q<jeweler>, [">= 0"])
53
+ s.add_development_dependency(%q<yard>, [">= 0"])
54
+ s.add_development_dependency(%q<RedCloth>, [">= 0"])
55
+ s.add_development_dependency(%q<rspec>, [">= 0"])
54
56
  else
55
57
  s.add_dependency(%q<savon>, [">= 0"])
58
+ s.add_dependency(%q<jeweler>, [">= 0"])
59
+ s.add_dependency(%q<yard>, [">= 0"])
60
+ s.add_dependency(%q<RedCloth>, [">= 0"])
61
+ s.add_dependency(%q<rspec>, [">= 0"])
56
62
  end
57
63
  else
58
64
  s.add_dependency(%q<savon>, [">= 0"])
65
+ s.add_dependency(%q<jeweler>, [">= 0"])
66
+ s.add_dependency(%q<yard>, [">= 0"])
67
+ s.add_dependency(%q<RedCloth>, [">= 0"])
68
+ s.add_dependency(%q<rspec>, [">= 0"])
59
69
  end
60
70
  end
61
71
 
@@ -71,6 +71,28 @@ describe StrongKeyLite do
71
71
  @client.should_receive(:ping).once.and_yield(soap).and_return(@response)
72
72
  @skles.ping
73
73
  end
74
+
75
+ it "should raise an HTTPError if an HTTP error occurs" do
76
+ @skles.add_user('all', 'password', :all)
77
+ soap = mock('Savon::Request')
78
+ soap.stub!(:body=)
79
+ @client.stub!(:ping).and_yield(soap).and_return(@response)
80
+ @response.stub!(:http_error?).and_return(true)
81
+ @response.stub!(:http_error).and_return("404 Not Found")
82
+
83
+ -> { @skles.ping }.should raise_error(StrongKeyLite::HTTPError)
84
+ end
85
+
86
+ it "should raise a SOAPError if a SOAP fault occurs" do
87
+ @skles.add_user('all', 'password', :all)
88
+ soap = mock('Savon::Request')
89
+ soap.stub!(:body=)
90
+ @client.stub!(:ping).and_yield(soap).and_return(@response)
91
+ @response.stub!(:soap_fault?).and_return(true)
92
+ @response.stub!(:soap_fault).and_return("Not enough XML")
93
+
94
+ -> { @skles.ping }.should raise_error(StrongKeyLite::SOAPError)
95
+ end
74
96
  end
75
97
 
76
98
  describe "#actions" do
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 0
8
- - 0
9
- version: 1.0.0
8
+ - 1
9
+ version: 1.0.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Tim Morgan
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-11-13 00:00:00 -08:00
17
+ date: 2010-11-22 00:00:00 -08:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -30,6 +30,58 @@ dependencies:
30
30
  type: :runtime
31
31
  prerelease: false
32
32
  version_requirements: *id001
33
+ - !ruby/object:Gem::Dependency
34
+ name: jeweler
35
+ requirement: &id002 !ruby/object:Gem::Requirement
36
+ none: false
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ segments:
41
+ - 0
42
+ version: "0"
43
+ type: :development
44
+ prerelease: false
45
+ version_requirements: *id002
46
+ - !ruby/object:Gem::Dependency
47
+ name: yard
48
+ requirement: &id003 !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ segments:
54
+ - 0
55
+ version: "0"
56
+ type: :development
57
+ prerelease: false
58
+ version_requirements: *id003
59
+ - !ruby/object:Gem::Dependency
60
+ name: RedCloth
61
+ requirement: &id004 !ruby/object:Gem::Requirement
62
+ none: false
63
+ requirements:
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ segments:
67
+ - 0
68
+ version: "0"
69
+ type: :development
70
+ prerelease: false
71
+ version_requirements: *id004
72
+ - !ruby/object:Gem::Dependency
73
+ name: rspec
74
+ requirement: &id005 !ruby/object:Gem::Requirement
75
+ none: false
76
+ requirements:
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ segments:
80
+ - 0
81
+ version: "0"
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: *id005
33
85
  description: A Ruby wrapper around the StrongKey Lite SOAP client API.
34
86
  email: git@timothymorgan.info
35
87
  executables: []
@@ -41,7 +93,6 @@ extra_rdoc_files:
41
93
  - README.textile
42
94
  files:
43
95
  - .document
44
- - .gitignore
45
96
  - .rspec
46
97
  - Gemfile
47
98
  - Gemfile.lock
@@ -60,8 +111,8 @@ homepage: http://github.com/RISCfuture/skles
60
111
  licenses: []
61
112
 
62
113
  post_install_message:
63
- rdoc_options:
64
- - --charset=UTF-8
114
+ rdoc_options: []
115
+
65
116
  require_paths:
66
117
  - lib
67
118
  required_ruby_version: !ruby/object:Gem::Requirement
data/.gitignore DELETED
@@ -1,25 +0,0 @@
1
- ## MAC OS
2
- .DS_Store
3
-
4
- ## TEXTMATE
5
- *.tmproj
6
- tmtags
7
-
8
- ## EMACS
9
- *~
10
- \#*
11
- .\#*
12
-
13
- ## VIM
14
- *.swp
15
-
16
- ## PROJECT::GENERAL
17
- pkg
18
- .rvm
19
- .idea
20
- .rvmrc
21
- .bundle
22
-
23
- ## PROJECT::DOCUMENTATION
24
- .yardoc
25
- doc