translation_panel 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/.rvmrc CHANGED
@@ -1 +1 @@
1
- rvm 1.9.2@translation_panel --create
1
+ rvm use 1.9.2@translation_panel --create
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.2
@@ -13,10 +13,11 @@ module TranslationPanel
13
13
  end
14
14
 
15
15
  def after(controller)
16
- if controller.send(@condition)
16
+ if controller.send(@condition) && controller.response.status == 200
17
17
  case controller.response.content_type
18
18
  when "text/html"
19
19
  return unless page = controller.response.body
20
+ return unless page.index("</head>")
20
21
  header_part = tag :link, :href => "/assets/translation_panel.css",
21
22
  :media => "screen", :rel => "stylesheet", :type => "text/css"
22
23
  header_part+= content_tag :script, "", :src => "/assets/translation_panel.js",
@@ -1,4 +1,7 @@
1
1
  class HomeController < ApplicationController
2
2
  def index
3
3
  end
4
+
5
+ def without_head
6
+ end
4
7
  end
@@ -0,0 +1,5 @@
1
+ <div>
2
+ <%= t(:some_i18n_key) %>
3
+ <%= t('long.chain.of.keys') %>
4
+ <%=raw t(:html_part) %>
5
+ </div>
@@ -1,3 +1,4 @@
1
1
  App::Application.routes.draw do
2
+ match ':controller(/:action(/:id))'
2
3
  root :to => "home#index"
3
4
  end
@@ -50,4 +50,20 @@ describe HomeController, :type => :controller do
50
50
  end
51
51
  end
52
52
  end
53
+
54
+ describe "without_head" do
55
+ render_views
56
+ before :all do
57
+ I18n.backend.store.flushdb
58
+ end
59
+
60
+ it "is successfull" do
61
+ lambda{ get :without_head, :translator => true }.should_not raise_error
62
+ end
63
+
64
+ it "isn't show panel" do
65
+ get :without_head, :translator => true
66
+ response.body.should_not have_selector("script")
67
+ end
68
+ end
53
69
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{translation_panel}
8
- s.version = "0.2.1"
8
+ s.version = "0.2.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = [%q{Mik-die}]
12
- s.date = %q{2011-07-28}
11
+ s.authors = ["Mik-die"]
12
+ s.date = %q{2011-08-09}
13
13
  s.description = %q{I18n backend, based on redis, with frontend panel for translations}
14
14
  s.email = %q{MikDiet@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -37,6 +37,7 @@ Gem::Specification.new do |s|
37
37
  "spec/app/app/controllers/application_controller.rb",
38
38
  "spec/app/app/controllers/home_controller.rb",
39
39
  "spec/app/app/views/home/index.html.erb",
40
+ "spec/app/app/views/home/without_head.html.erb",
40
41
  "spec/app/config.ru",
41
42
  "spec/app/config/application.rb",
42
43
  "spec/app/config/boot.rb",
@@ -58,9 +59,9 @@ Gem::Specification.new do |s|
58
59
  "translation_panel.gemspec"
59
60
  ]
60
61
  s.homepage = %q{http://github.com/Mik-die/translation_panel}
61
- s.licenses = [%q{MIT}]
62
- s.require_paths = [%q{lib}]
63
- s.rubygems_version = %q{1.8.5}
62
+ s.licenses = ["MIT"]
63
+ s.require_paths = ["lib"]
64
+ s.rubygems_version = %q{1.6.2}
64
65
  s.summary = %q{I18n backend}
65
66
 
66
67
  if s.respond_to? :specification_version then
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: translation_panel
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.2.1
5
+ version: 0.2.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Mik-die
@@ -10,7 +10,8 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-07-28 00:00:00 Z
13
+ date: 2011-08-09 00:00:00 +08:00
14
+ default_executable:
14
15
  dependencies:
15
16
  - !ruby/object:Gem::Dependency
16
17
  name: rails
@@ -108,6 +109,7 @@ files:
108
109
  - spec/app/app/controllers/application_controller.rb
109
110
  - spec/app/app/controllers/home_controller.rb
110
111
  - spec/app/app/views/home/index.html.erb
112
+ - spec/app/app/views/home/without_head.html.erb
111
113
  - spec/app/config.ru
112
114
  - spec/app/config/application.rb
113
115
  - spec/app/config/boot.rb
@@ -127,6 +129,7 @@ files:
127
129
  - spec/spec_helper.rb
128
130
  - spec/translation_panel_spec.rb
129
131
  - translation_panel.gemspec
132
+ has_rdoc: true
130
133
  homepage: http://github.com/Mik-die/translation_panel
131
134
  licenses:
132
135
  - MIT
@@ -140,7 +143,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
140
143
  requirements:
141
144
  - - ">="
142
145
  - !ruby/object:Gem::Version
143
- hash: -932656719
146
+ hash: -923747487
144
147
  segments:
145
148
  - 0
146
149
  version: "0"
@@ -153,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
153
156
  requirements: []
154
157
 
155
158
  rubyforge_project:
156
- rubygems_version: 1.8.5
159
+ rubygems_version: 1.6.2
157
160
  signing_key:
158
161
  specification_version: 3
159
162
  summary: I18n backend