mapped_attributes 1.0.0
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.
- data/.gitignore +6 -0
- data/Gemfile +2 -0
- data/LICENCE +20 -0
- data/README.md +82 -0
- data/Rakefile +12 -0
- data/lib/mapped_attributes.rb +34 -0
- data/lib/mapped_attributes/version.rb +3 -0
- data/mapped_attributes.gemspec +25 -0
- data/test/lib/mapped_attributes/mapped_attributes_test.rb +92 -0
- data/test/lib/mapped_attributes/version_test.rb +9 -0
- data/test/rails_app/config/application.rb +5 -0
- data/test/rails_app/config/database.yml +24 -0
- data/test/rails_app/config/environment.rb +5 -0
- data/test/rails_app/config/environments/development.rb +19 -0
- data/test/rails_app/config/environments/production.rb +33 -0
- data/test/rails_app/config/environments/test.rb +33 -0
- data/test/rails_app/config/initializers/backtrace_silencers.rb +7 -0
- data/test/rails_app/config/initializers/inflections.rb +2 -0
- data/test/rails_app/config/initializers/secret_token.rb +2 -0
- data/test/rails_app/config/locales/en.yml +24 -0
- data/test/rails_app/config/routes.rb +6 -0
- data/test/support/models.rb +16 -0
- data/test/support/schema.rb +22 -0
- data/test/test_helper.rb +12 -0
- metadata +148 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENCE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2013 Tomasz Borowski <http://tbprojects.pl> @TomaszBorowski
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,82 @@
|
|
1
|
+
Mapped Attributes
|
2
|
+
=================
|
3
|
+
|
4
|
+
This gem allows to build ActiveRecord objects with alternative attribute naming. It is useful when you are importing ie. fetched data from XLS or parsed data from some website.
|
5
|
+
|
6
|
+
## Installation:
|
7
|
+
```gem install mapped_attributes```
|
8
|
+
|
9
|
+
or
|
10
|
+
|
11
|
+
```gem 'mapped_attributes'``` in your Gemfile
|
12
|
+
|
13
|
+
## Usage & Example
|
14
|
+
Include **MappedAttributes** module to model, for which you would like to use attribute mapping:
|
15
|
+
```ruby
|
16
|
+
class Project < ActiveRecord::Base
|
17
|
+
include MappedAttributes
|
18
|
+
|
19
|
+
has_many :tasks
|
20
|
+
has_one :main_task, class_name: 'Task', order: 'priority ASC'
|
21
|
+
accepts_nested_attributes_for :main_task
|
22
|
+
end
|
23
|
+
|
24
|
+
class Task < ActiveRecord::Base
|
25
|
+
belongs_to :project
|
26
|
+
end
|
27
|
+
```
|
28
|
+
|
29
|
+
Define attributes mapping for certain model in your locales:
|
30
|
+
```yml
|
31
|
+
en:
|
32
|
+
activerecord:
|
33
|
+
mappings:
|
34
|
+
project:
|
35
|
+
subject: Project Name
|
36
|
+
summary: Description
|
37
|
+
priority: Importance
|
38
|
+
start_at:
|
39
|
+
- Beginning
|
40
|
+
- Start
|
41
|
+
main_task_attributes:
|
42
|
+
name:
|
43
|
+
- Task Name
|
44
|
+
- Main Task
|
45
|
+
description: Info
|
46
|
+
due_date: Deadline
|
47
|
+
```
|
48
|
+
|
49
|
+
And finally set mapped attributes:
|
50
|
+
```ruby
|
51
|
+
data = {
|
52
|
+
'Project Name' => 'Testing One',
|
53
|
+
'Description' => 'This project is just for test',
|
54
|
+
'Importance' => '3',
|
55
|
+
'Beginning' => '2013-01-01',
|
56
|
+
'Task Name' => 'Get a Job Done',
|
57
|
+
'Info' => 'Finalize first task',
|
58
|
+
'Deadline' => '2013-02-01'
|
59
|
+
'Comments' => 'Something something dark side'
|
60
|
+
}
|
61
|
+
project = Project.new
|
62
|
+
project.set_mapped_attributes(data)
|
63
|
+
project.save
|
64
|
+
```
|
65
|
+
|
66
|
+
Also, you can list unmapped attributes:
|
67
|
+
```ruby
|
68
|
+
project.get_unmapped_attributes
|
69
|
+
# => ['Comments']
|
70
|
+
```
|
71
|
+
|
72
|
+
## Features
|
73
|
+
- you can map given data to object attributes
|
74
|
+
- you can provide custom mapping definition namespace: ```project.set_mapped_attributes(data, as: :custom_project)```
|
75
|
+
- you can define multiple mapping for a single attribute
|
76
|
+
- you can map attributes for the *has_one* and *belongs_to* relations if you are using *nested_attributes*
|
77
|
+
|
78
|
+
## Tests
|
79
|
+
Module is tested with minitest. To run it just execute ```rake```
|
80
|
+
|
81
|
+
## Credits
|
82
|
+
[Tomasz Borowski](http://tbprojects.pl)
|
data/Rakefile
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
require 'bundler/gem_tasks'
|
3
|
+
|
4
|
+
require 'rake/testtask'
|
5
|
+
|
6
|
+
Rake::TestTask.new do |t|
|
7
|
+
t.libs << 'lib/mapped_attributes'
|
8
|
+
t.test_files = FileList['test/lib/mapped_attributes/*_test.rb']
|
9
|
+
t.verbose = true
|
10
|
+
end
|
11
|
+
|
12
|
+
task :default => :test
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require_relative "mapped_attributes/version"
|
2
|
+
|
3
|
+
module MappedAttributes
|
4
|
+
def set_mapped_attributes(data, opts = {})
|
5
|
+
@unused_data_fields = data.keys
|
6
|
+
mapping = get_attributes_mapping(opts[:as] || self.class.name.underscore)
|
7
|
+
self.attributes = get_mapped_attributes(data, mapping)
|
8
|
+
end
|
9
|
+
|
10
|
+
def get_unmapped_attributes
|
11
|
+
@unused_data_fields || []
|
12
|
+
end
|
13
|
+
|
14
|
+
private
|
15
|
+
def get_attributes_mapping(namespace)
|
16
|
+
mapping = I18n.t(namespace, scope: 'activerecord.mappings')
|
17
|
+
raise 'Mapping not defined in activerecord.mappings' unless mapping.is_a? Hash
|
18
|
+
mapping
|
19
|
+
end
|
20
|
+
|
21
|
+
def get_mapped_attributes(data, mapping)
|
22
|
+
mapping.inject({}) do |result, mapped_field|
|
23
|
+
if mapped_field[1].is_a? Hash
|
24
|
+
result[mapped_field[0]] = get_mapped_attributes(data, mapped_field[1])
|
25
|
+
else
|
26
|
+
labels = Array(mapped_field[1]).map(&:downcase)
|
27
|
+
@unused_data_fields.delete_if{|field| labels.include?(field.downcase)}
|
28
|
+
mapped_data = data.detect{|k,v| labels.include?(k.downcase)}
|
29
|
+
result[mapped_field[0]] = mapped_data[1] if mapped_data
|
30
|
+
end
|
31
|
+
result
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'mapped_attributes/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |gem|
|
7
|
+
gem.name = "mapped_attributes"
|
8
|
+
gem.version = MappedAttributes::VERSION
|
9
|
+
gem.authors = ["Tomasz Borowski [tbprojects]"]
|
10
|
+
gem.email = 'info.tbprojects@gmail.com'
|
11
|
+
gem.description = "Allows to build ActiveRecord objects with alternative attribute naming"
|
12
|
+
gem.summary = "Allows to build ActiveRecord objects with alternative attribute naming"
|
13
|
+
gem.homepage = "https://github.com/tbprojects/mapped_attributes"
|
14
|
+
|
15
|
+
gem.files = `git ls-files`.split("\n")
|
16
|
+
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
17
|
+
gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
+
gem.require_paths = ["lib"]
|
19
|
+
|
20
|
+
gem.add_development_dependency 'rake'
|
21
|
+
gem.add_development_dependency 'rails'
|
22
|
+
gem.add_development_dependency 'sqlite3'
|
23
|
+
gem.add_dependency 'activerecord'
|
24
|
+
gem.add_dependency 'i18n'
|
25
|
+
end
|
@@ -0,0 +1,92 @@
|
|
1
|
+
require_relative '../../test_helper'
|
2
|
+
|
3
|
+
describe MappedAttributes do
|
4
|
+
|
5
|
+
it "responds to set_mapped_attributes" do
|
6
|
+
Project.new.respond_to?(:set_mapped_attributes).must_equal true
|
7
|
+
end
|
8
|
+
|
9
|
+
it "responds to get_unmapped_attributes" do
|
10
|
+
Project.new.respond_to?(:get_unmapped_attributes).must_equal true
|
11
|
+
end
|
12
|
+
|
13
|
+
it "sets and returns mapped attributes" do
|
14
|
+
data = {
|
15
|
+
'Project Name' => 'Testing One',
|
16
|
+
'Description' => 'This project is just for test',
|
17
|
+
'Importance' => '3',
|
18
|
+
'Beginning' => '2013-01-01',
|
19
|
+
'Task Name' => 'Get a Job Done',
|
20
|
+
'Info' => 'Finalize first task',
|
21
|
+
'Deadline' => '2013-02-01'
|
22
|
+
}
|
23
|
+
project = Project.new
|
24
|
+
project.set_mapped_attributes(data)
|
25
|
+
project.save
|
26
|
+
project.persisted?.must_equal true
|
27
|
+
project.subject.must_equal data['Project Name']
|
28
|
+
project.summary.must_equal data['Description']
|
29
|
+
project.priority.to_s.must_equal data['Importance']
|
30
|
+
project.start_at.to_s(:db).must_equal data['Beginning']
|
31
|
+
|
32
|
+
task = project.main_task
|
33
|
+
task.persisted?.must_equal true
|
34
|
+
task.name.must_equal data['Task Name']
|
35
|
+
task.description.must_equal data['Info']
|
36
|
+
task.due_date.to_s(:db).must_equal data['Deadline']
|
37
|
+
end
|
38
|
+
|
39
|
+
it "remembers unmapped attributes" do
|
40
|
+
data = {
|
41
|
+
'Project Name' => 'Testing One',
|
42
|
+
'Task Name' => 'Get a Job Done',
|
43
|
+
'Comments' => 'Additional Text'
|
44
|
+
}
|
45
|
+
project = Project.new
|
46
|
+
project.set_mapped_attributes(data)
|
47
|
+
project.save
|
48
|
+
project.persisted?.must_equal true
|
49
|
+
project.get_unmapped_attributes.must_equal ['Comments']
|
50
|
+
end
|
51
|
+
|
52
|
+
it "allows to give provide custom mapping namespace" do
|
53
|
+
data = {
|
54
|
+
'Project Label' => 'Testing One',
|
55
|
+
'Main Task' => 'Get a Job Done',
|
56
|
+
}
|
57
|
+
project = Project.new
|
58
|
+
project.set_mapped_attributes(data, as: :custom_project)
|
59
|
+
project.save
|
60
|
+
project.persisted?.must_equal true
|
61
|
+
project.subject.must_equal data['Project Label']
|
62
|
+
|
63
|
+
task = project.main_task
|
64
|
+
task.persisted?.must_equal true
|
65
|
+
task.name.must_equal data['Main Task']
|
66
|
+
end
|
67
|
+
|
68
|
+
it 'allows to define multiple mappings for single attribute' do
|
69
|
+
data = {
|
70
|
+
'Work Name' => 'Testing One',
|
71
|
+
'Subwork Name' => 'Get a Job Done',
|
72
|
+
}
|
73
|
+
project = Project.new
|
74
|
+
project.set_mapped_attributes(data, as: :multiple_mapping_project)
|
75
|
+
project.save
|
76
|
+
project.persisted?.must_equal true
|
77
|
+
project.subject.must_equal data['Work Name']
|
78
|
+
|
79
|
+
task = project.main_task
|
80
|
+
task.persisted?.must_equal true
|
81
|
+
task.name.must_equal data['Subwork Name']
|
82
|
+
end
|
83
|
+
|
84
|
+
it "raises error when mapping is not defined" do
|
85
|
+
data = {
|
86
|
+
'Project Name' => 'Testing One',
|
87
|
+
'Task Name' => 'Get a Job Done'
|
88
|
+
}
|
89
|
+
project = Project.new
|
90
|
+
proc {project.set_mapped_attributes(data, as: :not_existing_mapping)}.must_raise RuntimeError
|
91
|
+
end
|
92
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
sqlite3mem: &SQLITE3MEM
|
2
|
+
adapter: sqlite3
|
3
|
+
database: ":memory:"
|
4
|
+
|
5
|
+
sqlite3: &SQLITE
|
6
|
+
adapter: sqlite3
|
7
|
+
database: mapped_attributes_test.sqlite3.db
|
8
|
+
|
9
|
+
postgresql: &POSTGRES
|
10
|
+
adapter: postgresql
|
11
|
+
username: postgres
|
12
|
+
password: postgres
|
13
|
+
database: mapped_attributes_test
|
14
|
+
min_messages: ERROR
|
15
|
+
|
16
|
+
mysql: &MYSQL
|
17
|
+
adapter: mysql
|
18
|
+
host: localhost
|
19
|
+
username: root
|
20
|
+
password:
|
21
|
+
database: mapped_attributes_test
|
22
|
+
|
23
|
+
test:
|
24
|
+
<<: *<%= ENV['DB'] || 'SQLITE3MEM' %>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
RailsApp::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/environment.rb
|
3
|
+
|
4
|
+
# In the development environment your application's code is reloaded on
|
5
|
+
# every request. This slows down response time but is perfect for development
|
6
|
+
# since you don't have to restart the webserver when you make code changes.
|
7
|
+
config.cache_classes = false
|
8
|
+
|
9
|
+
# Log error messages when you accidentally call methods on nil.
|
10
|
+
config.whiny_nils = true
|
11
|
+
|
12
|
+
# Show full error reports and disable caching
|
13
|
+
config.consider_all_requests_local = true
|
14
|
+
config.action_view.debug_rjs = true
|
15
|
+
config.action_controller.perform_caching = false
|
16
|
+
|
17
|
+
# Don't care if the mailer can't send
|
18
|
+
config.action_mailer.raise_delivery_errors = false
|
19
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
RailsApp::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/environment.rb
|
3
|
+
|
4
|
+
# The production environment is meant for finished, "live" apps.
|
5
|
+
# Code is not reloaded between requests
|
6
|
+
config.cache_classes = true
|
7
|
+
|
8
|
+
# Full error reports are disabled and caching is turned on
|
9
|
+
config.consider_all_requests_local = false
|
10
|
+
config.action_controller.perform_caching = true
|
11
|
+
|
12
|
+
# See everything in the log (default is :info)
|
13
|
+
# config.log_level = :debug
|
14
|
+
|
15
|
+
# Use a different logger for distributed setups
|
16
|
+
# config.logger = SyslogLogger.new
|
17
|
+
|
18
|
+
# Use a different cache store in production
|
19
|
+
# config.cache_store = :mem_cache_store
|
20
|
+
|
21
|
+
# Disable Rails's static asset server
|
22
|
+
# In production, Apache or nginx will already do this
|
23
|
+
config.serve_static_assets = false
|
24
|
+
|
25
|
+
# Enable serving of images, stylesheets, and javascripts from an asset server
|
26
|
+
# config.action_controller.asset_host = "http://assets.example.com"
|
27
|
+
|
28
|
+
# Disable delivery errors, bad email addresses will be ignored
|
29
|
+
# config.action_mailer.raise_delivery_errors = false
|
30
|
+
|
31
|
+
# Enable threaded mode
|
32
|
+
# config.threadsafe!
|
33
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
RailsApp::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/environment.rb
|
3
|
+
|
4
|
+
# The test environment is used exclusively to run your application's
|
5
|
+
# test suite. You never need to work with it otherwise. Remember that
|
6
|
+
# your test database is "scratch space" for the test suite and is wiped
|
7
|
+
# and recreated between test runs. Don't rely on the data there!
|
8
|
+
config.cache_classes = true
|
9
|
+
|
10
|
+
# Log error messages when you accidentally call methods on nil.
|
11
|
+
config.whiny_nils = true
|
12
|
+
|
13
|
+
# Show full error reports and disable caching
|
14
|
+
config.consider_all_requests_local = true
|
15
|
+
config.action_controller.perform_caching = false
|
16
|
+
|
17
|
+
# Disable request forgery protection in test environment
|
18
|
+
config.action_controller.allow_forgery_protection = false
|
19
|
+
|
20
|
+
# Tell Action Mailer not to deliver emails to the real world.
|
21
|
+
# The :test delivery method accumulates sent emails in the
|
22
|
+
# ActionMailer::Base.deliveries array.
|
23
|
+
config.action_mailer.delivery_method = :test
|
24
|
+
|
25
|
+
# Use SQL instead of Active Record's schema dumper when creating the test database.
|
26
|
+
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
27
|
+
# like if you have constraints or database-specific column types
|
28
|
+
# config.active_record.schema_format = :sql
|
29
|
+
|
30
|
+
config.action_dispatch.show_exceptions = false
|
31
|
+
|
32
|
+
config.active_support.deprecation = :stderr
|
33
|
+
end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
|
4
|
+
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
|
5
|
+
|
6
|
+
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
|
7
|
+
Rails.backtrace_cleaner.remove_silencers!
|
@@ -0,0 +1,24 @@
|
|
1
|
+
en:
|
2
|
+
activerecord:
|
3
|
+
mappings:
|
4
|
+
project:
|
5
|
+
subject: Project Name
|
6
|
+
summary: Description
|
7
|
+
priority: Importance
|
8
|
+
start_at: Beginning
|
9
|
+
main_task_attributes:
|
10
|
+
name: Task Name
|
11
|
+
description: Info
|
12
|
+
due_date: Deadline
|
13
|
+
custom_project:
|
14
|
+
subject: Project Label
|
15
|
+
main_task_attributes:
|
16
|
+
name: Main Task
|
17
|
+
multiple_mapping_project:
|
18
|
+
subject:
|
19
|
+
- Project Name
|
20
|
+
- Work Name
|
21
|
+
main_task_attributes:
|
22
|
+
name:
|
23
|
+
- Task Name
|
24
|
+
- Subwork Name
|
@@ -0,0 +1,6 @@
|
|
1
|
+
Rails.application.routes.draw do
|
2
|
+
|
3
|
+
# This is a legacy wild controller route that's not recommended for RESTful applications.
|
4
|
+
# Note: This route will make all actions in every controller accessible via GET requests.
|
5
|
+
match ':controller(/:action(/:id(.:format)))'
|
6
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class Project < ActiveRecord::Base
|
2
|
+
|
3
|
+
include MappedAttributes
|
4
|
+
|
5
|
+
has_many :tasks
|
6
|
+
has_one :main_task, class_name: 'Task', order: 'priority ASC'
|
7
|
+
accepts_nested_attributes_for :main_task
|
8
|
+
|
9
|
+
validates_presence_of :subject
|
10
|
+
end
|
11
|
+
|
12
|
+
class Task < ActiveRecord::Base
|
13
|
+
belongs_to :project
|
14
|
+
|
15
|
+
validates_presence_of :name
|
16
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'active_record'
|
2
|
+
require 'logger'
|
3
|
+
|
4
|
+
ActiveRecord::Base.establish_connection(:adapter => 'sqlite3', :database => ':memory:')
|
5
|
+
ActiveRecord::Base.logger = Logger.new(SPEC_ROOT.join('debug.log'))
|
6
|
+
ActiveRecord::Migration.verbose = false
|
7
|
+
|
8
|
+
ActiveRecord::Schema.define do
|
9
|
+
create_table :projects, :force => true do |t|
|
10
|
+
t.column :subject, :string
|
11
|
+
t.column :summary, :text
|
12
|
+
t.column :priority, :integer
|
13
|
+
t.column :start_at, :date
|
14
|
+
end
|
15
|
+
|
16
|
+
create_table :tasks, :force => true do |t|
|
17
|
+
t.column :name, :string
|
18
|
+
t.column :description, :text
|
19
|
+
t.column :project_id, :integer
|
20
|
+
t.column :due_date, :date
|
21
|
+
end
|
22
|
+
end
|
data/test/test_helper.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
ENV['RAILS_ENV'] = 'test'
|
2
|
+
|
3
|
+
require 'minitest/autorun'
|
4
|
+
require 'minitest/pride'
|
5
|
+
|
6
|
+
require 'rails/all'
|
7
|
+
require File.expand_path('../rails_app/config/environment.rb', __FILE__)
|
8
|
+
|
9
|
+
SPEC_ROOT = Pathname.new(File.expand_path('../', __FILE__))
|
10
|
+
Dir[SPEC_ROOT.join('support/*.rb')].each{|f| require f }
|
11
|
+
|
12
|
+
require File.expand_path('../../lib/mapped_attributes.rb', __FILE__)
|
metadata
ADDED
@@ -0,0 +1,148 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: mapped_attributes
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Tomasz Borowski [tbprojects]
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-04-02 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rake
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rails
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: sqlite3
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: activerecord
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
type: :runtime
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: i18n
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
type: :runtime
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
description: Allows to build ActiveRecord objects with alternative attribute naming
|
95
|
+
email: info.tbprojects@gmail.com
|
96
|
+
executables: []
|
97
|
+
extensions: []
|
98
|
+
extra_rdoc_files: []
|
99
|
+
files:
|
100
|
+
- .gitignore
|
101
|
+
- Gemfile
|
102
|
+
- LICENCE
|
103
|
+
- README.md
|
104
|
+
- Rakefile
|
105
|
+
- lib/mapped_attributes.rb
|
106
|
+
- lib/mapped_attributes/version.rb
|
107
|
+
- mapped_attributes.gemspec
|
108
|
+
- test/lib/mapped_attributes/mapped_attributes_test.rb
|
109
|
+
- test/lib/mapped_attributes/version_test.rb
|
110
|
+
- test/rails_app/config/application.rb
|
111
|
+
- test/rails_app/config/database.yml
|
112
|
+
- test/rails_app/config/environment.rb
|
113
|
+
- test/rails_app/config/environments/development.rb
|
114
|
+
- test/rails_app/config/environments/production.rb
|
115
|
+
- test/rails_app/config/environments/test.rb
|
116
|
+
- test/rails_app/config/initializers/backtrace_silencers.rb
|
117
|
+
- test/rails_app/config/initializers/inflections.rb
|
118
|
+
- test/rails_app/config/initializers/secret_token.rb
|
119
|
+
- test/rails_app/config/locales/en.yml
|
120
|
+
- test/rails_app/config/routes.rb
|
121
|
+
- test/support/models.rb
|
122
|
+
- test/support/schema.rb
|
123
|
+
- test/test_helper.rb
|
124
|
+
homepage: https://github.com/tbprojects/mapped_attributes
|
125
|
+
licenses: []
|
126
|
+
post_install_message:
|
127
|
+
rdoc_options: []
|
128
|
+
require_paths:
|
129
|
+
- lib
|
130
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
131
|
+
none: false
|
132
|
+
requirements:
|
133
|
+
- - ! '>='
|
134
|
+
- !ruby/object:Gem::Version
|
135
|
+
version: '0'
|
136
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
138
|
+
requirements:
|
139
|
+
- - ! '>='
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '0'
|
142
|
+
requirements: []
|
143
|
+
rubyforge_project:
|
144
|
+
rubygems_version: 1.8.25
|
145
|
+
signing_key:
|
146
|
+
specification_version: 3
|
147
|
+
summary: Allows to build ActiveRecord objects with alternative attribute naming
|
148
|
+
test_files: []
|