Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

updated .gitignore; remove Thorfile

  • Loading branch information...
commit 7dbcb6b00f3c6ff590714eacac5d246b2eeecfe3 1 parent 9557716
Mike Chlipala authored July 14, 2012

Showing 2 changed files with 2 additions and 60 deletions. Show diff stats Hide diff stats

  1. 3  .gitignore
  2. 59  Thorfile
3  .gitignore
... ...
@@ -1,3 +1,4 @@
1 1
 # Ignore the database
2 2
 /db/*.sqlite3
3  
-/tmp/*.sqlite3
  3
+/tmp/*.sqlite3
  4
+Thorfile
59  Thorfile
... ...
@@ -1,59 +0,0 @@
1  
-# encoding: utf-8
2  
-$:.unshift File.expand_path("../lib", __FILE__)
3  
-require 'bundler'
4  
-require 'active_support/inflector'
5  
-
6  
-class Default < Thor
7  
-  include Thor::Actions
8  
-  
9  
-  desc "service VERB URI FILENAME", "Generate scaffolding for a new service"
10  
-  def service(verb, route, path)
11  
-    route = route.gsub(/^\//, "") # strip leading forward slash
12  
-    path_without_suffix = path.gsub(/\.rb$/, "")
13  
-    create_file(File.join("api", "#{path_without_suffix}.rb")) do
14  
-      <<-RUBY.gsub(/^\s{6}/, '')
15  
-      describe_service "#{route}" do |service|
16  
-        service.formats   :json
17  
-        service.http_verb :#{verb.downcase}
18  
-        service.disable_auth # on by default
19  
-        
20  
-        # INPUT
21  
-        service.param.string :name, :default => 'World', :doc => "The name of the person to greet."
22  
-        
23  
-        # OUTPUT
24  
-        service.response do |response|
25  
-          response.object do |obj|
26  
-            obj.string :message, :doc => "The greeting message sent back. Defaults to 'World'"
27  
-            obj.datetime :at, :doc => "The timestamp of when the message was dispatched"
28  
-          end
29  
-        end
30  
-        
31  
-        # DOCUMENTATION
32  
-        service.documentation do |doc|
33  
-          doc.overall "This service provides a simple hello world implementation example."
34  
-          doc.example "<code>curl -I 'http://localhost:9292/hello_world?name=Matt'</code>"
35  
-        end
36  
-        
37  
-        # ACTION/IMPLEMENTATION
38  
-        service.implementation do
39  
-          halt 501, "Not Implemented, which is a pity, I'm sure"
40  
-        end
41  
-      end
42  
-      RUBY
43  
-    end
44  
-    
45  
-    class_name = path_without_suffix.classify.gsub(/::/, '') # strip modules; just want a unique class name for spec
46  
-    create_file(File.join("test", "integration", "#{path_without_suffix}_test.rb")) do
47  
-      <<-RUBY.gsub(/^\s{6}/, '')
48  
-      require 'test_helpers'
49  
-
50  
-      class #{class_name}Spec < MiniTest::Spec
51  
-        it "performs request" do
52  
-          TestApi.#{verb} "/#{route}", {}
53  
-          assert_api_response
54  
-        end
55  
-      end
56  
-      RUBY
57  
-    end
58  
-  end
59  
-end

0 notes on commit 7dbcb6b

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