ar-translatable 0.1.0 → 0.2.0

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: 242507fe538b5f33e98261046643e45763743378
4
- data.tar.gz: 51473bf243c66075c3d78e31c87ddaf236e2e05c
3
+ metadata.gz: be0b0dd51089a14927e703832923497a06aa4445
4
+ data.tar.gz: ff049f573ac9e966204ac487c03c852e792fc7d7
5
5
  SHA512:
6
- metadata.gz: 0a6df6b0a8af10c75eba96dd1c5b4edd7821161d557944efced550c2e210893fb79fdafe674841cdf6ca6c9a1d90ae31cc298027525fe5f2163a3e1fa6c544e8
7
- data.tar.gz: ead6b33a36a8244cdfb44d9aad8a390ada658e95adaee8c222cc17d335725bed386f335bf7375a88c9e276ebca777cc517bb1912669bfb5089eed27a7001627e
6
+ metadata.gz: e49a83e504c916260916428b6979641c40e99d37423b25fad8f226e456015f3249ae3dad38bcc8b545fde829009eaf5b0e4be1f01d54f052d9a933a0c2e16500
7
+ data.tar.gz: a352f011c2fdc6c5eb8fbda9e165a17b3961d6052772a4ef56469cfc00e642d86d5169fbd5ea34d7a0a31bf409b46516a928b37dc549a6c52a6d649a2b8a635b
@@ -0,0 +1,20 @@
1
+ # This configuration was generated by `rubocop --auto-gen-config`
2
+ # on 2014-09-22 04:32:14 +0900 using RuboCop version 0.26.1.
3
+ # The point is for the user to remove these configuration records
4
+ # one by one as the offenses are removed from the code base.
5
+ # Note that changes in the inspected code, or installation of new
6
+ # versions of RuboCop, may require this file to be generated again.
7
+
8
+ AllCops:
9
+ RunRailsCops: true
10
+ Excludes:
11
+ - spec/dummy/db/schema.rb
12
+ - vendor/bundle/**/*
13
+ Metrics/LineLength:
14
+ Enabled: false
15
+ Style/Documentation:
16
+ Enabled: false
17
+ Style/FileName:
18
+ Enabled: false
19
+ Style/RegexpLiteral:
20
+ Enabled: false
@@ -1,8 +1,8 @@
1
1
  language: ruby
2
2
  rvm:
3
3
  - 2.0.0
4
- - 2.1.2
4
+ - 2.1.3
5
5
  before_script:
6
- - cd spec/dummy
7
6
  - bundle exec rake db:migrate
