sinatra-hexacta 1.3.0 → 1.4.0

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
  SHA256:
3
- metadata.gz: 2f0b5543f96de1b88e37c6eaf7bc8cfcf61a3419fda741a9597f333a49f4ec1b
4
- data.tar.gz: 4224a9d29c78106f70fcef411891a9d54efbe62025becd73201d0740198e4d20
3
+ metadata.gz: 22856830fec4131abdb9b5038fc1e6862c053e11e1e0e47a90d238340512a678
4
+ data.tar.gz: 02adea101a40283d74e4f557b813db101e971fb02331e59d802bcfe2775164ad
5
5
  SHA512:
6
- metadata.gz: e22aa655547b0c55ab14163e7043dbf4e4fee7d321d51e99ccc7823dff01cda2139df7fd7fc7b68d51f999453239fc199d7af663109ab32283d5069e1c1ab473
7
- data.tar.gz: 885f0a1b6b4d3324217067cee4e976b25a967e7888b8ce5404c9a46c80c3e1faef444462bc409f1b85836f598d877b491633f1443cedca776858a47a3bd26d52
6
+ metadata.gz: a62841ea84938b005e46aa7fe7b78900f525cf09a00f3c33b9cb000406401a6b85ff8f2a0c5acab54880b05f27f7d75a473cc9c36f8ae12ad5e3939645537489
7
+ data.tar.gz: c5af975ac9d455609eca202196decc3dd5efa9e703e9a5f8cec16ac6491e3adb6b7bfaab9226953cb3ec19de964c3b3ae34495edd7e4643987f5eb5bde24df96
@@ -0,0 +1,22 @@
1
+ # encoding: utf-8
2
+ module Sinatra
3
+ module CrossOriginHandler
4
+ extend Hexacta
5
+
6
+ def enable_cross_origin
7
+ p "Enabling cross origin..."
8
+
9
+ configure do
10
+ enable :cross_origin
11
+ end
12
+
13
+ before do
14
+ response.headers['Access-Control-Allow-Origin'] = 'http://*.hexacta.com https://*.hexacta.com'
15
+ end
16
+
17
+ end
18
+
19
+ end
20
+ register CrossOriginHandler
21
+ end
22
+
@@ -6,3 +6,4 @@ require_relative 'reports'
6
6
  require_relative 'processes'
7
7
  require_relative 'constants'
8
8
  require_relative 'user_configurations'
9
+ require_relative 'cross_origin'
@@ -14,7 +14,6 @@ module Sinatra
14
14
  p "Setting up user configurations directory..."
15
15
  setup_dir("/app/views/#{Hexacta::GEM_FILE_DIR}/user_configurations")
16
16
  copy_all_files("/lib/sinatra/views/user_configurations","/app/views/#{Hexacta::GEM_FILE_DIR}/user_configurations")
17
-
18
17
  end
19
18
 
20
19
  helpers UserConfigurationHelper
@@ -1,5 +1,6 @@
1
1
  # encoding: utf-8
2
2
  require 'sinatra/base'
3
+ require 'sinatra/cross_origin'
3
4
  require 'fileutils'
4
5
  require 'sucker_punch'
5
6
  require 'rufus-scheduler'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra-hexacta
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marco Zanger
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: 0.0.4
69
+ - !ruby/object:Gem::Dependency
70
+ name: sinatra-cross_origin
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 0.3.1
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 0.3.1
69
83
  description: A gem to support general functionality accross all apps
70
84
  email: mzanger@hexacta.com
71
85
  executables: []
@@ -84,6 +98,7 @@ files:
84
98
  - lib/sinatra/extensions/notification.rb
85
99
  - lib/sinatra/extensions/processmanager.rb
86
100
  - lib/sinatra/handlers/constants.rb
101
+ - lib/sinatra/handlers/cross_origin.rb
87
102
  - lib/sinatra/handlers/errors.rb
88
103
  - lib/sinatra/handlers/init.rb
89
104
  - lib/sinatra/handlers/notifications.rb