elastic-beanstalk 1.1.1 → 1.1.2

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,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ODk1NDRlNWNiYzU4YjliODEzMmRlZDAxNzM5NmNjNGNmMDMzNjFhOQ==
5
- data.tar.gz: !binary |-
6
- YmZjN2U2ZTFkNDMwN2EwOTdiNmMwZTNmNDA2ZTI2NTQ0MTc4YTc1MA==
2
+ SHA1:
3
+ metadata.gz: bd92161e1d28fa74d1477f25722ab46ef7a317a3
4
+ data.tar.gz: a420656cf0377105535dcb2fe85c0fe9e5cdc2f3
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- NDgyNzAwZTljM2NhMThmOWJlZDEwM2JhOGM1YWFkZTkzYTVjMTBmOWRmMmEz
10
- ZjRhNGFjN2JhYzVkYTUzNDJjMGJiMDQxMWU2ZDU1Mjc4ZDFhZTA4ZWE5MDc5
11
- YzgyNzk4ZWRkODEwOTgxZGQ4YWY4N2I0MGJiY2Q5MmY1NzJkNzY=
12
- data.tar.gz: !binary |-
13
- ZjIwY2JiNjg2OTljNjkzOWQxODVmNTJiNzQwMzc2MjExYWU4ODAzNGQ3YWRm
14
- MzE0MmJkOTEzZTk1NzI1YWY5NTEyYmNiYzljMWY0YmM2ZjMxY2JiOGNiOGNi
15
- MTIyN2M1ODQwZWM0MjU1ZDhmNmI0Yjk1NWJkOTk1MmFjY2JmMGU=
6
+ metadata.gz: b6bf08a076d200af22fffe617675a16e9a7f4c3d737b55847e632cafc7a2a37f1f6a96a5f59cccfe6d88b568f939f0bdf621cc4b102d984ec2491a09eb9d7658
7
+ data.tar.gz: 40398ddde6d73fd67bbcd7e841e0b7d08497ac842f3ec0b39f9172727ecfdbbf6f1560f2437e6c9cbcf62848b6c9dee7b9070f515294cd5aa35001e512b82651
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
+ Gemfile.lock
1
2
  *.gem
2
3
  *.rbc
3
4
  .bundle
data/.rvmrc CHANGED
@@ -1 +1 @@
1
- rvm use ruby-1.9.3@elastic_beanstalk --create
1
+ rvm use ruby-2.1.2@elastic_beanstalk --create
@@ -37,4 +37,5 @@ Gem::Specification.new do |s|
37
37
  s.add_runtime_dependency 'rubyzip'
38
38
  s.add_runtime_dependency 'table_print'
39
39
  s.add_runtime_dependency 'nokogiri'
40
+ s.add_runtime_dependency 'dry-config'
40
41
  end
@@ -1,7 +1,6 @@
1
1
  module Elastic
2
2
  module Beanstalk
3
3
  require 'elastic/beanstalk/railtie' if defined?(Rails::Railtie)
4
- require 'deep_symbolize'
5
4
  require 'elastic/beanstalk/config'
6
5
  require 'elastic/beanstalk/extensions'
7
6
  require 'elastic/beanstalk/smoke_tester'
@@ -10,7 +9,7 @@ module Elastic
10
9
  end
11
10
  end
12
11
 
13
- EbConfig = Elastic::Beanstalk::Config
12
+ EbConfig = Elastic::Beanstalk::Config.instance
14
13
  EbExtensions = Elastic::Beanstalk::Extensions
15
14
  EbSmokeTester = Elastic::Beanstalk::SmokeTester
16
15
  Spinner = Elastic::Beanstalk::Spinner
@@ -1,5 +1,5 @@
1
- require 'deep_symbolize'
2
- require 'yaml'
1
+ require 'singleton'
2
+ require 'dry/config'
3
3
 
4
4
  module Elastic
5
5
  module Beanstalk
@@ -12,12 +12,13 @@ module Elastic
12
12
  # something is screwy, see the defaults in the #init as those add some default array values.
13
13
  # If this behavior of merging arrays or the defaults are somehow un-sensible, file an issue and we'll revisit it.
14
14
  #
15
- module Config
16
- # it's a singleton, thus implemented as a self-extended module
17
- extend self
15
+ class Config < Dry::Config::Base
18
16
 
19
- def init
17
+ include Singleton
18
+ # it's a singleton, thus implemented as a self-extended module
19
+ # extend self
20
20
 
21
+ def seed_default_configuration
21
22
  # seed the sensible defaults here
22
23
  @configuration = {
23
24
  environment: nil,
@@ -35,84 +36,25 @@ module Elastic
35
36
  }
36
37
  end
37
38
 
38
- init()
39
- attr_reader :configuration
40
-
41
- # This is the main point of entry - we call Settings.load! and provide
42
- # a name of the file to read as it's argument. We can also pass in some
43
- # options, but at the moment it's being used to allow per-environment
44
- # overrides in Rails
45
39
  def load!(environment = nil, filename = resolve_path('config/eb.yml'))
