wire-framework 0.1.3.7 → 0.1.3.8
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 +4 -4
- data/lib/app/render.rb +5 -5
- data/lib/app.rb +4 -2
- data/lib/closet/resource.rb +3 -1
- data/lib/closet.rb +17 -12
- data/lib/wire.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07f9ae453548fdc58086c388d49ac7379d4ea274
|
4
|
+
data.tar.gz: b13ec4a5f75e06eb422bf0659ea1fe6350c4477e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b08838a1c9f11894b0a8dc04054ce3dc29fe897664bb66b0ba8a755ffd2cbb5be58c1c55056286d85220689f4e0e942a529a3d45a4a2c72d34be17956707505a
|
7
|
+
data.tar.gz: 1e48b1518f91031e9d18553d91f9374fad6931b8cc609a17658737ffc1b769f55943c8390ac1afdd2d699b3a3e27224f0826b6da7c39e371a6d202bebd281113
|
data/lib/app/render.rb
CHANGED
@@ -100,19 +100,19 @@ module Render
|
|
100
100
|
headers = {referer: referer, remote_user: context.user}
|
101
101
|
case (method)
|
102
102
|
when :create
|
103
|
-
puts "POST: Forward Request to https://#{host}/#{path}/#{resource}#{q}"
|
103
|
+
$stderr.puts "POST: Forward Request to https://#{host}/#{path}/#{resource}#{q}"
|
104
104
|
RestClient.post "http://#{host}/#{path}/#{resource}#{q}", context.body, headers
|
105
105
|
when :update
|
106
|
-
puts "PUT: Forward Request to https://#{host}/#{path}/#{resource}/#{id}#{q}"
|
106
|
+
$stderr.puts "PUT: Forward Request to https://#{host}/#{path}/#{resource}/#{id}#{q}"
|
107
107
|
RestClient.put "http://#{host}/#{path}/#{resource}/#{id}#{q}", context.body , headers
|
108
108
|
when :readAll
|
109
|
-
puts "GET: Forward Request to https://#{host}/#{path}/#{resource}#{q}"
|
109
|
+
$stderr.puts "GET: Forward Request to https://#{host}/#{path}/#{resource}#{q}"
|
110
110
|
RestClient.get "http://#{host}/#{path}/#{resource}#{q}", headers
|
111
111
|
when :read
|
112
|
-
puts "GET: Forward Request to https://#{host}/#{path}/#{resource}/#{id}#{q}"
|
112
|
+
$stderr.puts "GET: Forward Request to https://#{host}/#{path}/#{resource}/#{id}#{q}"
|
113
113
|
RestClient.get "http://#{host}/#{path}/#{resource}/#{id}#{q}", headers
|
114
114
|
when :delete
|
115
|
-
puts "DELETE: Forward Request to https://#{host}/#{path}/#{resource}/#{id}#{q}"
|
115
|
+
$stderr.puts "DELETE: Forward Request to https://#{host}/#{path}/#{resource}/#{id}#{q}"
|
116
116
|
RestClient.delete "http://#{host}/#{path}/#{resource}/#{id}#{q}" , headers
|
117
117
|
else
|
118
118
|
401
|
data/lib/app.rb
CHANGED
@@ -12,8 +12,10 @@ module Wire
|
|
12
12
|
$current_uri = base_uri
|
13
13
|
$apps[base_uri] = { type: type, resources: {} }
|
14
14
|
$current_app = $apps[base_uri]
|
15
|
-
|
16
|
-
|
15
|
+
if ENV['RACK_ENV'].eql? 'development'
|
16
|
+
$stderr.puts "Starting App at: /#{base_uri}"
|
17
|
+
$stderr.puts 'Setting up resources...'
|
18
|
+
end
|
17
19
|
Docile.dsl_eval(type, &block)
|
18
20
|
end
|
19
21
|
end
|
data/lib/closet/resource.rb
CHANGED
@@ -11,7 +11,9 @@ module Wire
|
|
11
11
|
def resource(uri, &block)
|
12
12
|
$current_app[:resources][uri] = {}
|
13
13
|
$current_resource = $current_app[:resources][uri]
|
14
|
-
|
14
|
+
if ENV['RACK_ENV'].eql? 'development'
|
15
|
+
$stderr.puts "Starting Resource At: /#{$current_uri + '/' + uri}"
|
16
|
+
end
|
15
17
|
Docile.dsl_eval(self, &block)
|
16
18
|
end
|
17
19
|
end
|
data/lib/closet.rb
CHANGED
@@ -45,8 +45,9 @@ module Wire
|
|
45
45
|
context = Wire::Context.new(env)
|
46
46
|
response = route(context)
|
47
47
|
rescue Exception => e
|
48
|
+
$stderr.puts e.message
|
48
49
|
$stderr.puts e.backtrace
|
49
|
-
response = [
|
50
|
+
response = [500, {}, e.message]
|
50
51
|
end
|
51
52
|
if response.is_a? Array
|
52
53
|
if response[2]
|
@@ -69,31 +70,35 @@ module Wire
|
|
69
70
|
# @return [Wire::Closet] the configured Closet
|
70
71
|
def self.build(&block)
|
71
72
|
closet = Wire::Closet.new
|
72
|
-
|
73
|
-
|
73
|
+
if ENV['RACK_ENV'].eql? 'development'
|
74
|
+
$stderr.puts 'Starting Up Wire...'
|
75
|
+
$stderr.puts 'Starting Apps...'
|
76
|
+
end
|
74
77
|
Docile.dsl_eval(closet, &block)
|
75
|
-
|
78
|
+
if ENV['RACK_ENV'].eql? 'development'
|
79
|
+
closet.info
|
80
|
+
end
|
76
81
|
closet
|
77
82
|
end
|
78
83
|
|
79
84
|
# Print out a human-readable configuration
|
80
85
|
# @return [void]
|
81
86
|
def info
|
82
|
-
puts "Apps:\n"
|
87
|
+
$stderr.puts "Apps:\n"
|
83
88
|
$apps.each do |app, config|
|
84
|
-
puts "\u{2502}"
|
85
|
-
puts "\u{251c} Name: #{app}"
|
89
|
+
$stderr.puts "\u{2502}"
|
90
|
+
$stderr.puts "\u{251c} Name: #{app}"
|
86
91
|
if config[:auth]
|
87
|
-
puts "\u{2502}\t\u{251c} Auth:"
|
92
|
+
$stderr.puts "\u{2502}\t\u{251c} Auth:"
|
88
93
|
if config[:auth][:level] == :app
|
89
|
-
puts "\u{2502}\t\u{2502}\t\u{251c} Level:\t#{config[:auth][:level]}"
|
90
|
-
puts "\u{2502}\t\u{2502}\t\u{2514} Handler:\t#{config[:auth][:handler]}"
|
94
|
+
$stderr.puts "\u{2502}\t\u{2502}\t\u{251c} Level:\t#{config[:auth][:level]}"
|
95
|
+
$stderr.puts "\u{2502}\t\u{2502}\t\u{2514} Handler:\t#{config[:auth][:handler]}"
|
91
96
|
else
|
92
|
-
puts "\u{2502}\t\u{2502}\t\u{2514} Level:\t#{config[:auth][:level]}"
|
97
|
+
$stderr.puts "\u{2502}\t\u{2502}\t\u{2514} Level:\t#{config[:auth][:level]}"
|
93
98
|
end
|
94
99
|
end
|
95
100
|
if config[:type]
|
96
|
-
puts "\u{2502}\t\u{2514} Type: #{config[:type]}"
|
101
|
+
$stderr.puts "\u{2502}\t\u{2514} Type: #{config[:type]}"
|
97
102
|
end
|
98
103
|
end
|
99
104
|
end
|
data/lib/wire.rb
CHANGED