base_jump 0.0.1

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: a95caa3d63b725356774c63b4641cabb2ca06c2d
4
+ data.tar.gz: 5cc77e96c0b83c86623b9a534f7eafb65ae31dcb
5
+ SHA512:
6
+ metadata.gz: d99ba5420980457c88600f1b818ceedadb3f1c03ca61b1be276d5541504c0379e5059f14174649b1451729e91d9e5a72d5dc984b053fbdf72cb6eeab37a0f810
7
+ data.tar.gz: a963d94ff365dbfcfbef6363a39df7843519b7006c457a5e427fae6c7f6b88f6925d5ba9b03278e9b8ad780856993cf638cc8dff1383d1f8a837fd81744e02e2
Binary file
Binary file
@@ -0,0 +1,8 @@
1
+ lib = File.expand_path('../base_jump', __FILE__)
2
+
3
+ require File.join(lib, 'errors')
4
+ require File.join(lib, 'system')
5
+ require File.join(lib, 'config')
6
+ require File.join(lib, 'environment')
7
+ require File.join(lib, 'core')
8
+ require File.join(lib, 'application')
@@ -0,0 +1,15 @@
1
+ module BaseJump
2
+ module Application
3
+ extend self
4
+
5
+ def init(app)
6
+ raise ApplicationInitializedError.new(Config.app) if Config.app
7
+
8
+ app.extend Environment
9
+
10
+ Config.init app
11
+
12
+ BaseJump.load_environment
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,24 @@
1
+ module BaseJump
2
+ module Config
3
+ extend self
4
+
5
+ attr_accessor :app
6
+ attr_accessor :env_var
7
+
8
+ def init(app)
9
+ @app = app
10
+ set_env_var
11
+ @app.environment = ENV[@env_var]
12
+ end
13
+
14
+ private
15
+
16
+ def set_env_var
17
+ app_name = app.to_s
18
+ index = app_name.index(':') || 0
19
+ app_name = app_name[0..index - 1].upcase
20
+
21
+ @env_var = "#{app_name}_ENV"
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,25 @@
1
+ module BaseJump
2
+ module Core
3
+ extend self
4
+
5
+ def load_environment
6
+ System.dir_glob('config/environments/*.rb').each do |file|
7
+ environment = File.basename(file, '.rb')
8
+ add_environment_method "#{environment}?", environment.to_sym
9
+ end
10
+ end
11
+
12
+ private
13
+
14
+ def add_environment_method(method_name, environment)
15
+ Env.module_eval do
16
+ remove_method method_name if respond_to?(method_name)
17
+ define_method method_name do
18
+ Config.app.environment == environment
19
+ end
20
+ end
21
+ end
22
+ end
23
+
24
+ extend Core
25
+ end
@@ -0,0 +1,33 @@
1
+ module BaseJump
2
+ # This module holds the `test?`, `development?`, etc. methods.
3
+ module Env
4
+ extend self
5
+ end
6
+
7
+ module Environment
8
+ extend self
9
+
10
+ def env
11
+ Env
12
+ end
13
+
14
+ def environment
15
+ @environment
16
+ end
17
+
18
+ def environment=(value)
19
+ @environment = normalize(value)
20
+ ENV[Config.env_var] = @environment.to_s
21
+ end
22
+
23
+ private
24
+
25
+ def normalize(env)
26
+ if env.nil? || env.to_s.strip == ''
27
+ :development
28
+ else
29
+ env.to_s.strip.downcase.to_sym
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,11 @@
1
+ module BaseJump
2
+ class ApplicationInitializedError < StandardError
3
+ def initialize(namespace)
4
+ @namespace = namespace
5
+ end
6
+
7
+ def message
8
+ "Application already initialized using #{@namespace}."
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,9 @@
1
+ module BaseJump
2
+ module System
3
+ extend self
4
+
5
+ def dir_glob(*args)
6
+ Dir.glob(*args)
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,22 @@
1
+ BaseJump
2
+ ========
3
+
4
+ Jump start your application by base jumping your app.
5
+
6
+
7
+ Install
8
+ =======
9
+
10
+ $ gem install base_jump
11
+
12
+
13
+ Gemfile
14
+ =======
15
+
16
+ $ gem 'base_jump'
17
+
18
+
19
+ Require
20
+ =======
21
+
22
+ $ require 'base_jump'
metadata ADDED
@@ -0,0 +1,131 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: base_jump
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Travis Herrick
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIDcjCCAlqgAwIBAgIBATANBgkqhkiG9w0BAQUFADA/MREwDwYDVQQDDAh0dGhl
14
+ dG9hZDEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYDY29t
15
+ MCAXDTE0MDgwOTAzNTY0OFoYDzIxMTQwODA5MDM1NjQ4WjA/MREwDwYDVQQDDAh0
16
+ dGhldG9hZDEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYD
17
+ Y29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA6kkcaif6ZkAIw6Ki
18
+ 3R6zqLB/psWS+sKuL8W9TqQ6Qreu3sz9ZhSHpN5e1ZaUSMq0klkIIW5f8vN3n58/
19
+ SwnBLCFIrYKGeo37Sknu5w1j4PXdHY4ggsXPIvZ93/NuF1sobsgaAO4OvZX7chzx
20
+ boZF1WdB6LitRK4894x+X2tD3/z24ywJ7oZoZ3iM8YP6l2ch6D96ur3DNXMRjuMl
21
+ edgLQV6Htu3sueDm2J4mX2f9WKbuRVtP3crD/DU4IzM924tnLq4aH33DcQbRK+Go
22
+ m8eM/lMOs8Vy6woPRdUyH3MhalL1z7jv1AO74q8GCQK2jIoIYA492rzEWu4Nakc5
23
+ rGrpHQIDAQABo3cwdTAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNVHQ4EFgQU
24
+ lb7h/PSpwDA3wstwt75LFVNU7swwHQYDVR0RBBYwFIESdHRoZXRvYWRAZ21haWwu
25
+ Y29tMB0GA1UdEgQWMBSBEnR0aGV0b2FkQGdtYWlsLmNvbTANBgkqhkiG9w0BAQUF
26
+ AAOCAQEAU0AUOukpg8PTuSO6fxg5AYXzov/un1wz7pX9fvPodXLtb1+NdUl1rWjc
27
+ vlcV1dy0uIcwP1Q/WKL8AYuwmNSKgI24T0SqQl7gw/1ctMbqwhB/SXkLvB84a/9R
28
+ aWrUh9/kRyfTkrLS4sltuyGhGZPYGFqFeOOXfM2c43/3qwjHU0rJNPEf2fAoZG9E
29
+ at+NN+vUGIi00xlgYc9uzmTlFXyr3tfhYhrIZnyd02xsDkN3gMbs/KTGYPQYMTZQ
30
+ dFfJVAFuyqXRLmrl1YroL9qLu8nKUUiKEcrRbc44Bd84Ti0VdHms+c7SZXqW+VUV
31
+ kMsvl643w+TJ2BmsFnWZ4JMvHdZ8oQ==
32
+ -----END CERTIFICATE-----
33
+ date: 2015-05-30 00:00:00.000000000 Z
34
+ dependencies:
35
+ - !ruby/object:Gem::Dependency
36
+ name: rake_tasks
37
+ requirement: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ type: :development
43
+ prerelease: false
44
+ version_requirements: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
49
+ - !ruby/object:Gem::Dependency
50
+ name: gems
51
+ requirement: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ type: :development
57
+ prerelease: false
58
+ version_requirements: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
63
+ - !ruby/object:Gem::Dependency
64
+ name: cane
65
+ requirement: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ type: :development
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ - !ruby/object:Gem::Dependency
78
+ name: rspec
79
+ requirement: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
84
+ type: :development
85
+ prerelease: false
86
+ version_requirements: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
91
+ description: Jump start your application by base jumping your app
92
+ email:
93
+ - tthetoad@gmail.com
94
+ executables: []
95
+ extensions: []
96
+ extra_rdoc_files:
97
+ - readme.md
98
+ files:
99
+ - lib/base_jump.rb
100
+ - lib/base_jump/application.rb
101
+ - lib/base_jump/config.rb
102
+ - lib/base_jump/core.rb
103
+ - lib/base_jump/environment.rb
104
+ - lib/base_jump/errors.rb
105
+ - lib/base_jump/system.rb
106
+ - readme.md
107
+ homepage: http://www.bitbucket.org/ToadJamb/gems_base_jump
108
+ licenses:
109
+ - LGPLV3
110
+ metadata: {}
111
+ post_install_message:
112
+ rdoc_options: []
113
+ require_paths:
114
+ - lib
115
+ required_ruby_version: !ruby/object:Gem::Requirement
116
+ requirements:
117
+ - - ">="
118
+ - !ruby/object:Gem::Version
119
+ version: '0'
120
+ required_rubygems_version: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ requirements: []
126
+ rubyforge_project:
127
+ rubygems_version: 2.4.5
128
+ signing_key:
129
+ specification_version: 4
130
+ summary: Application framework
131
+ test_files: []
@@ -0,0 +1 @@
1
+ cKS@*!.������{R���i�W|�+�$F8�^�|jl�r;@���W���!7g>y�����JP<C���5rf0������Њ�����#�u8�e9> l�D�B@qg ���Xq���\��=�'�-��5h��@���a8��BZ��s�IP�P��A�C�E;�6n�`頇g�.�y�6%��|