46
-
47
- # merge all top level settings with the defaults set in the #init
48
- #@configuration.deep_merge!( YAML::load_file(filename).deep_symbolize )
49
- deep_merge!(@configuration, YAML::load_file(filename).deep_symbolize)
50
-
51
- # add the environment to the top level settings
52
- @configuration[:environment] = (environment.nil? ? nil : environment.to_s)
53
-
54
- # overlay the specific environment if provided
55
- if environment && @configuration[environment.to_sym]
56
-
57
- # this is environment specific, so prune any environment
58
- # based settings from the initial set so that they can be overlaid.
59
- [:development, :test, :staging, :production].each do |env|
60
- @configuration.delete(env)
61
- end
62
-
63
- # re-read the file
64
- environment_settings = YAML::load_file(filename).deep_symbolize
65
-
66
- # snag the requested environment
67
- environment_settings = environment_settings[environment.to_sym]
68
-
69
- # finally overlay what was provided
70
- #@configuration.deep_merge!(environment_settings)
71
- deep_merge!(@configuration, environment_settings)
72
- end
73
-
74
-
75
- #ap @configuration
76
- #generate_accessors
77
- end
78
-
79
- def deep_merge!(target, data)
80
- merger = proc { |key, v1, v2|
81
- if (Hash === v1 && Hash === v2)
82
- v1.merge(v2, &merger)
83
- elsif (Array === v1 && Array === v2)
84
- v1.concat(v2)
85
- else
86
- v2
87
- end
88
- }
89
- target.merge! data, &merger
90
- end
91
-
92
- def reload!(options = {}, filename)
93
- clear
94
- #filename.nil? ?
95
- load!(options) # : load!(options, filename)
96
- end
97
-
98
- def to_yaml
99
-
40
+ super(environment, filename)
100
41
  end
101
42
 
102
- def method_missing(name, *args, &block)
103
- @configuration[name.to_sym] ||
104
- #fail(NoMethodError, "Unknown settings root \'#{name}\'", caller)
105
- nil
106
- end
107
43
 
108
- def clear
109
- init
44
+ def resolve_path(relative_path)
45
+ if defined?(Rails)
46
+ Rails.root.join(relative_path)
47
+ elsif defined?(Rake.original_dir)
48
+ File.expand_path(relative_path, Rake.original_dir)
49
+ else
50
+ File.expand_path(relative_path, Dir.pwd)
51
+ end
110
52
  end
111
53
 
112
- def options
113
- @configuration[:options] = {} if @configuration[:options].nil?
114
- @configuration[:options]
115
- end
54
+ # def options
55
+ # @configuration[:options] = {} if @configuration[:options].nil?
56
+ # @configuration[:options]
57
+ # end
116
58
 
117
59
  # custom methods for the specifics of eb.yml settings
118
60
  def option_settings
@@ -158,43 +100,11 @@ module Elastic
158
100
 
159
101
  def to_option_setting(namespace, option_name, value)
160
102
  {
161
- :"namespace" => "#{namespace}",
162
- :"option_name" => "#{option_name}",
163
- :"value" => "#{value}"
103
+ :'namespace' => "#{namespace}",
104
+ :'option_name' => "#{option_name}",
105
+ :'value' => "#{value}"
164
106
  }
165
107
  end
166
-
167
- def resolve_path(relative_path)
168
-
169
- if defined?(Rails)
170
- Rails.root.join(relative_path)
171
- elsif defined?(Rake.original_dir)
172
- File.expand_path(relative_path, Rake.original_dir)
173
- else
174
- File.expand_path(relative_path, Dir.pwd)
175
- end
176
- end
177
-
178
-
179
- #def environment
180
- # @configuration[:environment]
181
- #end
182
- #
183
- #def options
184
- # @configuration[:options]
185
- #end
186
-
187
- private
188
-
189
- #def generate_accessors
190
- # # generate a method for accessors
191
- # @configuration.each do |key, value|
192
- # define_method(key) do
193
- # value
194
- # end unless ['options', 'environment'].include? key
195
- # end
196
- #end
197
108
  end
198
-
199
109
  end
200
110
  end
@@ -1,5 +1,5 @@
1
1
  module Elastic
2
2
  module Beanstalk
3
- VERSION = '1.1.1'
3
+ VERSION = '1.1.2'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,159 +1,171 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elastic-beanstalk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Ross
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-14 00:00:00.000000000 Z
11
+ date: 2014-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '1.3'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ! '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ! '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ! '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: 2.14.1
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ! '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: 2.14.1
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: railties
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ! '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '3.2'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ! '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '3.2'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: eb_deployer
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ! '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: 0.4.4
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ! '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: 0.4.4
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: awesome_print
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ! '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ! '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: time_diff
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ! '>='
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ! '>='
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rubyzip
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ! '>='
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - ! '>='
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: table_print
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ! '>='
129
+ - - ">="
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0'
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - ! '>='
136
+ - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: nokogiri
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - ! '>='
143
+ - - ">="
144
144
  - !ruby/object:Gem::Version
