jeanine 0.7.1 → 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: 88de5348121b7c5c778d523251999fdc88b6fa2b
4
- data.tar.gz: 1032b93658f81998494037f7dc9eb1a16a1bef0f
3
+ metadata.gz: e5edf90467faa847958a30a1fc3b937cf3ed6480
4
+ data.tar.gz: 154de020a71084d5a7155a77a0f2635164775cef
5
5
  SHA512:
6
- metadata.gz: 85b1a10571b6e8cf08bd8b2d1497eb4e47651dcce1f4c31546bed10368b53e3e8fb2d5f215006ab450af316e5763adb8e0640ff1fa2ddad84300947cafaab766
7
- data.tar.gz: 357e9d198d278167a330b9ad00ff0b5adcdda551690b157adb17b4bea3e99fa4e79cca2f4b6a46bf1ff22faa12dbded50961034132d3b2387bbb7130e38043d4
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,3 +1,4 @@
1
+ require 'jeanine/environment'
1
2
  require 'jeanine/mimes'
2
3
  require 'jeanine/request'
3
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,5 +1,4 @@
1
1
  require 'jeanine/view'
2
- require 'jeanine/view_paths'
3
2
 
4
3
  module Jeanine
5
4
  def self.view_paths
@@ -1,3 +1,3 @@
1
1
  module Jeanine
2
- VERSION = "0.7.1"
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.1
4
+ version: 0.7.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Brody
@@ -111,7 +111,8 @@ dependencies:
111
111
  description: A lightning-fast, batteries-included Ruby web micro-framework.
112
112
  email:
113
113
  - git@josh.mn
114
- executables: []
114
+ executables:
115
+ - jeanine
115
116
  extensions: []
116
117
  extra_rdoc_files: []
117
118
  files:
@@ -148,7 +149,6 @@ files:
148
149
  - lib/jeanine/session.rb
149
150
  - lib/jeanine/version.rb
150
151
  - lib/jeanine/view.rb
151
- - lib/jeanine/view_paths.rb
152
152
  homepage: https://github.com/joshmn/jeanine
153
153
  licenses:
154
154
  - MIT
@@ -1,8 +0,0 @@
1
- require 'tilt'
2
-
3
- module Jeanine
4
-
5
- module ViewPaths
6
-
7
- end
8
- end