extend_at 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/.rspec +2 -1
- data/CHANGELOG.txt +3 -0
- data/README.markdown +1 -0
- data/lib/extend_at/configuration.rb +57 -0
- data/lib/extend_at/environment.rb +42 -0
- data/lib/extend_at/model_manager.rb +13 -10
- data/lib/extend_at/structure.rb +12 -0
- data/lib/extend_at/table_manager.rb +20 -0
- data/lib/extend_at/version.rb +1 -1
- data/lib/extend_at.rb +37 -97
- data/spec/app/app/models/tool.rb +3 -0
- data/spec/app/app/models/toolbox.rb +3 -0
- data/spec/app/db/migrate/20120118200010_create_toolboxes.rb +9 -0
- data/spec/app/db/migrate/20120118200029_create_tools.rb +9 -0
- data/spec/app/db/schema.rb +13 -1
- data/spec/app/test/fixtures/toolboxes.yml +7 -0
- data/spec/app/test/fixtures/tools.yml +7 -0
- data/spec/app/test/unit/tool_test.rb +7 -0
- data/spec/app/test/unit/toolbox_test.rb +7 -0
- data/spec/extend_at_spec.rb +27 -1
- metadata +31 -10
data/.gitignore
CHANGED
data/.rspec
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
--color
|
1
|
+
--color
|
2
|
+
--format documentation
|
data/CHANGELOG.txt
ADDED
data/README.markdown
CHANGED
@@ -5,6 +5,7 @@ This gem allows you to extend models without migrations: This way you can, i.e.,
|
|
5
5
|
## Status:
|
6
6
|
|
7
7
|
[![Build Status](https://secure.travis-ci.org/anga/extend_at.png)](http://travis-ci.org/anga/extend_at)
|
8
|
+
[![Still Maintained](http://stillmaintained.com/anga/extend_at.png)](http://stillmaintained.com/anga/extend_at)
|
8
9
|
|
9
10
|
## Installation
|
10
11
|
|
@@ -0,0 +1,57 @@
|
|
1
|
+
require File.expand_path('../environment', __FILE__)
|
2
|
+
|
3
|
+
module ExtendModelAt
|
4
|
+
class Configuration
|
5
|
+
def self.run(env=nil,model=nil)
|
6
|
+
return expand_options env, { :not_call_symbol => [:boolean], :not_expand => [:validate, :default] }, model if env.kind_of? Hash
|
7
|
+
|
8
|
+
if not env.kind_of? Proc
|
9
|
+
return {}
|
10
|
+
else
|
11
|
+
Environment.new.run env, model
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
protected
|
16
|
+
def self.expand_options(options={}, opts={}, model=nil)
|
17
|
+
options = get_value_of options, model
|
18
|
+
config_opts = {
|
19
|
+
:not_expand => [],
|
20
|
+
:not_call_symbol => []
|
21
|
+
}.merge! opts
|
22
|
+
if options.kind_of? Hash
|
23
|
+
opts = {}
|
24
|
+
options.each do |column, config|
|
25
|
+
if not config_opts[:not_expand].include? column.to_sym
|
26
|
+
if not config_opts[:not_call_symbol].include? config
|
27
|
+
opts[column.to_sym] = expand_options(get_value_of(config, model), config_opts, model)
|
28
|
+
else
|
29
|
+
opts[column.to_sym] = expand_options(config, config_opts, model)
|
30
|
+
end
|
31
|
+
else
|
32
|
+
opts[column.to_sym] = config
|
33
|
+
end
|
34
|
+
end
|
35
|
+
return opts
|
36
|
+
else
|
37
|
+
return get_value_of options, model
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.get_value_of(value, model=nil)
|
42
|
+
if value.kind_of? Symbol
|
43
|
+
# If the function exist, we execute it
|
44
|
+
if model.respond_to? value
|
45
|
+
return model.send value
|
46
|
+
# if the the function not exist, whe set te symbol as a value
|
47
|
+
else
|
48
|
+
return value
|
49
|
+
end
|
50
|
+
elsif value.kind_of? Proc
|
51
|
+
return value.call
|
52
|
+
else
|
53
|
+
return value
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require File.expand_path('../structure', __FILE__)
|
2
|
+
|
3
|
+
module ExtendModelAt
|
4
|
+
class Environment
|
5
|
+
def initialize
|
6
|
+
@config = {}
|
7
|
+
@config[:has_one] = {}
|
8
|
+
@config[:has_many] = {}
|
9
|
+
@config[:belongs_to] = {}
|
10
|
+
@config[:static] = false
|
11
|
+
end
|
12
|
+
|
13
|
+
def run(env=nil, model=nil)
|
14
|
+
instance_exec env
|
15
|
+
end
|
16
|
+
|
17
|
+
[:has_one, :has_many, :belongs_to].each do |function|
|
18
|
+
define_method(function.to_s) do |name, opts={}|
|
19
|
+
@config[function][name.to_sym] = opts
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
# == Defining columns
|
24
|
+
# You cand define the _table structure_ using the function +structure+
|
25
|
+
#
|
26
|
+
# structure :static => true do |t|
|
27
|
+
# t.string :name
|
28
|
+
# t.integer :loggin_counter, :default => 0
|
29
|
+
# t.belongs_to :account
|
30
|
+
# t.belongs_to :owner, :polymorphic => true
|
31
|
+
# end
|
32
|
+
def structure(options={})
|
33
|
+
@config[:columns] = Structure.new.run yield
|
34
|
+
@config[:static] = options[:static]
|
35
|
+
end
|
36
|
+
|
37
|
+
protected
|
38
|
+
def config
|
39
|
+
@config
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -1,24 +1,23 @@
|
|
1
1
|
require File.expand_path('../models/all', __FILE__)
|
2
|
+
require File.expand_path('../configuration', __FILE__)
|
2
3
|
|
3
4
|
module ExtendModelAt
|
4
5
|
class ModelManager
|
5
6
|
def initialize(column_name,model, config)
|
6
7
|
@column_name, @model, @config = column_name, model, config
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
else
|
8
|
+
|
9
|
+
@extend_at = ExtendAt.find_by_model_id_and_model_type @model.id, @model.class.to_s
|
10
|
+
if @extend_at.nil?
|
11
11
|
@extend_at = ExtendAt.new
|
12
12
|
@extend_at.save
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
16
|
def assign(column,value)
|
17
|
-
raise "#{value} is not valid" if not @model.send(:valid_type?, value, @config[column.to_sym].try(:[], :type))
|
17
|
+
raise "#{value} is not valid" if not @model.send(:valid_type?, value, @config[:columns][column.to_sym].try(:[], :type))
|
18
18
|
|
19
19
|
last_model = get_column_model column
|
20
|
-
type_class = get_type_class( (@config[column.to_sym].try(:[], :type) || :any) )
|
21
|
-
|
20
|
+
type_class = get_type_class( (@config[:columns][column.to_sym].try(:[], :type) || :any) )
|
22
21
|
|
23
22
|
if last_model.nil?
|
24
23
|
new_column = Column.new :extend_at_id => @extend_at.id
|
@@ -38,7 +37,7 @@ module ExtendModelAt
|
|
38
37
|
model = get_column_model column #, get_type(column)
|
39
38
|
value = model.try(:value)
|
40
39
|
if value.nil?
|
41
|
-
value = @config[column.to_sym].try(:[], :default)
|
40
|
+
value = @config[:columns][column.to_sym].try(:[], :default)
|
42
41
|
assign column, value
|
43
42
|
end
|
44
43
|
value
|
@@ -77,6 +76,10 @@ module ExtendModelAt
|
|
77
76
|
hash
|
78
77
|
end
|
79
78
|
|
79
|
+
def read_model(model_name, configuration,force_reload=false)
|
80
|
+
# TODO
|
81
|
+
end
|
82
|
+
|
80
83
|
def to_a
|
81
84
|
all_values
|
82
85
|
end
|
@@ -101,8 +104,8 @@ module ExtendModelAt
|
|
101
104
|
end
|
102
105
|
|
103
106
|
def get_type(column)
|
104
|
-
if @config[column.to_sym].kind_of? Hash
|
105
|
-
@config[column.to_sym][:type]
|
107
|
+
if @config[:columns][column.to_sym].kind_of? Hash
|
108
|
+
@config[:columns][column.to_sym][:type]
|
106
109
|
else
|
107
110
|
:any
|
108
111
|
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require File.expand_path('../table_manager', __FILE__)
|
2
|
+
|
3
|
+
module ExtendModelAt
|
4
|
+
|
5
|
+
# Manage the environment of structure function
|
6
|
+
class Structure
|
7
|
+
def run
|
8
|
+
yield TableManager.new
|
9
|
+
TableManager.send :config # Get te configuration (is protected)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module ExtendModelAt
|
2
|
+
class TableManager
|
3
|
+
def initialize
|
4
|
+
@config = {}
|
5
|
+
end
|
6
|
+
|
7
|
+
[:any, :binary, :boolean, :date, :datetime, :decimal, :float, :integer, :string, :text, :time, :timestamp].each do |function|
|
8
|
+
define_method(function.to_s) do |column_name, options={}|
|
9
|
+
@config[column_name.to_sym] = options.merge!({:type => function})
|
10
|
+
nil
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
protected
|
15
|
+
|
16
|
+
def config
|
17
|
+
return @config
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/extend_at/version.rb
CHANGED
data/lib/extend_at.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
require "extend_at/version"
|
3
|
+
# require "extend_at/configuration"
|
3
4
|
require "extend_at/model_manager"
|
4
5
|
require "extend_at/models/all"
|
5
6
|
|
@@ -18,14 +19,16 @@ module ExtendModelAt
|
|
18
19
|
# The object how controll the data
|
19
20
|
class Extention
|
20
21
|
def initialize(options={})
|
21
|
-
@
|
22
|
-
@
|
23
|
-
@column_name = options[:column_name].to_s
|
24
|
-
@columns = options[:columns]
|
25
|
-
@value = get_defaults_values options
|
26
|
-
@model_manager = ::ExtendModelAt::ModelManager.new(@column_name, @model, @columns)
|
22
|
+
@configuration = ExtendModelAt::Configuration.run options, options[:model]
|
23
|
+
@model_manager = ::ExtendModelAt::ModelManager.new(@column_name, @configuration[:model], @configuration)
|
27
24
|
|
28
|
-
|
25
|
+
@static = @configuration[:static] || false
|
26
|
+
@model = @configuration[:model]
|
27
|
+
@column_name = @configuration[:column_name].to_s
|
28
|
+
@columns = @configuration[:columns]
|
29
|
+
@value = get_defaults_values @configuration
|
30
|
+
|
31
|
+
# define_associations
|
29
32
|
|
30
33
|
initialize_values
|
31
34
|
end
|
@@ -80,6 +83,13 @@ module ExtendModelAt
|
|
80
83
|
|
81
84
|
private
|
82
85
|
|
86
|
+
def configuration
|
87
|
+
@configuration
|
88
|
+
end
|
89
|
+
|
90
|
+
# def define_associationss
|
91
|
+
# end
|
92
|
+
|
83
93
|
def get_adapter(column, value)
|
84
94
|
if @columns[column.to_sym][:type] == String
|
85
95
|
return :to_s
|
@@ -221,7 +231,7 @@ module ExtendModelAt
|
|
221
231
|
self.class_eval <<-EOS
|
222
232
|
eval assign_attributes_eval
|
223
233
|
EOS
|
224
|
-
|
234
|
+
|
225
235
|
class_eval do
|
226
236
|
public
|
227
237
|
validate :extend_at_validations
|
@@ -229,18 +239,16 @@ module ExtendModelAt
|
|
229
239
|
|
230
240
|
define_method(column_name.to_s) do
|
231
241
|
if not @extend_at_configuration.kind_of? ExtendModelAt::Extention
|
232
|
-
|
233
|
-
options
|
234
|
-
|
235
|
-
|
236
|
-
columns = initialize_columns expand_options(options, { :not_call_symbol => [:boolean], :not_expand => [:validate, :default] }) if options.kind_of? Hash
|
237
|
-
@extend_at_configuration ||= ExtendModelAt::Extention.new({:model => self, :column_name => column_name.to_sym, :columns => columns, :static => options[:static]})
|
242
|
+
options[:model] = self
|
243
|
+
@extend_at_configuration ||= ExtendModelAt::Extention.new(options )
|
244
|
+
|
245
|
+
initialize_columns @extend_at_configuration.send(:configuration)[:columns] if options.kind_of? Hash
|
238
246
|
end
|
239
247
|
@extend_at_configuration
|
240
248
|
end
|
241
249
|
|
242
250
|
protected
|
243
|
-
|
251
|
+
|
244
252
|
def extend_at_validations
|
245
253
|
# @extend_at_configuration.valid?
|
246
254
|
@extend_at_validation ||= {} if not @extend_at_validation.kind_of? Hash
|
@@ -249,39 +257,22 @@ module ExtendModelAt
|
|
249
257
|
self.send validation, eval("@extend_at_configuration.\#\{column.to_s\}", binding)
|
250
258
|
elsif validation.kind_of? Proc
|
251
259
|
instance_exec @extend_at_configuration[column.to_sym], &validation
|
252
|
-
# validation.call @extend_at_configuration[column.to_sym]
|
253
260
|
end
|
254
261
|
end
|
255
262
|
end
|
256
263
|
|
257
|
-
def initialize_options(options={})
|
258
|
-
opts = expand_options options, { :not_call_symbol => [:boolean], :not_expand => [:validate, :default] }
|
259
|
-
end
|
260
|
-
|
261
264
|
# Initialize each column configuration
|
262
|
-
def initialize_columns(
|
263
|
-
|
264
|
-
|
265
|
-
options[:columns].each do |column, config|
|
266
|
-
columns[column] = initialize_column column, config
|
265
|
+
def initialize_columns(columns = {})
|
266
|
+
columns.each do |column, config|
|
267
|
+
initialize_column column, config
|
267
268
|
end
|
268
|
-
elsif options[:columns].kind_of? Symbol
|
269
|
-
hash = self.send options[:columns]
|
270
|
-
raise ExtendModelAt::ArgumentError, "Invalid columns configuration" if not hash.kind_of? Hash
|
271
|
-
columns = initialize_columns :columns => hash
|
272
|
-
elsif options[:columns].kind_of? Proc
|
273
|
-
hash = options[:columns].call
|
274
|
-
raise ExtendModelAt::ArgumentError, "Invalid columns configuration" if not hash.kind_of? Hash
|
275
|
-
columns = initialize_columns :columns => hash
|
276
|
-
end
|
277
|
-
columns
|
278
269
|
end
|
279
270
|
|
280
271
|
def initialize_column(column,config={})
|
281
272
|
raise ExtendModelAt::ArgumentError, "The column \#\{column\} have an invalid configuration (\#\{config.class\} => \#\{config\})" if not config.kind_of? Hash
|
282
|
-
|
273
|
+
|
283
274
|
@VALID_SYMBOLS ||= [:any, :binary, :boolean, :date, :datetime, :decimal, :float, :integer, :string, :text, :time, :timestamp]
|
284
|
-
|
275
|
+
|
285
276
|
column = column.to_sym
|
286
277
|
column_config = {}
|
287
278
|
|
@@ -291,29 +282,19 @@ module ExtendModelAt
|
|
291
282
|
column_config[:type] = get_type_for_class config[:type]
|
292
283
|
elsif config[:type].class == Symbol and @VALID_SYMBOLS.include? config[:type]
|
293
284
|
column_config[:type] = config[:type]
|
294
|
-
elsif [Symbol, Proc].include? config[:type]
|
295
|
-
column_config[:type] = get_value_of config[:type]
|
296
285
|
else
|
297
286
|
raise ExtendModelAt::ArgumentError, "\#\{config[:type]\} is not a valid column type"
|
298
287
|
end
|
299
288
|
|
300
|
-
#
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
elsif config[:default].kind_of? Proc
|
305
|
-
column_config[:default] = config[:default].call
|
306
|
-
else
|
307
|
-
# If the column have a type, we verify the type
|
308
|
-
if not column_config[:type].nil?
|
309
|
-
if not valid_type?(config[:default], column_config[:type])
|
310
|
-
raise ExtendModelAt::ArgumentError, "The column \#\{column\} has an invalid default value. Expected \#\{column_config[:type]}, not \#\{config[:default].class}"
|
311
|
-
end
|
312
|
-
column_config[:default] = config[:default]
|
313
|
-
else
|
314
|
-
# If is dynamic, only we set the default value
|
315
|
-
column_config[:default] = config[:default]
|
289
|
+
# If the column have a type, we verify the type
|
290
|
+
if not column_config[:type].nil?
|
291
|
+
if not valid_type?(config[:default], column_config[:type])
|
292
|
+
raise ExtendModelAt::ArgumentError, "The column \#\{column\} has an invalid default value. Expected \#\{column_config[:type]}, not \#\{config[:default].class}"
|
316
293
|
end
|
294
|
+
column_config[:default] = config[:default]
|
295
|
+
else
|
296
|
+
# If is dynamic, only we set the default value
|
297
|
+
column_config[:default] = config[:default]
|
317
298
|
end
|
318
299
|
|
319
300
|
# Set the validation
|
@@ -346,49 +327,8 @@ module ExtendModelAt
|
|
346
327
|
@extend_at_validation[column] = validation
|
347
328
|
end
|
348
329
|
|
349
|
-
def expand_options(options={}, opts={})
|
350
|
-
options = get_value_of options
|
351
|
-
config_opts = {
|
352
|
-
:not_expand => [],
|
353
|
-
:not_call_symbol => []
|
354
|
-
}.merge! opts
|
355
|
-
if options.kind_of? Hash
|
356
|
-
opts = {}
|
357
|
-
options.each do |column, config|
|
358
|
-
if not config_opts[:not_expand].include? column.to_sym
|
359
|
-
if not config_opts[:not_call_symbol].include? config
|
360
|
-
opts[column.to_sym] = expand_options(get_value_of(config), config_opts)
|
361
|
-
else
|
362
|
-
opts[column.to_sym] = expand_options(config, config_opts)
|
363
|
-
end
|
364
|
-
else
|
365
|
-
opts[column.to_sym] = config
|
366
|
-
end
|
367
|
-
end
|
368
|
-
return opts
|
369
|
-
else
|
370
|
-
return get_value_of options
|
371
|
-
end
|
372
|
-
end
|
373
|
-
|
374
|
-
def get_value_of(value)
|
375
|
-
if value.kind_of? Symbol
|
376
|
-
# If the function exist, we execute it
|
377
|
-
if self.respond_to? value
|
378
|
-
return self.send value
|
379
|
-
# if the the function not exist, whe set te symbol as a value
|
380
|
-
else
|
381
|
-
return value
|
382
|
-
end
|
383
|
-
elsif value.kind_of? Proc
|
384
|
-
return value.call
|
385
|
-
else
|
386
|
-
return value
|
387
|
-
end
|
388
|
-
end
|
389
|
-
|
390
330
|
def update_model_manager
|
391
|
-
@extend_at_configuration.send :update_model_manager
|
331
|
+
@extend_at_configuration.send :update_model_manager if @extend_at_configuration.respond_to? :update_model_manager
|
392
332
|
end
|
393
333
|
|
394
334
|
def get_type_for_class(type)
|
data/spec/app/db/schema.rb
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
#
|
12
12
|
# It's strongly recommended to check this file into your version control system.
|
13
13
|
|
14
|
-
ActiveRecord::Schema.define(:version =>
|
14
|
+
ActiveRecord::Schema.define(:version => 20120118200029) do
|
15
15
|
|
16
16
|
create_table "articles", :force => true do |t|
|
17
17
|
t.string "title"
|
@@ -104,6 +104,18 @@ ActiveRecord::Schema.define(:version => 20120110153027) do
|
|
104
104
|
t.string "model_type"
|
105
105
|
end
|
106
106
|
|
107
|
+
create_table "toolboxes", :force => true do |t|
|
108
|
+
t.string "name"
|
109
|
+
t.datetime "created_at"
|
110
|
+
t.datetime "updated_at"
|
111
|
+
end
|
112
|
+
|
113
|
+
create_table "tools", :force => true do |t|
|
114
|
+
t.string "name"
|
115
|
+
t.datetime "created_at"
|
116
|
+
t.datetime "updated_at"
|
117
|
+
end
|
118
|
+
|
107
119
|
create_table "users", :force => true do |t|
|
108
120
|
t.string "name"
|
109
121
|
t.text "private_info"
|
data/spec/extend_at_spec.rb
CHANGED
@@ -62,13 +62,15 @@ describe 'extend_at' do
|
|
62
62
|
article.save
|
63
63
|
article.errors.keys.include?(:extra_int1).should == true
|
64
64
|
end
|
65
|
+
end
|
65
66
|
|
67
|
+
context "general options" do
|
66
68
|
it "should support static columns" do
|
67
69
|
user = User.new :name => "Account"
|
68
70
|
lambda {user.private_info.etc = "etc"}.should raise_error(ExtendModelAt::InvalidColumn)
|
69
71
|
end
|
70
72
|
|
71
|
-
it "if
|
73
|
+
it "if isn't static should support dynamic columns" do
|
72
74
|
article = Article.new
|
73
75
|
lambda {article.extra.etc = "etc"}.should_not raise_error(ExtendModelAt::InvalidColumn)
|
74
76
|
article.save :validate => false
|
@@ -76,4 +78,28 @@ describe 'extend_at' do
|
|
76
78
|
article.extra.etc.should == "etc"
|
77
79
|
end
|
78
80
|
end
|
81
|
+
|
82
|
+
# context "associations support" do
|
83
|
+
# context "belongs_to" do
|
84
|
+
# it "simple usage" do
|
85
|
+
# box = Toolbox.new
|
86
|
+
# box.save
|
87
|
+
# box.extra.create_tool
|
88
|
+
# box.extra.tools.first.extra.toolbox.should == box
|
89
|
+
# end
|
90
|
+
# end
|
91
|
+
#
|
92
|
+
# context "has_many" do
|
93
|
+
# context "simple usage" do
|
94
|
+
# box = Toolbox.new
|
95
|
+
# box.save
|
96
|
+
# box.extra.create_tool
|
97
|
+
# box.extra.create_tool
|
98
|
+
# box.extra.create_tool
|
99
|
+
# box.extra.tools.class.should == Array
|
100
|
+
# box.extra.tools.size.should == 3
|
101
|
+
# box.extra.tools.first.extra.toolbox.should == box
|
102
|
+
# end
|
103
|
+
# end
|
104
|
+
# end
|
79
105
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: extend_at
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-01-
|
12
|
+
date: 2012-01-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
16
|
-
requirement: &
|
16
|
+
requirement: &20211600 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '3.1'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *20211600
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rspec
|
27
|
-
requirement: &
|
27
|
+
requirement: &20210900 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '2.5'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *20210900
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rspec-core
|
38
|
-
requirement: &
|
38
|
+
requirement: &20210520 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *20210520
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: database_cleaner
|
49
|
-
requirement: &
|
49
|
+
requirement: &20068540 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,7 +54,7 @@ dependencies:
|
|
54
54
|
version: '0.7'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *20068540
|
58
58
|
description: ! 'This gem allows you to extend rails models without migrations: This
|
59
59
|
way you can, i.e., develop your own content types, like in Drupal.'
|
60
60
|
email:
|
@@ -66,6 +66,7 @@ files:
|
|
66
66
|
- .gitignore
|
67
67
|
- .rspec
|
68
68
|
- .travis.yml
|
69
|
+
- CHANGELOG.txt
|
69
70
|
- Gemfile
|
70
71
|
- Gemfile.ci
|
71
72
|
- MIT-license.txt
|
@@ -73,6 +74,8 @@ files:
|
|
73
74
|
- Rakefile
|
74
75
|
- extend_at.gemspec
|
75
76
|
- lib/extend_at.rb
|
77
|
+
- lib/extend_at/configuration.rb
|
78
|
+
- lib/extend_at/environment.rb
|
76
79
|
- lib/extend_at/model_manager.rb
|
77
80
|
- lib/extend_at/models/all.rb
|
78
81
|
- lib/extend_at/models/any_value.rb
|
@@ -89,6 +92,8 @@ files:
|
|
89
92
|
- lib/extend_at/models/text_value.rb
|
90
93
|
- lib/extend_at/models/time_value.rb
|
91
94
|
- lib/extend_at/models/timestamp_value.rb
|
95
|
+
- lib/extend_at/structure.rb
|
96
|
+
- lib/extend_at/table_manager.rb
|
92
97
|
- lib/extend_at/version.rb
|
93
98
|
- lib/generators/extend_at/USAGE
|
94
99
|
- lib/generators/extend_at/install_generator.rb
|
@@ -114,6 +119,8 @@ files:
|
|
114
119
|
- spec/app/app/mailers/.gitkeep
|
115
120
|
- spec/app/app/models/.gitkeep
|
116
121
|
- spec/app/app/models/article.rb
|
122
|
+
- spec/app/app/models/tool.rb
|
123
|
+
- spec/app/app/models/toolbox.rb
|
117
124
|
- spec/app/app/models/user.rb
|
118
125
|
- spec/app/app/views/articles/_form.html.erb
|
119
126
|
- spec/app/app/views/articles/edit.html.erb
|
@@ -146,6 +153,8 @@ files:
|
|
146
153
|
- spec/app/db/migrate/20120101231517_create_articles.rb
|
147
154
|
- spec/app/db/migrate/20120104223248_create_users.rb
|
148
155
|
- spec/app/db/migrate/20120110153027_create_extend_at_tables.rb
|
156
|
+
- spec/app/db/migrate/20120118200010_create_toolboxes.rb
|
157
|
+
- spec/app/db/migrate/20120118200029_create_tools.rb
|
149
158
|
- spec/app/db/schema.rb
|
150
159
|
- spec/app/db/seeds.rb
|
151
160
|
- spec/app/db/test.sqlite3
|
@@ -162,6 +171,8 @@ files:
|
|
162
171
|
- spec/app/script/rails
|
163
172
|
- spec/app/test/fixtures/.gitkeep
|
164
173
|
- spec/app/test/fixtures/articles.yml
|
174
|
+
- spec/app/test/fixtures/toolboxes.yml
|
175
|
+
- spec/app/test/fixtures/tools.yml
|
165
176
|
- spec/app/test/fixtures/users.yml
|
166
177
|
- spec/app/test/functional/.gitkeep
|
167
178
|
- spec/app/test/functional/articles_controller_test.rb
|
@@ -173,6 +184,8 @@ files:
|
|
173
184
|
- spec/app/test/unit/article_test.rb
|
174
185
|
- spec/app/test/unit/helpers/articles_helper_test.rb
|
175
186
|
- spec/app/test/unit/helpers/users_helper_test.rb
|
187
|
+
- spec/app/test/unit/tool_test.rb
|
188
|
+
- spec/app/test/unit/toolbox_test.rb
|
176
189
|
- spec/app/test/unit/user_test.rb
|
177
190
|
- spec/app/vendor/assets/stylesheets/.gitkeep
|
178
191
|
- spec/app/vendor/plugins/.gitkeep
|
@@ -224,6 +237,8 @@ test_files:
|
|
224
237
|
- spec/app/app/mailers/.gitkeep
|
225
238
|
- spec/app/app/models/.gitkeep
|
226
239
|
- spec/app/app/models/article.rb
|
240
|
+
- spec/app/app/models/tool.rb
|
241
|
+
- spec/app/app/models/toolbox.rb
|
227
242
|
- spec/app/app/models/user.rb
|
228
243
|
- spec/app/app/views/articles/_form.html.erb
|
229
244
|
- spec/app/app/views/articles/edit.html.erb
|
@@ -256,6 +271,8 @@ test_files:
|
|
256
271
|
- spec/app/db/migrate/20120101231517_create_articles.rb
|
257
272
|
- spec/app/db/migrate/20120104223248_create_users.rb
|
258
273
|
- spec/app/db/migrate/20120110153027_create_extend_at_tables.rb
|
274
|
+
- spec/app/db/migrate/20120118200010_create_toolboxes.rb
|
275
|
+
- spec/app/db/migrate/20120118200029_create_tools.rb
|
259
276
|
- spec/app/db/schema.rb
|
260
277
|
- spec/app/db/seeds.rb
|
261
278
|
- spec/app/db/test.sqlite3
|
@@ -272,6 +289,8 @@ test_files:
|
|
272
289
|
- spec/app/script/rails
|
273
290
|
- spec/app/test/fixtures/.gitkeep
|
274
291
|
- spec/app/test/fixtures/articles.yml
|
292
|
+
- spec/app/test/fixtures/toolboxes.yml
|
293
|
+
- spec/app/test/fixtures/tools.yml
|
275
294
|
- spec/app/test/fixtures/users.yml
|
276
295
|
- spec/app/test/functional/.gitkeep
|
277
296
|
- spec/app/test/functional/articles_controller_test.rb
|
@@ -283,6 +302,8 @@ test_files:
|
|
283
302
|
- spec/app/test/unit/article_test.rb
|
284
303
|
- spec/app/test/unit/helpers/articles_helper_test.rb
|
285
304
|
- spec/app/test/unit/helpers/users_helper_test.rb
|
305
|
+
- spec/app/test/unit/tool_test.rb
|
306
|
+
- spec/app/test/unit/toolbox_test.rb
|
286
307
|
- spec/app/test/unit/user_test.rb
|
287
308
|
- spec/app/vendor/assets/stylesheets/.gitkeep
|
288
309
|
- spec/app/vendor/plugins/.gitkeep
|