Skip to content
Browse files

first added.

  • Loading branch information...
1 parent be42d5d commit 8dccc856bdd01c26f86c07897e5d44dc6ff04761 @komagata committed Oct 19, 2011
Showing with 137 additions and 21 deletions.
  1. +7 −10 Gemfile
  2. +32 −0 Gemfile.lock
  3. +2 −1 README.rdoc
  4. +2 −2 Rakefile
  5. 0 lib/lokka-hello.rb
  6. +9 −0 lib/lokka/hello.rb
  7. +61 −0 lokka-hello.gemspec
  8. +7 −1 test/helper.rb
  9. +8 −0 test/lokka/app.rb
  10. +9 −0 test/lokka/test_hello.rb
  11. +0 −7 test/test_lokka-hello.rb
View
17 Gemfile
@@ -1,13 +1,10 @@
-source "http://rubygems.org"
-# Add dependencies required to use your gem here.
-# Example:
-# gem "activesupport", ">= 2.3.5"
+source :rubygems
-# Add dependencies to develop your gem here.
-# Include everything needed to run rake, tests, features, etc.
group :development do
- gem "shoulda", ">= 0"
- gem "bundler", "~> 1.0.0"
- gem "jeweler", "~> 1.6.4"
- gem "rcov", ">= 0"
+ gem 'shoulda', '>= 0'
+ gem 'bundler', '~> 1.0.0'
+ gem 'jeweler', '~> 1.6.4'
+ gem 'rcov', '>= 0'
+ gem 'sinatra', '1.3.1'
+ gem 'rack-test'
end
View
32 Gemfile.lock
@@ -0,0 +1,32 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ git (1.2.5)
+ jeweler (1.6.4)
+ bundler (~> 1.0)
+ git (>= 1.2.5)
+ rake
+ rack (1.3.5)
+ rack-protection (1.1.4)
+ rack
+ rack-test (0.6.1)
+ rack (>= 1.0)
+ rake (0.9.2)
+ rcov (0.9.11)
+ shoulda (2.11.3)
+ sinatra (1.3.1)
+ rack (~> 1.3, >= 1.3.4)
+ rack-protection (~> 1.1, >= 1.1.2)
+ tilt (~> 1.3, >= 1.3.3)
+ tilt (1.3.3)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ bundler (~> 1.0.0)
+ jeweler (~> 1.6.4)
+ rack-test
+ rcov
+ shoulda
+ sinatra (= 1.3.1)
View
3 README.rdoc
@@ -1,6 +1,7 @@
= lokka-hello
-Description goes here.
+Lokka sample plugin.
+This plugin display "hello" when you access to "/hello" on lokka.
== Contributing to lokka-hello
View
4 Rakefile
@@ -17,8 +17,8 @@ Jeweler::Tasks.new do |gem|
gem.name = "lokka-hello"
gem.homepage = "http://github.com/komagata/lokka-hello"
gem.license = "MIT"
- gem.summary = %Q{TODO: one-line summary of your gem}
- gem.description = %Q{TODO: longer description of your gem}
+ gem.summary = %Q{Lokka sample plugin}
+ gem.description = %Q{Lokka sample plugin.}
gem.email = "komagata@gmail.com"
gem.authors = ["Masaki Komagata"]
# dependencies defined in Gemfile
View
0 lib/lokka-hello.rb
No changes.
View
9 lib/lokka/hello.rb
@@ -0,0 +1,9 @@
+module Lokka
+ module Hello
+ def self.registered(app)
+ app.get '/hello' do
+ 'hello'
+ end
+ end
+ end
+end
View
61 lokka-hello.gemspec
@@ -0,0 +1,61 @@
+# 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{lokka-hello}
+ s.version = "0.1.0"
+
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
+ s.authors = ["Masaki Komagata"]
+ s.date = %q{2011-10-19}
+ s.description = %q{Lokka sample plugin.}
+ s.email = %q{komagata@gmail.com}
+ s.extra_rdoc_files = [
+ "LICENSE.txt",
+ "README.rdoc"
+ ]
+ s.files = [
+ ".document",
+ "Gemfile",
+ "LICENSE.txt",
+ "README.rdoc",
+ "Rakefile",
+ "VERSION",
+ "test/helper.rb"
+ ]
+ s.homepage = %q{http://github.com/komagata/lokka-hello}
+ s.licenses = ["MIT"]
+ s.require_paths = ["lib"]
+ s.rubygems_version = %q{1.6.2}
+ s.summary = %q{Lokka sample plugin}
+
+ if s.respond_to? :specification_version then
+ s.specification_version = 3
+
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
+ s.add_development_dependency(%q<shoulda>, [">= 0"])
+ s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
+ s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
+ s.add_development_dependency(%q<rcov>, [">= 0"])
+ s.add_development_dependency(%q<sinatra>, ["= 1.3.1"])
+ s.add_development_dependency(%q<rack-test>, [">= 0"])
+ else
+ s.add_dependency(%q<shoulda>, [">= 0"])
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
+ s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
+ s.add_dependency(%q<rcov>, [">= 0"])
+ s.add_dependency(%q<sinatra>, ["= 1.3.1"])
+ s.add_dependency(%q<rack-test>, [">= 0"])
+ end
+ else
+ s.add_dependency(%q<shoulda>, [">= 0"])
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
+ s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
+ s.add_dependency(%q<rcov>, [">= 0"])
+ s.add_dependency(%q<sinatra>, ["= 1.3.1"])
+ s.add_dependency(%q<rack-test>, [">= 0"])
+ end
+end
+
View
8 test/helper.rb
@@ -12,7 +12,13 @@
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
-require 'lokka-hello'
+require 'rack/test'
+require 'lokka/app'
class Test::Unit::TestCase
+ include Rack::Test::Methods
+
+ def app
+ Lokka::App
+ end
end
View
8 test/lokka/app.rb
@@ -0,0 +1,8 @@
+require 'sinatra/base'
+require 'lokka/hello'
+
+module Lokka
+ class App < Sinatra::Base
+ register Lokka::Hello
+ end
+end
View
9 test/lokka/test_hello.rb
@@ -0,0 +1,9 @@
+require 'helper'
+
+class TestHello < Test::Unit::TestCase
+ should "return hello" do
+ get '/hello'
+ assert last_response.ok?
+ assert_equal 'hello', last_response.body
+ end
+end
View
7 test/test_lokka-hello.rb
@@ -1,7 +0,0 @@
-require 'helper'
-
-class TestLokkaHello < Test::Unit::TestCase
- should "probably rename this file and start testing for real" do
- flunk "hey buddy, you should probably rename this file and start testing for real"
- end
-end

0 comments on commit 8dccc85

Please sign in to comment.
Something went wrong with that request. Please try again.