formtastic 2.2.1 → 2.3.0.rc

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. data/.travis.yml +17 -13
  2. data/Appraisals +6 -3
  3. data/CHANGELOG +4 -0
  4. data/Gemfile +1 -1
  5. data/README.textile +14 -23
  6. data/Rakefile +0 -17
  7. data/app/assets/stylesheets/formtastic.css +2 -1
  8. data/formtastic.gemspec +4 -3
  9. data/gemfiles/{rails-3.0.gemfile → rails_3.0.gemfile} +1 -1
  10. data/gemfiles/{rails-3.1.gemfile → rails_3.1.gemfile} +1 -1
  11. data/gemfiles/{rails-3.2.gemfile → rails_3.2.gemfile} +1 -1
  12. data/gemfiles/rails_4.gemfile +7 -0
  13. data/gemfiles/rails_edge.gemfile +7 -0
  14. data/lib/formtastic/form_builder.rb +7 -0
  15. data/lib/formtastic/helpers/fieldset_wrapper.rb +1 -1
  16. data/lib/formtastic/helpers/form_helper.rb +8 -10
  17. data/lib/formtastic/helpers/input_helper.rb +1 -0
  18. data/lib/formtastic/inputs/base.rb +0 -1
  19. data/lib/formtastic/inputs/base/collections.rb +15 -4
  20. data/lib/formtastic/inputs/base/labelling.rb +4 -7
  21. data/lib/formtastic/inputs/base/numeric.rb +1 -1
  22. data/lib/formtastic/inputs/base/options.rb +1 -1
  23. data/lib/formtastic/inputs/base/timeish.rb +12 -4
  24. data/lib/formtastic/inputs/boolean_input.rb +6 -6
  25. data/lib/formtastic/inputs/check_boxes_input.rb +7 -2
  26. data/lib/formtastic/inputs/datetime_picker_input.rb +3 -3
  27. data/lib/formtastic/inputs/select_input.rb +4 -2
  28. data/lib/formtastic/util.rb +4 -0
  29. data/lib/formtastic/version.rb +1 -1
  30. data/lib/generators/templates/formtastic.rb +3 -3
  31. data/sample/basic_inputs.html +1 -1
  32. data/spec/builder/semantic_fields_for_spec.rb +0 -1
  33. data/spec/helpers/action_helper_spec.rb +1 -1
  34. data/spec/helpers/form_helper_spec.rb +30 -0
  35. data/spec/helpers/input_helper_spec.rb +1 -1
  36. data/spec/helpers/inputs_helper_spec.rb +13 -15
  37. data/spec/inputs/boolean_input_spec.rb +7 -0
  38. data/spec/inputs/check_boxes_input_spec.rb +31 -1
  39. data/spec/inputs/date_select_input_spec.rb +8 -0
  40. data/spec/inputs/datetime_picker_input_spec.rb +14 -14
  41. data/spec/inputs/datetime_select_input_spec.rb +8 -0
  42. data/spec/inputs/label_spec.rb +11 -0
  43. data/spec/inputs/select_input_spec.rb +21 -4
  44. data/spec/inputs/time_select_input_spec.rb +9 -1
  45. data/spec/spec_helper.rb +74 -13
  46. data/spec/support/custom_macros.rb +3 -2
  47. data/spec/support/test_environment.rb +2 -0
  48. metadata +116 -40
  49. data/gemfiles/rails-4.gemfile +0 -8
  50. data/lib/tasks/verify_rcov.rb +0 -44
@@ -1,8 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source :rubygems
4
-
5
- gem "rails", :git=>"git://github.com/rails/rails.git"
6
- gem "active_record_deprecated_finders", :git=>"https://github.com/rails/active_record_deprecated_finders.git"
7
-
8
- gemspec :path=>"../"
@@ -1,44 +0,0 @@
1
- require 'colored'
2
-
3
- # @private
4
- module RCov
5
-
6
- class VerifyTask < Rake::TaskLib
7
-
8
- attr_accessor :name
9
- attr_accessor :index_html
10
- attr_accessor :verbose
11
- attr_accessor :threshold
12
- attr_accessor :require_exact_threshold
13
-
14
- def initialize(name=:verify_rcov)
15
- @name = name
16
- @index_html = 'coverage/index.html'
17
- @verbose = true
18
- @require_exact_threshold = true
19
- yield self if block_given?
20
- raise "Threshold must be set" if @threshold.nil?
21
- define
22
- end
23
-
24
- def define
25
- desc "Verify that rcov coverage is at least #{threshold}%"
26
- task @name do
27
- total_coverage = 0
28
- File.open(index_html).each_line do |line|
29
- if line =~ /<tt class='coverage_total'>\s*(\d+\.\d+)%\s*<\/tt>/
30
- total_coverage = $1.to_f
31
- break
32
- end
33
- end
34
- output_coverage(total_coverage)
35
- end
36
- end
37
-
38
- def output_coverage(total_coverage)
39
- puts "Coverage: #{total_coverage}% (threshold: #{threshold}%)".green if verbose && total_coverage >= threshold
40
- raise "Coverage must be at least #{threshold}% but was #{total_coverage}%".red if total_coverage < threshold
41
- raise "Coverage has increased above the threshold of #{threshold}% to #{total_coverage}%. You should update your threshold value.".red if (total_coverage > threshold) and require_exact_threshold
42
- end
43
- end
44
- end