Skip to content

Commit 1cd901f

Browse files
author
Michael Bleigh
committed
Added base middleware and prefixer middleware.
1 parent 377f4a5 commit 1cd901f

File tree

18 files changed

+215
-49
lines changed

18 files changed

+215
-49
lines changed

.rspec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
--color
2+
--format=nested

.rvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rvm use ree@rails3 --passenger

Gemfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
gem 'rack'
2+
gem 'rack-mount'
3+
gem 'rack-jsonp'
4+
5+
group :test do
6+
gem 'rspec', '>= 2.0.0.beta.19'
7+
gem 'rack-test'
8+
gem 'cucumber', '>= 0.8.5'
9+
end

Gemfile.lock

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
GEM
2+
specs:
3+
builder (2.1.2)
4+
cucumber (0.8.5)
5+
builder (~> 2.1.2)
6+
diff-lcs (~> 1.1.2)
7+
gherkin (~> 2.1.4)
8+
json_pure (~> 1.4.3)
9+
term-ansicolor (~> 1.0.4)
10+
diff-lcs (1.1.2)
11+
gherkin (2.1.5)
12+
trollop (~> 1.16.2)
13+
json_pure (1.4.3)
14+
rack (1.2.1)
15+
rack-jsonp (1.0.0)
16+
rack-mount (0.6.9)
17+
rack (>= 1.0.0)
18+
rack-test (0.5.4)
19+
rack (>= 1.0)
20+
rspec (2.0.0.beta.19)
21+
rspec-core (= 2.0.0.beta.19)
22+
rspec-expectations (= 2.0.0.beta.19)
23+
rspec-mocks (= 2.0.0.beta.19)
24+
rspec-core (2.0.0.beta.19)
25+
rspec-expectations (2.0.0.beta.19)
26+
diff-lcs (>= 1.1.2)
27+
rspec-mocks (2.0.0.beta.19)
28+
term-ansicolor (1.0.5)
29+
trollop (1.16.2)
30+
31+
PLATFORMS
32+
ruby
33+
34+
DEPENDENCIES
35+
cucumber (>= 0.8.5)
36+
rack
37+
rack-jsonp
38+
rack-mount
39+
rack-test
40+
rspec (>= 2.0.0.beta.19)

README.rdoc

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,29 @@
1-
= grape
1+
= Grape
22

3-
Description goes here.
3+
Grape is a REST-like API micro-framework for Ruby. It is built to complement existing web application frameworks such as Rails and Sinatra by providing a simple DSL to easily provide APIs. It has built-in support for common conventions such as multiple formats, subdomain/prefix restriction, and versioning.
44

5+
class Twitter < Grape::Base
6+
# Set this API to work only on a specified subdomain
7+
subdomain 'api'
8+
9+
# Use a path prefix.
10+
path_prefix 'api'
11+
12+
version 'v2'
13+
14+
version 'v1' do
15+
16+
end
17+
end
18+
519
== Note on Patches/Pull Requests
620

721
* Fork the project.
822
* Make your feature addition or bug fix.
9-
* Add tests for it. This is important so I don't break it in a
10-
future version unintentionally.
11-
* Commit, do not mess with rakefile, version, or history.
12-
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
23+
* Add tests for it. This is important so I don't break it in a future version unintentionally.
24+
* Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
1325
* Send me a pull request. Bonus points for topic branches.
1426

1527
== Copyright
1628

17-
Copyright (c) 2010 Michael Bleigh. See LICENSE for details.
29+
Copyright (c) 2010 Michael Bleigh and Intridea, Inc. See LICENSE for details.

Rakefile

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,31 +19,17 @@ rescue LoadError
1919
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
2020
end
2121

22-
require 'spec/rake/spectask'
23-
Spec::Rake::SpecTask.new(:spec) do |spec|
24-
spec.libs << 'lib' << 'spec'
25-
spec.spec_files = FileList['spec/**/*_spec.rb']
22+
require 'rspec/core/rake_task'
23+
RSpec::Core::RakeTask.new(:spec) do |spec|
24+
spec.pattern = 'spec/**/*_spec.rb'
2625
end
2726

28-
Spec::Rake::SpecTask.new(:rcov) do |spec|
29-
spec.libs << 'lib' << 'spec'
27+
RSpec::Core::RakeTask.new(:rcov) do |spec|
3028
spec.pattern = 'spec/**/*_spec.rb'
3129
spec.rcov = true
3230
end
3331

3432
task :spec => :check_dependencies
35-
36-
begin
37-
require 'cucumber/rake/task'
38-
Cucumber::Rake::Task.new(:features)
39-
40-
task :features => :check_dependencies
41-
rescue LoadError
42-
task :features do
43-
abort "Cucumber is not available. In order to run features, you must: sudo gem install cucumber"
44-
end
45-
end
46-
4733
task :default => :spec
4834

4935
require 'rake/rdoctask'

autotest/discover.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Autotest.add_discovery { "rspec2" }

features/grape.feature

Lines changed: 0 additions & 9 deletions
This file was deleted.

features/step_definitions/grape_steps.rb

Whitespace-only changes.

features/support/env.rb

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)