wire-framework 0.1.6.3 → 0.1.6.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 936b7936fa2772c8e644c66d0dbcb91752a0bb9c
4
- data.tar.gz: d1067151867e7f063f24dfef5dbd26ed56087cba
3
+ metadata.gz: 7d8930ca50a8bf6237ede80003ee158fc30c1b2a
4
+ data.tar.gz: f12766c644b4d2d1b13edf53471750d96aecf541
5
5
  SHA512:
6
- metadata.gz: e13a6cc4395e4e740d011ae507cf90528e2ab1324633982c83f10dba81c13dc9627b08e8c30b78eb0339599fbf2402c01310cd994b72ddd662043681b6fa5f16
7
- data.tar.gz: 65a54308657a697e07f18215c68b88c8d2b3c5e8df5579243b562713791a29c2304691a3ca13b4ba301d1e711a687314fdde83e0593c34656de1af3efd24e204
6
+ metadata.gz: d0a33fe23a61707bb407fedc016a74d66755bd3608d911c52782a16ad75cf4cdcc12991c7272fc55b322d31522e12ff271f9dfe5ed120d93eda1ee92e114b76a
7
+ data.tar.gz: 200e0be6eeab670222e5ba0926d988a7fdbf9fe130e77cd622339a5ceabd99105469fe2db94159e9fbfa384c400fcc778881b224ed36d1206a2b4fedaccbb374
data/README.md CHANGED
@@ -7,7 +7,7 @@ Wire is a DSL and Rack interface for quickly building web applications, without
7
7
 
8
8
  ## License
9
9
 
10
- Copyright 2017 Bryan T. Meyers
10
+ Copyright 2017-2018 Bryan T. Meyers
11
11
 
12
12
  Licensed under the Apache License, Version 2.0 (the "License");
13
13
  you may not use this file except in compliance with the License.
data/lib/app.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  ##
2
- # Copyright 2017 Bryan T. Meyers
2
+ # Copyright 2017-2018 Bryan T. Meyers
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
data/lib/app/cache.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  ##
2
- # Copyright 2017 Bryan T. Meyers
2
+ # Copyright 2017-2018 Bryan T. Meyers
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
data/lib/app/db.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  ##
2
- # Copyright 2017 Bryan T. Meyers
2
+ # Copyright 2017-2018 Bryan T. Meyers
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -45,7 +45,7 @@ module DB
45
45
  # Read all of the configs in './config/dbs'
46
46
  # @return [void]
47
47
  def self.read_configs
48
- Wire::Config.read_config_dir('config/dbs', method(:init_db))
48
+ Wire::Config.read_config_dir('./config/dbs', method(:init_db))
49
49
  end
50
50
 
51
51
  # Add a new object to the DB table
data/lib/app/file.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  ##
2
- # Copyright 2017 Bryan T. Meyers
2
+ # Copyright 2017-2018 Bryan T. Meyers
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
data/lib/app/history.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  ##
2
- # Copyright 2017 Bryan T. Meyers
2
+ # Copyright 2017-2018 Bryan T. Meyers
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  ##
2
- # Copyright 2017 Bryan T. Meyers
2
+ # Copyright 2017-2018 Bryan T. Meyers
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
data/lib/app/login.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  ##
2
- # Copyright 2017 Bryan T. Meyers
2
+ # Copyright 2017-2018 Bryan T. Meyers
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
data/lib/app/render.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  ##
2
- # Copyright 2017 Bryan T. Meyers
2
+ # Copyright 2017-2018 Bryan T. Meyers
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  ##
2
- # Copyright 2017 Bryan T. Meyers
2
+ # Copyright 2017-2018 Bryan T. Meyers
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  ##
2
- # Copyright 2017 Bryan T. Meyers
2
+ # Copyright 2017-2018 Bryan T. Meyers
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  ##
2
- # Copyright 2017 Bryan T. Meyers
2
+ # Copyright 2017-2018 Bryan T. Meyers
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  ##
2
- # Copyright 2017 Bryan T. Meyers
2
+ # Copyright 2017-2018 Bryan T. Meyers
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  ##
2
- # Copyright 2017 Bryan T. Meyers
2
+ # Copyright 2017-2018 Bryan T. Meyers
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  ##
2
- # Copyright 2017 Bryan T. Meyers
2
+ # Copyright 2017-2018 Bryan T. Meyers
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  ##
2
- # Copyright 2017 Bryan T. Meyers
2
+ # Copyright 2017-2018 Bryan T. Meyers
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
data/lib/app/repo.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  ##
2
- # Copyright 2017 Bryan T. Meyers
2
+ # Copyright 2017-2018 Bryan T. Meyers
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
data/lib/app/repo/svn.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  ##
2
- # Copyright 2017 Bryan T. Meyers
2
+ # Copyright 2017-2018 Bryan T. Meyers
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
data/lib/closet.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  ##
2
- # Copyright 2017 Bryan T. Meyers
2
+ # Copyright 2017-2018 Bryan T. Meyers
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -35,11 +35,15 @@ module Wire
35
35
  # @return [Wire::Closet] the new closet
