eucalypt 0.1.1 → 0.1.2

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
  SHA256:
3
- metadata.gz: 3ff31c16e52b88c4347016094d3968710963f380473448a0e61d9fd8ca5cf260
4
- data.tar.gz: d81fbee051b5eb8e055f027ee5b76e3c4ea1f5ba3a59a617c35de6c9257df784
3
+ metadata.gz: 69c606f46045814abaee082ff7d794393711c4b09381fa7c48c02f0a24862296
4
+ data.tar.gz: 37daf301d17b09834ef411152108db3c45ece54104b02210fbe41100b4f0ba33
5
5
  SHA512:
6
- metadata.gz: '07933f7d49293837ae648bda144ac099045f01c49bbc0ff860339d9a3563456b34bb5fdca418140cfb1f6ad3be8096754f3624f7295953e7541ba7b9bf0d3b32'
7
- data.tar.gz: 9ddd2a61288259c154ad6d3b9c48fe53a6fcc5539a0d84a8d6a19541e89ae2429bbb696d3dec1e9ee86026e9bd366498ba0c6fb20e5daf76434727de6e8e5db7
6
+ metadata.gz: 795354977c8d759607bd723e4c2875b477c98660f2bb1c16549b747f6706d8f8cbe795563b10333b4e1d293b24a9f4cc306845048a8eabf0d4a3ad095041c951
7
+ data.tar.gz: 850326987691936e67a4c70c4d12ccf442d5d711a25057c32790a518e0a1a6f26b2353918ba028c26e082bd3e2da24abc49652370c4afeaa13839f8605bdbb2b
data/README.md CHANGED
@@ -2,6 +2,7 @@
2
2
  [![Gem](https://img.shields.io/gem/v/eucalypt.svg)](https://rubygems.org/gems/eucalypt)
3
3
  [![Build Status](https://travis-ci.org/eonu/eucalypt.svg?branch=master)](https://travis-ci.org/eonu/eucalypt)
4
4
  [![License](https://img.shields.io/github/license/eonu/eucalypt.svg)](https://github.com/eonu/eucalypt/blob/master/LICENSE)
5
+ [![Documentation](https://img.shields.io/badge/docs-gitbook-blue.svg)](https://gum.gitbook.io/eucalypt)
5
6
 
6
7
  # Eucalypt
7
8
 
@@ -31,7 +32,7 @@ Move into your new application's directory and run the top-level `eucalypt` comm
31
32
 
32
33
  ## Documentation and help
33
34
 
34
- The writing of full documentation is currently in progress and will be available in the form of a [GitBook](https://www.gitbook.com/).
35
+ The full documentation can be found [here](https://gum.gitbook.io/eucalypt).
35
36
 
36
37
  ---
37
38
 
@@ -42,9 +43,10 @@ Some of these features are pretty set in stone, but it may be possible to change
42
43
  | Type | Feature |
43
44
  | -------------------- | ------------------------------------------------------------ |
44
45
  | Core/DSL | [Sinatra](http://sinatrarb.com/) |
46
+ | CLI builder | [Thor](https://github.com/erikhuda/thor) |
45
47
  | Web server | [Thin](https://github.com/macournoyer/thin) |
46
48
  | ORM | [ActiveRecord](https://github.com/rails/rails/tree/master/activerecord) |
47
- | ORDBMS | [PostgreSQL](https://www.postgresql.org/) (prod) + [SQLite3](https://www.sqlite.org/) (test, dev) |
49
+ | ORDBMS | [PostgreSQL](https://www.postgresql.org/) + [SQLite3](https://www.sqlite.org/) |
48
50
  | Asset pipeline | [Sprockets](https://github.com/rails/sprockets) |
49
51
  | Templating engine | [ERB](https://ruby-doc.org/stdlib-2.5.0/libdoc/erb/rdoc/ERB.html) |
50
52
  | Markdown processor | [RDiscount](https://github.com/davidfstr/rdiscount) |
@@ -56,5 +58,4 @@ Some of these features are pretty set in stone, but it may be possible to change
56
58
  | Specs | [RSpec](http://rspec.info/) + [Rack-Test](https://github.com/rack-test/rack-test) + [Shoulda-Matchers](http://matchers.shoulda.io/) |
57
59
  | Encryption | [BCrypt](https://github.com/codahale/bcrypt-ruby) |
58
60
  | Authentication | [Warden](https://github.com/wardencommunity/warden) |
59
- | Authorization | [Pundit](https://github.com/varvet/pundit) |
60
-
61
+ | Authorization | [Pundit](https://github.com/varvet/pundit) |
data/eucalypt.gemspec CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.email = ["edwinonuonga@gmail.com"]
10
10
 
11
11
  spec.summary = %q{Micro-framework and CLI wrapped around the Sinatra DSL, for the generation and maintenance of structured web applications.}
12
- # spec.homepage = "https://eucalypt.gitbook.io/eucalypt/"
12
+ spec.homepage = "https://gum.gitbook.io/eucalypt"
13
13
  spec.license = "MIT"
14
14
  spec.files = Dir.glob('lib/**/*', File::FNM_DOTMATCH) + %w[Gemfile LICENSE README.md Rakefile eucalypt.gemspec bin/eucalypt]
15
15
  spec.bindir = "bin"
@@ -33,7 +33,7 @@ Gem::Specification.new do |spec|
33
33
  spec.add_runtime_dependency "rerun", "~> 0.13"
34
34
 
35
35
  spec.metadata = {
36
- # "documentation_uri" => "https://eucalypt.gitbook.io/eucalypt/",
36
+ "documentation_uri" => "https://gum.gitbook.io/eucalypt",
37
37
  "source_code_uri" => "https://github.com/eucalypt/eucalypt/"
38
38
  }
39
39
  end
@@ -10,7 +10,7 @@ module Eucalypt
10
10
  def launch(env = ENV['RACK_ENV']||'development')
11
11
  directory = File.expand_path('.')
12
12
  if Eucalypt.app? directory
13
- unless %w[production development test].include? env
13
+ unless %w[p production d development t test].include? env
14
14
  Out.error "Invalid Rack environment #{env.colorize(:bold)}"
15
15
  return
16
16
  end
@@ -22,6 +22,8 @@ module Eucalypt
22
22
  cmd.gsub!('rerun', 'rerun -q') if options[:quiet]
23
23
  end
24
24
 
25
+ env = map_env env
26
+
25
27
  puts "Running command: #{cmd.colorize(:bold)}"
26
28
  puts "Rack environment: #{env.colorize(:bold)}"
27
29
  exec "env RACK_ENV=#{env} #{cmd}"
@@ -29,5 +31,16 @@ module Eucalypt
29
31
  Eucalypt::Error.wrong_directory
30
32
  end
31
33
  end
34
+
35
+ no_tasks do
36
+ def map_env(env)
37
+ case env
38
+ when ?p then 'production'
39
+ when ?d then 'development'
40
+ when ?t then 'test'
41
+ else env
42
+ end
43
+ end
44
+ end
32
45
  end
33
46
  end
@@ -1,21 +1,21 @@
1
1
  class ApplicationController < Sinatra::Base
2
- configure :development do
3
- set :logger, Lumberjack::Logger.new
4
- end
5
-
6
- configure :test do
7
- set :logger, Lumberjack::Logger.new
8
- end
2
+ set :logger, Lumberjack::Logger.new
9
3
 
10
4
  configure :production do
11
- log_name = Time.now.strftime("server-start_%Y-%m-%dT%H-%M-%S_%z").sub(/_\+/,'_p').sub(/_\-/,'_m')
12
- log_file_path = Eucalypt.path 'log', "#{log_name}.log"
13
- set :logger, Lumberjack::Logger.new
5
+ require 'fileutils'
14
6
  use Rack::CommonLogger, $stdout
15
- log = File.new log_file_path, "a+"
16
- $stdout.reopen log
17
- $stderr.reopen log
7
+
8
+ log_path = Eucalypt.path 'log', Time.now.strftime("%Y-%m-%dT%H-%M-%S_%z").sub(/_\+/, ?p).sub(/_\-/, ?m)
9
+ FileUtils.mkdir_p log_path
10
+
11
+ # STDERR logger
12
+ stderr_log = File.new File.join(log_path, 'stderr.log'), 'a+'
13
+ $stderr.reopen stderr_log
18
14
  $stderr.sync = true
15
+
16
+ # STDOUT logger
17
+ stdout_log = File.new File.join(log_path, 'stdout.log'), 'a+'
18
+ $stdout.reopen stdout_log
19
19
  $stdout.sync = true
20
20
  end
21
21
 
@@ -1,3 +1,3 @@
1
1
  module Eucalypt
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eucalypt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Edwin Onuonga
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-16 00:00:00.000000000 Z
11
+ date: 2018-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -344,10 +344,11 @@ files:
344
344
  - lib/eucalypt/list.rb
345
345
  - lib/eucalypt/static.rb
346
346
  - lib/eucalypt/version.rb
347
- homepage:
347
+ homepage: https://gum.gitbook.io/eucalypt
348
348
  licenses:
349
349
  - MIT
350
350
  metadata:
351
+ documentation_uri: https://gum.gitbook.io/eucalypt
351
352
  source_code_uri: https://github.com/eucalypt/eucalypt/
352
353
  post_install_message:
353
354
  rdoc_options: []