jasper-core 0.0.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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 5da46e6bfc2ac4aa770d10a1202fe27baff8afa8
4
+ data.tar.gz: 64a28d897c6455d2344bf214427e3982082cd363
5
+ SHA512:
6
+ metadata.gz: 2fba350584535408a72961ce38bae1fb8ec39c95a3cf0e0fbfe2371dec9f50dd55eb550f19142bd3e901cf448e9a77f94837c4d1187f4b63f88dedbae86a29bd
7
+ data.tar.gz: b93990ee3ce75b1c6ebea4987bb613df1721562a7cd8f520498f61bd40c77b22a1d4a41d9fc72c87a5bce23425a1e9e0256d907f8fa0acfc30c74c73e1ecbfd2
data/LICENSE ADDED
@@ -0,0 +1,27 @@
1
+ Copyright (c) 2015, MediariuM Ltd.
2
+ All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without modification,
5
+ are permitted provided that the following conditions are met:
6
+
7
+ 1. Redistributions of source code must retain the above copyright notice,
8
+ this list of conditions and the following disclaimer.
9
+
10
+ 2. Redistributions in binary form must reproduce the above copyright notice,
11
+ this list of conditions and the following disclaimer in the documentation
12
+ and/or other materials provided with the distribution.
13
+
14
+ 3. Neither the name of the copyright holder nor the names of its contributors
15
+ may be used to endorse or promote products derived from this software
16
+ without specific prior written permission.
17
+
18
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21
+ IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
22
+ INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23
+ BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
25
+ OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
26
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
27
+ OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,3 @@
1
+ = Jasper Core
2
+
3
+ The bare bones necessary for Jasper (Video Management System).
@@ -0,0 +1 @@
1
+ Jasper::Core::Engine.draw_routes
@@ -0,0 +1,10 @@
1
+ require 'jasper/core/engine'
2
+ require 'jasper/core/routes'
3
+
4
+ module Jasper
5
+ module Core
6
+
7
+ # TODO: ...
8
+
9
+ end
10
+ end
@@ -0,0 +1,11 @@
1
+ module Jasper
2
+ module Core
3
+ class Engine < ::Rails::Engine
4
+ isolate_namespace Jasper
5
+ engine_name 'jasper_core'
6
+
7
+ # TODO: ...
8
+
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,19 @@
1
+ module Jasper
2
+ module Core
3
+
4
+ # Returns the version of the currently loaded Jasper as a <tt>Gem::Version</tt>
5
+ def self.gem_version
6
+ Gem::Version.new VERSION::STRING
7
+ end
8
+
9
+ module VERSION
10
+ MAJOR = 0
11
+ MINOR = 0
12
+ TINY = 8
13
+ PRE = nil
14
+
15
+ STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
16
+ end
17
+
18
+ end
19
+ end
@@ -0,0 +1,52 @@
1
+ module Jasper
2
+ module Core
3
+ class Engine < ::Rails::Engine
4
+
5
+ def self.add_routes(&block)
6
+ @jasper_routes ||= []
7
+
8
+ # Anything that causes the application's routes to be reloaded,
9
+ # will cause this method to be called more than once
10
+ # i.e. https://github.com/plataformatec/devise/blob/31971e69e6a1bcf6c7f01eaaa44f227c4af5d4d2/lib/devise/rails.rb#L14
11
+ # In the case of Devise, this *only* happens in the production env
12
+ # This coupled with Rails 4's insistence that routes are not drawn twice,
13
+ # poses quite a serious problem.
14
+ #
15
+ # This is mainly why this whole file exists in the first place.
16
+ #
17
+ # Thus we need to make sure that the routes aren't drawn twice.
18
+ unless @jasper_routes.include?(block)
19
+ @jasper_routes << block
20
+ end
21
+ end
22
+
23
+ def self.append_routes(&block)
24
+ @append_routes ||= []
25
+
26
+ # See comment in add_routes.
27
+ unless @append_routes.include?(block)
28
+ @append_routes << block
29
+ end
30
+ end
31
+
32
+ def self.draw_routes(&block)
33
+ @jasper_routes ||= []
34
+ @append_routes ||= []
35
+
36
+ eval_block(block) if block_given?
37
+
38
+ @jasper_routes.each { |r| eval_block(&r) }
39
+ @append_routes.each { |r| eval_block(&r) }
40
+
41
+ # # Clear out routes so that they aren't drawn twice.
42
+ @jasper_routes = []
43
+ @append_routes = []
44
+ end
45
+
46
+ def eval_block(&block)
47
+ Jasper::Core::Engine.routes.send :eval_block, block
48
+ end
49
+
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,12 @@
1
+ require 'jasper/core/gem_version'
2
+
3
+ module Jasper
4
+ module Core
5
+
6
+ # Returns the version of the currently loaded Jasper as a string.
7
+ def self.version
8
+ VERSION::STRING
9
+ end
10
+
11
+ end
12
+ end
@@ -0,0 +1 @@
1
+ require 'jasper/core'
metadata ADDED
@@ -0,0 +1,68 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jasper-core
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.8
5
+ platform: ruby
6
+ authors:
7
+ - Alexander Bragin
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-03-28 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '4.2'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '4.2'
27
+ description: Required dependency for Jasper (Video Management System).
28
+ email: bragin-av@mediarium.com
29
+ executables: []
30
+ extensions: []
31
+ extra_rdoc_files: []
32
+ files:
33
+ - LICENSE
34
+ - README.rdoc
35
+ - config/routes.rb
36
+ - lib/jasper/core.rb
37
+ - lib/jasper/core/engine.rb
38
+ - lib/jasper/core/gem_version.rb
39
+ - lib/jasper/core/routes.rb
40
+ - lib/jasper/core/version.rb
41
+ - lib/jasper_core.rb
42
+ homepage: http://jasper-vms.com
43
+ licenses:
44
+ - BSD-3
45
+ metadata: {}
46
+ post_install_message:
47
+ rdoc_options:
48
+ - "--exclude"
49
+ - "."
50
+ require_paths:
51
+ - lib
52
+ required_ruby_version: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: 2.2.1
57
+ required_rubygems_version: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: 1.9.0
62
+ requirements: []
63
+ rubyforge_project:
64
+ rubygems_version: 2.4.5
65
+ signing_key:
66
+ specification_version: 4
67
+ summary: The bare bones necessary for Jasper (Video Management System).
68
+ test_files: []