appinsights 0.0.3 → 0.0.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 +4 -4
- data/README.md +17 -1
- data/lib/appinsights.rb +6 -3
- data/lib/appinsights/installers/cuba.rb +22 -0
- data/lib/appinsights/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c026bac9394fb6235e8a4c0130a220d2d3d53363
|
4
|
+
data.tar.gz: 0c7ad2bccdbdaccf83f2493cecabf54eedfed853
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d23cb5cb6d1efe4a3be92e529a6249aa3a3651f8ef93e1dd3d32cc433eecc1f27c73fed186a5e51037dff936da195fbd2da4d7b0b71b7a515944571b0915f47
|
7
|
+
data.tar.gz: a6ca88d7249b66ce05435ce858423bba926f47c48b16ac985eca84c84a5a022fd0b6be0659c25888f0ac775a8eb439df08ce775cd45a3941a7b6dd9f5be0151f
|
data/README.md
CHANGED
@@ -52,10 +52,26 @@ There is nothing else to do.
|
|
52
52
|
|
53
53
|
Add the following line in your _sinatra application file_:
|
54
54
|
|
55
|
-
|
55
|
+
```ruby
|
56
|
+
require 'appinsights'
|
57
|
+
```
|
56
58
|
|
57
59
|
> NOTE: Ensure that `sinatra` was required first.
|
58
60
|
|
61
|
+
### Cuba
|
62
|
+
|
63
|
+
`cuba` is similar to `sinatra` but it requires one more line to configure it.
|
64
|
+
Since a `cuba` application does not keep the root path of the application we
|
65
|
+
have to specify it to read the config file and complete the installation.
|
66
|
+
Given this is a common framework, there is a one-step-installation line:
|
67
|
+
|
68
|
+
```ruby
|
69
|
+
require 'appinsights'
|
70
|
+
|
71
|
+
# Accepts the root path of the application and an optional file name
|
72
|
+
AppInsights::CubaInstaller.init File.dirname(__FILE__)
|
73
|
+
```
|
74
|
+
|
59
75
|
## Manual
|
60
76
|
|
61
77
|
Choosing a _Manual_ configuration is for those who have an application using a
|
data/lib/appinsights.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'logger'
|
1
2
|
require_relative 'appinsights/errors'
|
2
3
|
require_relative 'appinsights/context'
|
3
4
|
require_relative 'appinsights/middlewares'
|
@@ -5,14 +6,16 @@ require_relative 'appinsights/config_loader'
|
|
5
6
|
require_relative 'appinsights/installers/base'
|
6
7
|
|
7
8
|
module AppInsights
|
9
|
+
logger = Logger.new STDOUT
|
10
|
+
|
8
11
|
if defined?(Rails::VERSION)
|
9
12
|
require_relative 'appinsights/installers/rails'
|
10
13
|
elsif defined?(Sinatra::VERSION)
|
11
14
|
require_relative 'appinsights/installers/sinatra'
|
15
|
+
elsif defined?(Cuba::VERSION)
|
16
|
+
require_relative 'appinsights/installers/cuba'
|
17
|
+
logger.info AppInsights::CubaInstaller.installation_message
|
12
18
|
else
|
13
|
-
require 'logger'
|
14
|
-
|
15
|
-
logger = Logger.new STDOUT
|
16
19
|
logger.info <<-EOS
|
17
20
|
Framework unknown, auto installation suspended.
|
18
21
|
Use AppInsights::BaseInstaller.new app, root, filename
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require_relative 'base'
|
2
|
+
|
3
|
+
module AppInsights
|
4
|
+
class CubaInstaller
|
5
|
+
def self.init(root, filename = nil)
|
6
|
+
installer = AppInsights::BaseInstaller.new Cuba.app, root, filename
|
7
|
+
installer.install
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.installation_message
|
11
|
+
<<-EOS
|
12
|
+
Cuba framework does not keep the root path of the application.
|
13
|
+
The automatic installation can not continue. Please configure by your own
|
14
|
+
using the following code or doing a manual installation:
|
15
|
+
|
16
|
+
AppInsights::CubaInstaller.init application_root_path
|
17
|
+
|
18
|
+
EOS
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
data/lib/appinsights/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appinsights
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Emiliano Mancuso
|
@@ -72,6 +72,7 @@ files:
|
|
72
72
|
- lib/appinsights/context.rb
|
73
73
|
- lib/appinsights/errors.rb
|
74
74
|
- lib/appinsights/installers/base.rb
|
75
|
+
- lib/appinsights/installers/cuba.rb
|
75
76
|
- lib/appinsights/installers/rails.rb
|
76
77
|
- lib/appinsights/installers/sinatra.rb
|
77
78
|
- lib/appinsights/middlewares.rb
|