phrase 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -36,7 +36,6 @@ module Phrase
36
36
  end
37
37
  end
38
38
 
39
- autoload :Extensions, 'phrase/extensions'
40
39
  autoload :ViewHelpers, 'phrase/view_helpers'
41
40
 
42
41
  require 'phrase/engine'
@@ -6,7 +6,6 @@ module Phrase::Backend
6
6
 
7
7
  def initialize(args = {})
8
8
  self
9
- end
10
-
9
+ end
11
10
  end
12
11
  end
@@ -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
@@ -53,4 +53,4 @@ module PhraseGem
53
53
  end
54
54
  end
55
55
  end
56
- end
56
+ 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.3"
7
+ s.version = "0.1.4"
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.3
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-13 00:00:00.000000000 Z
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: &70098913523960 !ruby/object:Gem::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: *70098913523960
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
@@ -1,9 +0,0 @@
1
- # -*- encoding : utf-8 -*-
2
-
3
- module Phrase::Extensions
4
- end
5
-
6
- require File.join(File.dirname(__FILE__), 'extensions/hash')
7
- require File.join(File.dirname(__FILE__), 'extensions/string')
8
- require File.join(File.dirname(__FILE__), 'extensions/base')
9
-
@@ -1,10 +0,0 @@
1
- # -*- encoding : utf-8 -*-
2
-
3
- module Phrase::Extensions::Base
4
- extend ActiveSupport::Concern
5
-
6
- def translate(*args)
7
- Phrase.backend.translate(*args)
8
- end
9
- alias_method :t, :translate
10
- end
@@ -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)