trainbbcode 0.1.0 → 0.1.1

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/Manifest CHANGED
@@ -1,4 +1,5 @@
1
+ Manifest
1
2
  README.rdoc
2
3
  Rakefile
3
4
  lib/trainbbcode.rb
4
- Manifest
5
+ trainbbcode.gemspec
data/README.rdoc CHANGED
@@ -1,3 +1,25 @@
1
1
  = Train BBCode
2
2
 
3
3
  Rails Gem for BBCode
4
+
5
+ == Install
6
+
7
+ === As a Gem
8
+
9
+ gem install trainbbcode
10
+
11
+ For rails you will need to add:
12
+
13
+ config.gem "trainbbcode"
14
+
15
+ to config/enviroments.rb
16
+
17
+ == Usage
18
+
19
+ This adds a method to string of .tbbc which lets you parse the code like this:
20
+
21
+ "[b]bold text[/b] and [i]italic[/i]".tbbc
22
+
23
+ that would output:
24
+
25
+ "<strong>bold text</strong> and <i>italic</i>"
data/Rakefile CHANGED
@@ -2,9 +2,9 @@ require 'rubygems'
2
2
  require 'rake'
3
3
  require 'echoe'
4
4
 
5
- Echoe.new('trainbbcode','0.1.0') do |p|
6
- p.description = "Provides BBCode"
7
- p.url = "http://github.com/Arcath/TrainBBCode"
5
+ Echoe.new('trainbbcode','0.1.1') do |p|
6
+ p.description = "Provides BBCode for Ruby."
7
+ p.url = "http://www.arcath.net"
8
8
  p.author = "Adam \"Arcath\" Laycock"
9
9
  p.email = "adam@arcath.net"
10
10
  p.ignore_pattern= ["tmp/*", "scripts/*"]
data/lib/trainbbcode.rb CHANGED
@@ -6,6 +6,10 @@ class TBBC
6
6
  s=s.gsub(/\n/,'<br />')
7
7
  #Tags
8
8
  s=s.gsub(/\[b\](.*?)\[\/b\]/,'<strong>\1</strong>')
9
+ s=s.gsub(/\[i\](.*?)\[\/b\]/,'<i>\1</i>')
10
+ s=s.gsub(/\[u\](.*?)\[\/u\]/,'<u>\1</u>')
11
+ s=s.gsub(/\[url\](.*?)\[\/url\]/,'<a href="\1" target="_BLANK">\1</a>')
12
+ s=s.gsub(/\[url=(.*?)\](.*?)\[\/url\]/,'<a href="\1" target="_BLANK">\2</a>')
9
13
 
10
14
  return s
11
15
  end
data/trainbbcode.gemspec CHANGED
@@ -2,21 +2,21 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{trainbbcode}
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 = ["Adam \"Arcath\" Laycock"]
9
9
  s.date = %q{2009-12-06}
10
- s.description = %q{Provides BBCode}
10
+ s.description = %q{Provides BBCode for Ruby.}
11
11
  s.email = %q{adam@arcath.net}
12
12
  s.extra_rdoc_files = ["README.rdoc", "lib/trainbbcode.rb"]
13
13
  s.files = ["README.rdoc", "Rakefile", "lib/trainbbcode.rb", "Manifest", "trainbbcode.gemspec"]
14
- s.homepage = %q{http://github.com/Arcath/TrainBBCode}
14
+ s.homepage = %q{http://www.arcath.net}
15
15
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Trainbbcode", "--main", "README.rdoc"]
16
16
  s.require_paths = ["lib"]
17
17
  s.rubyforge_project = %q{trainbbcode}
18
18
  s.rubygems_version = %q{1.3.5}
19
- s.summary = %q{Provides BBCode}
19
+ s.summary = %q{Provides BBCode for Ruby.}
20
20
 
21
21
  if s.respond_to? :specification_version then
22
22
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trainbbcode
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
  - Adam "Arcath" Laycock
@@ -13,7 +13,7 @@ date: 2009-12-06 00:00:00 +00:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
16
- description: Provides BBCode
16
+ description: Provides BBCode for Ruby.
17
17
  email: adam@arcath.net
18
18
  executables: []
19
19
 
@@ -29,7 +29,7 @@ files:
29
29
  - Manifest
30
30
  - trainbbcode.gemspec
31
31
  has_rdoc: true
32
- homepage: http://github.com/Arcath/TrainBBCode
32
+ homepage: http://www.arcath.net
33
33
  licenses: []
34
34
 
35
35
  post_install_message:
@@ -60,6 +60,6 @@ rubyforge_project: trainbbcode
60
60
  rubygems_version: 1.3.5
61
61
  signing_key:
62
62
  specification_version: 3
63
- summary: Provides BBCode
63
+ summary: Provides BBCode for Ruby.
64
64
  test_files: []
65
65