145
145
  version: '0'
146
146
  type: :runtime
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - ! '>='
150
+ - - ">="
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
- description: ! ' The simplest way to configure and deploy an Elastic Beanstalk
154
- application via rake.
155
-
156
- '
153
+ - !ruby/object:Gem::Dependency
154
+ name: dry-config
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :runtime
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ description: |2
168
+ The simplest way to configure and deploy an Elastic Beanstalk application via rake.
157
169
  email:
158
170
  - kevin.ross@alienfast.com
159
171
  executables:
@@ -161,15 +173,14 @@ executables:
161
173
  extensions: []
162
174
  extra_rdoc_files: []
163
175
  files:
164
- - .gitignore
165
- - .rvmrc
176
+ - ".gitignore"
177
+ - ".rvmrc"
166
178
  - Gemfile
167
179
  - LICENSE.txt
168
180
  - README.md
169
181
  - Rakefile
170
182
  - bin/elastic-beanstalk
171
183
  - elastic-beanstalk.gemspec
172
- - lib/deep_symbolize.rb
173
184
  - lib/elastic/beanstalk.rb
174
185
  - lib/elastic/beanstalk/config.rb
175
186
  - lib/elastic/beanstalk/extensions.rb
@@ -194,17 +205,17 @@ require_paths:
194
205
  - lib
195
206
  required_ruby_version: !ruby/object:Gem::Requirement
196
207
  requirements:
197
- - - ! '>='
208
+ - - ">="
198
209
  - !ruby/object:Gem::Version
199
210
  version: '0'
200
211
  required_rubygems_version: !ruby/object:Gem::Requirement
201
212
  requirements:
202
- - - ! '>='
213
+ - - ">="
203
214
  - !ruby/object:Gem::Version
204
215
  version: '0'
205
216
  requirements: []
206
217
  rubyforge_project:
207
- rubygems_version: 2.1.9
218
+ rubygems_version: 2.2.2
208
219
  signing_key:
209
220
  specification_version: 4
210
221
  summary: Configure and deploy a rails app to Elastic Beanstalk via rake in 60 seconds.
@@ -1,74 +0,0 @@
1
- # Slightly modified from https://gist.github.com/morhekil/998709
2
-
3
- # Symbolizes all of hash's keys and subkeys.
4
- # Also allows for custom pre-processing of keys (e.g. downcasing, etc)
5
- # if the block is given:
6
- #
7
- # somehash.deep_symbolize { |key| key.downcase }
8
- #
9
- # Usage: either include it into global Hash class to make it available to
10
- # to all hashes, or extend only your own hash objects with this
11
- # module.
12
- # E.g.:
13
- # 1) class Hash; include DeepSymbolizable; end
14
- # 2) myhash.extend DeepSymbolizable
15
- module DeepSymbolizable
16
- def deep_symbolize(invert = false, &block)
17
- method = self.class.to_s.downcase.to_sym
18
- symbolizers = DeepSymbolizable::Symbolizers
19
- symbolizers.respond_to?(method) ? symbolizers.send(method, self, invert, &block) : self
20
- end
21
-
22
- module Symbolizers
23
- extend self
24
-
25
- # the primary method - symbolizes keys of the given hash,
26
- # preprocessing them with a block if one was given, and recursively
27
- # going into all nested enumerables
28
- def hash(hash, invert, &block)
29
- hash.inject({}) do |result, (key, value)|
30
- # Recursively deep-symbolize subhashes
31
- value = _recurse_(value, invert, &block)
32
-
33
- # Pre-process the key with a block if it was given
34
- key = yield key if block_given?
35
-
36
- if invert
37
- # UN-Symbolize the key
38
- s_key = key.to_s rescue key
39
-
40
- # write it back into the result and return the updated hash
41
- result[s_key] = value
42
-
43
- else
44
- # Symbolize the key string if it responds to to_sym
45
- sym_key = key.to_sym rescue key
46
-
47
- # write it back into the result and return the updated hash
48
- result[sym_key] = value
49
- end
50
- result
51
- end
52
- end
53
-
54
- # walking over arrays and symbolizing all nested elements
55
- def array(ary, invert, &block)
56
- ary.map { |v| _recurse_(v, invert, &block) }
57
- end
58
-
59
- # handling recursion - any Enumerable elements (except String)
60
- # is being extended with the module, and then symbolized
61
- def _recurse_(value, invert, &block)
62
- if value.is_a?(Enumerable) && !value.is_a?(String)
63
- # support for a use case without extended core Hash
64
- value.extend DeepSymbolizable unless value.class.include?(DeepSymbolizable)
65
- value = value.deep_symbolize(invert, &block)
66
- end
67
- value
68
- end
69
- end
70
-
71
- end
72
-
73
- # include in all Hash objects
74
- class Hash; include DeepSymbolizable; end