midas-guilded 0.2.8 → 0.2.9

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+ = 0.2.9 2009-06-18
2
+
3
+ * Added rescue code if the browser name or version fails.
4
+
5
+
1
6
  = 0.2.8 2009-06-12
2
7
 
3
8
  * Removed some code from the InactiveRecord:Base extension for human attrbiute hint that returns unless
data/guilded.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{guilded}
5
- s.version = "0.2.8"
5
+ s.version = "0.2.9"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["C. Jason Harrelson (midas)"]
9
- s.date = %q{2009-06-12}
9
+ s.date = %q{2009-06-18}
10
10
  s.description = %q{Guilded is a framework for building web based components centered around current web standards and best practices. The current framework is written in ruby, but could be ported to other languages. Guilded intends to provide a toolset for creating and consuming reusable web components. Currently, this problem domain is filled with JavaScript frameworks. These frameworks are wonderful and work very well. However, they do not degrade gracefully and are not accessible. Guilded seeks to provide the same level of "componentization" and ease of use without sacrificing degradability and accessibility. Guilded will achieve these goals by applying each technology at our disposal to do what it was intended. XHTML will be employed for content. CSS used for layout and styling. Behavior will be added to a component with JavaScript through progressive enhancement. The user will have the best experience with a Guilded component when CSS and JavaScript are enabled in their browser, but will still be able to use the component when CSS and JavaScript are disabled. Guilded will use jQuery as it's base JavaScript framework. jQuery was chosen because it lends itself to progressive enhancement due to the way it was authored. In addition, the tight integration of jQuery's selectors with CSS selectors is also highly desirable. When authoring a Guilded component, it is encouraged to write the behavior code as a jQuery plugin. This will allow the jQuery plugin to be used outside of the Guilded project, if desired. Guilded also seeks to provide a standardized CSS framework for creating layouts that are reusable and predictable. Guilded will utilize the currently existing RubyGems system to package its components. A new Guilded component will be packaged in a Gem and have a dependency on the Guilded gem. The Guilded gem contains the framework to build Guilded components.}
11
11
  s.email = ["jason@lookforwardenterprises.com"]
12
12
  s.extra_rdoc_files = ["History.txt", "Manifest.txt", "PostInstall.txt", "README.rdoc"]
data/lib/guilded.rb CHANGED
@@ -73,7 +73,7 @@ require 'guilded/rails/inactive_record/human_attribute_hint'
73
73
  # <%= g_load_alerter :skin => 'blueish', :id => 'load_alerter' %>
74
74
  #
75
75
  module Guilded
76
- VERSION = '0.2.8'
76
+ VERSION = '0.2.9'
77
77
  end
78
78
 
79
79
  ActionView::Base.send( :include, Guilded::Rails::ViewHelpers ) if defined?( ActionView )
@@ -34,37 +34,43 @@ module Guilded
34
34
  # * +request+ - The request object.
35
35
  #
36
36
  def browser_name
37
- @browser_name ||= begin
38
- ua = @request.env['HTTP_USER_AGENT']
39
- if ua.nil?
40
- 'unknown'
41
- else
42
- ua = ua.downcase
37
+ begin
38
+ @browser_name ||= begin
39
+ ua = @request.env['HTTP_USER_AGENT']
40
+ if ua.nil?
41
+ 'unknown'
42
+ else
43
+ ua = ua.downcase
43
44
 
