phrase 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/phrase.rb +0 -1
- data/lib/phrase/backend/phrase_service.rb +1 -2
- data/lib/phrase/engine.rb +0 -9
- data/lib/phrase/tool_config.rb +1 -1
- data/phrase.gemspec +1 -1
- metadata +4 -8
- data/lib/phrase/extensions.rb +0 -9
- data/lib/phrase/extensions/base.rb +0 -10
- data/lib/phrase/extensions/hash.rb +0 -32
- data/lib/phrase/extensions/string.rb +0 -13
data/lib/phrase.rb
CHANGED
data/lib/phrase/engine.rb
CHANGED
@@ -6,16 +6,7 @@ require 'i18n'
|
|
6
6
|
if defined? Rails
|
7
7
|
module Phrase
|
8
8
|
class Engine < Rails::Engine
|
9
|
-
|
10
9
|
initializer 'phrase' do |app|
|
11
|
-
ActiveSupport.on_load(:action_view) do
|
12
|
-
::ActionView::Base.send :include, Phrase::Extensions::Base
|
13
|
-
end
|
14
|
-
|
15
|
-
ActiveSupport.on_load(:action_controller) do
|
16
|
-
::ActionController::Base.send :include, Phrase::Extensions::Base
|
17
|
-
end
|
18
|
-
|
19
10
|
ActionView::Base.send :include, Phrase::ViewHelpers
|
20
11
|
end
|
21
12
|
end
|
data/lib/phrase/tool_config.rb
CHANGED
data/phrase.gemspec
CHANGED
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.
|
4
|
+
version: 0.1.4
|
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-
|
12
|
+
date: 2012-06-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
16
|
-
requirement: &
|
16
|
+
requirement: &70112071528200 !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: *
|
24
|
+
version_requirements: *70112071528200
|
25
25
|
description: phrase allows you to edit translations inline, on the page itself. More
|
26
26
|
information at phraseapp.com
|
27
27
|
email:
|
@@ -43,10 +43,6 @@ files:
|
|
43
43
|
- lib/phrase/backend/phrase_service.rb
|
44
44
|
- lib/phrase/config.rb
|
45
45
|
- lib/phrase/engine.rb
|
46
|
-
- lib/phrase/extensions.rb
|
47
|
-
- lib/phrase/extensions/base.rb
|
48
|
-
- lib/phrase/extensions/hash.rb
|
49
|
-
- lib/phrase/extensions/string.rb
|
50
46
|
- lib/phrase/tool.rb
|
51
47
|
- lib/phrase/tool_config.rb
|
52
48
|
- lib/phrase/view_helpers.rb
|
data/lib/phrase/extensions.rb
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
# -*- encoding : utf-8 -*-
|
2
|
-
|
3
|
-
module Phrase::Extensions::Hash
|
4
|
-
extend ActiveSupport::Concern
|
5
|
-
|
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
|
11
|
-
end
|
12
|
-
else
|
13
|
-
shallow_hash[key.to_s] = value
|
14
|
-
end
|
15
|
-
shallow_hash
|
16
|
-
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
|
-
}
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
Hash.send(:include, Phrase::Extensions::Hash)
|
@@ -1,13 +0,0 @@
|
|
1
|
-
# -*- encoding : utf-8 -*-
|
2
|
-
|
3
|
-
module Phrase::Extensions::String
|
4
|
-
extend ActiveSupport::Concern
|
5
|
-
|
6
|
-
def expand_to_hash(value=nil)
|
7
|
-
self.split('.').reverse.inject(value) do |hash, item|
|
8
|
-
{item => hash}
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
String.send(:include, Phrase::Extensions::String)
|