carrierwave_globalize 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: e3e1c2642e15a6453897922c98e0acf54f96683d
4
- data.tar.gz: c831eba2095b6ee0b4452c5ecd995db755c6559b
3
+ metadata.gz: 73d89a83834110cd286cf3a1ef93fd742e648b54
4
+ data.tar.gz: 65295beb8bd5582f22bc334c1358f282cd0c7ba4
5
5
  SHA512:
6
- metadata.gz: 2f907118263e277b5cfce8317e7be7b56d440c683fa9543f511b3fbd6d0102563d60fb379c86d41ffc9aaca5f588f448c173544fb364f6ac33180bad3ceadd37
7
- data.tar.gz: 67c9dfb756e3daefb6e04128fc5b4f479d4c7e7fd8c4fac2e3b3f9a7bf6a82197ac294a7eac1e44bb566ea0a2b45622824910681c83efeea90ba2e47c0f55b15
6
+ metadata.gz: 23d33b0e5b0602193a52959bf255bac03e789befe97ad165d337e57e1f86cbc1370b102f3b768400719eafdf640b69802fa0276fde8690eb334f9b3d61561add
7
+ data.tar.gz: 2055a375275fad568fce3cbf1d71ecb014a3be4611084b99efb88a2a49bb21d266fab0bec740cb6a089d5db20ca56e05de56f42a384b27eddc8a3710d3320242
data/.rubocop.yml ADDED
@@ -0,0 +1,18 @@
1
+ AllCops:
2
+ TargetRubyVersion: 2.4
3
+
4
+ Include:
5
+ - '**/Rakefile'
6
+ - '**/Gemfile'
7
+
8
+ Exclude:
9
+ - 'carrierwave_globalize.gemspec'
10
+ - 'spec/tmp/**/*'
11
+ - 'spec/public/**/*'
12
+ - 'spec/log/**/*'
13
+ - 'spec/dummy_app/**/*'
14
+ - 'spec/dummy_app/**/*'
15
+ - 'spec/dummy_app.rb'
16
+ - 'bin/**/*'
17
+ - 'coverage/**/*'
18
+ - 'pkg/**/*'
data/.travis.yml CHANGED
@@ -5,7 +5,8 @@ sudo: false
5
5
  rvm:
6
6
  - 2.1.9
7
7
  - 2.2.5
8
- - 2.3.1
8
+ - 2.3.3
9
+ - 2.4.1
9
10
  - jruby
10
11
  - rbx-2
11
12
  - ruby-head
@@ -23,5 +24,7 @@ bundler_args: --without debug --jobs=3 --retry=3 --path=../vendor/bundle
23
24
  cache: bundler
24
25
 
25
26
  addons:
26
- code_climate:
27
- repo_token: f86575690ba75e81107a310a79ec158a4dbac013cd17c46dcb97c2dfae817fcc
27
+ code_climate:
28
+ repo_token: f86575690ba75e81107a310a79ec158a4dbac013cd17c46dcb97c2dfae817fcc
29
+
30
+ script: bundle exec rake && bundle exec codeclimate-test-reporter
data/Gemfile CHANGED
@@ -1,15 +1,18 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  # Specify your gem's dependencies in carrierwave_globalize.gemspec
4
6
  gemspec
5
7
 
6
8
  gem 'activerecord-jdbcsqlite3-adapter', platform: :jruby
7
- gem 'sqlite3', platforms: [:ruby, :rbx]
9
+ gem 'carrierwave'
8
10
  gem 'pry'
11
+ gem 'sqlite3', platforms: %i[ruby rbx]
9
12
 
10
13
  platforms :rbx do
11
- gem 'rubysl', '~> 2.0'
12
14
  gem 'rubinius-developer_tools'
15
+ gem 'rubysl', '~> 2.0'
13
16
  end
14
17
 
15
18
  group :debug do
@@ -17,5 +20,6 @@ group :debug do
17
20
  end
18
21
 
19
22
  group :test do
20
- gem 'codeclimate-test-reporter', require: nil
23
+ gem 'codeclimate-test-reporter', '~> 1.0.0'
24
+ gem 'simplecov'
21
25
  end
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2016 Andrea Dal Ponte
3
+ Copyright (c) 2017 Andrea Dal Ponte
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Carrierwave Globalize
2
2
 
