rubyguy-simple_tabs 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -8,7 +8,7 @@ Super simple plugin/gem to easily add tabbed navigation to your Ruby on Rails ap
8
8
 
9
9
  In config/environment.rb:
10
10
 
11
- config.gem 'rubyguy-simple_tabs', :version => '0.1.0', :source => 'http://gems.github.com/', :lib => 'simple_tabs'
11
+ config.gem 'rubyguy-simple_tabs', :version => '0.1.1', :source => 'http://gems.github.com/', :lib => 'simple_tabs'
12
12
 
13
13
  And then run:
14
14
 
@@ -51,6 +51,11 @@ But if we were at the show action, the output would look like this:
51
51
  <li><a href="/about">About</a>
52
52
  </ul>
53
53
 
54
+ The tabbed_menu method accepts the following options:
55
+
56
+ :id => 'string' or :symbol - The id of the <ul> representing the menu.
57
+ :active_class => 'string' or :symbol - The class of the <li> of the active tab.
58
+
54
59
  Keep in mind:
55
60
 
56
61
  1. A tab is active if we're at the URL of the tab it self or any of its children.
data/Rakefile CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
  require 'rake'
3
3
  require 'echoe'
4
4
 
5
- Echoe.new('simple_tabs', '0.1.0') do |p|
5
+ Echoe.new('simple_tabs', '0.1.1') do |p|
6
6
  p.description = 'Super simple plugin/gem to easily add tabbed navigation to your Ruby on Rails application.'
7
7
  p.url = 'http://github.com/rubyguy/simple_tabs'
8
8
  p.author = 'David Knorr'
data/lib/simple_tabs.rb CHANGED
@@ -1,7 +1,8 @@
1
1
  module SimpleTabs
2
- def tabbed_menu
3
- concat tag(:ul, :id => 'menu')
4
- yield
2
+ def tabbed_menu(options={})
3
+ @options = options.reverse_merge(:id => 'menu', :active_class => 'active')
4
+ concat "<ul id='#{@options[:id]}'>"
5
+ yield if block_given?
5
6
  concat('</ul>')
6
7
  end
7
8
 
@@ -9,12 +10,12 @@ module SimpleTabs
9
10
  @active = false
10
11
  url = url_to_string(url)
11
12
  if current_page? url
12
- concat tag(:li, :class => 'active')
13
+ concat "<li class='#{@options[:active_class]}'>"
13
14
  else
14
15
  if block_given?
15
16
  yield
16
17
  if @active
17
- concat tag(:li, :class => 'active')
18
+ concat concat "<li class='#{@options[:active_class]}'>"
18
19
  else
19
20
  concat tag(:li)
20
21
  end
data/simple_tabs.gemspec CHANGED
@@ -2,15 +2,15 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{simple_tabs}
5
- s.version = "0.1.0"
5
+ s.version = "0.1.1"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["David Knorr"]
9
- s.date = %q{2009-03-28}
9
+ s.date = %q{2009-03-30}
10
10
  s.description = %q{Super simple plugin/gem to easily add tabbed navigation to your Ruby on Rails application.}
11
11
  s.email = %q{rubyguy@ymail.com}
12
12
  s.extra_rdoc_files = ["lib/simple_tabs.rb", "README.rdoc"]
13
- s.files = ["init.rb", "lib/simple_tabs.rb", "Rakefile", "README.rdoc", "Manifest", "simple_tabs.gemspec"]
13
+ s.files = ["init.rb", "lib/simple_tabs.rb", "Rakefile", "README.rdoc", "simple_tabs.gemspec", "Manifest"]
14
14
  s.has_rdoc = true
15
15
  s.homepage = %q{http://github.com/rubyguy/simple_tabs}
16
16
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Simple_tabs", "--main", "README.rdoc"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubyguy-simple_tabs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Knorr
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-03-28 00:00:00 -07:00
12
+ date: 2009-03-30 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -27,8 +27,8 @@ files:
27
27
  - lib/simple_tabs.rb
28
28
  - Rakefile
29
29
  - README.rdoc
30
- - Manifest
31
30
  - simple_tabs.gemspec
31
+ - Manifest
32
32
  has_rdoc: true
33
33
  homepage: http://github.com/rubyguy/simple_tabs
34
34
  post_install_message: