lws 0.4.2 → 6.1.0.beta1
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/README.rdoc +4 -2
- data/bin/lwsconsole +32 -35
- data/lib/lws/auth.rb +425 -152
- data/lib/lws/corporate_website.rb +186 -68
- data/lib/lws/digital_signage.rb +1796 -0
- data/lib/lws/generic.rb +46 -50
- data/lib/lws/maps.rb +84 -38
- data/lib/lws/presence.rb +93 -73
- data/lib/lws/stubbing.rb +2 -2
- data/lib/lws/ticket.rb +230 -177
- data/lib/lws/version.rb +2 -2
- data/lib/lws.rb +66 -25
- data/lws.gemspec +3 -2
- data/test/api_token_middleware_test.rb +4 -4
- data/test/auth_test.rb +95 -8
- data/test/corporate_website_test.rb +44 -2
- data/test/digital_signage_test.rb +829 -0
- data/test/fixtures/auth.yml +4 -1
- data/test/fixtures/permissions.yml +0 -4
- data/test/generic_test.rb +0 -17
- data/test/json_parser_test.rb +57 -0
- data/test/logger_test.rb +2 -1
- data/test/maps_test.rb +22 -1
- data/test/presence_test.rb +18 -18
- data/test/setup_test.rb +5 -0
- data/test/stubbing_test.rb +4 -2
- data/test/test_helper.rb +3 -2
- data/test/ticket_test.rb +59 -44
- metadata +43 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b11d23c335c4b23d73d44dc4da82d94efcc3d73f
|
4
|
+
data.tar.gz: 86e4b3e6ea6c9e9113d6f5bbda0202bab47b0c32
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ce4f6fa7a5c48d92ce9c7924148944268f850c6133fad6219d2ff616387768a227e19d17d9561f7fa9f99cbefd95a943f976761822333023887a1ef54a54106c
|
7
|
+
data.tar.gz: 8a523b327b062c967210d47ab5d4bfea17978c9404bf9d47f18aaf3cee6f428d9b5009c325c45b0c6daa5b53da088bdc2ad39cc743d1903b4774f816b7954ff8
|
data/README.rdoc
CHANGED
@@ -69,5 +69,7 @@ runtime determined API token as value, for example:
|
|
69
69
|
|
70
70
|
end
|
71
71
|
|
72
|
-
The +LC_LWS_ENV+
|
73
|
-
Allowed values are "production" (default) and "development".
|
72
|
+
The +LC_LWS_ENV+ environment variable is supported to override the LWS
|
73
|
+
environment. Allowed values are "production" (default) and "development".
|
74
|
+
The +LC_LWS_API_TOKEN+ is supported to set the LWS API token default.
|
75
|
+
This only works if not a custom API token middleware is used.
|
data/bin/lwsconsole
CHANGED
@@ -4,36 +4,10 @@
|
|
4
4
|
#
|
5
5
|
# Usage: lwsconsole <LWS API token> [<app>:<endpoint> ...]
|
6
6
|
|
7
|
-
require "irb"
|
8
7
|
require "logger"
|
9
8
|
require "lws"
|
10
9
|
require "pp"
|
11
|
-
|
12
|
-
# Module to allow for start an interfactive session at any point
|
13
|
-
# in a Ruby program.
|
14
|
-
# Source: http://jasonroelofs.com/2009/04/02/embedding-irb-into-your-ruby-application/
|
15
|
-
module IRB
|
16
|
-
def self.start_session(binding)
|
17
|
-
unless @__initialized
|
18
|
-
args = ARGV
|
19
|
-
ARGV.replace(ARGV.dup)
|
20
|
-
IRB.setup(nil)
|
21
|
-
ARGV.replace(args)
|
22
|
-
@__initialized = true
|
23
|
-
end
|
24
|
-
|
25
|
-
workspace = WorkSpace.new(binding)
|
26
|
-
|
27
|
-
irb = Irb.new(workspace)
|
28
|
-
|
29
|
-
@CONF[:IRB_RC].call(irb.context) if @CONF[:IRB_RC]
|
30
|
-
@CONF[:MAIN_CONTEXT] = irb.context
|
31
|
-
|
32
|
-
catch(:IRB_EXIT) do
|
33
|
-
irb.eval_input
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
10
|
+
require "pry"
|
37
11
|
|
38
12
|
# Parse the command-line arguments
|
39
13
|
if ARGV.length < 1
|
@@ -51,10 +25,11 @@ end
|
|
51
25
|
logger = Logger.new($stdout)
|
52
26
|
logger.level = Logger::DEBUG
|
53
27
|
logger.progname = "LWSConsole"
|
54
|
-
logger.formatter =
|
55
|
-
|
56
|
-
|
57
|
-
|
28
|
+
logger.formatter =
|
29
|
+
proc do |sev, datetime, progname, msg|
|
30
|
+
dt_fmt = logger.datetime_format || "%F %X"
|
31
|
+
"#{datetime.strftime(dt_fmt)} #{progname}(#$$) [#{sev}]: #{msg}\n"
|
32
|
+
end
|
58
33
|
|
59
34
|
# Set up the API
|
60
35
|
LWS.setup do |config|
|
@@ -65,11 +40,33 @@ LWS.setup do |config|
|
|
65
40
|
config.logger = logger
|
66
41
|
end
|
67
42
|
|
43
|
+
### Extra commands/methods
|
44
|
+
|
45
|
+
# Enables/disables HTTP debugging based
|
46
|
+
def http_debug(value)
|
47
|
+
LWS.config.http_debug = !!value
|
48
|
+
reload!
|
49
|
+
LWS.config.http_debug
|
50
|
+
end
|
51
|
+
|
52
|
+
# Enables/disables showing headers in the HTTP debugging information
|
53
|
+
def http_debug_headers(value)
|
54
|
+
LWS.config.http_debug_headers = !!value
|
55
|
+
reload!
|
56
|
+
LWS.config.http_debug_headers
|
57
|
+
end
|
58
|
+
|
59
|
+
# Enables/disables JSON object debugging
|
60
|
+
def json_debug(value)
|
61
|
+
LWS.config.json_debug = !!value
|
62
|
+
reload!
|
63
|
+
LWS.config.json_debug
|
64
|
+
end
|
65
|
+
|
66
|
+
# Reloads all app modules
|
68
67
|
def reload!
|
69
68
|
LWS.load_app_modules
|
70
69
|
end
|
71
70
|
|
72
|
-
# Use the LWS module as default namespace
|
73
|
-
|
74
|
-
|
75
|
-
IRB.start_session(binding)
|
71
|
+
# Use the LWS module as the default namespace
|
72
|
+
LWS.pry
|