copy_tuner_client 0.1.1.beta13 → 0.1.1.beta14

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- copy_tuner_client (0.1.1.beta13)
4
+ copy_tuner_client (0.1.1.beta14)
5
5
  i18n (>= 0.5.0)
6
6
  json
7
7
 
@@ -7,7 +7,6 @@ require 'copy_tuner_client/poller'
7
7
  require 'copy_tuner_client/prefixed_logger'
8
8
  require 'copy_tuner_client/request_sync'
9
9
  require 'copy_tuner_client/copyray_middleware'
10
- require 'copy_tuner_client/simple_form_extention'
11
10
 
12
11
  module CopyTunerClient
13
12
  # Used to set up and modify settings for the client.
@@ -170,6 +169,10 @@ module CopyTunerClient
170
169
  development_environments.include? environment_name
171
170
  end
172
171
 
172
+ def enable_middleware?
173
+ middleware && development? && !disable_middleware
174
+ end
175
+
173
176
  # Determines if the content will fetched from the server
174
177
  # @return [Boolean] Returns +true+ if in a test environment, +false+ otherwise.
175
178
  def test?
@@ -196,7 +199,7 @@ module CopyTunerClient
196
199
  process_guard = ProcessGuard.new(cache, poller, to_hash)
197
200
  I18n.backend = I18nBackend.new(cache)
198
201
 
199
- if middleware && development? && !disable_middleware
202
+ if enable_middleware?
200
203
  logger.info "Using copytuner sync middleware"
201
204
  middleware.use RequestSync, :cache => cache, :interval => sync_interval, :ignore_regex => sync_ignore_path_regex
202
205
  middleware.use CopyTunerClient::CopyrayMiddleware
@@ -16,8 +16,10 @@ module CopyTunerClient
16
16
  source
17
17
  end
18
18
  end
19
- alias_method_chain :translate, :copyray_comment
20
- alias :t :translate
19
+ if CopyTunerClient.configuration.enable_middleware?
20
+ alias_method_chain :translate, :copyray_comment
21
+ alias :t :translate
22
+ end
21
23
  end
22
24
  end
23
25
  end
@@ -10,6 +10,7 @@ module CopyTunerClient
10
10
  config.framework = "Rails: #{::Rails::VERSION::STRING}"
11
11
  config.middleware = ::Rails.configuration.middleware
12
12
  end
13
+ require 'copy_tuner_client/simple_form_extention'
13
14
  end
14
15
  end
15
16
  end
@@ -21,6 +21,8 @@ if defined?(SimpleForm)
21
21
  source
22
22
  end
23
23
  end
24
- alias_method_chain :label_translation, :copyray_comment
24
+ if CopyTunerClient.configuration.enable_middleware?
25
+ alias_method_chain :label_translation, :copyray_comment
26
+ end
25
27
  end
26
28
  end
@@ -1,6 +1,6 @@
1
1
  module CopyTunerClient
2
2
  # Client version
3
- VERSION = '0.1.1.beta13'
3
+ VERSION = '0.1.1.beta14'
4
4
 
5
5
  # API version being used to communicate with the server
6
6
  API_VERSION = '2.0'.freeze
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: copy_tuner_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1.beta13
4
+ version: 0.1.1.beta14
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-11-17 00:00:00.000000000 Z
12
+ date: 2014-12-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: i18n
@@ -349,7 +349,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
349
349
  version: '0'
350
350
  segments:
351
351
  - 0
352
- hash: 232727728491979424
352
+ hash: 4385524670175599867
353
353
  required_rubygems_version: !ruby/object:Gem::Requirement
354
354
  none: false
355
355
  requirements: