phrase 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,10 +3,8 @@
3
3
  module Phrase::Extensions::Base
4
4
  extend ActiveSupport::Concern
5
5
 
6
- module InstanceMethods
7
- def translate(*args)
8
- Phrase.backend.translate(*args)
9
- end
10
- alias_method :t, :translate
6
+ def translate(*args)
7
+ Phrase.backend.translate(*args)
11
8
  end
9
+ alias_method :t, :translate
12
10
  end
@@ -3,31 +3,29 @@
3
3
  module Phrase::Extensions::Hash
4
4
  extend ActiveSupport::Concern
5
5
 
6
- module InstanceMethods
7
- def to_shallow_hash
8
- self.inject({}) do |shallow_hash, (key, value)|
9
- if value.is_a?(Hash)
10
- value.to_shallow_hash.each do |sub_key, sub_value|
11
- shallow_hash[[key, sub_key].join(".")] = sub_value
12
- end
13
- else
14
- shallow_hash[key.to_s] = value
6
+ def to_shallow_hash
7
+ self.inject({}) do |shallow_hash, (key, value)|
8
+ if value.is_a?(Hash)
9
+ value.to_shallow_hash.each do |sub_key, sub_value|
10
+ shallow_hash[[key, sub_key].join(".")] = sub_value
15
11
  end
16
- shallow_hash
12
+ else
13
+ shallow_hash[key.to_s] = value
17
14
  end
15
+ shallow_hash
18
16
  end
19
-
20
- def deep_stringify_keys
21
- inject({}) { |result, (key, value)|
22
- value = value.deep_stringify_keys if value.is_a?(Hash)
23
- unless value.is_a? Proc
24
- result[(key.to_s rescue key) || key] = value
25
- else
26
- result[(key.to_s rescue key) || key] = nil
27
- end
28
- result
29
- }
30
- end
17
+ end
18
+
19
+ def deep_stringify_keys
20
+ inject({}) { |result, (key, value)|
21
+ value = value.deep_stringify_keys if value.is_a?(Hash)
22
+ unless value.is_a? Proc
23
+ result[(key.to_s rescue key) || key] = value
24
+ else
25
+ result[(key.to_s rescue key) || key] = nil
26
+ end
27
+ result
28
+ }
31
29
  end
32
30
  end
33
31
 
@@ -3,11 +3,9 @@
3
3
  module Phrase::Extensions::String
4
4
  extend ActiveSupport::Concern
5
5
 
6
- module InstanceMethods
7
- def expand_to_hash(value=nil)
8
- self.split('.').reverse.inject(value) do |hash, item|
9
- {item => hash}
10
- end
6
+ def expand_to_hash(value=nil)
7
+ self.split('.').reverse.inject(value) do |hash, item|
8
+ {item => hash}
11
9
  end
12
10
  end
13
11
  end
@@ -4,7 +4,7 @@ $:.unshift lib unless $:.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "phrase"
7
- s.version = "0.1.2"
7
+ s.version = "0.1.3"
8
8
  s.platform = Gem::Platform::RUBY
9
9
  s.authors = ["Dynport GmbH"]
10
10
  s.email = ["info@phraseapp.com"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phrase
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-07 00:00:00.000000000 Z
12
+ date: 2012-06-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
16
- requirement: &70240843846700 !ruby/object:Gem::Requirement
16
+ requirement: &70098913523960 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '3.0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70240843846700
24
+ version_requirements: *70098913523960
25
25
  description: phrase allows you to edit translations inline, on the page itself. More
26
26
  information at phraseapp.com
27
27
  email: