email_vision 0.1.4 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gem 'rake'
4
+ gem 'rspec', '~>2'
5
+ gem 'savon', '>=0.8'
6
+ gem 'httpclient'
7
+ gem 'jeweler'
@@ -0,0 +1,41 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ builder (2.1.2)
5
+ crack (0.1.8)
6
+ diff-lcs (1.1.2)
7
+ git (1.2.5)
8
+ gyoku (0.1.0)
9
+ builder (~> 2.1.2)
10
+ httpclient (2.1.5.2)
11
+ httpi (0.7.4)
12
+ rack
13
+ jeweler (1.5.2)
14
+ bundler (~> 1.0.0)
15
+ git (>= 1.2.5)
16
+ rake
17
+ rack (1.2.1)
18
+ rake (0.8.7)
19
+ rspec (2.3.0)
20
+ rspec-core (~> 2.3.0)
21
+ rspec-expectations (~> 2.3.0)
22
+ rspec-mocks (~> 2.3.0)
23
+ rspec-core (2.3.1)
24
+ rspec-expectations (2.3.0)
25
+ diff-lcs (~> 1.1.2)
26
+ rspec-mocks (2.3.0)
27
+ savon (0.8.0)
28
+ builder (~> 2.1.2)
29
+ crack (~> 0.1.8)
30
+ gyoku (>= 0.1.0)
31
+ httpi (>= 0.7.4)
32
+
33
+ PLATFORMS
34
+ ruby
35
+
36
+ DEPENDENCIES
37
+ httpclient
38
+ jeweler
39
+ rake
40
+ rspec (~> 2)
41
+ savon (>= 0.8)
data/Rakefile CHANGED
@@ -1,6 +1,8 @@
1
1
  task :default => :spec
2
- require 'spec/rake/spectask'
3
- Spec::Rake::SpecTask.new {|t| t.spec_opts = ['--color --backtrace']}
2
+ require "rspec/core/rake_task"
3
+ RSpec::Core::RakeTask.new(:spec) do |t|
4
+ t.rspec_opts = '--backtrace --color'
5
+ end
4
6
 
5
7
  def account
6
8
  YAML.load(File.read('spec/account.yml')) rescue {}
@@ -43,7 +45,7 @@ begin
43
45
  Jeweler::Tasks.new do |gem|
44
46
  gem.name = project_name
45
47
  gem.summary = "Ruby SOAP Api Client for EmailVision / CampaignCommander"
46
- gem.email = "grosser.michael@gmail.com"
48
+ gem.email = "michael@grosser.it"
47
49
  gem.homepage = "http://github.com/grosser/#{project_name}"
48
50
  gem.authors = ["Michael Grosser"]
49
51
  gem.add_dependency 'savon'
data/Readme.md CHANGED
@@ -23,6 +23,6 @@ Usage
23
23
 
24
24
  Author
25
25
  ======
26
- [Michael Grosser](http://pragmatig.wordpress.com)
27
- grosser.michael@gmail.com
26
+ [Michael Grosser](http://grosser.it)
27
+ michael@grosser.it
28
28
  Hereby placed under public domain, do what you want, just do not hold me accountable...
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.4
1
+ 0.2.0
@@ -1,28 +1,28 @@
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{email_vision}
8
- s.version = "0.1.4"
8
+ s.version = "0.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Michael Grosser"]
12
- s.date = %q{2010-10-09}
13
- s.email = %q{grosser.michael@gmail.com}
12
+ s.date = %q{2010-12-21}
13
+ s.email = %q{michael@grosser.it}
14
14
  s.files = [
15
- ".gitignore",
16
- "Rakefile",
17
- "Readme.md",
18
- "VERSION",
19
- "email_vision.gemspec",
20
- "lib/email_vision.rb",
21
- "spec/account.yml.example",
22
- "spec/email_vision_spec.rb"
15
+ "Gemfile",
16
+ "Gemfile.lock",
17
+ "Rakefile",
18
+ "Readme.md",
19
+ "VERSION",
20
+ "email_vision.gemspec",
21
+ "lib/email_vision.rb",
22
+ "spec/account.yml.example",
23
+ "spec/email_vision_spec.rb"
23
24
  ]
24
25
  s.homepage = %q{http://github.com/grosser/email_vision}
25
- s.rdoc_options = ["--charset=UTF-8"]
26
26
  s.require_paths = ["lib"]
27
27
  s.rubygems_version = %q{1.3.6}
28
28
  s.summary = %q{Ruby SOAP Api Client for EmailVision / CampaignCommander}
@@ -35,11 +35,26 @@ Gem::Specification.new do |s|
35
35
  s.specification_version = 3
36
36
 
37
37
  if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
38
+ s.add_runtime_dependency(%q<rake>, [">= 0"])
39
+ s.add_runtime_dependency(%q<rspec>, ["~> 2"])
40
+ s.add_runtime_dependency(%q<savon>, [">= 0.8"])
41
+ s.add_runtime_dependency(%q<httpclient>, [">= 0"])
42
+ s.add_runtime_dependency(%q<jeweler>, [">= 0"])
38
43
  s.add_runtime_dependency(%q<savon>, [">= 0"])
39
44
  else
45
+ s.add_dependency(%q<rake>, [">= 0"])
46
+ s.add_dependency(%q<rspec>, ["~> 2"])
47
+ s.add_dependency(%q<savon>, [">= 0.8"])
48
+ s.add_dependency(%q<httpclient>, [">= 0"])
49
+ s.add_dependency(%q<jeweler>, [">= 0"])
40
50
  s.add_dependency(%q<savon>, [">= 0"])
41
51
  end
42
52
  else
53
+ s.add_dependency(%q<rake>, [">= 0"])
54
+ s.add_dependency(%q<rspec>, ["~> 2"])
55
+ s.add_dependency(%q<savon>, [">= 0.8"])
56
+ s.add_dependency(%q<httpclient>, [">= 0"])
57
+ s.add_dependency(%q<jeweler>, [">= 0"])
43
58
  s.add_dependency(%q<savon>, [">= 0"])
44
59
  end
45
60
  end
@@ -71,13 +71,13 @@ class EmailVision
71
71
 
72
72
  def connection
73
73
  unless connected?
74
- response = client.open_api_connection{|r|
74
+ response = client.request :open_api_connection do |r|
75
75
  r.body = {
76
76
  :login => options[:login],
77
77
  :pwd => options[:password],
78
78
  :key => options[:key]
79
79
  }
80
- }
80
+ end
81
81
  @token = response.to_hash[:open_api_connection_response][:return]
82
82
  @token_requested = Time.now.to_i
83
83
  end
@@ -85,7 +85,9 @@ class EmailVision
85
85
  end
86
86
 
87
87
  def client
88
- @client ||= Savon::Client.new WSDL
88
+ @client ||= Savon::Client.new do
89
+ wsdl.document = WSDL
90
+ end
89
91
  end
90
92
 
91
93
  def connected?
@@ -115,7 +117,7 @@ class EmailVision
115
117
  end
116
118
 
117
119
  def execute(method, options={})
118
- response = connection.send(method){|r| r.body = options.merge(:token => @token) }
120
+ response = connection.request(method){|r| r.body = options.merge(:token => @token) }
119
121
  response.to_hash["#{method}_response".to_sym][:return]
120
122
  end
121
123
 
@@ -149,7 +149,7 @@ describe "EmailVision" do
149
149
  end
150
150
  date = client.find(changeable_user[:email])[:dateunjoin]
151
151
  date.is_a?(DateTime).should == true
152
- Time.parse(date.to_s).should be_close(Time.now, 40)
152
+ Time.parse(date.to_s).should be_within(40).of(Time.now)
153
153
  end
154
154
  end
155
155
 
@@ -160,7 +160,7 @@ describe "EmailVision" do
160
160
  end
161
161
  date = client.find(changeable_user[:email])[:datejoin]
162
162
  date.is_a?(DateTime).should == true
163
- Time.parse(date.to_s).should be_close(Time.now, 40)
163
+ Time.parse(date.to_s).should be_within(40).of(Time.now)
164
164
  end
165
165
  end
166
166
  end
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 1
8
- - 4
9
- version: 0.1.4
7
+ - 2
8
+ - 0
9
+ version: 0.2.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Michael Grosser
@@ -14,12 +14,10 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-10-09 00:00:00 +02:00
17
+ date: 2010-12-21 00:00:00 +01:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
- name: savon
22
- prerelease: false
23
21
  requirement: &id001 !ruby/object:Gem::Requirement
24
22
  requirements:
25
23
  - - ">="
@@ -29,8 +27,71 @@ dependencies:
29
27
  version: "0"
30
28
  type: :runtime
31
29
  version_requirements: *id001
30
+ prerelease: false
31
+ name: rake
32
+ - !ruby/object:Gem::Dependency
33
+ requirement: &id002 !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ~>
36
+ - !ruby/object:Gem::Version
37
+ segments:
38
+ - 2
39
+ version: "2"
40
+ type: :runtime
41
+ version_requirements: *id002
42
+ prerelease: false
43
+ name: rspec
44
+ - !ruby/object:Gem::Dependency
45
+ requirement: &id003 !ruby/object:Gem::Requirement
46
+ requirements:
47
+ - - ">="
48
+ - !ruby/object:Gem::Version
49
+ segments:
50
+ - 0
51
+ - 8
52
+ version: "0.8"
53
+ type: :runtime
54
+ version_requirements: *id003
55
+ prerelease: false
56
+ name: savon
57
+ - !ruby/object:Gem::Dependency
58
+ requirement: &id004 !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ segments:
63
+ - 0
64
+ version: "0"
65
+ type: :runtime
66
+ version_requirements: *id004
67
+ prerelease: false
68
+ name: httpclient
69
+ - !ruby/object:Gem::Dependency
70
+ requirement: &id005 !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ segments:
75
+ - 0
76
+ version: "0"
77
+ type: :runtime
78
+ version_requirements: *id005
79
+ prerelease: false
80
+ name: jeweler
81
+ - !ruby/object:Gem::Dependency
82
+ requirement: &id006 !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ">="
85
+ - !ruby/object:Gem::Version
86
+ segments:
87
+ - 0
88
+ version: "0"
89
+ type: :runtime
90
+ version_requirements: *id006
91
+ prerelease: false
92
+ name: savon
32
93
  description:
33
- email: grosser.michael@gmail.com
94
+ email: michael@grosser.it
34
95
  executables: []
35
96
 
36
97
  extensions: []
@@ -38,7 +99,8 @@ extensions: []
38
99
  extra_rdoc_files: []
39
100
 
40
101
  files:
41
- - .gitignore
102
+ - Gemfile
103
+ - Gemfile.lock
42
104
  - Rakefile
43
105
  - Readme.md
44
106
  - VERSION
@@ -51,8 +113,8 @@ homepage: http://github.com/grosser/email_vision
51
113
  licenses: []
52
114
 
53
115
  post_install_message:
54
- rdoc_options:
55
- - --charset=UTF-8
116
+ rdoc_options: []
117
+
56
118
  require_paths:
57
119
  - lib
58
120
  required_ruby_version: !ruby/object:Gem::Requirement
data/.gitignore DELETED
@@ -1,2 +0,0 @@
1
- spec/account.yml
2
- example.php