3
- [![Build Status](https://travis-ci.org/dalpo/carrierwave_globalize.svg?branch=master)](https://travis-ci.org/dalpo/carrierwave_globalize) [![Code Climate](https://codeclimate.com/github/dalpo/carrierwave_globalize/badges/gpa.svg)](https://codeclimate.com/github/dalpo/carrierwave_globalize)
3
+ [![Gem Version](https://badge.fury.io/rb/carrierwave_globalize.svg)](https://badge.fury.io/rb/carrierwave_globalize) [![Code Climate](https://codeclimate.com/github/dalpo/carrierwave_globalize/badges/gpa.svg)](https://codeclimate.com/github/dalpo/carrierwave_globalize) [![Test Coverage](https://codeclimate.com/github/dalpo/carrierwave_globalize/badges/coverage.svg)](https://codeclimate.com/github/dalpo/carrierwave_globalize/coverage) [![Build Status](https://travis-ci.org/dalpo/carrierwave_globalize.svg?branch=master)](https://travis-ci.org/dalpo/carrierwave_globalize)
4
4
 
5
5
  Use Globalize to manage Carrierwave translated fields.
6
6
 
@@ -11,7 +11,7 @@ Use Globalize to manage Carrierwave translated fields.
11
11
  Add this line to your application's Gemfile:
12
12
 
13
13
  ```ruby
14
- gem 'carrierwave_globalize', github: 'dalpo/carrierwave_globalize'
14
+ gem 'carrierwave_globalize', '~> 0.2.0'
15
15
  ```
16
16
 
17
17
  And then execute:
data/Rakefile CHANGED
@@ -1,6 +1,10 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler/gem_tasks'
2
4
  require 'rspec/core/rake_task'
5
+ require 'rubocop/rake_task'
3
6
 
4
7
  RSpec::Core::RakeTask.new(:spec)
8
+ RuboCop::RakeTask.new
5
9
 
6
- task :default => :spec
10
+ task default: %i[spec rubocop]
@@ -1,39 +1,42 @@
1
1
  # coding: utf-8
2
+ # frozen_string_literal: true
3
+
2
4
  lib = File.expand_path('../lib', __FILE__)
3
5
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
6
  require 'carrierwave_globalize/version'
5
7
 
6
8
  Gem::Specification.new do |spec|
7
- spec.name = "carrierwave_globalize"
9
+ spec.name = 'carrierwave_globalize'
8
10
  spec.version = CarrierwaveGlobalize::VERSION
9
- spec.authors = ["Andrea Dal Ponte"]
10
- spec.email = ["info@andreadalponte.com"]
11
+ spec.authors = ['Andrea Dal Ponte']
12
+ spec.email = ['info@andreadalponte.com']
11
13
 
12
- spec.summary = %q{Use Globalize to manage Carrierwave translated fields}
13
- spec.description = %q{Use Globalize to manage Carrierwave translated fields}
14
- spec.homepage = "https://github.com/dalpo/carrierwave_globalize"
15
- spec.license = "MIT"
14
+ spec.summary = 'Use Globalize to manage Carrierwave translated fields'
15
+ spec.description = 'Use Globalize to manage Carrierwave translated fields'
16
+ spec.homepage = 'https://github.com/dalpo/carrierwave_globalize'
17
+ spec.license = 'MIT'
16
18
 
17
19
  # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
18
20
  # to allow pushing to a single host or delete this section to allow pushing to any host.
19
21
  if spec.respond_to?(:metadata)
20
- spec.metadata['allowed_push_host'] = "https://rubygems.org"
22
+ spec.metadata['allowed_push_host'] = 'https://rubygems.org'
21
23
  else
22
- raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
24
+ raise 'RubyGems 2.0 or newer is required to protect against public gem pushes.'
23
25
  end
24
26
 
25
27
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
26
- spec.bindir = "exe"
28
+ spec.bindir = 'exe'
27
29
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
- spec.require_paths = ["lib"]
30
+ spec.require_paths = ['lib']
29
31
 
30
- spec.add_dependency "carrierwave"
31
- spec.add_dependency "globalize"
32
+ spec.add_dependency 'carrierwave'
33
+ spec.add_dependency 'globalize'
32
34
 
33
- spec.add_development_dependency "bundler", "~> 1.12"
34
- spec.add_development_dependency "rake", "~> 10.0"
35
- spec.add_development_dependency "rails", ['>= 4.2', '< 5.1']
36
- spec.add_development_dependency "rspec-rails", "~> 3.5"
35
+ spec.add_development_dependency 'bundler', '~> 1.12'
36
+ spec.add_development_dependency 'rake', '~> 10.0'
37
+ spec.add_development_dependency 'rails', ['>= 4.2', '< 5.1']
38
+ spec.add_development_dependency 'rspec-rails', '~> 3.5'
37
39
  spec.add_development_dependency 'rspec-its'
38
40
  spec.add_development_dependency 'database_cleaner'
41
+ spec.add_development_dependency 'rubocop', '~> 0.48.1'
39
42
  end
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  # CarrierwaveGlobalize Version
3
4
  module CarrierwaveGlobalize
4
- VERSION = '0.1.0'
5
+ VERSION = '0.2.0'
5
6
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'carrierwave'
3
- require 'carrierwave/mount'
4
4
 
5
5
  # Manage CarrierWave and Globalize to work together
6
6
  module CarrierwaveGlobalize
@@ -9,10 +9,10 @@ module CarrierwaveGlobalize
9
9
  delegate :"#{column}_will_change!", :"#{column}_changed?",
10
10
  to: :translation
11
11
 
12
- unless carrierwave_globalize_initialized?
13
- include CarrierwaveGlobalize::InstanceMethods
14
- @carrierwave_globalize_initialized = true
15
- end
12
+ return if carrierwave_globalize_initialized?
13
+
14
+ include CarrierwaveGlobalize::InstanceMethods
15
+ @carrierwave_globalize_initialized = true
16
16
  end
17
17
 
18
18
  def carrierwave_globalize_initialized?
@@ -38,7 +38,13 @@ module CarrierwaveGlobalize
38
38
  def _translations_mounter(column)
39
39
  @_translations_mounter ||= {}
40
40
  (@_translations_mounter[Globalize.locale.to_sym] ||= {})[column] ||= \
41
- ::CarrierWave::Mount::Mounter.new(self, column)
41
+ if defined?(CarrierWave::Mounter)
42
+ # CarrierWave >= 1.0.0
43
+ ::CarrierWave::Mounter.new(self, column)
44
+ else
45
+ # CarrierWave < 1.0.0
46
+ ::CarrierWave::Mount::Mounter.new(self, column)
47
+ end
42
48
  end
43
49
  end
44
50
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carrierwave_globalize
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
  - Andrea Dal Ponte
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-07-06 00:00:00.000000000 Z
11
+ date: 2017-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: carrierwave
@@ -128,6 +128,20 @@ dependencies:
128
128
  - - ">="
129
129
  - !ruby/object:Gem::Version
130
130
  version: '0'
131
+ - !ruby/object:Gem::Dependency
132
+ name: rubocop
133
+ requirement: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - "~>"
136
+ - !ruby/object:Gem::Version
137
+ version: 0.48.1
138
+ type: :development
139
+ prerelease: false
140
+ version_requirements: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - "~>"
143
+ - !ruby/object:Gem::Version
144
+ version: 0.48.1
131
145
  description: Use Globalize to manage Carrierwave translated fields
132
146
  email:
133
147
  - info@andreadalponte.com
@@ -137,6 +151,7 @@ extra_rdoc_files: []
137
151
  files:
138
152
  - ".gitignore"
139
153
  - ".rspec"
154
+ - ".rubocop.yml"
140
155
  - ".travis.yml"
141
156
  - CODE_OF_CONDUCT.md
142
157
  - Gemfile
@@ -169,7 +184,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
169
184
  version: '0'
170
185
  requirements: []
171
186
  rubyforge_project:
172
- rubygems_version: 2.5.1
187
+ rubygems_version: 2.6.11
173
188
  signing_key:
174
189
  specification_version: 4
175
190
  summary: Use Globalize to manage Carrierwave translated fields