webfontloader 1.0.27 → 1.0.28

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ v1.0.28 (June 4, 2012)
2
+ * Added support for detecting the Chrome OS platform ("CrOS") in the UserAgentParser.
3
+
1
4
  v1.0.27 (April 20, 2012)
2
5
  * Updated DomHelper to not require a UserAgent instance. Feature-detection is not used instead of UA detection for switching DOM methods.
3
6
 
data/lib/webfontloader.rb CHANGED
@@ -3,7 +3,7 @@ require 'yaml'
3
3
  require 'webfontloader/modules'
4
4
 
5
5
  module WebFontLoader
6
- VERSION = '1.0.27'
6
+ VERSION = '1.0.28'
7
7
 
8
8
  ProjectRoot = File.expand_path(File.dirname(__FILE__) + "/..")
9
9
 
@@ -84,6 +84,22 @@ UserAgentTest.prototype.testBrowserIsChrome = function() {
84
84
  assertTrue(userAgent.isSupportingWebFont());
85
85
  };
86
86
 
87
+ UserAgentTest.prototype.testBrowserIsChromeOS = function() {
88
+ var userAgentParser = new webfont.UserAgentParser(
89
+ "Mozilla/5.0 (X11; CrOS i686 1660.57.0) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.46 Safari/535.19",
90
+ this.defaultDocument_);
91
+ var userAgent = userAgentParser.parse();
92
+
93
+ assertEquals("Chrome", userAgent.getName());
94
+ assertEquals("18.0.1025.46", userAgent.getVersion());
95
+ assertEquals("CrOS", userAgent.getPlatform());
96
+ assertEquals("i686 1660.57.0", userAgent.getPlatformVersion());
97
+ assertEquals("AppleWebKit", userAgent.getEngine());
98
+ assertEquals("535.19", userAgent.getEngineVersion());
99
+ assertEquals(undefined, userAgent.getDocumentMode());
100
+ assertTrue(userAgent.isSupportingWebFont());
101
+ };
102
+
87
103
  UserAgentTest.prototype.testBrowserIsSafari = function() {
88
104
  var userAgentParser = new webfont.UserAgentParser(
89
105
  "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; en-us) AppleWebKit/531.21.8 (KHTML, like Gecko) Version/4.0.4 Safari/531.21.10",
@@ -56,7 +56,7 @@ webfont.UserAgentParser.prototype.getPlatform_ = function() {
56
56
  return mobileOs;
57
57
  }
58
58
  var os = this.getMatchingGroup_(this.userAgent_,
59
- /(Linux|Mac_PowerPC|Macintosh|Windows)/, 1);
59
+ /(Linux|Mac_PowerPC|Macintosh|Windows|CrOS)/, 1);
60
60
 
61
61
  if (os != "") {
62
62
  if (os == "Mac_PowerPC") {
@@ -71,10 +71,10 @@ webfont.UserAgentParser.prototype.getPlatform_ = function() {
71
71
  * @private
72
72
  */
73
73
  webfont.UserAgentParser.prototype.getPlatformVersion_ = function() {
74
- var macVersion = this.getMatchingGroup_(this.userAgent_,
75
- /(OS X|Windows NT|Android) ([^;)]+)/, 2);
76
- if (macVersion) {
77
- return macVersion;
74
+ var genericVersion = this.getMatchingGroup_(this.userAgent_,
75
+ /(OS X|Windows NT|Android|CrOS) ([^;)]+)/, 2);
76
+ if (genericVersion) {
77
+ return genericVersion;
78
78
  }
79
79
  var iVersion = this.getMatchingGroup_(this.userAgent_,
80
80
  /(iPhone )?OS ([\d_]+)/, 2);
@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
13
13
  ## If your rubyforge_project name is different, then edit it and comment out
14
14
  ## the sub! line in the Rakefile
15
15
  s.name = 'webfontloader'
16
- s.version = '1.0.27'
17
- s.date = '2012-04-20'
16
+ s.version = '1.0.28'
17
+ s.date = '2012-06-04'
18
18
 
19
19
  ## Make sure your summary is short. The description may be as long
20
20
  ## as you like.
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webfontloader
3
3
  version: !ruby/object:Gem::Version
4
- hash: 33
4
+ hash: 47
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 27
10
- version: 1.0.27
9
+ - 28
10
+ version: 1.0.28
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ryan Carver
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2012-04-20 00:00:00 Z
19
+ date: 2012-06-04 00:00:00 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  prerelease: false