p 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- p (0.1.4)
4
+ p (0.1.5)
5
5
  thor (~> 0.18.0)
6
6
 
7
7
  GEM
data/lib/p.rb CHANGED
@@ -2,7 +2,7 @@ require 'fileutils'
2
2
 
3
3
  module P
4
4
 
5
- VERSION = "0.1.4"
5
+ VERSION = "0.1.5"
6
6
 
7
7
  def self.template_paths
8
8
  [ File.join(File.dirname(__FILE__), "templates") ]
@@ -0,0 +1,20 @@
1
+ file "README.md" do
2
+ source "README.erb"
3
+ end
4
+
5
+ file "Gemfile"
6
+ file "Rakefile"
7
+
8
+ file "#{@name.snakecase}.rb" do
9
+ source "app.erb"
10
+ end
11
+
12
+ directory "test"
13
+
14
+ file "test/test_helper.rb" do
15
+ source "test_helper.erb"
16
+ end
17
+
18
+ file "test/#{@name.snakecase}_test.rb" do
19
+ source "test.erb"
20
+ end
@@ -0,0 +1,4 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "sinatra"
4
+ gem "rack-test"
@@ -0,0 +1,6 @@
1
+ <%= @name.camelcase %>
2
+ <%= "=" * @name.camelcase.length %>
3
+
4
+ * Run `bundle install` to install the necessary gems
5
+ * Run `rake` to run the test suite - everything should pass!
6
+ * Run `ruby <%= @name.snakecase %>.rb` to start the Sinatra app, and you should see `TODO` when you visit `http://localhost:4567/`
@@ -0,0 +1,7 @@
1
+ require 'rake/testtask'
2
+
3
+ Rake::TestTask.new do |t|
4
+ t.pattern = "test/**/*_test.rb"
5
+ end
6
+
7
+ task :default => :test
@@ -0,0 +1,6 @@
1
+ require 'bundler/setup'
2
+ Bundler.require(:default)
3
+
4
+ get '/' do
5
+ "TODO"
6
+ end
@@ -0,0 +1,9 @@
1
+ require_relative 'test_helper'
2
+
3
+ class <%= @name.camelcase %>Test < Test::Unit::TestCase
4
+
5
+ def test_should_respond_with_200
6
+ get '/'
7
+ assert_equal last_response.status, 200
8
+ end
9
+ end
@@ -0,0 +1,10 @@
1
+ ENV['RACK_ENV'] = 'test'
2
+ require_relative '../<%= @name.snakecase %>'
3
+ require 'test/unit'
4
+ require 'rack/test'
5
+
6
+ class Test::Unit::TestCase
7
+ include Rack::Test::Methods
8
+
9
+ def app; Sinatra::Application; end
10
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: p
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-11-20 00:00:00.000000000 Z
12
+ date: 2013-11-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
@@ -79,6 +79,13 @@ files:
79
79
  - lib/templates/gem/Rakefile
80
80
  - lib/templates/gem/test.erb
81
81
  - lib/templates/gem.rb
82
+ - lib/templates/sinatra/app.erb
83
+ - lib/templates/sinatra/Gemfile
84
+ - lib/templates/sinatra/Rakefile
85
+ - lib/templates/sinatra/README.erb
86
+ - lib/templates/sinatra/test.erb
87
+ - lib/templates/sinatra/test_helper.erb
88
+ - lib/templates/sinatra.rb
82
89
  - Gemfile
83
90
  - Gemfile.lock
84
91
  - Rakefile