eac_rails_utils 0.8.0 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +2 -0
- data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper.rb +8 -1
- data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder.rb +12 -2
- data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder/association_select_field.rb +5 -2
- data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder/common_text_fields.rb +4 -3
- data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder/currency_field.rb +14 -12
- data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder/date_field.rb +3 -1
- data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder/fields_for.rb +3 -1
- data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder/file_field.rb +2 -1
- data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder/radio_select_field.rb +5 -2
- data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder/searchable_association_field.rb +7 -3
- data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder/select_field.rb +3 -1
- data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder/time_field.rb +2 -1
- data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder/year_month_field.rb +2 -1
- data/app/helpers/eac_rails_utils/data_table_helper.rb +13 -0
- data/{lib/eac → app/helpers/eac_rails_utils}/data_table_helper/column.rb +6 -3
- data/{lib/eac → app/helpers/eac_rails_utils}/data_table_helper/data_table.rb +13 -11
- data/{lib/eac → app/helpers/eac_rails_utils}/data_table_helper/setup.rb +3 -2
- data/app/helpers/eac_rails_utils/formatter_helper.rb +2 -0
- data/app/helpers/eac_rails_utils/links_helper.rb +12 -2
- data/{lib/eac → app/helpers/eac_rails_utils}/menus_helper.rb +10 -2
- data/{lib/eac → app/helpers/eac_rails_utils}/menus_helper/bootstrap_gui_builder.rb +8 -5
- data/{lib/eac → app/helpers/eac_rails_utils}/menus_helper/data_builder.rb +7 -2
- data/{lib/eac → app/helpers/eac_rails_utils}/menus_helper/gui_builder.rb +6 -3
- data/app/helpers/eac_rails_utils/open_graph_protocol_helper.rb +2 -0
- data/{lib/eac → app/validators/eac_rails_utils}/cpf_validator.rb +8 -4
- data/{lib/eac → app/validators/eac_rails_utils}/no_presence_validator.rb +3 -3
- data/lib/assets/javascripts/jMenu.jquery.min.js +12 -12
- data/lib/eac_rails_utils.rb +3 -41
- data/lib/eac_rails_utils/engine.rb +3 -0
- data/lib/{eac → eac_rails_utils}/htmlbeautifier.rb +3 -1
- data/lib/eac_rails_utils/models.rb +9 -0
- data/lib/eac_rails_utils/models/attribute_required.rb +43 -0
- data/lib/eac_rails_utils/models/fetch_errors.rb +92 -0
- data/lib/eac_rails_utils/models/inequality_queries.rb +39 -0
- data/lib/eac_rails_utils/models/tableless.rb +97 -0
- data/lib/eac_rails_utils/models/test_utils.rb +65 -0
- data/lib/eac_rails_utils/patches.rb +9 -0
- data/lib/eac_rails_utils/patches/action_controller_base.rb +3 -0
- data/lib/eac_rails_utils/version.rb +2 -1
- data/test/dummy/Rakefile +3 -1
- data/test/dummy/app/models/job.rb +2 -0
- data/test/dummy/app/models/user.rb +6 -0
- data/test/dummy/config.ru +2 -0
- data/test/dummy/config/application.rb +3 -1
- data/test/dummy/config/boot.rb +3 -1
- data/test/dummy/config/environment.rb +3 -1
- data/test/dummy/config/environments/test.rb +2 -0
- data/test/dummy/config/routes.rb +2 -0
- data/test/dummy/db/migrate/20160415125333_create_users.rb +2 -0
- data/test/dummy/db/migrate/20160415143123_create_jobs.rb +2 -0
- data/test/dummy/db/migrate/20160415143229_add_job_to_users.rb +2 -0
- data/test/{lib/eac → helpers/eac_rails_utils}/common_form_helper_test.rb +4 -2
- data/test/{lib/eac/data_table_test_helper.rb → helpers/eac_rails_utils/data_table_test_helper_test.rb} +4 -3
- data/test/{app/helpers → helpers}/eac_rails_utils/formatter_helper_test.rb +1 -0
- data/test/lib/eac_rails_utils/{patches/model_attribute_required_test.rb → models/attribute_required_test.rb} +3 -0
- data/test/lib/eac_rails_utils/models/fetch_errors_test.rb +80 -0
- data/test/lib/eac_rails_utils/models/tableless_test.rb +25 -0
- data/test/test_helper.rb +3 -1
- data/test/{lib/eac → validators}/cpf_validator_test.rb +4 -2
- metadata +91 -98
- data/lib/eac/data_table_helper.rb +0 -12
- data/lib/eac/inequality_queries.rb +0 -36
- data/lib/eac/model.rb +0 -87
- data/lib/eac/parsers/files_test.rb +0 -63
- data/lib/eac/source_target_fixtures.rb +0 -66
- data/lib/eac/test_utils.rb +0 -56
- data/lib/eac_rails_utils/patches/model_attribute_required.rb +0 -31
- data/lib/eac_rails_utils/patches/ofx_parser.rb +0 -42
- data/lib/eac_rails_utils/tableless_model.rb +0 -90
- data/test/lib/eac/model_test.rb +0 -76
- data/test/lib/eac/parsers/files_test_test.rb +0 -27
- data/test/lib/eac/parsers/ok_test_files/a.source.yaml +0 -1
- data/test/lib/eac/parsers/ok_test_files/a.target.yaml +0 -1
- data/test/lib/eac/parsers/ok_test_files/b.source.yaml +0 -1
- data/test/lib/eac/parsers/ok_test_files/b.target.yaml +0 -1
- data/test/lib/eac/source_target_fixtures_test.rb +0 -41
- data/test/lib/eac/source_target_fixtures_test_files/a.source.html +0 -1
- data/test/lib/eac/source_target_fixtures_test_files/a.target.yaml +0 -1
- data/test/lib/eac/source_target_fixtures_test_files/b.source.html +0 -1
- data/test/lib/eac/source_target_fixtures_test_files/c.target.yaml +0 -1
- data/test/lib/eac_rails_utils/tableless_model_test.rb +0 -23
@@ -1 +0,0 @@
|
|
1
|
-
|
@@ -1 +0,0 @@
|
|
1
|
-
|
@@ -1 +0,0 @@
|
|
1
|
-
|
@@ -1 +0,0 @@
|
|
1
|
-
|
@@ -1,41 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
require 'test_helper'
|
3
|
-
|
4
|
-
module Eac
|
5
|
-
class SourceTargetFixturesTest < ActionView::TestCase
|
6
|
-
def test_source_target_files
|
7
|
-
r = ::Eac::SourceTargetFixtures.new(fixtures_dir).source_target_files
|
8
|
-
assert_equal 3, r.count
|
9
|
-
|
10
|
-
a = r.find { |x| x.source && File.basename(x.source) == 'a.source.html' }
|
11
|
-
assert a
|
12
|
-
assert_equal File.join(fixtures_dir, 'a.source.html'), a.source
|
13
|
-
assert_equal File.join(fixtures_dir, 'a.target.yaml'), a.target
|
14
|
-
|
15
|
-
b = r.find { |x| x.source && File.basename(x.source) == 'b.source.html' }
|
16
|
-
assert b
|
17
|
-
assert_equal File.join(fixtures_dir, 'b.source.html'), b.source
|
18
|
-
assert_nil b.target
|
19
|
-
|
20
|
-
c = r.find { |x| x.target && File.basename(x.target) == 'c.target.yaml' }
|
21
|
-
assert c
|
22
|
-
assert_nil c.source
|
23
|
-
assert_equal File.join(fixtures_dir, 'c.target.yaml'), c.target
|
24
|
-
end
|
25
|
-
|
26
|
-
def test_source_files
|
27
|
-
r = ::Eac::SourceTargetFixtures.new(fixtures_dir).source_files
|
28
|
-
assert_equal 2, r.count
|
29
|
-
|
30
|
-
%w(a.source.html b.source.html).each do |expected|
|
31
|
-
assert r.include?(File.join(fixtures_dir, expected)), expected
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
private
|
36
|
-
|
37
|
-
def fixtures_dir
|
38
|
-
File.expand_path('../source_target_fixtures_test_files', __FILE__)
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
|
@@ -1 +0,0 @@
|
|
1
|
-
|
@@ -1 +0,0 @@
|
|
1
|
-
|
@@ -1 +0,0 @@
|
|
1
|
-
|
@@ -1,23 +0,0 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
# frozen_string_literal: true
|
3
|
-
require 'test_helper'
|
4
|
-
|
5
|
-
module EacRailsUtils
|
6
|
-
class TablelessModelTest < ActiveSupport::TestCase
|
7
|
-
class Stub < ::EacRailsUtils::TablelessModel
|
8
|
-
attribute :tempo, DateTime
|
9
|
-
end
|
10
|
-
|
11
|
-
test 'date time array values' do
|
12
|
-
stub = Stub.new('tempo(1i)' => '9', 'tempo(2i)' => '10', 'tempo(3i)' => '11',
|
13
|
-
'tempo(4i)' => '12', 'tempo(5i)' => '13', 'tempo(6i)' => '14')
|
14
|
-
assert stub.tempo.is_a?(DateTime), "Class: |#{stub.tempo.class}|, Value: |#{stub.tempo}|"
|
15
|
-
assert_equal 9, stub.tempo.year, 'Year'
|
16
|
-
assert_equal 10, stub.tempo.month, 'Month'
|
17
|
-
assert_equal 11, stub.tempo.day, 'Day'
|
18
|
-
assert_equal 12, stub.tempo.hour, 'Hour'
|
19
|
-
assert_equal 13, stub.tempo.minute, 'Minute'
|
20
|
-
assert_equal 14, stub.tempo.second, 'Second'
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|