Permalink
Browse files

Renamed ffi-upskirt to ffi-sundown.

  • Loading branch information...
postmodern committed Jul 18, 2011
1 parent 13544d7 commit 5fec03c53f0f0d4e17e5ee221d4001d30ec632cf
View
@@ -1 +1 @@
---markup markdown --title "ffi-upskirt Documentation" --protected
+--markup markdown --title "FFI::Sundown Documentation" --protected
View
@@ -1,50 +1,50 @@
-# ffi-upskirt
+# ffi-sundown
-* [Source](http://github.com/postmodern/ffi-upskirt)
-* [Issues](http://github.com/postmodern/ffi-upskirt/issues)
-* [Documentation](http://rubydoc.info/gems/ffi-upskirt/frames)
+* [Source](http://github.com/postmodern/ffi-sundown)
+* [Issues](http://github.com/postmodern/ffi-sundown/issues)
+* [Documentation](http://rubydoc.info/gems/ffi-sundown/frames)
* [Email](mailto:postmodern.mod3 at gmail.com)
## Description
-Ruby FFI bindings for the libupskirt markdown library.
+Ruby FFI bindings for the libsundown markdown library.
## Examples
- require 'ffi/upskirt'
+ require 'ffi/sundown'
- doc = FFI::Upskirt::Document.new(File.read('README.md'))
+ doc = FFI::Sundown::Document.new(File.read('README.md'))
puts doc.to_html
- # <h1>ffi-upskirt</h1>
+ # <h1>ffi-sundown</h1>
#
# <ul>
- # <li><a href="http://github.com/postmodern/ffi-upskirt">Source</a></li>
- # <li><a href="http://github.com/postmodern/ffi-upskirt/issues">Issues</a></li>
- # <li><a href="http://rubydoc.info/gems/ffi-upskirt/frames">Documentation</a></li>
+ # <li><a href="http://github.com/postmodern/ffi-sundown">Source</a></li>
+ # <li><a href="http://github.com/postmodern/ffi-sundown/issues">Issues</a></li>
+ # <li><a href="http://rubydoc.info/gems/ffi-sundown/frames">Documentation</a></li>
# <li><a href="mailto:postmodern.mod3 at gmail.com">Email</a></li>
# </ul>
#
# <h2>Description</h2>
#
- # <p>Ruby FFI bindings for the libupskirt markdown library.</p>
+ # <p>Ruby FFI bindings for the libsundown markdown library.</p>
#
# <h2>Examples</h2>
#
- # <pre><code>require 'ffi/upskirt'
+ # <pre><code>require 'ffi/sundown'
#
- # doc = FFI::Upskirt::Document.new(File.read('README.md'))
+ # doc = FFI::Sundown::Document.new(File.read('README.md'))
# puts doc.to_html
# </code></pre>
#
# <h2>Requirements</h2>
#
# <ul>
- # <li><a href="https://github.com/tanoku/upskirt">libupskirt</a> &gt;= 1.2.0</li>
+ # <li><a href="https://github.com/tanoku/sundown">libsundown</a> &gt;= 1.2.0</li>
# </ul>
#
# <h2>Install</h2>
#
- # <pre><code>$ gem install ffi-upskirt
+ # <pre><code>$ gem install ffi-sundown
# </code></pre>
#
# <h2>Copyright</h2>
@@ -55,7 +55,7 @@ Ruby FFI bindings for the libupskirt markdown library.
puts doc.to_toc
# <ul>
- # <li><a href="#toc_0">ffi-upskirt</a></li>
+ # <li><a href="#toc_0">ffi-sundown</a></li>
# <li><ul>
# <li><a href="#toc_1">Description</a></li>
# <li><a href="#toc_2">Examples</a></li>
@@ -67,12 +67,12 @@ Ruby FFI bindings for the libupskirt markdown library.
## Requirements
-* [libupskirt](https://github.com/tanoku/upskirt) >= 1.2.0
+* [libsundown](https://github.com/tanoku/sundown) >= 1.2.0
* [ffi](http://github.com/ffi/ffi) ~> 1.0
## Install
- $ gem install ffi-upskirt
+ $ gem install ffi-sundown
## Copyright
@@ -3,6 +3,8 @@
require 'yaml'
Gem::Specification.new do |gemspec|
+ root = File.dirname(__FILE__)
+ lib_dir = File.join(root,'lib')
files = if File.directory?('.git')
`git ls-files`.split($/)
elsif File.directory?('.hg')
@@ -23,12 +25,12 @@ Gem::Specification.new do |gemspec|
}
version = {
- :file => 'lib/ffi/upskirt/version.rb',
- :constant => 'FFI::Upskirt::VERSION'
+ :file => 'sundown/version',
+ :constant => 'FFI::Sundown::VERSION'
}
defaults = {
- 'name' => File.basename(File.dirname(__FILE__)),
+ 'name' => File.basename(root),
'files' => files,
'executables' => filter_files['bin/*'].map { |path| File.basename(path) },
'test_files' => filter_files['{test/{**/}*_test.rb,spec/{**/}*_spec.rb}'],
@@ -40,8 +42,10 @@ Gem::Specification.new do |gemspec|
gemspec.name = metadata.fetch('name',defaults[:name])
gemspec.version = if metadata['version']
metadata['version']
- elsif File.file?(version[:file])
- require File.join('.',version[:file])
+ else
+ $LOAD_PATH << lib_dir unless $LOAD_PATH.include?(lib_dir)
+
+ require version[:file]
eval(version[:constant])
end
View
@@ -1,15 +1,15 @@
-name: ffi-upskirt
-summary: FFI bindings for libupskirt
+name: ffi-sundown
+summary: FFI bindings for libsundown
description:
- Ruby FFI bindings for the libupskirt markdown library.
+ Ruby FFI bindings for the libsundown markdown library.
license: MIT
authors: Postmodern
email: postmodern.mod3@gmail.com
-homepage: http://github.com/postmodern/ffi-upskirt
+homepage: http://github.com/postmodern/ffi-sundown
has_yard: true
-requirements: "libupskirt >= 1.2.0"
+requirements: "libsundown >= 1.2.0"
dependencies:
ffi: ~> 1.0
View
@@ -0,0 +1,2 @@
+require 'ffi/sundown/document'
+require 'ffi/sundown/version'
@@ -1,7 +1,7 @@
-require 'ffi/upskirt/upskirt'
+require 'ffi/sundown/sundown'
module FFI
- module Upskirt
+ module Sundown
class Buffer < FFI::Struct
layout :data, :pointer,
@@ -26,11 +26,11 @@ class Buffer < FFI::Struct
# Once the block has returned, the buffer will be released.
#
def self.create_empty(size)
- buffer = new(Upskirt.bufnew(size))
+ buffer = new(Sundown.bufnew(size))
yield buffer
- Upskirt.bufrelease(buffer)
+ Sundown.bufrelease(buffer)
end
#
@@ -68,7 +68,7 @@ def self.create_from(text)
# The length to increase the buffer by.
#
def grow(length)
- Upskirt.bufgrow(self,length)
+ Sundown.bufgrow(self,length)
end
#
@@ -91,7 +91,7 @@ def to_smartypants
result = nil
Buffer.create_empty(128) do |smart_buffer|
- Upskirt.upshtml_smartypants(smart_buffer,self)
+ Sundown.upshtml_smartypants(smart_buffer,self)
result = self.to_s
end
@@ -1,16 +1,16 @@
-require 'ffi/upskirt/types'
-require 'ffi/upskirt/buffer'
-require 'ffi/upskirt/renderer'
+require 'ffi/sundown/types'
+require 'ffi/sundown/buffer'
+require 'ffi/sundown/renderer'
module FFI
- module Upskirt
+ module Sundown
class Document
# The `render_mode` enum
- RENDER_MODES = Upskirt.enum_type(:render_mode)
+ RENDER_MODES = Sundown.enum_type(:render_mode)
# The `markdown_extensions` enum
- EXTENSIONS = Upskirt.enum_type(:markdown_extensions)
+ EXTENSIONS = Sundown.enum_type(:markdown_extensions)
# Valid options for {#initialize}
VALID_OPTIONS = RENDER_MODES.symbols + EXTENSIONS.symbols
@@ -158,7 +158,7 @@ def render(renderer)
Buffer.create_empty(128) do |output_buffer|
output_buffer.grow(@source.length * 1.2)
- Upskirt.ups_markdown(output_buffer,input_buffer,renderer,extensions)
+ Sundown.ups_markdown(output_buffer,input_buffer,renderer,extensions)
result = if @smart
output_buffer.to_smartypants
@@ -1,7 +1,7 @@
-require 'ffi/upskirt/upskirt'
+require 'ffi/sundown/sundown'
module FFI
- module Upskirt
+ module Sundown
class Renderer < FFI::Struct
layout :blockcode, :blockcode_callback,
@@ -48,11 +48,11 @@ class Renderer < FFI::Struct
#
def Renderer.html(flags)
renderer = new
- Upskirt.upshtml_renderer(renderer,flags)
+ Sundown.upshtml_renderer(renderer,flags)
yield renderer
- Upskirt.upshtml_free_renderer(renderer)
+ Sundown.upshtml_free_renderer(renderer)
end
#
@@ -72,11 +72,11 @@ def Renderer.html(flags)
#
def Renderer.toc
renderer = new
- Upskirt.upshtml_toc_renderer(renderer)
+ Sundown.upshtml_toc_renderer(renderer)
yield renderer
- Upskirt.upshtml_free_renderer(renderer)
+ Sudown.upshtml_free_renderer(renderer)
end
end
@@ -1,12 +1,12 @@
-require 'ffi/upskirt/types'
+require 'ffi/sundown/types'
require 'ffi'
module FFI
- module Upskirt
+ module Sundown
extend FFI::Library
- ffi_lib 'upskirt'
+ ffi_lib 'sundown'
attach_function :bufcasecmp, [:pointer, :pointer], :int
attach_function :bufcmp, [:pointer, :pointer], :int
@@ -42,12 +42,12 @@ module Upskirt
attach_function :upshtml_smartypants, [:pointer, :pointer], :void
#
- # Returns the version of the installed `libupskirt`.
+ # Returns the version of the installed `libsundown`.
#
# @return [String]
# The version string.
#
- def Upskirt.version
+ def Sundown.version
ints = FFI::MemoryPointer.new(:int,3)
ups_version(ints[0],ints[1],ints[2])
@@ -1,7 +1,7 @@
require 'ffi'
module FFI
- module Upskirt
+ module Sundown
extend FFI::Library
enum :markdown_autolink, [
@@ -1,6 +1,6 @@
module FFI
- module Upskirt
- # ffi-upskirt version
+ module Sundown
+ # ffi-sundown version
VERSION = "0.1.0"
end
end
View
@@ -1,2 +0,0 @@
-require 'ffi/upskirt/document'
-require 'ffi/upskirt/version'
View
@@ -1,5 +1,5 @@
-require 'ffi/upskirt/document'
+require 'ffi/sundown/document'
unless Object.const_defined?(:Markdown)
- Object.const_set(:Markdown,FFI::Upskirt::Document)
+ Object.const_set(:Markdown,FFI::Sundown::Document)
end
View
@@ -1,5 +1,5 @@
gem 'rspec', '~> 2.4'
require 'rspec'
-require 'ffi/upskirt/version'
+require 'ffi/sundown/version'
-include FFI::Upskirt
+include FFI::Sundown
@@ -1,7 +1,7 @@
require 'spec_helper'
-require 'ffi/upskirt'
+require 'ffi/sundown'
-describe FFI::Upskirt do
+describe FFI::Sundown do
it "should have a VERSION constant" do
subject.const_get('VERSION').should_not be_empty
end

0 comments on commit 5fec03c

Please sign in to comment.