8
- - cd ../../
7
+ - bundle exec rake spec
8
+ - bundle exec rubocop
@@ -0,0 +1,37 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ # Note: The cmd option is now required due to the increasing number of ways
5
+ # rspec may be run, below are examples of the most common uses.
6
+ # * bundler: 'bundle exec rspec'
7
+ # * bundler binstubs: 'bin/rspec'
8
+ # * spring: 'bin/rsspec' (This will use spring if running and you have
9
+ # installed the spring binstubs per the docs)
10
+ # * zeus: 'zeus rspec' (requires the server to be started separetly)
11
+ # * 'just' rspec: 'rspec'
12
+ guard :rspec, cmd: 'bundle exec rspec' do
13
+ watch(%r{^spec/.+_spec\.rb$})
14
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
15
+ watch('spec/spec_helper.rb') { 'spec' }
16
+
17
+ # Rails example
18
+ watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
19
+ watch(%r{^app/(.*)(\.erb|\.haml|\.slim)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
20
+ watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
21
+ watch(%r{^spec/support/(.+)\.rb$}) { 'spec' }
22
+ watch('config/routes.rb') { 'spec/routing' }
23
+ watch('app/controllers/application_controller.rb') { 'spec/controllers' }
24
+ watch('spec/rails_helper.rb') { 'spec' }
25
+
26
+ # Capybara features specs
27
+ watch(%r{^app/views/(.+)/.*\.(erb|haml|slim)$}) { |m| "spec/features/#{m[1]}_spec.rb" }
28
+
29
+ # Turnip features and steps
30
+ watch(%r{^spec/acceptance/(.+)\.feature$})
31
+ watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' }
32
+ end
33
+
34
+ guard :rubocop, cli: '--auto-correct' do
35
+ watch(%r{.+\.rb$})
36
+ watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
37
+ end
data/README.md CHANGED
@@ -20,7 +20,7 @@ Or install it yourself as:
20
20
 
21
21
  ### Setup
22
22
 
23
- rails generate translatable:migration
23
+ rake translatable:install:migrations
24
24
  rake db:migrate
25
25
 
26
26
  ### Setting Model
data/Rakefile CHANGED
@@ -1,7 +1,15 @@
1
- require "bundler/gem_tasks"
2
- require "rspec/core/rake_task"
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
3
6
 
4
- RSpec::Core::RakeTask.new(:spec)
7
+ require 'bundler/gem_tasks'
8
+ require 'rspec/core/rake_task'
9
+
10
+ APP_RAKEFILE = File.expand_path('../spec/dummy/Rakefile', __FILE__)
11
+ load 'rails/tasks/engine.rake'
5
12
 
6
- task :default => :spec
13
+ RSpec::Core::RakeTask.new(:spec)
7
14
 
15
+ task default: :spec
@@ -0,0 +1,33 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'translatable/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'ar-translatable'
8
+ spec.version = Translatable::VERSION
9
+ spec.authors = ['masarakki']
10
+ spec.email = ['masaki@hisme.net']
11
+ spec.summary = 'ActiveRecord plugin to translate.'
12
+ spec.description = 'ActiveRecord plugin to translate.'
13
+ spec.homepage = 'https://github.com/masarakki/ar-translatable'
14
+ spec.license = 'MIT'
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ['lib']
20
+
21
+ spec.add_development_dependency 'bundler', '~> 1.6'
22
+ spec.add_dependency 'rails', '>= 4.0.0'
23
+ spec.add_development_dependency 'sqlite3'
24
+ spec.add_development_dependency 'rake'
25
+ spec.add_development_dependency 'rspec'
26
+ spec.add_development_dependency 'rspec-rails'
27
+ spec.add_development_dependency 'pry'
28
+ spec.add_development_dependency 'pry-doc'
29
+ spec.add_development_dependency 'factory_girl_rails'
30
+ spec.add_development_dependency 'guard'
31
+ spec.add_development_dependency 'guard-rspec'
32
+ spec.add_development_dependency 'guard-rubocop'
33
+ end
@@ -1,11 +1,11 @@
1
1
  class CreateTranslatedWords < ActiveRecord::Migration
2
2
  def change
3
3
  create_table(:translated_words) do |t|
4
- t.string :translatable_type, null: false
4
+ t.string :translatable_type, null: false
5
5
  t.integer :translatable_id, null: false
6
- t.string :key, null: false
7
- t.string :locale, null: false
8
- t.string :value, null: false
6
+ t.string :key, null: false
7
+ t.string :locale, null: false
8
+ t.string :value, null: false
9
9
  t.index [:translatable_type, :translatable_id, :key, :locale], name: 'translated_word', unique: true
10
10
  t.timestamps
11
11
  end
@@ -1,6 +1,6 @@
1
- require "translatable/version"
2
- require "translatable/acts_as_translatable"
3
- require "translatable/engine" if defined? Rails
1
+ require 'translatable/version'
2
+ require 'translatable/acts_as_translatable'
3
+ require 'translatable/engine' if defined? Rails
4
4
 
5
5
  module Translatable
6
6
  end
@@ -7,12 +7,12 @@ module Translatable
7
7
  module ClassMethods
8
8
  def translatable(column)
9
9
  key_name = column.to_s.pluralize.to_sym
10
- has_many key_name, -> { where(key: column.to_s) }, :as => :translatable, class_name: 'TranslatedWord',
11
- :inverse_of => :translatable, :dependent => :destroy
10
+ has_many key_name, -> { where(key: column.to_s) }, as: :translatable, class_name: 'TranslatedWord',
11
+ inverse_of: :translatable, dependent: :destroy
12
12
  accepts_nested_attributes_for key_name
13
13
  define_method column do |locale = I18n.default_locale|
14
14
  localizes = send(key_name)
15
- localizes.detect{|w| w.locale.to_s == locale.to_s }.try(:value) || localizes.first.try(:value)
15
+ localizes.find { |w| w.locale.to_s == locale.to_s }.try(:value) || localizes.first.try(:value)
16
16
  end
17
17
  end
18
18
  end
@@ -1,7 +1,7 @@
1
1
  module Translatable
2
2
  class Engine < ::Rails::Engine
3
3
  isolate_namespace Translatable
4
- initializer "translatable.initialize" do
4
+ initializer 'translatable.initialize' do
5
5
  ActiveSupport.on_load :active_record do
6
6
  include Translatable::ActsAsTranslatable
7
7
  end
@@ -1,9 +1,9 @@
1
1
  module Translatable
2
2
  class Railtie < ::Rails::Railtie
3
- initializer "translatable.initialize" do
3
+ initializer 'translatable.initialize' do
4
4
  ActiveSupport.on_load :active_record do
5
5
  include Translatable::ActsAsTranslatable
6
- require "translatable/translated_word"
6
+ require 'translatable/translated_word'
7
7
  end
8
8
  end
9
9
  end
@@ -1,3 +1,3 @@
1
1
  module Translatable
2
- VERSION = "0.1.0"
2
+ VERSION = '0.2.0'
3
3
  end
@@ -3,7 +3,7 @@ require File.expand_path('../boot', __FILE__)
3
3
  require 'rails/all'
4
4
 
5
5
  Bundler.require(*Rails.groups)
6
- require "translatable"
6
+ require 'translatable'
7
7
 
8
8
  module Dummy
9
9
  class Application < Rails::Application
@@ -1,3 +1,3 @@
1
1
  # Be sure to restart your server when you modify this file.
2
2
 
3
- Rails.application.config.action_dispatch.cookies_serializer = :json
3
+ Rails.application.config.action_dispatch.cookies_serializer = :json
@@ -11,24 +11,24 @@
11
11
  #
12
12
  # It's strongly recommended that you check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(version: 20140625174008) do
14
+ ActiveRecord::Schema.define(version: 20_140_625_174_008) do
15
15
 
16
- create_table "translated_words", force: true do |t|
17
- t.string "translatable_type", null: false
18
- t.integer "translatable_id", null: false
19
- t.string "key", null: false
20
- t.string "locale", null: false
21
- t.string "value", null: false
22
- t.datetime "created_at"
23
- t.datetime "updated_at"
16
+ create_table 'translated_words', force: true do |t|
17
+ t.string 'translatable_type', null: false
18
+ t.integer 'translatable_id', null: false
19
+ t.string 'key', null: false
20
+ t.string 'locale', null: false
21
+ t.string 'value', null: false
22
+ t.datetime 'created_at'
23
+ t.datetime 'updated_at'
24
24
  end
25
25
 
26
- add_index "translated_words", ["translatable_type", "translatable_id", "key", "locale"], name: "translated_word", unique: true
26
+ add_index 'translated_words', %w(translatable_type translatable_id key locale), name: 'translated_word', unique: true
27
27
 
28
- create_table "users", force: true do |t|
29
- t.date "birthday"
30
- t.datetime "created_at"
31
- t.datetime "updated_at"
28
+ create_table 'users', force: true do |t|
29
+ t.date 'birthday'
30
+ t.datetime 'created_at'
31
+ t.datetime 'updated_at'
32
32
  end
33
33
 
34
34
  end
@@ -5,12 +5,12 @@ FactoryGirl.define do
5
5
  key :first_name
6
6
  trait :en do
7
7
  locale :en
8
- value "John"
8
+ value 'John'
9
9
  end
10
10
 
11
11
  trait :ja do
12
12
  locale :ja
13
- value "ジョン"
13
+ value 'ジョン'
14
14
  end
15
15
  end
16
16
  end
@@ -1,7 +1,7 @@
1
1
  require 'rails_helper'
2
2
 
3
3
  describe TranslatedWord do
4
- describe "factory" do
4
+ describe 'factory' do
5
5
  it { expect(build(:translated_word, :en)).to be_valid }
6
6
  end
7
7
  end
@@ -2,42 +2,42 @@
2
2
  require 'rails_helper'
3
3
 
4
4
  describe User do
5
- describe "factory" do
5
+ describe 'factory' do
6
6
  it { expect(build(:user)).to be_valid }
7
7
  end
8
8
 
9
- describe "nested_attributes_for" do
10
- let(:user) {
9
+ describe 'nested_attributes_for' do
10
+ let(:user) do
11
11
  User.create(
12
- first_names_attributes: [{locale: 'ja', value: 'ジョン'}, {locale: 'en', value: 'John'}],
13
- last_names_attributes: [{locale: 'ja', value: 'レノン'}, {locale: 'en', value: 'Lennon'}]
12
+ first_names_attributes: [{ locale: 'ja', value: 'ジョン' }, { locale: 'en', value: 'John' }],
13
+ last_names_attributes: [{ locale: 'ja', value: 'レノン' }, { locale: 'en', value: 'Lennon' }]
14
14
  )
15
- }
15
+ end
16
16
  it { expect(user.first_names.count).to eq 2 }
17
17
  it { expect(user.last_names.count).to eq 2 }
18
18
  end
19
19
 
20
- describe "translatable" do
20
+ describe 'translatable' do
21
21
  before { I18n.available_locales = [:en, :ja] }
22
22
  let(:user) { create :user }
23
23
  before do
24
24
  create :translated_word, :en, translatable: user
25
25
  create :translated_word, :ja, translatable: user
26
26
  end
27
- it { expect(user.first_name(:en)).to eq "John" }
28
- it { expect(user.first_name(:ja)).to eq "ジョン" }
29
- it { expect(user.first_name(:fr)).to eq "John" }
27
+ it { expect(user.first_name(:en)).to eq 'John' }
28
+ it { expect(user.first_name(:ja)).to eq 'ジョン' }
29
+ it { expect(user.first_name(:fr)).to eq 'John' }
30
30
 
31
- context "default locale = :en" do
31
+ context 'default locale = :en' do
32
32
  before { I18n.default_locale = :en }
33
33
  after { I18n.default_locale = :en }
34
- it { expect(user.first_name).to eq "John" }
34
+ it { expect(user.first_name).to eq 'John' }
35
35
  end
36
36
 
37
- context "default locale = :ja" do
37
+ context 'default locale = :ja' do
38
38
  before { I18n.default_locale = :ja }
39
39
  after { I18n.default_locale = :en }
40
- it { expect(user.first_name).to eq "ジョン" }
40
+ it { expect(user.first_name).to eq 'ジョン' }
41
41
  end
42
42
  end
43
43
  end
@@ -1,8 +1,8 @@
1
1
  # Configure Rails Environment
2
- ENV["RAILS_ENV"] = "test"
3
- require "spec_helper"
2
+ ENV['RAILS_ENV'] = 'test'
3
+ require 'spec_helper'
4
4
  require 'pry'
5
- require File.expand_path("../dummy/config/environment.rb", __FILE__)
5
+ require File.expand_path('../dummy/config/environment.rb', __FILE__)
6
6
  require 'rspec/rails'
7
7
 
8
8
  # Load support files
@@ -14,65 +14,63 @@
14
14
  # users commonly want.
15
15
  #
16
16
  # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
17
- RSpec.configure do |config|
18
- # The settings below are suggested to provide a good initial experience
19
- # with RSpec, but feel free to customize to your heart's content.
20
- =begin
21
- # These two settings work together to allow you to limit a spec run
22
- # to individual examples or groups you care about by tagging them with
23
- # `:focus` metadata. When nothing is tagged with `:focus`, all examples
24
- # get run.
25
- config.filter_run :focus
26
- config.run_all_when_everything_filtered = true
27
-
28
- # Many RSpec users commonly either run the entire suite or an individual
29
- # file, and it's useful to allow more verbose output when running an
30
- # individual spec file.
31
- if config.files_to_run.one?
32
- # Use the documentation formatter for detailed output,
33
- # unless a formatter has already been configured
34
- # (e.g. via a command-line flag).
35
- config.default_formatter = 'doc'
36
- end
37
-
38
- # Print the 10 slowest examples and example groups at the
39
- # end of the spec run, to help surface which specs are running
40
- # particularly slow.
41
- config.profile_examples = 10
42
-
43
- # Run specs in random order to surface order dependencies. If you find an
44
- # order dependency and want to debug it, you can fix the order by providing
45
- # the seed, which is printed after each run.
46
- # --seed 1234
47
- config.order = :random
48
-
49
- # Seed global randomization in this process using the `--seed` CLI option.
50
- # Setting this allows you to use `--seed` to deterministically reproduce
51
- # test failures related to randomization by passing the same `--seed` value
52
- # as the one that triggered the failure.
53
- Kernel.srand config.seed
54
-
55
- # rspec-expectations config goes here. You can use an alternate
56
- # assertion/expectation library such as wrong or the stdlib/minitest
57
- # assertions if you prefer.
58
- config.expect_with :rspec do |expectations|
59
- # Enable only the newer, non-monkey-patching expect syntax.
60
- # For more details, see:
61
- # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
62
- expectations.syntax = :expect
63
- end
64
-
65
- # rspec-mocks config goes here. You can use an alternate test double
66
- # library (such as bogus or mocha) by changing the `mock_with` option here.
67
- config.mock_with :rspec do |mocks|
68
- # Enable only the newer, non-monkey-patching expect syntax.
69
- # For more details, see:
70
- # - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
71
- mocks.syntax = :expect
72
-
73
- # Prevents you from mocking or stubbing a method that does not exist on
74
- # a real object. This is generally recommended.
75
- mocks.verify_partial_doubles = true
76
- end
77
- =end
17
+ RSpec.configure do |_config|
18
+ # The settings below are suggested to provide a good initial experience
19
+ # with RSpec, but feel free to customize to your heart's content.
20
+ # # These two settings work together to allow you to limit a spec run
21
+ # # to individual examples or groups you care about by tagging them with
22
+ # # `:focus` metadata. When nothing is tagged with `:focus`, all examples
23
+ # # get run.
24
+ # config.filter_run :focus
25
+ # config.run_all_when_everything_filtered = true
26
+ #
27
+ # # Many RSpec users commonly either run the entire suite or an individual
28
+ # # file, and it's useful to allow more verbose output when running an
29
+ # # individual spec file.
30
+ # if config.files_to_run.one?
31
+ # # Use the documentation formatter for detailed output,
32
+ # # unless a formatter has already been configured
33
+ # # (e.g. via a command-line flag).
34
+ # config.default_formatter = 'doc'
35
+ # end
36
+ #
37
+ # # Print the 10 slowest examples and example groups at the
38
+ # # end of the spec run, to help surface which specs are running
39
+ # # particularly slow.
40
+ # config.profile_examples = 10
41
+ #
42
+ # # Run specs in random order to surface order dependencies. If you find an
43
+ # # order dependency and want to debug it, you can fix the order by providing
44
+ # # the seed, which is printed after each run.
45
+ # # --seed 1234
46
+ # config.order = :random
47
+ #
48
+ # # Seed global randomization in this process using the `--seed` CLI option.
49
+ # # Setting this allows you to use `--seed` to deterministically reproduce
50
+ # # test failures related to randomization by passing the same `--seed` value
51
+ # # as the one that triggered the failure.
52
+ # Kernel.srand config.seed
53
+ #
54
+ # # rspec-expectations config goes here. You can use an alternate
55
+ # # assertion/expectation library such as wrong or the stdlib/minitest
56
+ # # assertions if you prefer.
57
+ # config.expect_with :rspec do |expectations|
58
+ # # Enable only the newer, non-monkey-patching expect syntax.
59
+ # # For more details, see:
60
+ # # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
61
+ # expectations.syntax = :expect
62
+ # end
63
+ #
64
+ # # rspec-mocks config goes here. You can use an alternate test double
65
+ # # library (such as bogus or mocha) by changing the `mock_with` option here.
66
+ # config.mock_with :rspec do |mocks|
67
+ # # Enable only the newer, non-monkey-patching expect syntax.
68
+ # # For more details, see:
69
+ # # - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
70
+ # mocks.syntax = :expect
71
+ #
72
+ # # Prevents you from mocking or stubbing a method that does not exist on
73
+ # # a real object. This is generally recommended.
74
+ # mocks.verify_partial_doubles = true
75
+ # end
78
76
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ar-translatable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - masarakki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-11 00:00:00.000000000 Z
11
+ date: 2014-09-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -136,6 +136,48 @@ dependencies:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: guard
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: guard-rspec
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: guard-rubocop
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
139
181
  description: ActiveRecord plugin to translate.
140
182
  email:
141
183
  - masaki@hisme.net
@@ -145,15 +187,17 @@ extra_rdoc_files: []
145
187
  files:
146
188
  - ".gitignore"
147
189
  - ".rspec"
190
+ - ".rubocop.yml"
148
191
  - ".travis.yml"
149
192
  - Gemfile
193
+ - Guardfile
150
194
  - LICENSE.txt
151
195
  - README.md
152
196
  - Rakefile
153
197
  - app/models/translated_word.rb
198
+ - ar-translatable.gemspec
199
+ - db/migrate/20140625163354_create_translated_words.rb
154
200
  - lib/ar-translatable.rb
155
- - lib/generators/translatable/migration_generator.rb
156
- - lib/generators/translatable/templates/migration.rb
157
201
  - lib/translatable.rb
158
202
  - lib/translatable/acts_as_translatable.rb
159
203
  - lib/translatable/engine.rb
@@ -194,7 +238,6 @@ files:
194
238
  - spec/dummy/config/locales/en.yml
195
239
  - spec/dummy/config/routes.rb
196
240
  - spec/dummy/config/secrets.yml
197
- - spec/dummy/db/migrate/20140625163354_create_translated_words.rb
198
241
  - spec/dummy/db/migrate/20140625174008_create_users.rb
199
242
  - spec/dummy/db/schema.rb
200
243
  - spec/dummy/lib/assets/.keep
@@ -211,8 +254,7 @@ files:
211
254
  - spec/spec_helper.rb
212
255
  - spec/translatable/acts_as_translatable_spec.rb
213
256
  - spec/translatable_spec.rb
214
- - translatable.gemspec
215
- homepage: https://github.com/masarakki/translatable
257
+ homepage: https://github.com/masarakki/ar-translatable
216
258
  licenses:
217
259
  - MIT
218
260
  metadata: {}
@@ -271,7 +313,6 @@ test_files:
271
313
  - spec/dummy/config/locales/en.yml
272
314
  - spec/dummy/config/routes.rb
273
315
  - spec/dummy/config/secrets.yml
274
- - spec/dummy/db/migrate/20140625163354_create_translated_words.rb
275
316
  - spec/dummy/db/migrate/20140625174008_create_users.rb
276
317
  - spec/dummy/db/schema.rb
277
318
  - spec/dummy/lib/assets/.keep
@@ -1,17 +0,0 @@
1
- require 'rails/generators/active_record'
2
-
3
- module Translatable
4
- class MigrationGenerator < ::Rails::Generators::Base
5
- include Rails::Generators::Migration
6
- source_root File.expand_path('../templates', __FILE__)
7
-
8
- desc 'Install migration file'
9
- def install
10
- migration_template 'migration.rb', 'db/migrate/create_translated_words.rb'
11
- end
12
-
13
- def self.next_migration_number(dirname)
14
- ActiveRecord::Generators::Base.next_migration_number(dirname)
15
- end
16
- end
17
- end
@@ -1,13 +0,0 @@
1
- class CreateTranslatedWords < ActiveRecord::Migration
2
- def change
3
- create_table(:translated_words) do |t|
4
- t.string :translatable_type, null: false
5
- t.integer :translatable_id, null: false
6
- t.string :key, null: false
7
- t.string :locale, null: false
8
- t.string :value, null: false
9
- t.index [:translatable_type, :translatable_id, :key, :locale], name: 'translated_word', unique: true
10
- t.timestamps
11
- end
12
- end
13
- end
@@ -1,30 +0,0 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'translatable/version'
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = "ar-translatable"
8
- spec.version = Translatable::VERSION
9
- spec.authors = ["masarakki"]
10
- spec.email = ["masaki@hisme.net"]
11
- spec.summary = %q{ActiveRecord plugin to translate.}
12
- spec.description = %q{ActiveRecord plugin to translate.}
13
- spec.homepage = "https://github.com/masarakki/translatable"
14
- spec.license = "MIT"
15
-
16
- spec.files = `git ls-files -z`.split("\x0")
17
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
- spec.require_paths = ["lib"]
20
-
21
- spec.add_development_dependency "bundler", "~> 1.6"
22
- spec.add_dependency "rails", ">= 4.0.0"
23
- spec.add_development_dependency "sqlite3"
24
- spec.add_development_dependency "rake"
25
- spec.add_development_dependency "rspec"
26
- spec.add_development_dependency "rspec-rails"
27
- spec.add_development_dependency "pry"
28
- spec.add_development_dependency "pry-doc"
29
- spec.add_development_dependency "factory_girl_rails"
30
- end