wurfl_cloud_client_light 1.0.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.
Files changed (38) hide show
  1. data/.gitignore +5 -0
  2. data/FOSS_THIRD_PARTY_LICENSES.txt +23 -0
  3. data/Gemfile +4 -0
  4. data/Gemfile.lock +40 -0
  5. data/LICENSE.txt +75 -0
  6. data/Rakefile +14 -0
  7. data/lib/wurfl_cloud/cache/cookie.rb +36 -0
  8. data/lib/wurfl_cloud/cache/local_memory.rb +36 -0
  9. data/lib/wurfl_cloud/cache/null.rb +34 -0
  10. data/lib/wurfl_cloud/client.rb +98 -0
  11. data/lib/wurfl_cloud/configuration.rb +81 -0
  12. data/lib/wurfl_cloud/device_capabilities.rb +71 -0
  13. data/lib/wurfl_cloud/environment.rb +41 -0
  14. data/lib/wurfl_cloud/errors.rb +16 -0
  15. data/lib/wurfl_cloud/helper.rb +14 -0
  16. data/lib/wurfl_cloud/rack/cache_manager.rb +47 -0
  17. data/lib/wurfl_cloud/rails.rb +27 -0
  18. data/lib/wurfl_cloud/version.rb +7 -0
  19. data/lib/wurfl_cloud.rb +42 -0
  20. data/spec/files/generic.json +1 -0
  21. data/spec/files/generic_filtered.json +1 -0
  22. data/spec/files/lumia.json +1 -0
  23. data/spec/files/lumia_filtered.json +1 -0
  24. data/spec/files/strange_values.json +1 -0
  25. data/spec/spec_helper.rb +20 -0
  26. data/spec/support/rack_helpers.rb +79 -0
  27. data/spec/support/string_extensions.rb +26 -0
  28. data/spec/wurfl_cloud/client_spec.rb +200 -0
  29. data/spec/wurfl_cloud/configuration_spec.rb +111 -0
  30. data/spec/wurfl_cloud/cookie_cache_spec.rb +44 -0
  31. data/spec/wurfl_cloud/device_capabilities_spec.rb +136 -0
  32. data/spec/wurfl_cloud/environment_spec.rb +86 -0
  33. data/spec/wurfl_cloud/helper_spec.rb +28 -0
  34. data/spec/wurfl_cloud/null_cache_spec.rb +30 -0
  35. data/spec/wurfl_cloud/rack_cache_manager_spec.rb +69 -0
  36. data/spec/wurfl_cloud/server_request_spec.rb +38 -0
  37. data/wurfl_cloud_client_light.gemspec +31 -0
  38. metadata +161 -0
