Permalink
Browse files

Gemifying project

Adding example to README
  • Loading branch information...
mattt committed Sep 19, 2011
1 parent 0e10289 commit e0ef7b0428f99f826c294a509e08fcbce6ff0448
Showing with 80 additions and 0 deletions.
  1. +2 −0 .gitignore
  2. +7 −0 Gemfile
  3. +19 −0 LICENSE
  4. +22 −0 README.rdoc
  5. +11 −0 Rakefile
  6. +2 −0 lib/rack/typekit.rb
  7. +17 −0 rack-typekit.gemspec
View
@@ -0,0 +1,2 @@
+*.gem
+Gemfile.lock
View
@@ -0,0 +1,7 @@
+source :rubygems
+
+gem "rack"
+
+group :development do
+ gem "rake"
+end
View
19 LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2011 Mattt Thompson (http://mattt.me)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND 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.
View
@@ -0,0 +1,22 @@
+= rack-typekit
+
+Rack middleware to automatically include your Typekit JavaScript files
+
+== Example
+
+ require 'rack/typekit'
+
+ use Rack::TypeKit, :kit => 'lng5bpe'
+
+Including this in the <tt>config.ru</tt> file of your Rack application will automatically inject the corresponding JavaScript into the <tt><head></tt> of your HTML:
+
+ <script src="http://use.typekit.com/lng5bpe.js" type="text/javascript"></script><script type="text/javascript">
+ //<![CDATA[
+ try{Typekit.load();}catch(e){}
+ //]]>
+ </script>
+ <script type="text/javascript">
+
+== License
+
+rack-typekit is available under the MIT license. See the LICENSE file for more info.
View
@@ -0,0 +1,11 @@
+require "bundler"
+Bundler.setup
+
+gemspec = eval(File.read("rack-typekit.gemspec"))
+
+task :build => "#{gemspec.full_name}.gem"
+
+file "#{gemspec.full_name}.gem" => gemspec.files + ["rack-typekit.gemspec"] do
+ system "gem build rack-typekit.gemspec"
+ system "gem install rack-typekit-#{Rack::Typekit::VERSION}.gem"
+end
View
@@ -2,6 +2,8 @@
module Rack #:nodoc:
class Typekit
+
+ VERSION = "0.1.0"
def initialize(app, options = {})
raise ArgumentError, "Typekit Kit ID Required" unless options[:kit] and !options[:kit].empty?
View
@@ -0,0 +1,17 @@
+require File.expand_path("../lib/rack/typekit", __FILE__)
+
+Gem::Specification.new do |s|
+ s.name = "rack-typekit"
+ s.authors = ["Mattt Thompson"]
+ s.email = "m@mattt.me"
+ s.homepage = "http://github.com/mattt/rack-typekit"
+ s.version = Rack::Typekit::VERSION
+ s.platform = Gem::Platform::RUBY
+ s.summary = "rack-typekit"
+ s.description = "Rack middleware to automatically include your Typekit JavaScript files"
+
+ s.required_rubygems_version = ">= 1.3.6"
+
+ s.files = Dir["{lib}/**/*.rb", "bin/*", "LICENSE", "*.md", "*.rdoc"]
+ s.require_path = 'lib'
+end

0 comments on commit e0ef7b0

Please sign in to comment.