traducto 1.0.3 → 1.0.4

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c965bc9b436cf0dabe263034f8f78c9df2fd86a3
4
- data.tar.gz: 75a63361701b8615e30ef0948ae08d1083f108ec
3
+ metadata.gz: dc68ea3c2de967b1f946c41eac30cc5f2a560fd2
4
+ data.tar.gz: 640369a35edb3f9a4243d3cdf818b455988e87d7
5
5
  SHA512:
6
- metadata.gz: 196fe456324604543a76e5de978b1e6391ef1f4eab84594a588da830eb8d2dd2ba9b80b233cd61a039e6496a26fd1636c637854db4d236d48e151ef9dc213869
7
- data.tar.gz: fd5aad57d746269b81814d419942f2eeb053c21b22f63b96517b8a55430b798d4be60c134f22a0feb2df466fdf8d231ec4b3f164538350fc802c644eed41d562
6
+ metadata.gz: e67a80e679bcbf5404ba2d18ab8df528f3bdd6c687477b02275481004fccde245e72cf80e921ecbbb2f6a520caf386ba2aff83cc57ea71bd843afca2d7393300
7
+ data.tar.gz: 8bd8b31f4e77d2903ede0db155fed1c5e41fefa2dc5fccabc3ad2092b79cc13855b9b7aff215d2c87fc2b98a2ade43fbbed8b3a3f32f756a77522158a1d20c5a
data/Gemfile CHANGED
@@ -2,3 +2,5 @@ source "http://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in traducto.gemspec
4
4
  gemspec
5
+
6
+ gem 'coveralls', require: false
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- Traducto [![Build Status](https://secure.travis-ci.org/alchimikweb/traducto.png?branch=master)](http://travis-ci.org/alchimikweb/traducto) [![Code Climate](https://codeclimate.com/repos/527c039556b10201a000874c/badges/67a2619a2ba5c6777c81/gpa.png)](https://codeclimate.com/repos/527c039556b10201a000874c/feed) [![Coverage Status](https://coveralls.io/repos/alchimikweb/traducto/badge.png)](https://coveralls.io/r/alchimikweb/traducto) [![Gem Version](https://badge.fury.io/rb/traducto.png)](http://badge.fury.io/rb/traducto)
1
+ Traducto [![Build Status](https://secure.travis-ci.org/alchimikweb/traducto.png?branch=master)](http://travis-ci.org/alchimikweb/traducto) [![Code Climate](https://codeclimate.com/github/alchimikweb/traducto.png)](https://codeclimate.com/github/alchimikweb/traducto) [![Coverage Status](https://coveralls.io/repos/alchimikweb/traducto/badge.png)](https://coveralls.io/r/alchimikweb/traducto) [![Gem Version](https://badge.fury.io/rb/traducto.png)](http://badge.fury.io/rb/traducto)
2
2
  ===============
3
3
 
4
4
  Rails helpers collection to simplify the localization code.
@@ -82,13 +82,13 @@ You can also provide the format options to wrap the content by paragraphs.
82
82
 
83
83
  ```ruby
84
84
  t('description.intro', format: nil)
85
- #--> Let me start by
85
+ # => Let me start by
86
86
 
87
87
  t('description.intro', format: :text)
88
- #--> <p>Let me start by</p>
88
+ # => <p>Let me start by</p>
89
89
 
90
90
  t('description.main', format: :text)
91
- #--> <p>A lot of ...</p><p>Paragraphs that needs to be ...</p><p>Separated by p tags.</p>
91
+ # => <p>A lot of ...</p><p>Paragraphs that needs to be ...</p><p>Separated by p tags.</p>
92
92
  ```
93
93
 
94
94
 
data/lib/traducto/base.rb CHANGED
@@ -23,7 +23,11 @@ module Traducto
23
23
 
24
24
  format
25
25
 
26
- return @text.html_safe
26
+ if @text.is_a? String
27
+ @text.html_safe
28
+ else
29
+ @text
30
+ end
27
31
  end
28
32
 
29
33
  private
@@ -43,10 +47,6 @@ module Traducto
43
47
  end
44
48
  end
45
49
 
46
- def format?
47
- @options[:format] ? true : false
48
- end
49
-
50
50
  def format_base
51
51
  @text = @text.join("\n") if @text.is_a? Array
52
52
  end
data/spec/spec_helper.rb CHANGED
@@ -2,10 +2,12 @@ ENV["RAILS_ENV"] ||= 'test'
2
2
 
3
3
  require 'simplecov'
4
4
  require 'simplecov-rcov-text'
5
+ require 'coveralls'
5
6
 
6
7
  SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
7
8
  SimpleCov::Formatter::HTMLFormatter,
8
- SimpleCov::Formatter::RcovTextFormatter
9
+ SimpleCov::Formatter::RcovTextFormatter,
10
+ Coveralls::SimpleCov::Formatter
9
11
  ]
10
12
  SimpleCov.start do
11
13
  add_filter "spec/dummy"
@@ -18,10 +20,7 @@ require File.expand_path("../dummy/config/environment", __FILE__)
18
20
  require 'rspec/rails'
19
21
  require 'rspec/autorun'
20
22
 
21
- require 'coveralls'
22
- Coveralls.wear!
23
-
24
- Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
23
+ Dir["./spec/support/**/*.rb"].sort.each {|f| require f }
25
24
 
26
25
  RSpec.configure do |config|
27
26
  config.mock_with :rspec
data/traducto.gemspec CHANGED
@@ -3,7 +3,7 @@ Gem::Specification.new do |gem|
3
3
  gem.description = "Rails helpers collection to simplify the localization code."
4
4
  gem.summary = "Rails helpers collection to simplify the localization code."
5
5
  gem.homepage = "https://github.com/alchimikweb/traducto"
6
- gem.version = "1.0.3"
6
+ gem.version = "1.0.4"
7
7
  gem.licenses = ["MIT"]
8
8
 
9
9
  gem.authors = ["Sebastien Rosa"]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: traducto
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastien Rosa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-08 00:00:00.000000000 Z
11
+ date: 2014-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails