css3-progress-bar-rails 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.markdown CHANGED
@@ -20,6 +20,8 @@ Into the application.css header:
20
20
 
21
21
  *= require 'css3-progress-bar'
22
22
 
23
+ [View Examples Here][examples]
24
+
23
25
  ## Indication
24
26
 
25
27
  Except where indicated:
@@ -28,4 +30,4 @@ Copyright (c) 2011 [Nicholas Fine][vanity], released under the MIT license.
28
30
  [js]: http://dipperstove.com/index.html
29
31
  [blog]: http://dipperstove.com/design/css3-progress-bars.html
30
32
  [vanity]: http://ndfine.com
31
-
33
+ [examples]: http://ndfine.com/2012/01/03/css3-progress-bars-for-rails.html
@@ -57,6 +57,8 @@ module Css3ProgressBarsHelper
57
57
 
58
58
  protected
59
59
 
60
+ # Yeah, if you pass a string that non-numeric, it'll validate because 'string'.to_i returns 0.
61
+ # I can live with it.
60
62
  def validate_percentage percentage
61
63
  (0..100).to_a.include?(percentage.to_i) ? true : (raise ArgumentError, "Invalid Percentage Value")
62
64
  end
@@ -2,7 +2,7 @@ module Css3
2
2
  module Progress
3
3
  module Bar
4
4
  module Rails
5
- VERSION = "0.2.0"
5
+ VERSION = "0.2.1"
6
6
  end
7
7
  end
8
8
  end
@@ -9,7 +9,7 @@ include Css3ProgressBarsHelper
9
9
  describe Css3ProgressBarsHelper do
10
10
  describe '#combo_progress_bar' do
11
11
  describe 'given a collection that contains an invalid percentage value' do
12
- it 'raises and ArgumentError' do
12
+ it 'raises an ArgumentError' do
13
13
  proc {combo_progress_bar([1,2,888])}.must_raise ArgumentError
14
14
  proc {combo_progress_bar([1,2,'99999',4,5])}.must_raise ArgumentError
15
15
  end
@@ -24,6 +24,10 @@ describe Css3ProgressBarsHelper do
24
24
  end
25
25
  end
26
26
 
27
+ it 'ignores any values not in the first five members of the collection' do
28
+ Nokogiri::HTML(combo_progress_bar([1,2,3,4,5,6,7])).search('div').count.must_equal 7
29
+ end
30
+
27
31
  it 'returns the correct number of divs' do
28
32
  Nokogiri::HTML(combo_progress_bar([1,2,3,4,5])).search('div').count.must_equal 7
29
33
  Nokogiri::HTML(combo_progress_bar([1,2,3,4])).search('div').count.must_equal 6
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: css3-progress-bar-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-01-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &14890920 !ruby/object:Gem::Requirement
16
+ requirement: &9217780 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *14890920
24
+ version_requirements: *9217780
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: minitest
27
- requirement: &14890500 !ruby/object:Gem::Requirement
27
+ requirement: &9217360 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *14890500
35
+ version_requirements: *9217360
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: nokogiri
38
- requirement: &14889900 !ruby/object:Gem::Requirement
38
+ requirement: &9216760 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *14889900
46
+ version_requirements: *9216760
47
47
  description: Integrates Josh Sullivan's CSS3 Progress Bars into Rails and adds ActionView
48
48
  helpers for generation.
49
49
  email: