Permalink
Browse files

Release 0.2.9.

  • Loading branch information...
midas committed Jun 18, 2009
1 parent 480a822 commit 33014f81a23f75859d2e336c9153a41c311cbc08
Showing with 60 additions and 46 deletions.
  1. +5 −0 History.txt
  2. +2 −2 guilded.gemspec
  3. +1 −1 lib/guilded.rb
  4. +52 −40 lib/guilded/browser_detector.rb
  5. +0 −3 lib/guilded/rails/inactive_record/human_attribute_hint.rb
View
@@ -1,3 +1,8 @@
+= 0.2.9 2009-06-18
+
+* Added rescue code if the browser name or version fails.
+
+
= 0.2.8 2009-06-12
* Removed some code from the InactiveRecord:Base extension for human attrbiute hint that returns unless
View
@@ -2,11 +2,11 @@
Gem::Specification.new do |s|
s.name = %q{guilded}
- s.version = "0.2.8"
+ s.version = "0.2.9"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["C. Jason Harrelson (midas)"]
- s.date = %q{2009-06-12}
+ s.date = %q{2009-06-18}
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.}
s.email = ["jason@lookforwardenterprises.com"]
s.extra_rdoc_files = ["History.txt", "Manifest.txt", "PostInstall.txt", "README.rdoc"]
View
@@ -73,7 +73,7 @@
# <%= g_load_alerter :skin => 'blueish', :id => 'load_alerter' %>
#
module Guilded
- VERSION = '0.2.8'
+ VERSION = '0.2.9'
end
ActionView::Base.send( :include, Guilded::Rails::ViewHelpers ) if defined?( ActionView )
@@ -34,37 +34,43 @@ def browser_is?( options={} )
# * +request+ - The request object.
#
def browser_name
- @browser_name ||= begin
- ua = @request.env['HTTP_USER_AGENT']
- if ua.nil?
- 'unknown'
- else
- ua = ua.downcase
+ begin
+ @browser_name ||= begin
+ ua = @request.env['HTTP_USER_AGENT']
+ if ua.nil?
+ 'unknown'
+ else
+ ua = ua.downcase
- if ua.index( 'msie' ) && !ua.index( 'opera' ) && !ua.index( 'webtv' )
- if ua.index( 'windows ce' )
- 'ie' + '_ce' #+ ua[ua.index( 'msie' ) + 5].chr
+ if ua.index( 'msie' ) && !ua.index( 'opera' ) && !ua.index( 'webtv' )
+ if ua.index( 'windows ce' )
+ 'ie' + '_ce' #+ ua[ua.index( 'msie' ) + 5].chr
+ else
+ 'ie' # + ua[ua.index( 'msie' ) + 5].chr
+ end
+ elsif ua.include?( 'chrome' )
+ 'chrome'
+ elsif ua.include?( 'netscape' )
+ 'netscape'
+ elsif ua.include?( 'gecko/' )
+ 'firefox'
+ elsif ua.include?( 'opera' )
+ 'opera'
+ elsif ua.include?( 'konqueror' )
+ 'konqueror'
+ elsif ua.include?( 'applewebkit/' )
+ 'safari'
+ elsif ua.include?( 'mozilla/' )
+ 'firefox'
+ elsif ua.include?( 'firefox' )
+ 'firefox'
else
- 'ie' # + ua[ua.index( 'msie' ) + 5].chr
+ 'unknown'
end
- elsif ua.index( 'netscape' )
- 'netscape'
- elsif ua.index( 'gecko/' )
- 'firefox'
- elsif ua.index( 'opera' )
- 'opera'
- elsif ua.index( 'konqueror' )
- 'konqueror'
- elsif ua.index( 'applewebkit/' )
- 'safari'
- elsif ua.index( 'mozilla/' )
- 'firefox'
- elsif ua.index( 'firefox' )
- 'firefox'
- else
- 'unknown'
end
end
+ rescue
+ 'unknown'
end
end
@@ -83,22 +89,28 @@ def browser_full_name
# * +request+ - The request object.
#
def browser_version
- @browser_version ||= begin
- ua = @request.env['HTTP_USER_AGENT'].downcase
+ begin
+ @browser_version ||= begin
+ ua = @request.env['HTTP_USER_AGENT'].downcase
- if browser_name == 'opera'
- ua[ua.index( 'opera' ) + 6].chr
- elsif browser_name == 'firefox'
- ua[ua.index( 'firefox' ) + 8].chr
- elsif browser_name == 'netscape'
- ua[ua.index( 'netscape' ) + 9].chr
- elsif browser_name.index( 'ie' )
- ua[ua.index( 'msie' ) + 5].chr
- elsif browser_name.index( 'safari' )
- ua[ua.index( 'version' ) + 8].chr
- else
- 'unknown'
+ if browser_name == 'opera'
+ ua[ua.index( 'opera' ) + 6].chr
+ elsif browser_name == 'chrome'
+ ua[ua.index( 'chrome' ) + 7].chr
+ elsif browser_name == 'firefox'
+ ua[ua.index( 'firefox' ) + 8].chr
+ elsif browser_name == 'netscape'
+ ua[ua.index( 'netscape' ) + 9].chr
+ elsif browser_name.index( 'ie' )
+ ua[ua.index( 'msie' ) + 5].chr
+ elsif browser_name.index( 'safari' )
+ ua[ua.index( 'version' ) + 8].chr
+ else
+ '0'
+ end
end
+ rescue
+ '0'
end
end
@@ -1,9 +1,6 @@
module InactiveRecord
class Base
class <<self
- # Allows alternate humanized versions of attributes to be set. For example, an attribute such as 'num_employees' would be
- # converted to 'Num employees' normally using <tt>human_attribute_name</tt>. More descriptive text can be set. Example:
- # attr_human_name 'num_employees' => 'Number of employees'
def attr_human_hint(attributes) # :nodoc:
#return unless table_exists?

0 comments on commit 33014f8

Please sign in to comment.