formtastic 2.2.1 → 2.3.0.rc
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 +17 -13
- data/Appraisals +6 -3
- data/CHANGELOG +4 -0
- data/Gemfile +1 -1
- data/README.textile +14 -23
- data/Rakefile +0 -17
- data/app/assets/stylesheets/formtastic.css +2 -1
- data/formtastic.gemspec +4 -3
- data/gemfiles/{rails-3.0.gemfile → rails_3.0.gemfile} +1 -1
- data/gemfiles/{rails-3.1.gemfile → rails_3.1.gemfile} +1 -1
- data/gemfiles/{rails-3.2.gemfile → rails_3.2.gemfile} +1 -1
- data/gemfiles/rails_4.gemfile +7 -0
- data/gemfiles/rails_edge.gemfile +7 -0
- data/lib/formtastic/form_builder.rb +7 -0
- data/lib/formtastic/helpers/fieldset_wrapper.rb +1 -1
- data/lib/formtastic/helpers/form_helper.rb +8 -10
- data/lib/formtastic/helpers/input_helper.rb +1 -0
- data/lib/formtastic/inputs/base.rb +0 -1
- data/lib/formtastic/inputs/base/collections.rb +15 -4
- data/lib/formtastic/inputs/base/labelling.rb +4 -7
- data/lib/formtastic/inputs/base/numeric.rb +1 -1
- data/lib/formtastic/inputs/base/options.rb +1 -1
- data/lib/formtastic/inputs/base/timeish.rb +12 -4
- data/lib/formtastic/inputs/boolean_input.rb +6 -6
- data/lib/formtastic/inputs/check_boxes_input.rb +7 -2
- data/lib/formtastic/inputs/datetime_picker_input.rb +3 -3
- data/lib/formtastic/inputs/select_input.rb +4 -2
- data/lib/formtastic/util.rb +4 -0
- data/lib/formtastic/version.rb +1 -1
- data/lib/generators/templates/formtastic.rb +3 -3
- data/sample/basic_inputs.html +1 -1
- data/spec/builder/semantic_fields_for_spec.rb +0 -1
- data/spec/helpers/action_helper_spec.rb +1 -1
- data/spec/helpers/form_helper_spec.rb +30 -0
- data/spec/helpers/input_helper_spec.rb +1 -1
- data/spec/helpers/inputs_helper_spec.rb +13 -15
- data/spec/inputs/boolean_input_spec.rb +7 -0
- data/spec/inputs/check_boxes_input_spec.rb +31 -1
- data/spec/inputs/date_select_input_spec.rb +8 -0
- data/spec/inputs/datetime_picker_input_spec.rb +14 -14
- data/spec/inputs/datetime_select_input_spec.rb +8 -0
- data/spec/inputs/label_spec.rb +11 -0
- data/spec/inputs/select_input_spec.rb +21 -4
- data/spec/inputs/time_select_input_spec.rb +9 -1
- data/spec/spec_helper.rb +74 -13
- data/spec/support/custom_macros.rb +3 -2
- data/spec/support/test_environment.rb +2 -0
- metadata +116 -40
- data/gemfiles/rails-4.gemfile +0 -8
- data/lib/tasks/verify_rcov.rb +0 -44
data/gemfiles/rails-4.gemfile
DELETED
data/lib/tasks/verify_rcov.rb
DELETED
@@ -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
|