jeanine 0.7.3.2 → 0.7.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 16130f0450616f7e8d1d0a5f61be6a4ecadcaa14
4
- data.tar.gz: 8886f65a66bc9557f3fc68b00943b76c5a849c93
3
+ metadata.gz: e5edf90467faa847958a30a1fc3b937cf3ed6480
4
+ data.tar.gz: 154de020a71084d5a7155a77a0f2635164775cef
5
5
  SHA512:
6
- metadata.gz: 4af8318cb9f4b7fc9c8f6c2fcd4535ad6aab647a03f1d53c7a26f191d508542edfb5e657d2b38d19dbb0e593172f950f99addd00bfcf1a41dad590c313e4debe
7
- data.tar.gz: 523562998fcffca362cef4727e02f25f1b8d592167d5eb926918b9326e3b934e8e5e8d88ace2d3b127c438b91cdec97e7bb4e263ba5a567ca4d9ef64a23b3111
6
+ metadata.gz: c3639863abf7a3f23ba443313a1705324b46588b23de82ca5703b8a19863aa6d7c56618c2e0159bb3b77ef330d34a74bf8a983ae1f222f009b6e59cd033b2cf8
7
+ data.tar.gz: 02c17bcff9607506feb24d7a1079d4c292322c48d0a9aa07d842fbdcf055886fa2258347cf6bd9035d4ad927195d629958b1ba94e0b06ee3510c47439de58e28
data/README.md CHANGED
@@ -43,6 +43,16 @@ run App
43
43
 
44
44
  `$ rackup`
45
45
 
46
+ Or generate a new app:
47
+
48
+ ```
49
+ $ gem install jeanine
50
+ $ jeanine new my_api
51
+ $ cd my_api
52
+ $ bundle
53
+ $ rackup
54
+ ```
55
+
46
56
  ## Advanced usage
47
57
 
48
58
  ```ruby
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'jeanine/cli'
3
+ require_relative '../lib/jeanine/cli'
4
4
 
5
5
  Jeanine::CLI.new(ARGV).execute
@@ -1,4 +1,4 @@
1
- require 'jeanine/cli'
1
+ require 'jeanine/environment'
2
2
  require 'jeanine/mimes'
3
3
  require 'jeanine/request'
4
4
  require 'jeanine/response'
@@ -15,18 +15,23 @@ module Jeanine
15
15
  end
16
16
 
17
17
  def command_new!
18
+ $stdout.puts("Creating new app #{@args[1]}")
18
19
  FileUtils.mkdir("#{@args[1]}") unless Dir.exists?("#{@args[1]}")
19
20
  FileUtils.mkdir("#{@args[1]}/config") unless Dir.exists?("#{@args[1]}/config")
20
- relative_dir = "lib/jeanine/generator/new"
21
- Dir.glob("lib/jeanine/generator/new/**/*.*").each do |file|
21
+ FileUtils.mkdir("#{@args[1]}/tmp") unless Dir.exists?("#{@args[1]}/tmp")
22
+ FileUtils.mkdir("#{@args[1]}/tmp/pids") unless Dir.exists?("#{@args[1]}/tmp/pids")
23
+ FileUtils.touch("#{@args[1]}/tmp/pids/.keep") unless File.exists?("#{@args[1]}/tmp/pids/.keep")
24
+ relative_dir = "#{__dir__}/generator/new"
25
+ Dir.glob("#{__dir__}/generator/new/**/*.*").each do |file|
22
26
  new_dir = file.gsub(relative_dir, "#{@args[1]}")[0...-3]
23
27
  FileUtils.copy_file(file, new_dir)
24
28
  end
25
- relative_dir = "lib/jeanine/generator/new/config"
26
- Dir.glob("lib/jeanine/generator/new/config/**/*.*").each do |file|
29
+ relative_dir = "#{__dir__}/generator/new/config"
30
+ Dir.glob("#{__dir__}/generator/new/config/**/*.*").each do |file|
27
31
  new_dir = file.gsub(relative_dir, "#{@args[1]}/config")[0...-3]
28
32
  FileUtils.copy_file(file, new_dir)
29
33
  end
34
+ $stdout.puts("Created #{@args[1]}!")
30
35
  end
31
36
  end
32
37
  end
@@ -1,7 +1,5 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- ruby "$RUBY_VERSION$"
4
-
5
3
  gem "jeanine"
6
4
 
7
5
  group :production do
@@ -1,4 +1,4 @@
1
- require_relative 'boot'
1
+ require_relative 'config/boot'
2
2
 
3
3
  require 'jeanine'
4
4
 
@@ -7,4 +7,23 @@ require 'jeanine'
7
7
  Bundler.require(*Jeanine.groups)
8
8
 
9
9
  class App < ::Jeanine::App
10
+ # plugin :Callbacks
11
+ # plugin :Rescuable
12
+ # plugin :Rendering
13
+ # plugin :Session
14
+
15
+ root do
16
+ "Hello world!"
17
+ end
18
+
19
+ get "/health" do
20
+ if request.json?
21
+ # Get this for free with plugin :Rendering
22
+ # and `render json: { status: "Healthy" }`
23
+ response.content_type = ::Rack::Mime::MIME_TYPES[".json"]
24
+ { status: "Healthy" }.to_json
25
+ else
26
+ "Healthy!"
27
+ end
28
+ end
10
29
  end
@@ -1,3 +1,3 @@
1
1
  module Jeanine
2
- VERSION = "0.7.3.2"
2
+ VERSION = "0.7.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jeanine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.3.2
4
+ version: 0.7.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Brody