appinsights 0.0.3 → 0.0.4

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
  SHA1:
3
- metadata.gz: 9d20dcc9f60a001f8ace5c97f9e9cb8157c0a9de
4
- data.tar.gz: 83e30a63ca45290f6089ca93a221a67b85908307
3
+ metadata.gz: c026bac9394fb6235e8a4c0130a220d2d3d53363
4
+ data.tar.gz: 0c7ad2bccdbdaccf83f2493cecabf54eedfed853
5
5
  SHA512:
6
- metadata.gz: ff7a702005292eaa2e6d2e8dbc6ff960c8cfe82c1905d2a9f642e48418d501a0fe1d58980d2a3a978c539661071c07b9975cc4ef6acee48f5645647bdd7f0137
7
- data.tar.gz: 969fa848c73a60da51faec3ffb187082f5598bda75ac607cc8590757a3c9684b3a1d30a851b5f91bd50c4e42f55a990494dd23278e469602464e96d86d7ae360
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
- require 'appinsights'
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
@@ -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
+
@@ -1,3 +1,3 @@
1
1
  module AppInsights
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
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.3
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