36
36
  def initialize
37
37
  @mode = ENV['RACK_ENV']
38
+ if @mode.nil? or @mode.empty?
39
+ @mode = 'production'
40
+ end
38
41
  if @mode.eql? 'development'
39
42
  $stderr.puts 'Starting Up Wire...'
40
43
  $stderr.puts 'Reading Environment Config...'
41
44
  end
42
- @env = Wire::Config.read_config_dir('./config/env', nil)[@mode]
45
+ configs = Wire::Config.read_config_dir('./config/env', nil)
46
+ @env = configs[@mode]
43
47
  if @mode.eql? 'development'
44
48
  $stderr.puts 'Reading DB Configs...'
45
49
  end
@@ -81,13 +85,15 @@ module Wire
81
85
  # @param [Hash] env the Rack environment
82
86
  # @return [Response] a Rack Response triplet, or status code
83
87
  def call(env)
88
+ headers = {}
84
89
  begin
85
90
  context = Wire::Context.new(self, env)
86
91
  response = route(context)
87
92
  rescue Exception => e
88
93
  $stderr.puts e.message
89
94
  $stderr.puts e.backtrace
90
- response = [500, {}, e.message]
95
+ $stderr.flush
96
+ response = [500, headers, e.message + "\n" + e.backtrace]
91
97
  end
92
98
  if response.is_a? Array
93
99
  if response[2] and not response[2].is_a? Array
@@ -95,9 +101,9 @@ module Wire
95
101
  end
96
102
  else
97
103
  if response.is_a? Integer
98
- response = [response, {}, []]
104
+ response = [response, headers, []]
99
105
  else
100
- response = [200, {}, [response]]
106
+ response = [200, headers, [response]]
101
107
  end
102
108
  end
103
109
  response
@@ -124,4 +130,4 @@ module Wire
124
130
  end
125
131
  end
126
132
  end
127
- end
133
+ end
data/lib/closet/auth.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  ##
2
- # Copyright 2017 Bryan T. Meyers
2
+ # Copyright 2017-2018 Bryan T. Meyers
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
data/lib/closet/config.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  ##
2
- # Copyright 2017 Bryan T. Meyers
2
+ # Copyright 2017-2018 Bryan T. Meyers
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -31,4 +31,4 @@ module Wire
31
31
  configs
32
32
  end
33
33
  end
34
- end
34
+ end
@@ -1,5 +1,5 @@
1
1
  ##
2
- # Copyright 2017 Bryan T. Meyers
2
+ # Copyright 2017-2018 Bryan T. Meyers
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -109,11 +109,13 @@ module Wire
109
109
  throw Exception.new("App: #{@uri[1]} is Undefined")
110
110
  end
111
111
  @query = {}
112
- env['QUERY_STRING'].split('&').each do |q|
113
- param = q.split('=')
114
- @query[param[0].to_sym] = param[1]
112
+ if env['QUERY_STRING']
113
+ env['QUERY_STRING'].split('&').each do |q|
114
+ param = q.split('=')
115
+ @query[param[0].to_sym] = param[1]
116
+ end
115
117
  end
116
- @query_string = env['QUERY_STRING']
118
+ @query_string = env['QUERY_STRING'] ? env['QUERY_STRING'] : ""
117
119
  if env['rack.input']
118
120
  @body = env['rack.input'].read
119
121
  begin
@@ -151,4 +153,4 @@ module Wire
151
153
  RL.request verb, URI.escape(uri), headers, body
152
154
  end
153
155
  end
154
- end
156
+ end
@@ -1,5 +1,5 @@
1
1
  ##
2
- # Copyright 2017 Bryan T. Meyers
2
+ # Copyright 2017-2018 Bryan T. Meyers
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
data/lib/wire.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  ##
2
- # Copyright 2017 Bryan T. Meyers
2
+ # Copyright 2017-2018 Bryan T. Meyers
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License");
5
5
  # you may not use this file except in compliance with the License.
@@ -33,7 +33,7 @@ end
33
33
  # @author Bryan T. Meyers
34
34
  module Wire
35
35
  # Current version of the Wire Gem
36
- VERSION = '0.1.6.3'
36
+ VERSION = '0.1.6.4'
37
37
  end
38
38
 
39
39
  require_relative 'app'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wire-framework
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6.3
4
+ version: 0.1.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bryan T. Meyers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-31 00:00:00.000000000 Z
11
+ date: 2018-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: awesome_print