trainbbcode 0.1.0
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 +4 -0
- data/README.rdoc +3 -0
- data/Rakefile +14 -0
- data/lib/trainbbcode.rb +19 -0
- data/trainbbcode.gemspec +30 -0
- metadata +65 -0
data/Manifest
ADDED
data/README.rdoc
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
require 'echoe'
|
4
|
+
|
5
|
+
Echoe.new('trainbbcode','0.1.0') do |p|
|
6
|
+
p.description = "Provides BBCode"
|
7
|
+
p.url = "http://github.com/Arcath/TrainBBCode"
|
8
|
+
p.author = "Adam \"Arcath\" Laycock"
|
9
|
+
p.email = "adam@arcath.net"
|
10
|
+
p.ignore_pattern= ["tmp/*", "scripts/*"]
|
11
|
+
p.development_dependencies = []
|
12
|
+
end
|
13
|
+
|
14
|
+
Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext| load ext }
|
data/lib/trainbbcode.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
class TBBC
|
2
|
+
def parse(s)
|
3
|
+
#First off remove the < and > which will disable all HTML
|
4
|
+
s=s.gsub("<","<").gsub(">",">")
|
5
|
+
#Convert new lines to <br />'s
|
6
|
+
s=s.gsub(/\n/,'<br />')
|
7
|
+
#Tags
|
8
|
+
s=s.gsub(/\[b\](.*?)\[\/b\]/,'<strong>\1</strong>')
|
9
|
+
|
10
|
+
return s
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
class String
|
15
|
+
def tbbc
|
16
|
+
bbc=TBBC.new
|
17
|
+
bbc.parse(self)
|
18
|
+
end
|
19
|
+
end
|
data/trainbbcode.gemspec
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
Gem::Specification.new do |s|
|
4
|
+
s.name = %q{trainbbcode}
|
5
|
+
s.version = "0.1.0"
|
6
|
+
|
7
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
|
+
s.authors = ["Adam \"Arcath\" Laycock"]
|
9
|
+
s.date = %q{2009-12-06}
|
10
|
+
s.description = %q{Provides BBCode}
|
11
|
+
s.email = %q{adam@arcath.net}
|
12
|
+
s.extra_rdoc_files = ["README.rdoc", "lib/trainbbcode.rb"]
|
13
|
+
s.files = ["README.rdoc", "Rakefile", "lib/trainbbcode.rb", "Manifest", "trainbbcode.gemspec"]
|
14
|
+
s.homepage = %q{http://github.com/Arcath/TrainBBCode}
|
15
|
+
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Trainbbcode", "--main", "README.rdoc"]
|
16
|
+
s.require_paths = ["lib"]
|
17
|
+
s.rubyforge_project = %q{trainbbcode}
|
18
|
+
s.rubygems_version = %q{1.3.5}
|
19
|
+
s.summary = %q{Provides BBCode}
|
20
|
+
|
21
|
+
if s.respond_to? :specification_version then
|
22
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
23
|
+
s.specification_version = 3
|
24
|
+
|
25
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
26
|
+
else
|
27
|
+
end
|
28
|
+
else
|
29
|
+
end
|
30
|
+
end
|
metadata
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: trainbbcode
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Adam "Arcath" Laycock
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-12-06 00:00:00 +00:00
|
13
|
+
default_executable:
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description: Provides BBCode
|
17
|
+
email: adam@arcath.net
|
18
|
+
executables: []
|
19
|
+
|
20
|
+
extensions: []
|
21
|
+
|
22
|
+
extra_rdoc_files:
|
23
|
+
- README.rdoc
|
24
|
+
- lib/trainbbcode.rb
|
25
|
+
files:
|
26
|
+
- README.rdoc
|
27
|
+
- Rakefile
|
28
|
+
- lib/trainbbcode.rb
|
29
|
+
- Manifest
|
30
|
+
- trainbbcode.gemspec
|
31
|
+
has_rdoc: true
|
32
|
+
homepage: http://github.com/Arcath/TrainBBCode
|
33
|
+
licenses: []
|
34
|
+
|
35
|
+
post_install_message:
|
36
|
+
rdoc_options:
|
37
|
+
- --line-numbers
|
38
|
+
- --inline-source
|
39
|
+
- --title
|
40
|
+
- Trainbbcode
|
41
|
+
- --main
|
42
|
+
- README.rdoc
|
43
|
+
require_paths:
|
44
|
+
- lib
|
45
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: "0"
|
50
|
+
version:
|
51
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: "1.2"
|
56
|
+
version:
|
57
|
+
requirements: []
|
58
|
+
|
59
|
+
rubyforge_project: trainbbcode
|
60
|
+
rubygems_version: 1.3.5
|
61
|
+
signing_key:
|
62
|
+
specification_version: 3
|
63
|
+
summary: Provides BBCode
|
64
|
+
test_files: []
|
65
|
+
|