leadtune 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/spec/put.rb ADDED
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # LeadTune API Ruby Gem
4
+ #
5
+ # http://github.com/leadtune/leadtune-ruby
6
+ # Eric Wollesen (mailto:devs@leadtune.com)
7
+ # Copyright 2010 LeadTune LLC
8
+
9
+ require "rubygems"
10
+ require "pp"
11
+ require File.join(File.dirname(__FILE__), "../lib/leadtune")
12
+
13
+
14
+ begin
15
+ p = Leadtune::Prospect.get({:prospect_id => "4c93fda2b34601ddb7d1c030",
16
+ :username => "admin@acme.edu",
17
+ :password => "admin",
18
+ :organization => "AcmeU",})
19
+ p.browser_family = "Firefox"
20
+ p.leadtune_host = "http://localhost:8080"
21
+ p.put
22
+
23
+ p = Leadtune::Prospect.get({:prospect_id => "4c92f8d6b34601dd5ecac030",
24
+ :username => "admin@acme.edu",
25
+ :password => "admin",
26
+ :organization => "AcmeU",})
27
+ pp p.factors
28
+
29
+ rescue Leadtune::LeadtuneError => e
30
+ puts e.to_s
31
+ end
32
+
@@ -0,0 +1,35 @@
1
+ # LeadTune API Ruby Gem
2
+ #
3
+ # http://github.com/leadtune/leadtune-ruby
4
+ # Eric Wollesen (mailto:devs@leadtune.com)
5
+ # Copyright 2010 LeadTune LLC
6
+
7
+ require "ruby-debug"
8
+ require "rspec"
9
+ require File.dirname(__FILE__) + "/../lib/leadtune"
10
+
11
+ require 'webmock/rspec'
12
+
13
+ RSpec.configure do |config|
14
+ config.include WebMock
15
+ end
16
+
17
+ def setup_leadtune_env
18
+ ENV["LEADTUNE_USERNAME"] = "env@env.com"
19
+ ENV["LEADTUNE_PASSWORD"] = "env_secret"
20
+ ENV["LEADTUNE_ORGANIZATION"] = "env_org"
21
+ end
22
+
23
+ def teardown_leadtune_env
24
+ ENV.delete("LEADTUNE_USERNAME")
25
+ ENV.delete("LEADTUNE_PASSWORD")
26
+ ENV.delete("LEADTUNE_ORGANIZATION")
27
+ end
28
+
29
+ def leadtune_config_file
30
+ StringIO.new <<EOF
31
+ username: config_file@config_file.com
32
+ password: config_file_secret
33
+ organization: config_file_org
34
+ EOF
35
+ end
data/spec/test_curb.rb ADDED
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # LeadTune API Ruby Gem
4
+ #
5
+ # http://github.com/leadtune/leadtune-ruby
6
+ # Eric Wollesen (mailto:devs@leadtune.com)
7
+ # Copyright 2010 LeadTune LLC
8
+
9
+ require "rubygems"
10
+ require "curb"
11
+ require "time"
12
+
13
+ c = Curl::Easy.new("http://www.google.com/")
14
+
15
+ c.on_failure do |curl, code|
16
+ puts "failure!"
17
+ puts "code: #{code.inspect}"
18
+ puts "response code: #{curl.response_code}"
19
+ puts "response headers:\n#{curl.header_str}"
20
+ end
21
+
22
+ c.on_success do |curl|
23
+ puts "success!"
24
+ end
25
+
26
+ c.http_post
27
+ puts "*" * 20
28
+ c.http_get
metadata ADDED
@@ -0,0 +1,108 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: leadtune
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ version: 0.0.1
11
+ platform: ruby
12
+ authors:
13
+ - Eric Wollesen
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2010-09-20 00:00:00 -06:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ version_requirements: &id001 !ruby/object:Gem::Requirement
23
+ none: false
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ hash: 23
28
+ segments:
29
+ - 1
30
+ - 0
31
+ - 0
32
+ version: 1.0.0
33
+ requirement: *id001
34
+ type: :development
35
+ name: bundler
36
+ prerelease: false
37
+ description: LeadTune Ruby API Gem
38
+ email:
39
+ - devs@leadtune.com
40
+ executables: []
41
+
42
+ extensions: []
43
+
44
+ extra_rdoc_files: []
45
+
46
+ files:
47
+ - .gitignore
48
+ - .rspec
49
+ - Gemfile
50
+ - Gemfile.lock
51
+ - README.rdoc
52
+ - Rakefile
53
+ - leadtune.gemspec
54
+ - lib/array_extensions.rb
55
+ - lib/hash_extensions.rb
56
+ - lib/leadtune.rb
57
+ - lib/leadtune/appraisals.rb
58
+ - lib/leadtune/config.rb
59
+ - lib/leadtune/prospect.rb
60
+ - lib/leadtune/rest.rb
61
+ - lib/leadtune/version.rb
62
+ - spec/echo_server.rb
63
+ - spec/get.rb
64
+ - spec/leadtune/appraisals_spec.rb
65
+ - spec/leadtune/prospect_spec.rb
66
+ - spec/leadtune/rest_spec.rb
67
+ - spec/post.rb
68
+ - spec/put.rb
69
+ - spec/spec_helper.rb
70
+ - spec/test_curb.rb
71
+ has_rdoc: true
72
+ homepage: http://github.com/leadtune/leadtune-ruby
73
+ licenses: []
74
+
75
+ post_install_message:
76
+ rdoc_options: []
77
+
78
+ require_paths:
79
+ - lib
80
+ required_ruby_version: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ">="
84
+ - !ruby/object:Gem::Version
85
+ hash: 3
86
+ segments:
87
+ - 0
88
+ version: "0"
89
+ required_rubygems_version: !ruby/object:Gem::Requirement
90
+ none: false
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ hash: 23
95
+ segments:
96
+ - 1
97
+ - 3
98
+ - 6
99
+ version: 1.3.6
100
+ requirements: []
101
+
102
+ rubyforge_project:
103
+ rubygems_version: 1.3.7
104
+ signing_key:
105
+ specification_version: 3
106
+ summary: LeadTune Ruby API Gem
107
+ test_files: []
108
+