Permalink
Browse files

bundlerized

  • Loading branch information...
1 parent 002ba3b commit 6d3e26048bfc10feba813c92a74c2ad6f3607f5e @wbzyl committed Jul 25, 2011
Showing with 63 additions and 149 deletions.
  1. +3 −5 .gitignore
  2. +4 −0 Gemfile
  3. +2 −2 LICENSE
  4. +36 −26 README.markdown → README.md
  5. +2 −24 Rakefile
  6. +3 −8 TODO
  7. +0 −5 VERSION.yml
  8. +13 −79 rack-codehighlighter.gemspec
View
8 .gitignore
@@ -1,5 +1,3 @@
-\#*
-.\#*
-*~
-*.bak
-*.gem
+pkg/*
+Gemfile.lock
+.bundle
View
4 Gemfile
@@ -0,0 +1,4 @@
+source "http://rubygems.org"
+
+# Specify your gem's dependencies in sinatra-filler.gemspec
+gemspec
View
4 LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2009, 2010 Wlodek Bzyl
+Copyright (c) 2009, 2010, 2011 Włodek Bzyl
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
@@ -19,4 +19,4 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.
+OTHER DEALINGS IN THE SOFTWARE.
View
62 README.markdown → README.md
@@ -42,15 +42,15 @@ stylesheets in the *examples/public/stylesheets* directory.
In order to use, include the following code in a Rails application
*config/environment.rb* file:
- require 'coderay' # get one of supported highlighters
+ require 'coderay' # get one of supported highlighters
require 'rack/codehighlighter'
-
- Rails::Initializer.run do |config|
+
+ Rails::Initializer.run do |config|
config.gem 'coderay'
config.gem 'rack-codehighlighter'
-
+
config.middleware.use Rack::Codehighlighter, :coderay, :element => "pre", :pattern => /\A:::(\w+)\s*\n/
- end
+ end
### Any Rack application
@@ -59,12 +59,12 @@ for example with a **Sinatra** application. If your application
includes a rackup file or uses *Rack::Builder* to construct the
application pipeline, simply require and use as follows:
- gem 'coderay' # get one of supported highlighters
- require 'coderay'
-
+ gem 'coderay' # get one of supported highlighters
+ require 'coderay'
+
gem 'rack-codehighlighter'
require 'rack/codehighlighter'
-
+
use Rack::Codehighlighter, :coderay, :element => "pre", :pattern => /\A:::(\w+)\s*\n/
run app
@@ -84,7 +84,7 @@ element below:
puts "hello world"
</pre>
-the *ruby* name is extracted.
+the *ruby* name is extracted.
To find the appropriate name to use for programming language,
look at the lists below.
@@ -113,8 +113,8 @@ Ultraviolet:
or
- use Rack::Codehighlighter, :ultraviolet, :markdown => true,
- :theme => "minimal_theme", :lines => false, :element => "pre>code",
+ use Rack::Codehighlighter, :ultraviolet, :markdown => true,
+ :theme => "minimal_theme", :lines => false, :element => "pre>code",
:pattern => /\A:::([-_+\w]+)\s*(\n|&#x000A;)/, :logging => false,
:themes => {"vibrant_ink" => ["ruby"], "upstream_sunburst" => ["objective-c", "java"]}
@@ -139,7 +139,7 @@ Censor:
:element => "pre", :pattern => /\A:::(\w+)\s*(\n|&#x000A;)/i, :logging => false
-Markdown, Maruku and RDiscount processors, the code is wrapped with `pre>code`.
+Markdown, Maruku and RDiscount processors, the code is wrapped with `pre>code`.
To remove this extra one level of nesting the `:markdown` option should be used:
use Rack::Codehighlighter, :coderay, :markdown => true,
@@ -156,7 +156,7 @@ The *examples* directory contains several rackup files.
Each rackup file uses a different highlighter.
Install the *shotgun* gem and try, for example, the Pygments highlighter:
- shotgun pygments.ru
+ shotgun pygments.ru
The results could be checked at *http://localhost:9393*.
@@ -172,13 +172,13 @@ A simple Copy & Paste example.
require 'sinatra'
gem 'rack-codehighlighter'
require 'rack/codehighlighter'
-
+
use Rack::Codehighlighter, :censor, :reason => '[[--difficult code removed--]]'
-
+
get "/" do
erb :hello
end
-
+
__END__
@@ hello
<h3>Fibonacci numbers in Ruby</h3>
@@ -201,28 +201,32 @@ and check results at *http://localhost:4567*.
## Supported highlighters
-These currently include: *Syntax* (fast), *Coderay* (very fast),
+These currently include: *Syntax* (fast), *Coderay* (very fast),
*Ultraviolet* (slow, but highlights almost any language).
### [Syntax](http://syntax.rubyforge.org/)
-Languages supported by *Syntax*:
+Languages supported by *Syntax*:
* xml
* ruby
### [Coderay](http://coderay.rubychan.de/)
-Languages supported by *Coderay*:
+Languages supported by
+the [coderay](https://github.com/rubychan/coderay) library:
-* C, CSS
+* C, C++, CSS
* Delphi, diff
-* HTML, RHTML (Rails), Nitro-XHTML
+* ERB+HTML, Groovy (beta), HTML
* Java, JavaScript, JSON
-* Ruby
-* YAML
+* Nitro-XHTML, PHP, Python
+* Ruby, Scheme (beta), SQL
+* XML, YAML
+
-### [Ultraviolet](http://ultraviolet.rubyforge.org/)
+
+### [Ultraviolet](http://ultraviolet.rubyforge.org/) and 1.8 tree of the Ruby programming language
The *ultraviolet* gem needs oniguruma regexp library.
@@ -237,6 +241,12 @@ Now, install the gem:
sudo gem install ultraviolet
+### [Ultraviolet](http://ultraviolet.rubyforge.org/) and 1.9 tree of the Ruby programming language
+
+Install a fixed version of the Ultraviolet syntax highlighting
+library for the 1.9 tree of the Ruby programming language from
+[here](https://github.com/spox/ultraviolet).
+
See also [Ultraviolet themes gallery](http://ultraviolet.rubyforge.org/themes.xhtml)
Ultraviolet supports almost any language:
@@ -253,7 +263,7 @@ Ultraviolet supports almost any language:
* haml, haskell, html, html-asp, html\_django, html\_for\_asp.net, html\_mason,
html\_rails, html\_tcl
* icalendar, inform, ini, installer\_distribution\_script, io
-* java, javaproperties, javascript, javascript\_+\_prototype,
+* java, javaproperties, javascript, javascript\_+\_prototype,
javascript\_+\_prototype\_bracketed, jquery\_javascript, json
* languagedefinition, latex, latex\_beamer, latex\_log, latex\_memoir, lexflex,
lighttpd, lilypond, lisp, literate\_haskell, logo, logtalk, lua
View
26 Rakefile
@@ -1,24 +1,2 @@
-require "rake"
-
-begin
- require 'jeweler'
- Jeweler::Tasks.new do |gemspec|
- gemspec.name = "rack-codehighlighter"
- gemspec.summary = "Rack Middleware for Code Highlighting."
- gemspec.email = "matwb@univ.gda.pl"
- gemspec.homepage = "http://github.com/wbzyl/rack-codehighlighter"
- gemspec.authors = ["Wlodek Bzyl"]
- gemspec.description = gemspec.summary
-
- gemspec.files = %w[LICENSE TODO Rakefile VERSION.yml] + FileList['lib/**/*.rb', "examples/**/*"]
-
- gemspec.add_runtime_dependency 'rack', '>=1.0.0'
- gemspec.add_runtime_dependency 'nokogiri', '>=1.4.1'
-
- gemspec.add_development_dependency 'rack-test', '>=0.3.0'
- end
- Jeweler::GemcutterTasks.new
-rescue LoadError
- puts "Jeweler not available. Install it with:"
- puts " sudo gem install jeweler"
-end
+require 'bundler'
+Bundler::GemHelper.install_tasks
View
11 TODO
@@ -1,9 +1,4 @@
-[15.06.2009]
-
- Compare: http://freelancing-god.github.com/ts/en/
- Description of thinking-sphinx gem.
-
-[13.10.2009]
+[22.07.2011]
Currently, almost everything what I write is rendered by Ruby on Rails
and Sinatra applications. To improve the readability of the text, I
@@ -14,7 +9,7 @@ The problem is to how syntax highlighting features are hooked into
these frameworks.
Look at the current practice. To this end, analyze the top three tools
-listed on *The Ruby Toolbox* in category
+listed on *The Ruby Toolbox* in category
[Syntax Highlighting](http://ruby-toolbox.com/categories/syntax_highlighting.html).
[tm_syntax_highlighting](http://github.com/arya/tm_syntax_highlighting/) (plugin):
@@ -29,7 +24,7 @@ listed on *The Ruby Toolbox* in category
[Redcloth with CodeRay](http://github.com/augustl/redcloth-with-coderay) (gem):
- <source:ruby> some_ruby_code </source>
+ <source:ruby> some_ruby_code </source>
In each piece of code inserted into html we must change:
`<` to `&lt;`. This is annoying thing.
View
5 VERSION.yml
@@ -1,5 +0,0 @@
----
-:minor: 4
-:patch: 7
-:build:
-:major: 0
View
92 rack-codehighlighter.gemspec
@@ -1,85 +1,19 @@
-# Generated by jeweler
-# DO NOT EDIT THIS FILE DIRECTLY
-# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
- s.name = %q{rack-codehighlighter}
- s.version = "0.4.7"
+ s.name = "rack-codehighlighter"
+ s.version = "1.0.0"
+ s.platform = Gem::Platform::RUBY
+ s.authors = ["Włodek Bzyl"]
+ s.email = ["matwb@ug.edu.pl"]
+ s.homepage = "http://tao.inf.ug.edu.pl/"
+ s.summary = %q{Rack Middleware for Code Highlighting.}
+ s.description = %q{Rack Middleware for Code Highlighting. Supports the most popular Ruby code highlighters.}
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
- s.authors = ["Wlodek Bzyl"]
- s.date = %q{2011-07-24}
- s.description = %q{Rack Middleware for Code Highlighting.}
- s.email = %q{matwb@univ.gda.pl}
- s.extra_rdoc_files = [
- "LICENSE",
- "README.markdown",
- "TODO"
- ]
- s.files = [
- "LICENSE",
- "Rakefile",
- "TODO",
- "VERSION.yml",
- "examples/app.rb",
- "examples/check.rb",
- "examples/coderay.ru",
- "examples/config.ru",
- "examples/public/javascripts/lang-css.js",
- "examples/public/javascripts/lang-hs.js",
- "examples/public/javascripts/lang-lisp.js",
- "examples/public/javascripts/lang-lua.js",
- "examples/public/javascripts/lang-ml.js",
- "examples/public/javascripts/lang-proto.js",
- "examples/public/javascripts/lang-sql.js",
- "examples/public/javascripts/lang-vb.js",
- "examples/public/javascripts/lang-wiki.js",
- "examples/public/javascripts/prettify.js",
- "examples/public/stylesheets/application.css",
- "examples/public/stylesheets/censor.css",
- "examples/public/stylesheets/coderay.css",
- "examples/public/stylesheets/prettify.css",
- "examples/public/stylesheets/pygments.css",
- "examples/public/stylesheets/syntax.css",
- "examples/public/stylesheets/uv.css",
- "examples/public/stylesheets/uv/amy.css",
- "examples/public/stylesheets/uv/blackboard.css",
- "examples/public/stylesheets/uv/cobalt.css",
- "examples/public/stylesheets/uv/dawn.css",
- "examples/public/stylesheets/uv/espresso_libre.css",
- "examples/public/stylesheets/uv/sunburst.css",
- "examples/public/stylesheets/uv/twilight.css",
- "examples/public/stylesheets/uv/zenburnesque.css",
- "examples/pygments.ru",
- "examples/pygments_api.ru",
- "examples/syntax.ru",
- "examples/ultraviolet.ru",
- "examples/views/index.erb",
- "examples/views/layout.erb",
- "lib/rack/codehighlighter.rb"
- ]
- s.homepage = %q{http://github.com/wbzyl/rack-codehighlighter}
- s.require_paths = ["lib"]
- s.rubygems_version = %q{1.6.2}
- s.summary = %q{Rack Middleware for Code Highlighting.}
-
- if s.respond_to? :specification_version then
- s.specification_version = 3
+ s.add_runtime_dependency 'rack', '>= 1.0.0'
+ s.add_runtime_dependency 'nokogiri', '>= 1.4.1'
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
- s.add_runtime_dependency(%q<rack>, [">= 1.0.0"])
- s.add_runtime_dependency(%q<nokogiri>, [">= 1.4.1"])
- s.add_development_dependency(%q<rack-test>, [">= 0.3.0"])
- else
- s.add_dependency(%q<rack>, [">= 1.0.0"])
- s.add_dependency(%q<nokogiri>, [">= 1.4.1"])
- s.add_dependency(%q<rack-test>, [">= 0.3.0"])
- end
- else
- s.add_dependency(%q<rack>, [">= 1.0.0"])
- s.add_dependency(%q<nokogiri>, [">= 1.4.1"])
- s.add_dependency(%q<rack-test>, [">= 0.3.0"])
- end
+ s.files = `git ls-files`.split("\n")
+ #s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
+ s.require_paths = ["lib"]
end
-

0 comments on commit 6d3e260

Please sign in to comment.