44
- if ua.index( 'msie' ) && !ua.index( 'opera' ) && !ua.index( 'webtv' )
45
- if ua.index( 'windows ce' )
46
- 'ie' + '_ce' #+ ua[ua.index( 'msie' ) + 5].chr
45
+ if ua.index( 'msie' ) && !ua.index( 'opera' ) && !ua.index( 'webtv' )
46
+ if ua.index( 'windows ce' )
47
+ 'ie' + '_ce' #+ ua[ua.index( 'msie' ) + 5].chr
48
+ else
49
+ 'ie' # + ua[ua.index( 'msie' ) + 5].chr
50
+ end
51
+ elsif ua.include?( 'chrome' )
52
+ 'chrome'
53
+ elsif ua.include?( 'netscape' )
54
+ 'netscape'
55
+ elsif ua.include?( 'gecko/' )
56
+ 'firefox'
57
+ elsif ua.include?( 'opera' )
58
+ 'opera'
59
+ elsif ua.include?( 'konqueror' )
60
+ 'konqueror'
61
+ elsif ua.include?( 'applewebkit/' )
62
+ 'safari'
63
+ elsif ua.include?( 'mozilla/' )
64
+ 'firefox'
65
+ elsif ua.include?( 'firefox' )
66
+ 'firefox'
47
67
  else
48
- 'ie' # + ua[ua.index( 'msie' ) + 5].chr
68
+ 'unknown'
49
69
  end
50
- elsif ua.index( 'netscape' )
51
- 'netscape'
52
- elsif ua.index( 'gecko/' )
53
- 'firefox'
54
- elsif ua.index( 'opera' )
55
- 'opera'
56
- elsif ua.index( 'konqueror' )
57
- 'konqueror'
58
- elsif ua.index( 'applewebkit/' )
59
- 'safari'
60
- elsif ua.index( 'mozilla/' )
61
- 'firefox'
62
- elsif ua.index( 'firefox' )
63
- 'firefox'
64
- else
65
- 'unknown'
66
70
  end
67
71
  end
72
+ rescue
73
+ 'unknown'
68
74
  end
69
75
  end
70
76
 
@@ -83,22 +89,28 @@ module Guilded
83
89
  # * +request+ - The request object.
84
90
  #
85
91
  def browser_version
86
- @browser_version ||= begin
87
- ua = @request.env['HTTP_USER_AGENT'].downcase
92
+ begin
93
+ @browser_version ||= begin
94
+ ua = @request.env['HTTP_USER_AGENT'].downcase
88
95
 
89
- if browser_name == 'opera'
90
- ua[ua.index( 'opera' ) + 6].chr
91
- elsif browser_name == 'firefox'
92
- ua[ua.index( 'firefox' ) + 8].chr
93
- elsif browser_name == 'netscape'
94
- ua[ua.index( 'netscape' ) + 9].chr
95
- elsif browser_name.index( 'ie' )
96
- ua[ua.index( 'msie' ) + 5].chr
97
- elsif browser_name.index( 'safari' )
98
- ua[ua.index( 'version' ) + 8].chr
99
- else
100
- 'unknown'
96
+ if browser_name == 'opera'
97
+ ua[ua.index( 'opera' ) + 6].chr
98
+ elsif browser_name == 'chrome'
99
+ ua[ua.index( 'chrome' ) + 7].chr
100
+ elsif browser_name == 'firefox'
101
+ ua[ua.index( 'firefox' ) + 8].chr
102
+ elsif browser_name == 'netscape'
103
+ ua[ua.index( 'netscape' ) + 9].chr
104
+ elsif browser_name.index( 'ie' )
105
+ ua[ua.index( 'msie' ) + 5].chr
106
+ elsif browser_name.index( 'safari' )
107
+ ua[ua.index( 'version' ) + 8].chr
108
+ else
109
+ '0'
110
+ end
101
111
  end
112
+ rescue
113
+ '0'
102
114
  end
103
115
  end
104
116
 
@@ -1,9 +1,6 @@
1
1
  module InactiveRecord
2
2
  class Base
3
3
  class <<self
4
- # Allows alternate humanized versions of attributes to be set. For example, an attribute such as 'num_employees' would be
5
- # converted to 'Num employees' normally using <tt>human_attribute_name</tt>. More descriptive text can be set. Example:
6
- # attr_human_name 'num_employees' => 'Number of employees'
7
4
  def attr_human_hint(attributes) # :nodoc:
8
5
  #return unless table_exists?
9
6
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: midas-guilded
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.2.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - C. Jason Harrelson (midas)
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-06-12 00:00:00 -07:00
12
+ date: 2009-06-18 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency