tabulous 0.0.2 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. data/CHANGELOG.rdoc +4 -0
  2. data/README.rdoc +6 -4
  3. data/lib/generators/tabs/tabs_generator.rb +3 -3
  4. data/lib/generators/tabs/templates/tabulous.rb +24 -25
  5. data/lib/tabulous/formatter.rb +2 -4
  6. data/lib/tabulous/railtie.rb +3 -9
  7. data/lib/tabulous/tab.rb +4 -30
  8. data/lib/tabulous/tabulous.rb +58 -38
  9. data/lib/tabulous/version.rb +1 -1
  10. data/lib/tasks/tabulous.rake +2 -2
  11. data/test/applications/main/{config/initializers → app/tabs}/tabulous.rb +38 -39
  12. data/test/applications/main/test/integration/actions_test.rb +36 -32
  13. data/test/applications/main/test/integration/active_tab_clickable_test.rb +36 -32
  14. data/test/applications/main/test/integration/always_render_subtabs_test.rb +36 -32
  15. data/test/applications/main/test/integration/css_no_scaffolding_test.rb +36 -32
  16. data/test/applications/main/test/integration/css_scaffolding_test.rb +36 -32
  17. data/test/applications/main/test/integration/display_text_test.rb +36 -32
  18. data/test/applications/main/test/integration/enabled_test.rb +36 -32
  19. data/test/applications/main/test/integration/html5_test.rb +36 -32
  20. data/test/applications/main/test/integration/path_test.rb +36 -32
  21. data/test/applications/main/test/integration/visible_test.rb +36 -32
  22. data/test/applications/main/test/unit/tabs_generator_test.rb +1 -1
  23. data/test/applications/simple_tabs/{config/initializers → app/tabs}/tabulous.rb +31 -32
  24. data/test/applications/subtabs/app/tabs/tabulous.rb +166 -0
  25. data/test/test_application_integration_test_helper.rb +1 -1
  26. data/test/{test_initializers → test_tab_files}/empty +0 -0
  27. data/test/test_tab_files/expected +59 -0
  28. data/test/test_tab_files/random_horizontal_whitespace +59 -0
  29. data/test/test_tab_files/random_vertical_whitespace +106 -0
  30. data/test/{test_initializers → test_tab_files}/text +0 -0
  31. data/test/test_tab_files/trailing_comments +59 -0
  32. data/test/units/tabulous_formatter_test.rb +8 -8
  33. metadata +13 -13
  34. data/test/applications/subtabs/config/initializers/tabulous.rb +0 -167
  35. data/test/test_initializers/expected +0 -55
  36. data/test/test_initializers/random_horizontal_whitespace +0 -55
  37. data/test/test_initializers/random_vertical_whitespace +0 -102
  38. data/test/test_initializers/trailing_comments +0 -55
@@ -3,41 +3,45 @@ require File.expand_path("../integration_test_helper", File.dirname(__FILE__))
3
3
  class ActiveTabClickableTest < ActionController::IntegrationTest
4
4
 
5
5
  def init(active_tab_clickable)
6
- use_initializer %Q{
6
+ use_tab_file %Q{
7
7
  Tabulous.setup do |config|
8
8
 
9
- config.tabs = [
10
- #------------------------------------------------------------------------------------------------------#
11
- # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
12
- #------------------------------------------------------------------------------------------------------#
13
- [ :home_tab , 'Explanation' , "/" , true , true ],
14
- [ :galaxies_tab , 'Galaxies' , "/galaxies" , true , true ],
15
- [ :stars_tab , 'Stars' , "/stars" , true , true ],
16
- [ :planets_tab , 'Planets' , "/planets" , true , true ],
17
- [ :subtabs_tab , 'Subtabs' , "/subtabs/one" , true , true ],
18
- [ :one_subtab , 'One' , "/subtabs/one" , true , true ],
19
- [ :two_subtab , 'Two' , "/subtabs/two" , true , true ],
20
- [ :three_subtab , 'Three' , "/subtabs/three" , true , true ],
21
- #------------------------------------------------------------------------------------------------------#
22
- # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
23
- #------------------------------------------------------------------------------------------------------#
24
- ]
9
+ config.tabs do
10
+ [
11
+ #------------------------------------------------------------------------------------------------------#
12
+ # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
13
+ #------------------------------------------------------------------------------------------------------#
14
+ [ :home_tab , 'Explanation' , "/" , true , true ],
15
+ [ :galaxies_tab , 'Galaxies' , "/galaxies" , true , true ],
16
+ [ :stars_tab , 'Stars' , "/stars" , true , true ],
17
+ [ :planets_tab , 'Planets' , "/planets" , true , true ],
18
+ [ :subtabs_tab , 'Subtabs' , "/subtabs/one" , true , true ],
19
+ [ :one_subtab , 'One' , "/subtabs/one" , true , true ],
20
+ [ :two_subtab , 'Two' , "/subtabs/two" , true , true ],
21
+ [ :three_subtab , 'Three' , "/subtabs/three" , true , true ],
22
+ #------------------------------------------------------------------------------------------------------#
23
+ # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
24
+ #------------------------------------------------------------------------------------------------------#
25
+ ]
26
+ end
25
27
 
26
- config.actions = [
27
- #-------------------------------------------------------------#
28
- # CONTROLLER | ACTION | TAB #
29
- #-------------------------------------------------------------#
30
- [ :home , :all_actions , :home_tab ],
31
- [ :galaxies , :all_actions , :galaxies_tab ],
32
- [ :stars , :all_actions , :stars_tab ],
33
- [ :planets , :all_actions , :planets_tab ],
34
- [ :subtabs , :one , :one_subtab ],
35
- [ :subtabs , :two , :two_subtab ],
36
- [ :subtabs , :three , :three_subtab ],
37
- #-------------------------------------------------------------#
38
- # CONTROLLER | ACTION | TAB #
39
- #-------------------------------------------------------------#
40
- ]
28
+ config.actions do
29
+ [
30
+ #-------------------------------------------------------------#
31
+ # CONTROLLER | ACTION | TAB #
32
+ #-------------------------------------------------------------#
33
+ [ :home , :all_actions , :home_tab ],
34
+ [ :galaxies , :all_actions , :galaxies_tab ],
35
+ [ :stars , :all_actions , :stars_tab ],
36
+ [ :planets , :all_actions , :planets_tab ],
37
+ [ :subtabs , :one , :one_subtab ],
38
+ [ :subtabs , :two , :two_subtab ],
39
+ [ :subtabs , :three , :three_subtab ],
40
+ #-------------------------------------------------------------#
41
+ # CONTROLLER | ACTION | TAB #
42
+ #-------------------------------------------------------------#
43
+ ]
44
+ end
41
45
 
42
46
  config.active_tab_clickable = #{active_tab_clickable}
43
47
 
@@ -3,41 +3,45 @@ require File.expand_path("../integration_test_helper", File.dirname(__FILE__))
3
3
  class AlwaysRenderSubtabsTest < ActionController::IntegrationTest
4
4
 
5
5
  def init(always_render_subtabs)
6
- use_initializer %Q{
6
+ use_tab_file %Q{
7
7
  Tabulous.setup do |config|
8
8
 
9
- config.tabs = [
10
- #------------------------------------------------------------------------------------------------------#
11
- # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
12
- #------------------------------------------------------------------------------------------------------#
13
- [ :home_tab , 'Explanation' , "/" , true , true ],
14
- [ :galaxies_tab , 'Galaxies' , "/galaxies" , true , true ],
15
- [ :stars_tab , 'Stars' , "/stars" , true , true ],
16
- [ :planets_tab , 'Planets' , "/planets" , true , true ],
17
- [ :subtabs_tab , 'Subtabs' , "/subtabs/one" , true , true ],
18
- [ :one_subtab , 'One' , "/subtabs/one" , true , true ],
19
- [ :two_subtab , 'Two' , "/subtabs/two" , true , true ],
20
- [ :three_subtab , 'Three' , "/subtabs/three" , true , true ],
21
- #------------------------------------------------------------------------------------------------------#
22
- # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
23
- #------------------------------------------------------------------------------------------------------#
24
- ]
9
+ config.tabs do
10
+ [
11
+ #------------------------------------------------------------------------------------------------------#
12
+ # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
13
+ #------------------------------------------------------------------------------------------------------#
14
+ [ :home_tab , 'Explanation' , "/" , true , true ],
15
+ [ :galaxies_tab , 'Galaxies' , "/galaxies" , true , true ],
16
+ [ :stars_tab , 'Stars' , "/stars" , true , true ],
17
+ [ :planets_tab , 'Planets' , "/planets" , true , true ],
18
+ [ :subtabs_tab , 'Subtabs' , "/subtabs/one" , true , true ],
19
+ [ :one_subtab , 'One' , "/subtabs/one" , true , true ],
20
+ [ :two_subtab , 'Two' , "/subtabs/two" , true , true ],
21
+ [ :three_subtab , 'Three' , "/subtabs/three" , true , true ],
22
+ #------------------------------------------------------------------------------------------------------#
23
+ # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
24
+ #------------------------------------------------------------------------------------------------------#
25
+ ]
26
+ end
25
27
 
26
- config.actions = [
27
- #-------------------------------------------------------------#
28
- # CONTROLLER | ACTION | TAB #
29
- #-------------------------------------------------------------#
30
- [ :home , :all_actions , :home_tab ],
31
- [ :galaxies , :all_actions , :galaxies_tab ],
32
- [ :stars , :all_actions , :stars_tab ],
33
- [ :planets , :all_actions , :planets_tab ],
34
- [ :subtabs , :one , :one_subtab ],
35
- [ :subtabs , :two , :two_subtab ],
36
- [ :subtabs , :three , :three_subtab ],
37
- #-------------------------------------------------------------#
38
- # CONTROLLER | ACTION | TAB #
39
- #-------------------------------------------------------------#
40
- ]
28
+ config.actions do
29
+ [
30
+ #-------------------------------------------------------------#
31
+ # CONTROLLER | ACTION | TAB #
32
+ #-------------------------------------------------------------#
33
+ [ :home , :all_actions , :home_tab ],
34
+ [ :galaxies , :all_actions , :galaxies_tab ],
35
+ [ :stars , :all_actions , :stars_tab ],
36
+ [ :planets , :all_actions , :planets_tab ],
37
+ [ :subtabs , :one , :one_subtab ],
38
+ [ :subtabs , :two , :two_subtab ],
39
+ [ :subtabs , :three , :three_subtab ],
40
+ #-------------------------------------------------------------#
41
+ # CONTROLLER | ACTION | TAB #
42
+ #-------------------------------------------------------------#
43
+ ]
44
+ end
41
45
 
42
46
  config.always_render_subtabs = #{always_render_subtabs}
43
47
 
@@ -3,41 +3,45 @@ require File.expand_path("../integration_test_helper", File.dirname(__FILE__))
3
3
  class CssNoScaffoldingTest < ActionController::IntegrationTest
4
4
 
5
5
  def setup
6
- use_initializer %Q{
6
+ use_tab_file %Q{
7
7
  Tabulous.setup do |config|
8
8
 
9
- config.tabs = [
10
- #------------------------------------------------------------------------------------------------------#
11
- # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
12
- #------------------------------------------------------------------------------------------------------#
13
- [ :home_tab , 'Explanation' , "/" , true , true ],
14
- [ :galaxies_tab , 'Galaxies' , "/galaxies" , true , true ],
15
- [ :stars_tab , 'Stars' , "/stars" , true , true ],
16
- [ :planets_tab , 'Planets' , "/planets" , true , true ],
17
- [ :subtabs_tab , 'Subtabs' , "/subtabs/one" , true , true ],
18
- [ :one_subtab , 'One' , "/subtabs/one" , true , true ],
19
- [ :two_subtab , 'Two' , "/subtabs/two" , true , true ],
20
- [ :three_subtab , 'Three' , "/subtabs/three" , true , true ],
21
- #------------------------------------------------------------------------------------------------------#
22
- # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
23
- #------------------------------------------------------------------------------------------------------#
24
- ]
9
+ config.tabs do
10
+ [
11
+ #------------------------------------------------------------------------------------------------------#
12
+ # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
13
+ #------------------------------------------------------------------------------------------------------#
14
+ [ :home_tab , 'Explanation' , "/" , true , true ],
15
+ [ :galaxies_tab , 'Galaxies' , "/galaxies" , true , true ],
16
+ [ :stars_tab , 'Stars' , "/stars" , true , true ],
17
+ [ :planets_tab , 'Planets' , "/planets" , true , true ],
18
+ [ :subtabs_tab , 'Subtabs' , "/subtabs/one" , true , true ],
19
+ [ :one_subtab , 'One' , "/subtabs/one" , true , true ],
20
+ [ :two_subtab , 'Two' , "/subtabs/two" , true , true ],
21
+ [ :three_subtab , 'Three' , "/subtabs/three" , true , true ],
22
+ #------------------------------------------------------------------------------------------------------#
23
+ # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
24
+ #------------------------------------------------------------------------------------------------------#
25
+ ]
26
+ end
25
27
 
26
- config.actions = [
27
- #-------------------------------------------------------------#
28
- # CONTROLLER | ACTION | TAB #
29
- #-------------------------------------------------------------#
30
- [ :home , :all_actions , :home_tab ],
31
- [ :galaxies , :all_actions , :galaxies_tab ],
32
- [ :stars , :all_actions , :stars_tab ],
33
- [ :planets , :all_actions , :planets_tab ],
34
- [ :subtabs , :one , :one_subtab ],
35
- [ :subtabs , :two , :two_subtab ],
36
- [ :subtabs , :three , :three_subtab ],
37
- #-------------------------------------------------------------#
38
- # CONTROLLER | ACTION | TAB #
39
- #-------------------------------------------------------------#
40
- ]
28
+ config.actions do
29
+ [
30
+ #-------------------------------------------------------------#
31
+ # CONTROLLER | ACTION | TAB #
32
+ #-------------------------------------------------------------#
33
+ [ :home , :all_actions , :home_tab ],
34
+ [ :galaxies , :all_actions , :galaxies_tab ],
35
+ [ :stars , :all_actions , :stars_tab ],
36
+ [ :planets , :all_actions , :planets_tab ],
37
+ [ :subtabs , :one , :one_subtab ],
38
+ [ :subtabs , :two , :two_subtab ],
39
+ [ :subtabs , :three , :three_subtab ],
40
+ #-------------------------------------------------------------#
41
+ # CONTROLLER | ACTION | TAB #
42
+ #-------------------------------------------------------------#
43
+ ]
44
+ end
41
45
 
42
46
  end
43
47
  }
@@ -3,41 +3,45 @@ require File.expand_path("../integration_test_helper", File.dirname(__FILE__))
3
3
  class CssScaffoldingTest < ActionController::IntegrationTest
4
4
 
5
5
  def setup
6
- use_initializer %Q{
6
+ use_tab_file %Q{
7
7
  Tabulous.setup do |config|
8
8
 
9
- config.tabs = [
10
- #------------------------------------------------------------------------------------------------------#
11
- # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
12
- #------------------------------------------------------------------------------------------------------#
13
- [ :home_tab , 'Explanation' , "/" , true , true ],
14
- [ :galaxies_tab , 'Galaxies' , "/galaxies" , true , true ],
15
- [ :stars_tab , 'Stars' , "/stars" , true , true ],
16
- [ :planets_tab , 'Planets' , "/planets" , true , true ],
17
- [ :subtabs_tab , 'Subtabs' , "/subtabs/one" , true , true ],
18
- [ :one_subtab , 'One' , "/subtabs/one" , true , true ],
19
- [ :two_subtab , 'Two' , "/subtabs/two" , true , true ],
20
- [ :three_subtab , 'Three' , "/subtabs/three" , true , true ],
21
- #------------------------------------------------------------------------------------------------------#
22
- # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
23
- #------------------------------------------------------------------------------------------------------#
24
- ]
9
+ config.tabs do
10
+ [
11
+ #------------------------------------------------------------------------------------------------------#
12
+ # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
13
+ #------------------------------------------------------------------------------------------------------#
14
+ [ :home_tab , 'Explanation' , "/" , true , true ],
15
+ [ :galaxies_tab , 'Galaxies' , "/galaxies" , true , true ],
16
+ [ :stars_tab , 'Stars' , "/stars" , true , true ],
17
+ [ :planets_tab , 'Planets' , "/planets" , true , true ],
18
+ [ :subtabs_tab , 'Subtabs' , "/subtabs/one" , true , true ],
19
+ [ :one_subtab , 'One' , "/subtabs/one" , true , true ],
20
+ [ :two_subtab , 'Two' , "/subtabs/two" , true , true ],
21
+ [ :three_subtab , 'Three' , "/subtabs/three" , true , true ],
22
+ #------------------------------------------------------------------------------------------------------#
23
+ # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
24
+ #------------------------------------------------------------------------------------------------------#
25
+ ]
26
+ end
25
27
 
26
- config.actions = [
27
- #-------------------------------------------------------------#
28
- # CONTROLLER | ACTION | TAB #
29
- #-------------------------------------------------------------#
30
- [ :home , :all_actions , :home_tab ],
31
- [ :galaxies , :all_actions , :galaxies_tab ],
32
- [ :stars , :all_actions , :stars_tab ],
33
- [ :planets , :all_actions , :planets_tab ],
34
- [ :subtabs , :one , :one_subtab ],
35
- [ :subtabs , :two , :two_subtab ],
36
- [ :subtabs , :three , :three_subtab ],
37
- #-------------------------------------------------------------#
38
- # CONTROLLER | ACTION | TAB #
39
- #-------------------------------------------------------------#
40
- ]
28
+ config.actions do
29
+ [
30
+ #-------------------------------------------------------------#
31
+ # CONTROLLER | ACTION | TAB #
32
+ #-------------------------------------------------------------#
33
+ [ :home , :all_actions , :home_tab ],
34
+ [ :galaxies , :all_actions , :galaxies_tab ],
35
+ [ :stars , :all_actions , :stars_tab ],
36
+ [ :planets , :all_actions , :planets_tab ],
37
+ [ :subtabs , :one , :one_subtab ],
38
+ [ :subtabs , :two , :two_subtab ],
39
+ [ :subtabs , :three , :three_subtab ],
40
+ #-------------------------------------------------------------#
41
+ # CONTROLLER | ACTION | TAB #
42
+ #-------------------------------------------------------------#
43
+ ]
44
+ end
41
45
 
42
46
  config.css.scaffolding = true
43
47
  config.css.background_color = '#000'
@@ -3,41 +3,45 @@ require File.expand_path("../integration_test_helper", File.dirname(__FILE__))
3
3
  class DisplayTextTest < ActionController::IntegrationTest
4
4
 
5
5
  def setup
6
- use_initializer %Q{
6
+ use_tab_file %Q{
7
7
  Tabulous.setup do |config|
8
8
 
9
- config.tabs = [
10
- #-------------------------------------------------------------------------------------------------------------------#
11
- # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
12
- #-------------------------------------------------------------------------------------------------------------------#
13
- [ :home_tab , 'Explanation' , "/" , true , true ],
14
- [ :galaxies_tab , 'Galaxies' , "/galaxies" , true , true ],
15
- [ :stars_tab , 'Stars' , "/stars" , true , true ],
16
- [ :planets_tab , 'Asteroids' , "/planets" , true , true ],
17
- [ :subtabs_tab , 'Subtabs' , "/subtabs/one" , true , true ],
18
- [ :one_subtab , 'One' , "/subtabs/one" , true , true ],
19
- [ :two_subtab , lambda { controller_name } , "/subtabs/two" , true , true ],
20
- [ :three_subtab , 'Three' , "/subtabs/three" , true , true ],
21
- #-------------------------------------------------------------------------------------------------------------------#
22
- # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
23
- #-------------------------------------------------------------------------------------------------------------------#
24
- ]
9
+ config.tabs do
10
+ [
11
+ #-------------------------------------------------------------------------------------------------------------------#
12
+ # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
13
+ #-------------------------------------------------------------------------------------------------------------------#
14
+ [ :home_tab , 'Explanation' , "/" , true , true ],
15
+ [ :galaxies_tab , 'Galaxies' , "/galaxies" , true , true ],
16
+ [ :stars_tab , 'Stars' , "/stars" , true , true ],
17
+ [ :planets_tab , 'Asteroids' , "/planets" , true , true ],
18
+ [ :subtabs_tab , 'Subtabs' , "/subtabs/one" , true , true ],
19
+ [ :one_subtab , 'One' , "/subtabs/one" , true , true ],
20
+ [ :two_subtab , controller_name , "/subtabs/two" , true , true ],
21
+ [ :three_subtab , 'Three' , "/subtabs/three" , true , true ],
22
+ #-------------------------------------------------------------------------------------------------------------------#
23
+ # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
24
+ #-------------------------------------------------------------------------------------------------------------------#
25
+ ]
26
+ end
25
27
 
26
- config.actions = [
27
- #-------------------------------------------------------------#
28
- # CONTROLLER | ACTION | TAB #
29
- #-------------------------------------------------------------#
30
- [ :home , :all_actions , :home_tab ],
31
- [ :galaxies , :all_actions , :galaxies_tab ],
32
- [ :stars , :all_actions , :stars_tab ],
33
- [ :planets , :all_actions , :planets_tab ],
34
- [ :subtabs , :one , :one_subtab ],
35
- [ :subtabs , :two , :two_subtab ],
36
- [ :subtabs , :three , :three_subtab ],
37
- #-------------------------------------------------------------#
38
- # CONTROLLER | ACTION | TAB #
39
- #-------------------------------------------------------------#
40
- ]
28
+ config.actions do
29
+ [
30
+ #-------------------------------------------------------------#
31
+ # CONTROLLER | ACTION | TAB #
32
+ #-------------------------------------------------------------#
33
+ [ :home , :all_actions , :home_tab ],
34
+ [ :galaxies , :all_actions , :galaxies_tab ],
35
+ [ :stars , :all_actions , :stars_tab ],
36
+ [ :planets , :all_actions , :planets_tab ],
37
+ [ :subtabs , :one , :one_subtab ],
38
+ [ :subtabs , :two , :two_subtab ],
39
+ [ :subtabs , :three , :three_subtab ],
40
+ #-------------------------------------------------------------#
41
+ # CONTROLLER | ACTION | TAB #
42
+ #-------------------------------------------------------------#
43
+ ]
44
+ end
41
45
 
42
46
  config.css.scaffolding = true
43
47
 
@@ -3,41 +3,45 @@ require File.expand_path("../integration_test_helper", File.dirname(__FILE__))
3
3
  class EnabledTest < ActionController::IntegrationTest
4
4
 
5
5
  def setup
6
- use_initializer %Q{
6
+ use_tab_file %Q{
7
7
  Tabulous.setup do |config|
8
8
 
9
- config.tabs = [
10
- #-------------------------------------------------------------------------------------------------------------------------------#
11
- # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
12
- #-------------------------------------------------------------------------------------------------------------------------------#
13
- [ :home_tab , 'Explanation' , "/" , true , true ],
14
- [ :galaxies_tab , 'Galaxies' , "/galaxies" , true , true ],
15
- [ :stars_tab , 'Stars' , "/stars" , true , lambda { controller_name =~ /t/ } ],
16
- [ :planets_tab , 'Planets' , "/planets" , true , false ],
17
- [ :subtabs_tab , 'Subtabs' , "/subtabs/one" , true , true ],
18
- [ :one_subtab , 'One' , "/subtabs/one" , true , true ],
19
- [ :two_subtab , 'Two' , "/subtabs/two" , true , false ],
20
- [ :three_subtab , 'Three' , "/subtabs/three" , true , lambda { true } ],
21
- #-------------------------------------------------------------------------------------------------------------------------------#
22
- # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
23
- #-------------------------------------------------------------------------------------------------------------------------------#
24
- ]
9
+ config.tabs do
10
+ [
11
+ #-------------------------------------------------------------------------------------------------------------------------------#
12
+ # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
13
+ #-------------------------------------------------------------------------------------------------------------------------------#
14
+ [ :home_tab , 'Explanation' , "/" , true , true ],
15
+ [ :galaxies_tab , 'Galaxies' , "/galaxies" , true , true ],
16
+ [ :stars_tab , 'Stars' , "/stars" , true , controller_name =~ /t/ ],
17
+ [ :planets_tab , 'Planets' , "/planets" , true , false ],
18
+ [ :subtabs_tab , 'Subtabs' , "/subtabs/one" , true , true ],
19
+ [ :one_subtab , 'One' , "/subtabs/one" , true , true ],
20
+ [ :two_subtab , 'Two' , "/subtabs/two" , true , false ],
21
+ [ :three_subtab , 'Three' , "/subtabs/three" , true , 5 == 5 ],
22
+ #-------------------------------------------------------------------------------------------------------------------------------#
23
+ # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
24
+ #-------------------------------------------------------------------------------------------------------------------------------#
25
+ ]
26
+ end
25
27
 
26
- config.actions = [
27
- #-------------------------------------------------------------#
28
- # CONTROLLER | ACTION | TAB #
29
- #-------------------------------------------------------------#
30
- [ :home , :all_actions , :home_tab ],
31
- [ :galaxies , :all_actions , :galaxies_tab ],
32
- [ :stars , :all_actions , :stars_tab ],
33
- [ :planets , :all_actions , :planets_tab ],
34
- [ :subtabs , :one , :one_subtab ],
35
- [ :subtabs , :two , :two_subtab ],
36
- [ :subtabs , :three , :three_subtab ],
37
- #-------------------------------------------------------------#
38
- # CONTROLLER | ACTION | TAB #
39
- #-------------------------------------------------------------#
40
- ]
28
+ config.actions do
29
+ [
30
+ #-------------------------------------------------------------#
31
+ # CONTROLLER | ACTION | TAB #
32
+ #-------------------------------------------------------------#
33
+ [ :home , :all_actions , :home_tab ],
34
+ [ :galaxies , :all_actions , :galaxies_tab ],
35
+ [ :stars , :all_actions , :stars_tab ],
36
+ [ :planets , :all_actions , :planets_tab ],
37
+ [ :subtabs , :one , :one_subtab ],
38
+ [ :subtabs , :two , :two_subtab ],
39
+ [ :subtabs , :three , :three_subtab ],
40
+ #-------------------------------------------------------------#
41
+ # CONTROLLER | ACTION | TAB #
42
+ #-------------------------------------------------------------#
43
+ ]
44
+ end
41
45
 
42
46
  config.css.scaffolding = true
43
47
 
@@ -3,41 +3,45 @@ require File.expand_path("../integration_test_helper", File.dirname(__FILE__))
3
3
  class Html5Test < ActionController::IntegrationTest
4
4
 
5
5
  def init(html5)
6
- use_initializer %Q{
6
+ use_tab_file %Q{
7
7
  Tabulous.setup do |config|
8
8
 
9
- config.tabs = [
10
- #------------------------------------------------------------------------------------------------------#
11
- # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
12
- #------------------------------------------------------------------------------------------------------#
13
- [ :home_tab , 'Explanation' , "/" , true , true ],
14
- [ :galaxies_tab , 'Galaxies' , "/galaxies" , true , true ],
15
- [ :stars_tab , 'Stars' , "/stars" , true , true ],
16
- [ :planets_tab , 'Planets' , "/planets" , true , true ],
17
- [ :subtabs_tab , 'Subtabs' , "/subtabs/one" , true , true ],
18
- [ :one_subtab , 'One' , "/subtabs/one" , true , true ],
19
- [ :two_subtab , 'Two' , "/subtabs/two" , true , true ],
20
- [ :three_subtab , 'Three' , "/subtabs/three" , true , true ],
21
- #------------------------------------------------------------------------------------------------------#
22
- # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
23
- #------------------------------------------------------------------------------------------------------#
24
- ]
9
+ config.tabs do
10
+ [
11
+ #------------------------------------------------------------------------------------------------------#
12
+ # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
13
+ #------------------------------------------------------------------------------------------------------#
14
+ [ :home_tab , 'Explanation' , "/" , true , true ],
15
+ [ :galaxies_tab , 'Galaxies' , "/galaxies" , true , true ],
16
+ [ :stars_tab , 'Stars' , "/stars" , true , true ],
17
+ [ :planets_tab , 'Planets' , "/planets" , true , true ],
18
+ [ :subtabs_tab , 'Subtabs' , "/subtabs/one" , true , true ],
19
+ [ :one_subtab , 'One' , "/subtabs/one" , true , true ],
20
+ [ :two_subtab , 'Two' , "/subtabs/two" , true , true ],
21
+ [ :three_subtab , 'Three' , "/subtabs/three" , true , true ],
22
+ #------------------------------------------------------------------------------------------------------#
23
+ # TAB NAME | DISPLAY TEXT | PATH | VISIBLE? | ENABLED? #
24
+ #------------------------------------------------------------------------------------------------------#
25
+ ]
26
+ end
25
27
 
26
- config.actions = [
27
- #-------------------------------------------------------------#
28
- # CONTROLLER | ACTION | TAB #
29
- #-------------------------------------------------------------#
30
- [ :home , :all_actions , :home_tab ],
31
- [ :galaxies , :all_actions , :galaxies_tab ],
32
- [ :stars , :all_actions , :stars_tab ],
33
- [ :planets , :all_actions , :planets_tab ],
34
- [ :subtabs , :one , :one_subtab ],
35
- [ :subtabs , :two , :two_subtab ],
36
- [ :subtabs , :three , :three_subtab ],
37
- #-------------------------------------------------------------#
38
- # CONTROLLER | ACTION | TAB #
39
- #-------------------------------------------------------------#
40
- ]
28
+ config.actions do
29
+ [
30
+ #-------------------------------------------------------------#
31
+ # CONTROLLER | ACTION | TAB #
32
+ #-------------------------------------------------------------#
33
+ [ :home , :all_actions , :home_tab ],
34
+ [ :galaxies , :all_actions , :galaxies_tab ],
35
+ [ :stars , :all_actions , :stars_tab ],
36
+ [ :planets , :all_actions , :planets_tab ],
37
+ [ :subtabs , :one , :one_subtab ],
38
+ [ :subtabs , :two , :two_subtab ],
39
+ [ :subtabs , :three , :three_subtab ],
40
+ #-------------------------------------------------------------#
41
+ # CONTROLLER | ACTION | TAB #
42
+ #-------------------------------------------------------------#
43
+ ]
44
+ end
41
45
 
42
46
  config.html5 = #{html5}
43
47