acts_as_read_only_i18n_localised 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.codeclimate.yml +30 -0
- data/.gitignore +14 -0
- data/.rspec +2 -0
- data/.travis.yml +8 -0
- data/CONTRIBUTING.md +60 -0
- data/Gemfile +7 -0
- data/Gemfile.lock +57 -0
- data/LICENSE +21 -0
- data/README.md +78 -0
- data/Rakefile +9 -0
- data/acts_as_read_only_i18n_localised.gemspec +29 -0
- data/lib/acts_as_read_only_i18n_localised.rb +41 -0
- data/lib/acts_as_read_only_i18n_localised/version.rb +3 -0
- data/spec/acts_as_read_only_i18n_localised_spec.rb +33 -0
- data/spec/db_helper.rb +3 -0
- data/spec/spec_helper.rb +85 -0
- metadata +144 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: d49d07db700e026f139a9734fd231b13d8305d86
|
4
|
+
data.tar.gz: 1a3fd6440e06b304458e741a1e6ccb3dca0bf0bd
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 4383f8c270f5ba8a6638968e69efa5b5d2911a78e6c70b174b403da30b51caae2a631cf2399a69b5b5d43e0ffea73a80ad1e8cb92cd600b21c4605ab6b64ba8f
|
7
|
+
data.tar.gz: 7d10db3e855a7f976ae40c4945f83b05ebfb2fdb553cfe93f955f6c5092ba24a343f3306e1953102150792661f14ddadfb8e1bbfa5002ef763ce91ec80d913b3
|
data/.codeclimate.yml
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
---
|
2
|
+
engines:
|
3
|
+
brakeman:
|
4
|
+
enabled: false
|
5
|
+
bundler-audit:
|
6
|
+
enabled: true
|
7
|
+
csslint:
|
8
|
+
enabled: false
|
9
|
+
coffeelint:
|
10
|
+
enabled: false
|
11
|
+
duplication:
|
12
|
+
enabled: true
|
13
|
+
config:
|
14
|
+
languages:
|
15
|
+
- ruby
|
16
|
+
eslint:
|
17
|
+
enabled: false
|
18
|
+
fixme:
|
19
|
+
enabled: true
|
20
|
+
rubocop:
|
21
|
+
enabled: true
|
22
|
+
ratings:
|
23
|
+
paths:
|
24
|
+
- Gemfile.lock
|
25
|
+
- "**.rb"
|
26
|
+
exclude_paths:
|
27
|
+
- coverage/
|
28
|
+
- log/
|
29
|
+
- tmp/
|
30
|
+
- Rakefile
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
# How to contribute to Acts as Read-Only I18n Localised project
|
2
|
+
|
3
|
+
## Development Process
|
4
|
+
|
5
|
+
All development is to follow the [standard git-flow](http://nvie.com/posts/a-successful-git-branching-model/) process, modified to allow for code-reviews.
|
6
|
+
|
7
|
+
See this handy, if ugly, [cheat sheet](http://danielkummer.github.io/git-flow-cheatsheet/).
|
8
|
+
|
9
|
+
### Setup
|
10
|
+
|
11
|
+
1. Fork this repo into your personal GitHub account
|
12
|
+
2. clone your fork to your local development machine
|
13
|
+
3. Set this repo as the `upstream` repo `git remote add upstream git@github.com:davesag/acts_as_read_only_i18n_localised.git`
|
14
|
+
4. Disallow direct pushing to upstream `git remote set-url --push upstream no_push`
|
15
|
+
|
16
|
+
### Working on new features
|
17
|
+
|
18
|
+
1. Create a "feature branch" for the change you wish to make via `git flow feature start {feature_name}`. See below for how to name features.
|
19
|
+
2. Now work on your changes locally until you are happy the issue is resolved. See below for how to name commit messages.
|
20
|
+
3. `git flow feature publish {feature_name}` will push it back up to your fork on GitHub.
|
21
|
+
4. Use `git flow feature pull {remote_name} {feature_name}` to bring in any other changes, If other people have also merged changes in, and you can't merge your PR automatically you'll need to `rebase` their changes into your changes and then `--force` push the resulting changes using standard `git` commands.
|
22
|
+
5. Use GitHub to raise a Pull Request. Add labels as appropriate. See below for how to name pull requests.
|
23
|
+
6. Respond to any comments as appropriate, making changes and `git push` ing further changes as appropriate.
|
24
|
+
7. When all comments are dealt and the PR finally gets a :+1: from someone else then merge the PR. _Note we will not be using the `git flow feature finish`_ option as that merges into develop automatically without the option for review. [see this stackexchange for more on that](http://programmers.stackexchange.com/questions/187723/code-review-with-git-flow-and-github).
|
25
|
+
8. In your command-line `git checkout develop` then `git pull upstream develop` to get the latest code and `git branch -D feature/{branchname}` to delete the old feature branch.
|
26
|
+
|
27
|
+
#### Hotfixes and Support branches
|
28
|
+
|
29
|
+
It's basically the same process but use the word `hotfix` or `support` instead of `feature`. `git flow` knows what to do.
|
30
|
+
|
31
|
+
## Naming things
|
32
|
+
|
33
|
+
There are various systems, including GitHub itself, which will pick up the issue numbers from commit messages and pull requests and automatically associate them with the issues. It is therefore desirable to use a formal naming scheme for features, commit messages and pull requests.
|
34
|
+
|
35
|
+
### Features
|
36
|
+
|
37
|
+
Features must be named per the following pattern `{issue number}_{some_descriptive_text}` — so for example, if you are working on issue `#1` with the title "do the thing", call your feature `1_do_the_thing`. Obviously use your common sense to avoid making the feature names too long.
|
38
|
+
|
39
|
+
Note this will creating a feature via `git flow` will create a branch called `feature/{issue number}_{some_descriptive_text}`.
|
40
|
+
|
41
|
+
### Commit Messages
|
42
|
+
|
43
|
+
When commiting something use the `-m` flag to add a short commit message of the format `#{issue number} summary of what you changed`. So for example if you are working on issue `#1` and you added a method to the `aardvark_controller` you might use the following commit message `"#1 added anteater method to aardvark controller"`
|
44
|
+
|
45
|
+
Commit messages ought to be in the past tense.
|
46
|
+
|
47
|
+
In general try to group file changes wherever appropriate, so if your controller change also involved updating something in a helper file, the one commit message can happily encompas the changes to both files. The message ought to reflect the main aim of the change.
|
48
|
+
|
49
|
+
### Pull Requests
|
50
|
+
|
51
|
+
Pull requests must be named as follows `[issue type, #issue number] high level description of change`. The following Issue Types are recognised
|
52
|
+
|
53
|
+
* `Bug Fix` - the change fixes a bug
|
54
|
+
* `Feature` - the change adds a new feature (the usual issue type)
|
55
|
+
* `Documentation` — The change is a documentation only change
|
56
|
+
* `Optimisation` - The change is an optimisation of the code base without any functional changes
|
57
|
+
|
58
|
+
If your change does not fit any of these categories, use `Feature`. Likewise if your change is not tied to an issue number you may use `n/a` instead.
|
59
|
+
|
60
|
+
So to use the above example your Pull Request would be named `[Feature, #1] added anteater to aardvark`
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
acts_as_read_only_i18n_localised (0.0.1)
|
5
|
+
i18n
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
binding_of_caller (0.7.2)
|
11
|
+
debug_inspector (>= 0.0.1)
|
12
|
+
byebug (8.2.5)
|
13
|
+
coderay (1.1.1)
|
14
|
+
debug_inspector (0.0.2)
|
15
|
+
diff-lcs (1.2.5)
|
16
|
+
i18n (0.7.0)
|
17
|
+
method_source (0.8.2)
|
18
|
+
pry (0.10.3)
|
19
|
+
coderay (~> 1.1.0)
|
20
|
+
method_source (~> 0.8.1)
|
21
|
+
slop (~> 3.4)
|
22
|
+
pry-byebug (3.3.0)
|
23
|
+
byebug (~> 8.0)
|
24
|
+
pry (~> 0.10)
|
25
|
+
pry-remote (0.1.8)
|
26
|
+
pry (~> 0.9)
|
27
|
+
slop (~> 3.0)
|
28
|
+
rake (11.1.2)
|
29
|
+
rspec (3.4.0)
|
30
|
+
rspec-core (~> 3.4.0)
|
31
|
+
rspec-expectations (~> 3.4.0)
|
32
|
+
rspec-mocks (~> 3.4.0)
|
33
|
+
rspec-core (3.4.4)
|
34
|
+
rspec-support (~> 3.4.0)
|
35
|
+
rspec-expectations (3.4.0)
|
36
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
37
|
+
rspec-support (~> 3.4.0)
|
38
|
+
rspec-mocks (3.4.1)
|
39
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
40
|
+
rspec-support (~> 3.4.0)
|
41
|
+
rspec-support (3.4.1)
|
42
|
+
slop (3.6.0)
|
43
|
+
|
44
|
+
PLATFORMS
|
45
|
+
ruby
|
46
|
+
|
47
|
+
DEPENDENCIES
|
48
|
+
acts_as_read_only_i18n_localised!
|
49
|
+
binding_of_caller
|
50
|
+
pry
|
51
|
+
pry-byebug
|
52
|
+
pry-remote
|
53
|
+
rake
|
54
|
+
rspec
|
55
|
+
|
56
|
+
BUNDLED WITH
|
57
|
+
1.11.2
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 Dave Sag
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,78 @@
|
|
1
|
+
# Acts as Read-Only I18n Localised
|
2
|
+
|
3
|
+
A variant on the `acts_as_localized` theme for when you have static seed data in your system that must be localised.
|
4
|
+
|
5
|
+
[![Build Status](https://travis-ci.org/davesag/acts_as_read_only_i18n_localised.svg?branch=master)](https://travis-ci.org/davesag/acts_as_read_only_i18n_localised) [![Code Climate](https://codeclimate.com/github/davesag/acts_as_read_only_i18n_localised/badges/gpa.svg)](https://codeclimate.com/github/davesag/acts_as_read_only_i18n_localised)
|
6
|
+
|
7
|
+
## Why use it?
|
8
|
+
|
9
|
+
1. It's designed for a specific use-case, namely the localisation of your seed data.
|
10
|
+
2. It works with the standard Rails I18n system and assumes you already have a lot of your localisation data in `config/locales/*.yml`, or you have your `i18n` stuff already set up in a database.
|
11
|
+
3. It's fast and easy.
|
12
|
+
|
13
|
+
## Example of use
|
14
|
+
|
15
|
+
In `config/locales/categories.en.yml`
|
16
|
+
|
17
|
+
en:
|
18
|
+
categories:
|
19
|
+
fruits:
|
20
|
+
name: Great fresh fruit
|
21
|
+
description: Our fantastic range of seasonal and local fresh fruit will delight you.
|
22
|
+
vegetables:
|
23
|
+
name: Farm fresh veggies
|
24
|
+
description: Our locally grown and freshly harvested veggies are simply delicious.
|
25
|
+
meats:
|
26
|
+
name: Farm-fresh seasonal meat
|
27
|
+
description: >-
|
28
|
+
Loved in life then lightly killed, our meat is locally sourced from small farms
|
29
|
+
that meet our demanding standards.
|
30
|
+
|
31
|
+
In `app/models/category.rb`
|
32
|
+
|
33
|
+
class Category < ActiveRecord::Base
|
34
|
+
include ActsAsReadOnlyI18nLocalised
|
35
|
+
validates :slug, format: {with: /^[a-z]+[\-?[a-z]*]*$/},
|
36
|
+
uniqueness: true,
|
37
|
+
presence: true
|
38
|
+
has_many :products
|
39
|
+
validates_associated :products
|
40
|
+
|
41
|
+
acts_as_read_only_i18n_localised :name, :description
|
42
|
+
end
|
43
|
+
|
44
|
+
This simply generates appropriate `name` and `description` methods along the lines of
|
45
|
+
|
46
|
+
def name
|
47
|
+
key = "#{self.class.name.pluralize}.#{slug}.name".downcase.to_sym
|
48
|
+
return I18n.t(key)
|
49
|
+
end
|
50
|
+
|
51
|
+
with the effect that a call to `category.name` will always return the localised name using the standard `I18n` system.
|
52
|
+
|
53
|
+
Depending on how your code is configured, `I18n` will raise a `MissingTranslationData` exception if the key does correspond to any data. Exceptions on missing keys is usually turned on in `development` and `test` but not on `staging` or `production`. See The [Rails I18n Guide](http://guides.rubyonrails.org/i18n.html) for more.
|
54
|
+
|
55
|
+
## Seeding your database
|
56
|
+
|
57
|
+
In `db/seeds.rb` add something like
|
58
|
+
|
59
|
+
require 'i18n'
|
60
|
+
|
61
|
+
I18n.t(:categories).each do |key, data|
|
62
|
+
Category.create(slug: key)
|
63
|
+
end
|
64
|
+
|
65
|
+
# Development
|
66
|
+
|
67
|
+
## To build the gem
|
68
|
+
|
69
|
+
gem build acts_as_read_only_i18n_localised.gemspec
|
70
|
+
|
71
|
+
## To test it
|
72
|
+
|
73
|
+
rspec
|
74
|
+
|
75
|
+
or
|
76
|
+
|
77
|
+
rake
|
78
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
$LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
|
4
|
+
require 'acts_as_read_only_i18n_localised/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = 'acts_as_read_only_i18n_localised'
|
8
|
+
s.version = ActsAsReadOnlyI18nLocalised::VERSION
|
9
|
+
s.authors = ['Dave Sag']
|
10
|
+
s.email = ['davesag@gmail.com']
|
11
|
+
s.homepage = 'http://github.com/davesag/acts_as_read_only_i18n_localised'
|
12
|
+
s.summary = 'Simple mechanism to allow localised lookups of seed data.'
|
13
|
+
s.description = 'A way to read localised data in Active Record models'
|
14
|
+
s.license = 'MIT'
|
15
|
+
|
16
|
+
s.files = `git ls-files`.split("\n")
|
17
|
+
s.platform = Gem::Platform::RUBY
|
18
|
+
s.require_paths = ['lib']
|
19
|
+
|
20
|
+
s.required_ruby_version = '> 2.0.0'
|
21
|
+
|
22
|
+
s.add_dependency 'i18n'
|
23
|
+
|
24
|
+
s.add_development_dependency 'rspec'
|
25
|
+
s.add_development_dependency 'binding_of_caller'
|
26
|
+
s.add_development_dependency 'pry'
|
27
|
+
s.add_development_dependency 'pry-remote'
|
28
|
+
s.add_development_dependency 'pry-byebug'
|
29
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
require 'i18n'
|
2
|
+
|
3
|
+
#
|
4
|
+
# Use as follows
|
5
|
+
# class Thing < ActiveRecord::Base
|
6
|
+
# include ActsAsReadOnlyI18nLocalised
|
7
|
+
# validates :slug, format: {with: /^[a-z]+[\-?[a-z]*]*$/},
|
8
|
+
# uniqueness: true,
|
9
|
+
# presence: true
|
10
|
+
# acts_as_read_only_i18n_localised :name
|
11
|
+
# end
|
12
|
+
#
|
13
|
+
# thing = Thing.create(stub: 'test')
|
14
|
+
# puts(thing.name)
|
15
|
+
#
|
16
|
+
module ActsAsReadOnlyI18nLocalised
|
17
|
+
def self.included(base)
|
18
|
+
base.extend(ClassMethods)
|
19
|
+
end
|
20
|
+
|
21
|
+
#
|
22
|
+
# Standard Ruby idiom for auto-adding class methods
|
23
|
+
#
|
24
|
+
module ClassMethods
|
25
|
+
def underscore(string)
|
26
|
+
string
|
27
|
+
end
|
28
|
+
|
29
|
+
def acts_as_read_only_i18n_localised(*attributes)
|
30
|
+
attributes.each do |attribute|
|
31
|
+
define_method attribute do
|
32
|
+
I18n.t("#{self.class.name.gsub(/::/, '/')
|
33
|
+
.gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
|
34
|
+
.gsub(/([a-z\d])([A-Z])/, '\1_\2')
|
35
|
+
.tr('-', '_')}.#{send(:slug)}.#{attribute}"
|
36
|
+
.downcase.to_sym)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'i18n'
|
2
|
+
require 'acts_as_read_only_i18n_localised'
|
3
|
+
|
4
|
+
class TestModel
|
5
|
+
include ActsAsReadOnlyI18nLocalised
|
6
|
+
attr_reader :slug
|
7
|
+
|
8
|
+
def initialize(options)
|
9
|
+
@slug = options[:slug]
|
10
|
+
end
|
11
|
+
|
12
|
+
acts_as_read_only_i18n_localised :name
|
13
|
+
end
|
14
|
+
|
15
|
+
describe 'ActsAsReadOnlyI18nLocalised' do
|
16
|
+
let(:model) { TestModel.new(slug: 'test') }
|
17
|
+
let(:key) { :'test_model.test.name' }
|
18
|
+
let(:expected) { 'test-result' }
|
19
|
+
|
20
|
+
before :all do
|
21
|
+
I18n.enforce_available_locales = false
|
22
|
+
I18n.locale = :en
|
23
|
+
end
|
24
|
+
|
25
|
+
before :each do
|
26
|
+
allow(I18n).to receive(:t).with(key).and_return(expected)
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'has a name method' do
|
30
|
+
expect(model).to respond_to :name
|
31
|
+
expect(model.name).to eq expected
|
32
|
+
end
|
33
|
+
end
|
data/spec/db_helper.rb
ADDED
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,85 @@
|
|
1
|
+
# The `.rspec` file also contains a few flags that are not defaults but that
|
2
|
+
# users commonly want.
|
3
|
+
#
|
4
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
5
|
+
RSpec.configure do |config|
|
6
|
+
# rspec-expectations config goes here. You can use an alternate
|
7
|
+
# assertion/expectation library such as wrong or the stdlib/minitest
|
8
|
+
# assertions if you prefer.
|
9
|
+
config.expect_with :rspec do |expectations|
|
10
|
+
# This option will default to `true` in RSpec 4. It makes the `description`
|
11
|
+
# and `failure_message` of custom matchers include text for helper methods
|
12
|
+
# defined using `chain`, e.g.:
|
13
|
+
# be_bigger_than(2).and_smaller_than(4).description
|
14
|
+
# # => "be bigger than 2 and smaller than 4"
|
15
|
+
# ...rather than:
|
16
|
+
# # => "be bigger than 2"
|
17
|
+
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
|
18
|
+
end
|
19
|
+
|
20
|
+
# rspec-mocks config goes here. You can use an alternate test double
|
21
|
+
# library (such as bogus or mocha) by changing the `mock_with` option here.
|
22
|
+
config.mock_with :rspec do |mocks|
|
23
|
+
# Prevents you from mocking or stubbing a method that does not exist on
|
24
|
+
# a real object. This is generally recommended, and will default to
|
25
|
+
# `true` in RSpec 4.
|
26
|
+
mocks.verify_partial_doubles = true
|
27
|
+
end
|
28
|
+
|
29
|
+
# allow us to disable verify_partial_doubles on a case by case basis.
|
30
|
+
config.around(:each, verify_stubs: false) do |ex|
|
31
|
+
config.mock_with :rspec do |mocks|
|
32
|
+
mocks.verify_partial_doubles = false
|
33
|
+
ex.run
|
34
|
+
mocks.verify_partial_doubles = true
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
# These two settings work together to allow you to limit a spec run
|
39
|
+
# to individual examples or groups you care about by tagging them with
|
40
|
+
# `:focus` metadata. When nothing is tagged with `:focus`, all examples
|
41
|
+
# get run.
|
42
|
+
config.filter_run :focus
|
43
|
+
config.run_all_when_everything_filtered = true
|
44
|
+
|
45
|
+
# Allows RSpec to persist some state between runs in order to support
|
46
|
+
# the `--only-failures` and `--next-failure` CLI options. We recommend
|
47
|
+
# you configure your source control system to ignore this file.
|
48
|
+
# config.example_status_persistence_file_path = 'spec/examples.txt'
|
49
|
+
|
50
|
+
# Limits the available syntax to the non-monkey patched syntax that is
|
51
|
+
# recommended. For more details, see:
|
52
|
+
# - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
|
53
|
+
# - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
|
54
|
+
# - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
|
55
|
+
config.disable_monkey_patching!
|
56
|
+
# But allow use of `describe` etc regardless.
|
57
|
+
config.expose_dsl_globally = true
|
58
|
+
|
59
|
+
# Many RSpec users commonly either run the entire suite or an individual
|
60
|
+
# file, and it's useful to allow more verbose output when running an
|
61
|
+
# individual spec file.
|
62
|
+
if config.files_to_run.one?
|
63
|
+
# Use the documentation formatter for detailed output,
|
64
|
+
# unless a formatter has already been configured
|
65
|
+
# (e.g. via a command-line flag).
|
66
|
+
config.default_formatter = 'doc'
|
67
|
+
end
|
68
|
+
|
69
|
+
# Print the 10 slowest examples and example groups at the
|
70
|
+
# end of the spec run, to help surface which specs are running
|
71
|
+
# particularly slow.
|
72
|
+
config.profile_examples = 10
|
73
|
+
|
74
|
+
# Run specs in random order to surface order dependencies. If you find an
|
75
|
+
# order dependency and want to debug it, you can fix the order by providing
|
76
|
+
# the seed, which is printed after each run.
|
77
|
+
# --seed 1234
|
78
|
+
config.order = :random
|
79
|
+
|
80
|
+
# Seed global randomization in this process using the `--seed` CLI option.
|
81
|
+
# Setting this allows you to use `--seed` to deterministically reproduce
|
82
|
+
# test failures related to randomization by passing the same `--seed` value
|
83
|
+
# as the one that triggered the failure.
|
84
|
+
Kernel.srand config.seed
|
85
|
+
end
|
metadata
ADDED
@@ -0,0 +1,144 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: acts_as_read_only_i18n_localised
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Dave Sag
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-05-06 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: i18n
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rspec
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: binding_of_caller
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: pry
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: pry-remote
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: pry-byebug
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
description: A way to read localised data in Active Record models
|
98
|
+
email:
|
99
|
+
- davesag@gmail.com
|
100
|
+
executables: []
|
101
|
+
extensions: []
|
102
|
+
extra_rdoc_files: []
|
103
|
+
files:
|
104
|
+
- ".codeclimate.yml"
|
105
|
+
- ".gitignore"
|
106
|
+
- ".rspec"
|
107
|
+
- ".travis.yml"
|
108
|
+
- CONTRIBUTING.md
|
109
|
+
- Gemfile
|
110
|
+
- Gemfile.lock
|
111
|
+
- LICENSE
|
112
|
+
- README.md
|
113
|
+
- Rakefile
|
114
|
+
- acts_as_read_only_i18n_localised.gemspec
|
115
|
+
- lib/acts_as_read_only_i18n_localised.rb
|
116
|
+
- lib/acts_as_read_only_i18n_localised/version.rb
|
117
|
+
- spec/acts_as_read_only_i18n_localised_spec.rb
|
118
|
+
- spec/db_helper.rb
|
119
|
+
- spec/spec_helper.rb
|
120
|
+
homepage: http://github.com/davesag/acts_as_read_only_i18n_localised
|
121
|
+
licenses:
|
122
|
+
- MIT
|
123
|
+
metadata: {}
|
124
|
+
post_install_message:
|
125
|
+
rdoc_options: []
|
126
|
+
require_paths:
|
127
|
+
- lib
|
128
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- - ">"
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: 2.0.0
|
133
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
134
|
+
requirements:
|
135
|
+
- - ">="
|
136
|
+
- !ruby/object:Gem::Version
|
137
|
+
version: '0'
|
138
|
+
requirements: []
|
139
|
+
rubyforge_project:
|
140
|
+
rubygems_version: 2.4.8
|
141
|
+
signing_key:
|
142
|
+
specification_version: 4
|
143
|
+
summary: Simple mechanism to allow localised lookups of seed data.
|
144
|
+
test_files: []
|