common_view_helpers 0.3.2 → 0.3.3

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.
data/README.rdoc CHANGED
@@ -42,11 +42,11 @@ A lightweight set of view helpers Gemini uses in all of our Rails applications.
42
42
  urlify(address)
43
43
 
44
44
  # Breaks up a BigNum, FixNum or Float with commas
45
- # e.g., 532566 => 532,566 and 79593255.66 => 79,593,255.66
46
- commify(num)
45
+ # e.g., 532566 => 532,566 and 79593255.66 => 79,593,255.66
46
+ commify(num)
47
47
 
48
- # Converts a camelized string into snakecase (eg, SomeClass -> some_class)
49
- snakeify(string)
48
+ # Converts a camelized string into snakecase (eg, SomeClass -> some_class)
49
+ snakeify(string)
50
50
 
51
51
  == Copyright & Licensing
52
52
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.2
1
+ 0.3.3
@@ -99,9 +99,9 @@ module CommonViewHelpers
99
99
  js_escape_map = {
100
100
  '\\' => '\\\\',
101
101
  '</' => '<\/',
102
- "\r\n" => '\n',
103
- "\n" => '\n',
104
- "\r" => '\n',
102
+ "\r\n" => ' ',
103
+ "\n" => ' ',
104
+ "\r" => ' ',
105
105
  '"' => '\\"',
106
106
  "'" => "\\'" }
107
107
 
metadata CHANGED
@@ -1,13 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: common_view_helpers
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
5
4
  prerelease:
6
- segments:
7
- - 0
8
- - 3
9
- - 2
10
- version: 0.3.2
5
+ version: 0.3.3
11
6
  platform: ruby
12
7
  authors:
13
8
  - Zeke Sikelianos
@@ -16,7 +11,7 @@ autorequire:
16
11
  bindir: bin
17
12
  cert_chain: []
18
13
 
19
- date: 2011-02-28 00:00:00 -05:00
14
+ date: 2011-05-10 00:00:00 -04:00
20
15
  default_executable:
21
16
  dependencies:
22
17
  - !ruby/object:Gem::Dependency
@@ -27,11 +22,6 @@ dependencies:
27
22
  requirements:
28
23
  - - ">="
29
24
  - !ruby/object:Gem::Version
30
- hash: 15
31
- segments:
32
- - 2
33
- - 0
34
- - 0
35
25
  version: 2.0.0
36
26
  type: :runtime
37
27
  version_requirements: *id001
@@ -43,11 +33,6 @@ dependencies:
43
33
  requirements:
44
34
  - - ">="
45
35
  - !ruby/object:Gem::Version
46
- hash: 13
47
- segments:
48
- - 1
49
- - 2
50
- - 9
51
36
  version: 1.2.9
52
37
  type: :development
53
38
  version_requirements: *id002
@@ -59,11 +44,6 @@ dependencies:
59
44
  requirements:
60
45
  - - ">="
61
46
  - !ruby/object:Gem::Version
62
- hash: 59
63
- segments:
64
- - 4
65
- - 1
66
- - 0
67
47
  version: 4.1.0
68
48
  type: :development
69
49
  version_requirements: *id003
@@ -84,8 +64,6 @@ files:
84
64
  - lib/common_view_helpers.rb
85
65
  - lib/common_view_helpers/common_view_helpers.rb
86
66
  - rails/init.rb
87
- - spec/common_view_helpers_spec.rb
88
- - spec/spec_helper.rb
89
67
  has_rdoc: true
90
68
  homepage: http://github.com/geminisbs/common_view_helpers
91
69
  licenses: []
@@ -100,26 +78,19 @@ required_ruby_version: !ruby/object:Gem::Requirement
100
78
  requirements:
101
79
  - - ">="
102
80
  - !ruby/object:Gem::Version
103
- hash: 3
104
- segments:
105
- - 0
106
81
  version: "0"
107
82
  required_rubygems_version: !ruby/object:Gem::Requirement
108
83
  none: false
109
84
  requirements:
110
85
  - - ">="
111
86
  - !ruby/object:Gem::Version
112
- hash: 3
113
- segments:
114
- - 0
115
87
  version: "0"
116
88
  requirements: []
117
89
 
118
90
  rubyforge_project:
119
- rubygems_version: 1.4.1
91
+ rubygems_version: 1.5.2
120
92
  signing_key:
121
93
  specification_version: 3
122
94
  summary: Common view helpers for Rails apps
123
- test_files:
124
- - spec/common_view_helpers_spec.rb
125
- - spec/spec_helper.rb
95
+ test_files: []
96
+
@@ -1,44 +0,0 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
-
3
- require 'rubygems'
4
- require 'RedCloth'
5
- require 'active_support' # to get methods like blank? and starts_with?
6
- require 'action_view'
7
- require File.dirname(__FILE__) + '/../lib/common_view_helpers'
8
-
9
- include ActionView::Helpers
10
- include CommonViewHelpers::ViewHelpers
11
- # include ActionView::Helpers::TextHelper
12
- # include ActionView::Helpers::TagHelper
13
- # include ActionView::Helpers::DateHelper
14
- # include ActionView::Helpers::CacheHelper
15
- # include ActionView::Helpers::CaptureHelper # For the generate_table method
16
-
17
- describe CommonViewHelpers do
18
- context "time_ago_in_words_or_date" do
19
- it "gets relative times right" do
20
- time_ago_in_words_or_date(Time.now - 10.minutes).should == "10 minutes ago"
21
- time_ago_in_words_or_date(Time.now - 1.day).should == "1 day ago"
22
- time_ago_in_words_or_date(Time.now - 2.days).should == "2 days ago"
23
- end
24
-
25
- it "should use short format for non-relative dates in the last year" do
26
- time_ago_in_words_or_date(Time.now - 8.days).should =~ /\w{3} \d+/i
27
- time_ago_in_words_or_date(Time.now - 6.months).should =~ /\w{3} \d+/i
28
- end
29
-
30
- it "should display year format for non-relative dates beyond one year ago" do
31
- time_ago_in_words_or_date(Time.now - 13.months).should =~ /\w{3} \d+, \d{4}/i
32
- end
33
- end
34
-
35
- context "generate_table" do
36
- it "should generate a simple table" do
37
- collection = [%w(lucy 12)]
38
- headers = %w(name age)
39
- # generate_table(collection, headers).should == "<table><thead><tr><th>name</th><th>age</th></tr></thead><tbody><tr><td>lucy</td><td>12</td></tr></tbody></table>"
40
- end
41
-
42
- end
43
-
44
- end
data/spec/spec_helper.rb DELETED
@@ -1,9 +0,0 @@
1
- $LOAD_PATH.unshift(File.dirname(__FILE__))
2
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
- require 'common_view_helpers'
4
- require 'spec'
5
- require 'spec/autorun'
6
-
7
- Spec::Runner.configure do |config|
8
-
9
- end