@@ -0,0 +1,38 @@
1
+ #
2
+ # This software is the Copyright of ScientiaMobile, Inc.
3
+ # Please refer to the LICENSE.txt file distributed with the software for licensing information
4
+ #
5
+ require 'spec_helper'
6
+
7
+
8
+ describe "the client doing a real request" do
9
+ before(:all) do
10
+ unless defined?(TEST_API_KEY)
11
+ pending(%{ MISSING TEST API KEY
12
+ To be able to execute this test you need to add a file spec/support/test_api_key.rb in which you define the
13
+ constant TEST_API_KEY to hold the api key you'll be using to do the test:
14
+ TEST_API_KEY = '000000:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
15
+ ** DO NOT ADD YOUR KEY TO THE REPOSITORY **
16
+ })
17
+ else
18
+ WurflCloud.configure do |config|
19
+ config.host = 'staging.wurflcloud.com'
20
+ config.api_key = TEST_API_KEY
21
+ end
22
+ @environment = WurflCloud::Environment.new({"HTTP_USER_AGENT"=>%{Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Mobile/7D11}})
23
+
24
+ WebMock.allow_net_connect!
25
+ @device = WurflCloud::Client.detect_device(@environment, WurflCloud.configuration.cache(nil))
26
+ end
27
+ end
28
+
29
+ it "should detect the correct device" do
30
+
31
+ @device['id'].should =='apple_iphone_ver4'
32
+ end
33
+
34
+ it "should have the device capabilities" do
35
+ @device['is_wireless_device'].should ==true
36
+ end
37
+
38
+ end
@@ -0,0 +1,31 @@
1
+ # -*- encoding: utf-8 -*-
2
+ #
3
+ # This software is the Copyright of ScientiaMobile, Inc.
4
+ # Please refer to the LICENSE.txt file distributed with the software for licensing information
5
+ #
6
+ $:.push File.expand_path("../lib", __FILE__)
7
+ require "wurfl_cloud/version"
8
+
9
+ Gem::Specification.new do |s|
10
+ s.name = "wurfl_cloud_client_light"
11
+ s.version = WurflCloud::VERSION
12
+ s.platform = Gem::Platform::RUBY
13
+ s.authors = ["ScientiaMobile, Inc."]
14
+ s.email = ["info@scientiamobile.com"]
15
+ s.homepage = ""
16
+ s.summary = %q{Wurfl Cound Ruby Client - Light}
17
+ s.description = %q{ruby client for the Wurfl Cloud API}
18
+
19
+ s.rubyforge_project = "wurfl_cloud_client_light"
20
+
21
+ s.add_dependency "json"
22
+ s.add_dependency "rack"
23
+ s.add_development_dependency "rspec"
24
+ s.add_development_dependency "webmock"
25
+ s.add_development_dependency "simplecov"
26
+
27
+ s.files = `git ls-files`.split("\n").reject{|f| f =~ /cache\/(memcached|rails)/ || f =~ /(memcached|rails)_cache_spec/ || f == "wurfl_cloud_client.gemspec"}
28
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n").reject{|f| f =~ /(memcached|rails)_cache_spec/ }
29
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
30
+ s.require_paths = ["lib"]
31
+ end
metadata ADDED
@@ -0,0 +1,161 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: wurfl_cloud_client_light
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 1.0.0
6
+ platform: ruby
7
+ authors:
8
+ - ScientiaMobile, Inc.
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2012-09-05 00:00:00 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: json
17
+ prerelease: false
18
+ requirement: &id001 !ruby/object:Gem::Requirement
19
+ none: false
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "0"
24
+ type: :runtime
25
+ version_requirements: *id001
26
+ - !ruby/object:Gem::Dependency
27
+ name: rack
28
+ prerelease: false
29
+ requirement: &id002 !ruby/object:Gem::Requirement
30
+ none: false
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: "0"
35
+ type: :runtime
36
+ version_requirements: *id002
37
+ - !ruby/object:Gem::Dependency
38
+ name: rspec
39
+ prerelease: false
40
+ requirement: &id003 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: "0"
46
+ type: :development
47
+ version_requirements: *id003
48
+ - !ruby/object:Gem::Dependency
49
+ name: webmock
50
+ prerelease: false
51
+ requirement: &id004 !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: "0"
57
+ type: :development
58
+ version_requirements: *id004
59
+ - !ruby/object:Gem::Dependency
60
+ name: simplecov
61
+ prerelease: false
62
+ requirement: &id005 !ruby/object:Gem::Requirement
63
+ none: false
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: "0"
68
+ type: :development
69
+ version_requirements: *id005
70
+ description: ruby client for the Wurfl Cloud API
71
+ email:
72
+ - info@scientiamobile.com
73
+ executables: []
74
+
75
+ extensions: []
76
+
77
+ extra_rdoc_files: []
78
+
79
+ files:
80
+ - .gitignore
81
+ - FOSS_THIRD_PARTY_LICENSES.txt
82
+ - Gemfile
83
+ - Gemfile.lock
84
+ - LICENSE.txt
85
+ - Rakefile
86
+ - lib/wurfl_cloud.rb
87
+ - lib/wurfl_cloud/cache/cookie.rb
88
+ - lib/wurfl_cloud/cache/local_memory.rb
89
+ - lib/wurfl_cloud/cache/null.rb
90
+ - lib/wurfl_cloud/client.rb
91
+ - lib/wurfl_cloud/configuration.rb
92
+ - lib/wurfl_cloud/device_capabilities.rb
93
+ - lib/wurfl_cloud/environment.rb
94
+ - lib/wurfl_cloud/errors.rb
95
+ - lib/wurfl_cloud/helper.rb
96
+ - lib/wurfl_cloud/rack/cache_manager.rb
97
+ - lib/wurfl_cloud/rails.rb
98
+ - lib/wurfl_cloud/version.rb
99
+ - spec/files/generic.json
100
+ - spec/files/generic_filtered.json
101
+ - spec/files/lumia.json
102
+ - spec/files/lumia_filtered.json
103
+ - spec/files/strange_values.json
104
+ - spec/spec_helper.rb
105
+ - spec/support/rack_helpers.rb
106
+ - spec/support/string_extensions.rb
107
+ - spec/wurfl_cloud/client_spec.rb
108
+ - spec/wurfl_cloud/configuration_spec.rb
109
+ - spec/wurfl_cloud/cookie_cache_spec.rb
110
+ - spec/wurfl_cloud/device_capabilities_spec.rb
111
+ - spec/wurfl_cloud/environment_spec.rb
112
+ - spec/wurfl_cloud/helper_spec.rb
113
+ - spec/wurfl_cloud/null_cache_spec.rb
114
+ - spec/wurfl_cloud/rack_cache_manager_spec.rb
115
+ - spec/wurfl_cloud/server_request_spec.rb
116
+ - wurfl_cloud_client_light.gemspec
117
+ homepage: ""
118
+ licenses: []
119
+
120
+ post_install_message:
121
+ rdoc_options: []
122
+
123
+ require_paths:
124
+ - lib
125
+ required_ruby_version: !ruby/object:Gem::Requirement
126
+ none: false
127
+ requirements:
128
+ - - ">="
129
+ - !ruby/object:Gem::Version
130
+ version: "0"
131
+ required_rubygems_version: !ruby/object:Gem::Requirement
132
+ none: false
133
+ requirements:
134
+ - - ">="
135
+ - !ruby/object:Gem::Version
136
+ version: "0"
137
+ requirements: []
138
+
139
+ rubyforge_project: wurfl_cloud_client_light
140
+ rubygems_version: 1.8.10
141
+ signing_key:
142
+ specification_version: 3
143
+ summary: Wurfl Cound Ruby Client - Light
144
+ test_files:
145
+ - spec/files/generic.json
146
+ - spec/files/generic_filtered.json
147
+ - spec/files/lumia.json
148
+ - spec/files/lumia_filtered.json
149
+ - spec/files/strange_values.json
150
+ - spec/spec_helper.rb
151
+ - spec/support/rack_helpers.rb
152
+ - spec/support/string_extensions.rb
153
+ - spec/wurfl_cloud/client_spec.rb
154
+ - spec/wurfl_cloud/configuration_spec.rb
155
+ - spec/wurfl_cloud/cookie_cache_spec.rb
156
+ - spec/wurfl_cloud/device_capabilities_spec.rb
157
+ - spec/wurfl_cloud/environment_spec.rb
158
+ - spec/wurfl_cloud/helper_spec.rb
159
+ - spec/wurfl_cloud/null_cache_spec.rb
160
+ - spec/wurfl_cloud/rack_cache_manager_spec.rb
161
+ - spec/wurfl_cloud/server_request_spec.rb