appfuel 0.3.0 → 0.3.1

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: 4cd3911f6f1983c5d75076fe3f2c8187227689ce
4
- data.tar.gz: dddd8acaac5dd41bf98b6ce7f7ba5d6c481c23c7
3
+ metadata.gz: 19c9a0a0f8b98e6ff2aa760b235be925681b2d56
4
+ data.tar.gz: 9b204bab5d8e2f054effcc3a6fc2eaf527916a93
5
5
  SHA512:
6
- metadata.gz: ed43fb31b3cd2a2d09db565d9a70a017c0d6f9b88d1f48a7ad9e8e383e720662cc0b475bf6a9f6ed438d05233b4b9284eb7ade4519a5f64cd871fce0038ac130
7
- data.tar.gz: 4fa72c3fdd7c070cf484c63bee167d126144d93d311577f4d2697ce8d0ef4a570f40f8da2cb41dba9cf8a54afda3aca53ed246e8c909c2e9b84b19bac121f54c
6
+ metadata.gz: 5f1221be2c438f441d24b1751820c1e25cd84be90b6d2a87d3ca50a830c025361dd0cbd2ae182e6f315f72e49b1d13c90cadb3bc44d15e0362a2e0a47bce08bd
7
+ data.tar.gz: f2cce133a6207adae6cde406cc01d6bbf1cbc078dea433593a257a249b87140abfb2118d513a832a6b4e909341f699181ca495e24a7e6f2256bd2901bcf6ae6f
data/CHANGELOG.md CHANGED
@@ -5,6 +5,9 @@ All notable changes to this project will be documented in this file. (Pending ap
5
5
 
6
6
 
7
7
  # Releases
8
+ ## [[0.3.1]](https://github.com/rsb/appfuel/releases/tag/0.3.1) 2017-06-20
9
+ ### Fixed
10
+ - `mapping_dsl` was missing `web_api`
8
11
  ## [[0.3.0]](https://github.com/rsb/appfuel/releases/tag/0.3.0) 2017-06-20
9
12
  ### Added
10
13
  - adding `web_api` storage to be used for WebApi repositories. The default
@@ -9,7 +9,7 @@ module Appfuel
9
9
  attr_reader :domain_name, :storage, :entries, :entry_class,
10
10
  :container_name
11
11
 
12
- STORAGE_TYPES = [:db, :file, :memory]
12
+ STORAGE_TYPES = [:db, :file, :memory, :web_api]
13
13
 
14
14
  # 1) mapping 'feature.domain', db: true, do
15
15
  # ...
@@ -97,10 +97,7 @@ module Appfuel
97
97
 
98
98
  if all_storage_symbols?(*args)
99
99
  args.unshift(type)
100
- args.each do |storage_type|
101
- @storage[storage_type] = send("initialize_#{storage_type}_storage", true)
102
- end
103
-
100
+ @storage = initialize_storage(storage: args)
104
101
  return self
105
102
  end
106
103
 
@@ -142,26 +139,33 @@ module Appfuel
142
139
  storage = {}
143
140
  if data.key?(:db)
144
141
  value = data[:db]
145
- storage[:db] = initialize_db_storage(value, data)
142
+ storage[:db] = initialize_general_storage(:db, value, data)
146
143
  elsif data.key?(:file)
147
144
  value = data[:file]
148
- storage[:file] = initialize_default_storage(value, :file)
145
+ storage[:file] = initialize_file_storage(value)
146
+ elsif data.key?(:web_api)
147
+ value = data[:web_api]
148
+ storage[:webapi] = initialize_general_storage(:web_api, value, data)
149
149
  elsif data.key?(:storage) && data[:storage].is_a?(Array)
150
150
  data[:storage].each do |type|
151
- storage[type] = send("initialize_#{type}_storage", true)
151
+ storage[type] = if type.to_s.downcase == 'file'
152
+ initialize_file_storage(true)
153
+ else
154
+ initialize_general_storage(type, true)
155
+ end
152
156
  end
153
157
  end
154
158
  storage
155
159
  end
156
160
 
157
- def initialize_db_storage(value, opts = {})
161
+ def initialize_general_storage(key, value, opts = {})
158
162
  case
159
163
  when value == true
160
- translate_storage_key(:db, domain_name)
164
+ translate_storage_key(key, domain_name)
161
165
  when opts.is_a?(Hash) && opts[:key_translation] == false
162
166
  value
163
167
  else
164
- translate_storage_key(:db, value)
168
+ translate_storage_key(key, value)
165
169
  end
166
170
  end
167
171
 
@@ -1,3 +1,3 @@
1
1
  module Appfuel
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appfuel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Scott-Buccleuch