foundation_rails_helper 0.3 → 0.4

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/.travis.yml CHANGED
@@ -1,3 +1,2 @@
1
1
  rvm:
2
- - 1.9.2
3
- - 1.8.7
2
+ - 1.9.3
@@ -4,8 +4,8 @@ require File.expand_path('../lib/foundation_rails_helper/version', __FILE__)
4
4
  Gem::Specification.new do |gem|
5
5
  gem.authors = ["Sebastien Gruhier"]
6
6
  gem.email = ["sebastien.gruhier@xilinus.com"]
7
- gem.description = %q{Rails 3 for zurb foundation CSS framework. Form builder, flash message, ...}
8
- gem.summary = %q{Rails 3 helpers for zurb foundation CSS framework}
7
+ gem.description = %q{Rails for zurb foundation CSS framework. Form builder, flash message, ...}
8
+ gem.summary = %q{Rails helpers for zurb foundation CSS framework}
9
9
  gem.homepage = "http://github.com/sgruhier/foundation_rails_helper"
10
10
 
11
11
  gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
@@ -15,8 +15,8 @@ Gem::Specification.new do |gem|
15
15
  gem.require_paths = ["lib"]
16
16
  gem.version = FoundationRailsHelper::VERSION
17
17
 
18
- gem.add_dependency 'railties', '~> 3.0'
19
- gem.add_dependency "actionpack", '~> 3.0'
18
+ gem.add_dependency 'railties', '>= 3.0'
19
+ gem.add_dependency "actionpack", '>= 3.0'
20
20
  gem.add_development_dependency "rspec-rails"
21
21
  gem.add_development_dependency "capybara"
22
22
  end
@@ -16,7 +16,7 @@ module FoundationRailsHelper
16
16
  key_matching = DEFAULT_KEY_MATCHING.merge(key_matching)
17
17
 
18
18
  flash.inject "" do |message, (key, value)|
19
- message += content_tag :div, :class => "alert-box #{key_matching[key] || :standard}" do
19
+ message += content_tag :div, :data => { :alert => "" }, :class => "alert-box #{key_matching[key] || :standard}" do
20
20
  (value + link_to("×".html_safe, "#", :class => :close)).html_safe
21
21
  end
22
22
  end.html_safe
@@ -13,18 +13,18 @@ module FoundationRailsHelper
13
13
  end
14
14
  end
15
15
 
16
- def check_box(attribute, options = {})
16
+ def check_box(attribute, options = {}, checked_value = "1", unchecked_value = "0")
17
17
  custom_label(attribute, options[:label], options[:label_options]) do
18
18
  options.delete(:label)
19
19
  options.delete(:label_options)
20
- super(attribute, options)
20
+ super(attribute, options, checked_value, unchecked_value)
21
21
  end + error_and_hint(attribute, options)
22
22
  end
23
23
 
24
24
  def radio_button(attribute, tag_value, options = {})
25
25
  options[:for] ||= "#{object.class.to_s.downcase}_#{attribute}_#{tag_value}"
26
- l = label(attribute, options)
27
26
  c = super(attribute, tag_value, options)
27
+ l = label(attribute, options.delete(:text), options)
28
28
  l.gsub(/(for=\"\w*\"\>)/, "\\1#{c} ").html_safe
29
29
  end
30
30
 
@@ -1,3 +1,3 @@
1
1
  module FoundationRailsHelper
2
- VERSION = "0.3"
2
+ VERSION = "0.4"
3
3
  end
@@ -129,6 +129,14 @@ describe "FoundationRailsHelper::FormHelper" do
129
129
  end
130
130
  end
131
131
 
132
+ it "should generate radio_button input" do
133
+ form_for(@author) do |builder|
134
+ node = Capybara.string builder.radio_button(:active, true, text: "Functioning")
135
+ node.should have_css('input[type="radio"][name="author[active]"]')
136
+ node.should have_css('label[for="author_active_true"]', text: "Functioning")
137
+ end
138
+ end
139
+
132
140
  it "should generate date_select input" do
133
141
  form_for(@author) do |builder|
134
142
  node = Capybara.string builder.label(:birthdate) + builder.date_select(:birthdate)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foundation_rails_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.3'
4
+ version: '0.4'
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,14 +9,14 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-01 00:00:00.000000000 Z
12
+ date: 2013-07-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
- - - ~>
19
+ - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
21
  version: '3.0'
22
22
  type: :runtime
@@ -24,7 +24,7 @@ dependencies:
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  none: false
26
26
  requirements:
27
- - - ~>
27
+ - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
29
  version: '3.0'
30
30
  - !ruby/object:Gem::Dependency
@@ -32,7 +32,7 @@ dependencies:
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  none: false
34
34
  requirements:
35
- - - ~>
35
+ - - ! '>='
36
36
  - !ruby/object:Gem::Version
37
37
  version: '3.0'
38
38
  type: :runtime
@@ -40,7 +40,7 @@ dependencies:
40
40
  version_requirements: !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
- - - ~>
43
+ - - ! '>='
44
44
  - !ruby/object:Gem::Version
45
45
  version: '3.0'
46
46
  - !ruby/object:Gem::Dependency
@@ -75,7 +75,7 @@ dependencies:
75
75
  - - ! '>='
76
76
  - !ruby/object:Gem::Version
77
77
  version: '0'
78
- description: Rails 3 for zurb foundation CSS framework. Form builder, flash message,
78
+ description: Rails for zurb foundation CSS framework. Form builder, flash message,
79
79
  ...
80
80
  email:
81
81
  - sebastien.gruhier@xilinus.com
@@ -114,18 +114,24 @@ required_ruby_version: !ruby/object:Gem::Requirement
114
114
  - - ! '>='
115
115
  - !ruby/object:Gem::Version
116
116
  version: '0'
117
+ segments:
118
+ - 0
119
+ hash: -422087938175981355
117
120
  required_rubygems_version: !ruby/object:Gem::Requirement
118
121
  none: false
119
122
  requirements:
120
123
  - - ! '>='
121
124
  - !ruby/object:Gem::Version
122
125
  version: '0'
126
+ segments:
127
+ - 0
128
+ hash: -422087938175981355
123
129
  requirements: []
124
130
  rubyforge_project:
125
131
  rubygems_version: 1.8.23
126
132
  signing_key:
127
133
  specification_version: 3
128
- summary: Rails 3 helpers for zurb foundation CSS framework
134
+ summary: Rails helpers for zurb foundation CSS framework
129
135
  test_files:
130
136
  - spec/foundation_rails_helper/flash_helper_spec.rb
131
137
  - spec/foundation_rails_helper/form_builder_spec.rb