weeler 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/.DS_Store +0 -0
  3. data/README.md +4 -0
  4. data/app/.DS_Store +0 -0
  5. data/app/assets/.DS_Store +0 -0
  6. data/app/assets/javascripts/.DS_Store +0 -0
  7. data/app/assets/javascripts/weeler.js.coffee +8 -0
  8. data/app/assets/javascripts/weeler/.DS_Store +0 -0
  9. data/app/assets/javascripts/weeler/bootstrap-fileupload.js +169 -0
  10. data/app/assets/javascripts/weeler/bootstrap.js +1992 -0
  11. data/app/assets/javascripts/weeler/bootstrap.rowlink.js +71 -0
  12. data/app/assets/javascripts/weeler/bootstrap.switch.js +382 -0
  13. data/app/assets/javascripts/weeler/jquery.pnotify.js +912 -0
  14. data/app/assets/stylesheets/.DS_Store +0 -0
  15. data/app/assets/stylesheets/weeler.css +9 -0
  16. data/app/assets/stylesheets/weeler/.DS_Store +0 -0
  17. data/app/assets/stylesheets/weeler/bootstrap-fileupload.css +132 -0
  18. data/app/assets/stylesheets/weeler/bootstrap.css +6086 -0
  19. data/app/assets/stylesheets/weeler/bootstrap.min.css +9 -0
  20. data/app/assets/stylesheets/weeler/bootstrap.rowlink.css +50 -0
  21. data/app/assets/stylesheets/weeler/bootstrap.spinner.css +43 -0
  22. data/app/assets/stylesheets/weeler/bootstrap.switch.css +408 -0
  23. data/app/assets/stylesheets/weeler/jquery.pnotify.css +84 -0
  24. data/app/assets/stylesheets/weeler/style.css.scss.erb +48 -0
  25. data/app/controllers/weeler/base_controller.rb +16 -0
  26. data/app/controllers/weeler/home_controller.rb +8 -0
  27. data/app/controllers/weeler/translations_controller.rb +151 -0
  28. data/app/views/kaminari/_first_page.html.erb +13 -0
  29. data/app/views/kaminari/_gap.html.erb +8 -0
  30. data/app/views/kaminari/_last_page.html.erb +13 -0
  31. data/app/views/kaminari/_next_page.html.erb +14 -0
  32. data/app/views/kaminari/_page.html.erb +12 -0
  33. data/app/views/kaminari/_paginator.html.erb +23 -0
  34. data/app/views/kaminari/_prev_page.html.erb +13 -0
  35. data/app/views/layouts/weeler/base.html.erb +86 -0
  36. data/app/views/weeler/home/about.html.erb +16 -0
  37. data/app/views/weeler/home/index.html.erb +4 -0
  38. data/app/views/weeler/translations/_form.html.erb +43 -0
  39. data/app/views/weeler/translations/_translation.html.erb +11 -0
  40. data/app/views/weeler/translations/edit.html.erb +19 -0
  41. data/app/views/weeler/translations/index.html.erb +106 -0
  42. data/app/views/weeler/translations/new.html.erb +19 -0
  43. data/config/initializers/weeler_mime_types.rb +1 -0
  44. data/lib/.DS_Store +0 -0
  45. data/lib/generators/weeler/.DS_Store +0 -0
  46. data/lib/generators/weeler/install_generator.rb +73 -0
  47. data/lib/generators/weeler/templates/initializers/weeler.rb +7 -0
  48. data/lib/generators/weeler/templates/migrations/create_weeler_translations.rb +16 -0
  49. data/lib/i18n/.DS_Store +0 -0
  50. data/lib/i18n/backend/.DS_Store +0 -0
  51. data/lib/i18n/backend/weeler.rb +76 -0
  52. data/lib/i18n/backend/weeler/store_procs.rb +39 -0
  53. data/lib/i18n/backend/weeler/translation.rb +118 -0
  54. data/lib/i18n/humanize_missing_translations.rb +11 -0
  55. data/lib/i18n/weeler.rb +6 -0
  56. data/lib/weeler.rb +25 -1
  57. data/lib/weeler/.DS_Store +0 -0
  58. data/lib/weeler/engine.rb +11 -0
  59. data/lib/weeler/route_mapper.rb +41 -0
  60. data/lib/weeler/version.rb +1 -1
  61. data/rspec.html +454 -0
  62. data/spec/.DS_Store +0 -0
  63. data/spec/controllers/translations_controller_spec.rb +41 -0
  64. data/spec/dummy/README.rdoc +28 -0
  65. data/spec/dummy/Rakefile +6 -0
  66. data/spec/dummy/app/assets/images/.keep +0 -0
  67. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  68. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  69. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  70. data/spec/dummy/app/controllers/concerns/.keep +0 -0
  71. data/spec/dummy/app/controllers/weeler/posts_controller.rb +7 -0
  72. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  73. data/spec/dummy/app/mailers/.keep +0 -0
  74. data/spec/dummy/app/models/.keep +0 -0
  75. data/spec/dummy/app/models/concerns/.keep +0 -0
  76. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  77. data/spec/dummy/bin/bundle +3 -0
  78. data/spec/dummy/bin/rails +4 -0
  79. data/spec/dummy/bin/rake +4 -0
  80. data/spec/dummy/config.ru +4 -0
  81. data/spec/dummy/config/application.rb +23 -0
  82. data/spec/dummy/config/boot.rb +5 -0
  83. data/spec/dummy/config/database.yml +25 -0
  84. data/spec/dummy/config/environment.rb +5 -0
  85. data/spec/dummy/config/environments/development.rb +29 -0
  86. data/spec/dummy/config/environments/production.rb +80 -0
  87. data/spec/dummy/config/environments/test.rb +36 -0
  88. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  89. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  90. data/spec/dummy/config/initializers/inflections.rb +16 -0
  91. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  92. data/spec/dummy/config/initializers/secret_token.rb +12 -0
  93. data/spec/dummy/config/initializers/session_store.rb +3 -0
  94. data/spec/dummy/config/initializers/weeler.rb +2 -0
  95. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  96. data/spec/dummy/config/locales/en.yml +23 -0
  97. data/spec/dummy/config/routes.rb +5 -0
  98. data/spec/dummy/db/development.sqlite3 +0 -0
  99. data/spec/dummy/db/migrate/20131015144900_create_weeler_translations.rb +16 -0
  100. data/spec/dummy/db/production.sqlite3 +0 -0
  101. data/spec/dummy/db/schema.rb +29 -0
  102. data/spec/dummy/db/test.sqlite3 +0 -0
  103. data/spec/dummy/lib/assets/.keep +0 -0
  104. data/spec/dummy/log/.keep +0 -0
  105. data/spec/dummy/log/development.log +19 -0
  106. data/spec/dummy/log/production.log +4 -0
  107. data/spec/dummy/log/test.log +38396 -0
  108. data/spec/dummy/public/404.html +58 -0
  109. data/spec/dummy/public/422.html +58 -0
  110. data/spec/dummy/public/500.html +57 -0
  111. data/spec/dummy/public/favicon.ico +0 -0
  112. data/spec/factories/translations.rb +7 -0
  113. data/spec/routing/routes_spec.rb +140 -0
  114. data/spec/spec_helper.rb +54 -0
  115. data/spec/weeler/.DS_Store +0 -0
  116. data/spec/weeler/i18n_backend_weeler_spec.rb +169 -0
  117. data/spec/weeler/i18n_humanize_missing_translations_spec.rb +18 -0
  118. data/weeler.gemspec +14 -0
  119. metadata +354 -3
@@ -0,0 +1,118 @@
1
+ require 'active_record'
2
+
3
+ module I18n
4
+ module Backend
5
+ # Weeler model used to store actual translations to the database.
6
+ #
7
+ # This model expects a table like the following to be already set up in
8
+ # your the database:
9
+ #
10
+ # create_table :translations do |t|
11
+ # t.string :locale
12
+ # t.string :key
13
+ # t.text :value
14
+ # t.text :interpolations
15
+ # t.boolean :is_proc, :default => false
16
+ # end
17
+ #
18
+ # This model supports to named scopes :locale and :lookup. The :locale
19
+ # scope simply adds a condition for a given locale:
20
+ #
21
+ # I18n::Backend::Weeler::Translation.locale(:en).all
22
+ # # => all translation records that belong to the :en locale
23
+ #
24
+ # The :lookup scope adds a condition for looking up all translations
25
+ # that either start with the given keys (joined by an optionally given
26
+ # separator or I18n.default_separator) or that exactly have this key.
27
+ #
28
+ # # with translations present for :"foo.bar" and :"foo.baz"
29
+ # I18n::Backend::Weeler::Translation.lookup(:foo)
30
+ # # => an array with both translation records :"foo.bar" and :"foo.baz"
31
+ #
32
+ # I18n::Backend::Weeler::Translation.lookup([:foo, :bar])
33
+ # I18n::Backend::Weeler::Translation.lookup(:"foo.bar")
34
+ # # => an array with the translation record :"foo.bar"
35
+ #
36
+ # When the StoreProcs module was mixed into this model then Procs will
37
+ # be stored to the database as Ruby code and evaluated when :value is
38
+ # called.
39
+ #
40
+ # Translation = I18n::Backend::Weeler::Translation
41
+ # Translation.create \
42
+ # :locale => 'en'
43
+ # :key => 'foo'
44
+ # :value => lambda { |key, options| 'FOO' }
45
+ # Translation.find_by_locale_and_key('en', 'foo').value
46
+ # # => 'FOO'
47
+ class Weeler
48
+ class Translation < ::ActiveRecord::Base
49
+ TRUTHY_CHAR = "\001"
50
+ FALSY_CHAR = "\002"
51
+
52
+ self.table_name = 'weeler_translations'
53
+
54
+ serialize :value
55
+ serialize :interpolations, Array
56
+
57
+ class << self
58
+
59
+ def locale(locale)
60
+ where(:locale => locale.to_s)
61
+ end
62
+
63
+ def lookup(keys, *separator)
64
+ column_name = connection.quote_column_name('key')
65
+ keys = Array(keys).map! { |key| key.to_s }
66
+
67
+ unless separator.empty?
68
+ warn "[DEPRECATION] Giving a separator to Translation.lookup is deprecated. " <<
69
+ "You can change the internal separator by overwriting FLATTEN_SEPARATOR."
70
+ end
71
+
72
+ namespace = "#{keys.last}#{I18n::Backend::Flatten::FLATTEN_SEPARATOR}%"
73
+ where("#{column_name} IN (?) OR #{column_name} LIKE ?", keys, namespace)
74
+ end
75
+
76
+ def available_locales
77
+ Translation.select("DISTINCT locale").map { |t| t.locale.to_sym }
78
+ end
79
+
80
+ # This problably works only with PG
81
+ def groups
82
+ # Translation.select("DISTINCT split_part(key, '.', 1), split_part(key, '.', 1) AS key_group").order("key_group").map { |t| t.key_group.to_sym }
83
+ groups_records = Translation.select("key").order("key").map{ |t| t.key.split(".")[0] }.uniq{ |t| t}
84
+ groups_records.uniq{ |t| t }
85
+ end
86
+ end
87
+
88
+ def interpolates?(key)
89
+ self.interpolations.include?(key) if self.interpolations
90
+ end
91
+
92
+ def value
93
+ value = read_attribute(:value)
94
+ if is_proc
95
+ Kernel.eval(value)
96
+ elsif value == FALSY_CHAR
97
+ false
98
+ elsif value == TRUTHY_CHAR
99
+ true
100
+ else
101
+ value
102
+ end
103
+ end
104
+
105
+ def value=(value)
106
+ if value === false
107
+ value = FALSY_CHAR
108
+ elsif value === true
109
+ value = TRUTHY_CHAR
110
+ end
111
+
112
+ write_attribute(:value, value)
113
+ end
114
+ end
115
+ end
116
+ end
117
+ end
118
+
@@ -0,0 +1,11 @@
1
+ module I18n
2
+ module HumanizeMissingTranslations
3
+ def call(exception, locale, key, options)
4
+ if exception.is_a?(I18n::MissingTranslation)
5
+ key.to_s.split('.').last.humanize
6
+ else
7
+ super
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,6 @@
1
+ require 'i18n'
2
+ require 'i18n/humanize_missing_translations'
3
+ require 'i18n/backend/weeler'
4
+
5
+ I18n.exception_handler.extend I18n::HumanizeMissingTranslations
6
+ I18n.backend = I18n::Backend::Chain.new(I18n::Backend::Weeler.new, I18n::Backend::Simple.new)
data/lib/weeler.rb CHANGED
@@ -1,5 +1,29 @@
1
1
  require "weeler/version"
2
+ require "rails"
3
+ require "weeler/route_mapper"
4
+ require "weeler/engine"
5
+ require "kaminari"
2
6
 
3
7
  module Weeler
4
- # Your code goes here...
8
+
9
+ mattr_accessor :create_missing_translations
10
+ @@create_missing_translations = true
11
+
12
+ mattr_accessor :use_weeler_i18n
13
+ @@use_weeler_i18n = true
14
+
15
+ mattr_accessor :menu_items
16
+ @@menu_items = []
17
+
18
+ mattr_accessor :required_user_method
19
+ @@required_user_method = nil
20
+
21
+ def self.setup
22
+ if Weeler.use_weeler_i18n
23
+ require "i18n/weeler"
24
+ end
25
+
26
+ yield self
27
+ end
5
28
  end
29
+
Binary file
@@ -0,0 +1,11 @@
1
+ module Weeler
2
+ class Engine < ::Rails::Engine
3
+ config.weeler = Weeler
4
+ isolate_namespace Weeler
5
+ end
6
+
7
+ ActiveSupport.on_load :action_controller do
8
+ ActionDispatch::Routing::Mapper.send(:include, Weeler::RouteMapper)
9
+ end
10
+
11
+ end
@@ -0,0 +1,41 @@
1
+ module Weeler::RouteMapper
2
+ # Pass given resource to "resources" mount method and
3
+ # add extra routes for members and collections needed by weeler
4
+ def weeler_resources(*args, &block)
5
+ add_menu_item args[0] if args[0].present? && args[1].present? && args[1][:include_in_weeler_menu] == true
6
+ resources *args do
7
+ yield if block_given?
8
+ end
9
+ end
10
+
11
+ def mount_weeler_at mount_location, options={}, &block
12
+ mount_location_namespace = mount_location.gsub("/", "").to_sym
13
+ scope mount_location do
14
+ namespace :weeler, :path => nil do
15
+ mount_translations_controller
16
+
17
+ root :to => "home#index"
18
+ get "/about" => "home#about"
19
+
20
+ yield if block_given?
21
+ end
22
+ end
23
+ end
24
+
25
+ private
26
+
27
+ # Add menu item for resource
28
+ def add_menu_item resource
29
+ Weeler.menu_items << resource unless Weeler.menu_items.select{ |item| item == resource }.size > 0
30
+ end
31
+
32
+ # Mount translations controller
33
+ def mount_translations_controller
34
+ resources :translations, :except => [:show] do
35
+ collection do
36
+ get :export
37
+ post :import
38
+ end
39
+ end
40
+ end
41
+ end # Weeler::RouteMapper
@@ -1,3 +1,3 @@
1
1
  module Weeler
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/rspec.html ADDED
@@ -0,0 +1,454 @@
1
+ <!DOCTYPE html>
2
+ <html lang='en'>
3
+ <head>
4
+ <title>RSpec results</title>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <meta http-equiv="Expires" content="-1" />
7
+ <meta http-equiv="Pragma" content="no-cache" />
8
+ <style type="text/css">
9
+ body {
10
+ margin: 0;
11
+ padding: 0;
12
+ background: #fff;
13
+ font-size: 80%;
14
+ }
15
+ </style>
16
+ <script type="text/javascript">
17
+ // <![CDATA[
18
+
19
+ function addClass(element_id, classname) {
20
+ document.getElementById(element_id).className += (" " + classname);
21
+ }
22
+
23
+ function removeClass(element_id, classname) {
24
+ var elem = document.getElementById(element_id);
25
+ var classlist = elem.className.replace(classname,'');
26
+ elem.className = classlist;
27
+ }
28
+
29
+ function moveProgressBar(percentDone) {
30
+ document.getElementById("rspec-header").style.width = percentDone +"%";
31
+ }
32
+
33
+ function makeRed(element_id) {
34
+ removeClass(element_id, 'passed');
35
+ removeClass(element_id, 'not_implemented');
36
+ addClass(element_id,'failed');
37
+ }
38
+
39
+ function makeYellow(element_id) {
40
+ var elem = document.getElementById(element_id);
41
+ if (elem.className.indexOf("failed") == -1) { // class doesn't includes failed
42
+ if (elem.className.indexOf("not_implemented") == -1) { // class doesn't include not_implemented
43
+ removeClass(element_id, 'passed');
44
+ addClass(element_id,'not_implemented');
45
+ }
46
+ }
47
+ }
48
+
49
+ function apply_filters() {
50
+ var passed_filter = document.getElementById('passed_checkbox').checked;
51
+ var failed_filter = document.getElementById('failed_checkbox').checked;
52
+ var pending_filter = document.getElementById('pending_checkbox').checked;
53
+
54
+ assign_display_style("example passed", passed_filter);
55
+ assign_display_style("example failed", failed_filter);
56
+ assign_display_style("example not_implemented", pending_filter);
57
+
58
+ assign_display_style_for_group("example_group passed", passed_filter);
59
+ assign_display_style_for_group("example_group not_implemented", pending_filter, pending_filter || passed_filter);
60
+ assign_display_style_for_group("example_group failed", failed_filter, failed_filter || pending_filter || passed_filter);
61
+ }
62
+
63
+ function get_display_style(display_flag) {
64
+ var style_mode = 'none';
65
+ if (display_flag == true) {
66
+ style_mode = 'block';
67
+ }
68
+ return style_mode;
69
+ }
70
+
71
+ function assign_display_style(classname, display_flag) {
72
+ var style_mode = get_display_style(display_flag);
73
+ var elems = document.getElementsByClassName(classname)
74
+ for (var i=0; i<elems.length;i++) {
75
+ elems[i].style.display = style_mode;
76
+ }
77
+ }
78
+
79
+ function assign_display_style_for_group(classname, display_flag, subgroup_flag) {
80
+ var display_style_mode = get_display_style(display_flag);
81
+ var subgroup_style_mode = get_display_style(subgroup_flag);
82
+ var elems = document.getElementsByClassName(classname)
83
+ for (var i=0; i<elems.length;i++) {
84
+ var style_mode = display_style_mode;
85
+ if ((display_flag != subgroup_flag) && (elems[i].getElementsByTagName('dt')[0].innerHTML.indexOf(", ") != -1)) {
86
+ elems[i].style.display = subgroup_style_mode;
87
+ } else {
88
+ elems[i].style.display = display_style_mode;
89
+ }
90
+ }
91
+ }
92
+
93
+ // ]]>
94
+ </script>
95
+ <style type="text/css">
96
+ #rspec-header {
97
+ background: #65C400; color: #fff; height: 4em;
98
+ }
99
+
100
+ .rspec-report h1 {
101
+ margin: 0px 10px 0px 10px;
102
+ padding: 10px;
103
+ font-family: "Lucida Grande", Helvetica, sans-serif;
104
+ font-size: 1.8em;
105
+ position: absolute;
106
+ }
107
+
108
+ #label {
109
+ float:left;
110
+ }
111
+
112
+ #display-filters {
113
+ float:left;
114
+ padding: 28px 0 0 40%;
115
+ font-family: "Lucida Grande", Helvetica, sans-serif;
116
+ }
117
+
118
+ #summary {
119
+ float:right;
120
+ padding: 5px 10px;
121
+ font-family: "Lucida Grande", Helvetica, sans-serif;
122
+ text-align: right;
123
+ }
124
+
125
+ #summary p {
126
+ margin: 0 0 0 2px;
127
+ }
128
+
129
+ #summary #totals {
130
+ font-size: 1.2em;
131
+ }
132
+
133
+ .example_group {
134
+ margin: 0 10px 5px;
135
+ background: #fff;
136
+ }
137
+
138
+ dl {
139
+ margin: 0; padding: 0 0 5px;
140
+ font: normal 11px "Lucida Grande", Helvetica, sans-serif;
141
+ }
142
+
143
+ dt {
144
+ padding: 3px;
145
+ background: #65C400;
146
+ color: #fff;
147
+ font-weight: bold;
148
+ }
149
+
150
+ dd {
151
+ margin: 5px 0 5px 5px;
152
+ padding: 3px 3px 3px 18px;
153
+ }
154
+
155
+ dd .duration {
156
+ padding-left: 5px;
157
+ text-align: right;
158
+ right: 0px;
159
+ float:right;
160
+ }
161
+
162
+ dd.example.passed {
163
+ border-left: 5px solid #65C400;
164
+ border-bottom: 1px solid #65C400;
165
+ background: #DBFFB4; color: #3D7700;
166
+ }
167
+
168
+ dd.example.not_implemented {
169
+ border-left: 5px solid #FAF834;
170
+ border-bottom: 1px solid #FAF834;
171
+ background: #FCFB98; color: #131313;
172
+ }
173
+
174
+ dd.example.pending_fixed {
175
+ border-left: 5px solid #0000C2;
176
+ border-bottom: 1px solid #0000C2;
177
+ color: #0000C2; background: #D3FBFF;
178
+ }
179
+
180
+ dd.example.failed {
181
+ border-left: 5px solid #C20000;
182
+ border-bottom: 1px solid #C20000;
183
+ color: #C20000; background: #FFFBD3;
184
+ }
185
+
186
+
187
+ dt.not_implemented {
188
+ color: #000000; background: #FAF834;
189
+ }
190
+
191
+ dt.pending_fixed {
192
+ color: #FFFFFF; background: #C40D0D;
193
+ }
194
+
195
+ dt.failed {
196
+ color: #FFFFFF; background: #C40D0D;
197
+ }
198
+
199
+
200
+ #rspec-header.not_implemented {
201
+ color: #000000; background: #FAF834;
202
+ }
203
+
204
+ #rspec-header.pending_fixed {
205
+ color: #FFFFFF; background: #C40D0D;
206
+ }
207
+
208
+ #rspec-header.failed {
209
+ color: #FFFFFF; background: #C40D0D;
210
+ }
211
+
212
+
213
+ .backtrace {
214
+ color: #000;
215
+ font-size: 12px;
216
+ }
217
+
218
+ a {
219
+ color: #BE5C00;
220
+ }
221
+
222
+ /* Ruby code, style similar to vibrant ink */
223
+ .ruby {
224
+ font-size: 12px;
225
+ font-family: monospace;
226
+ color: white;
227
+ background-color: black;
228
+ padding: 0.1em 0 0.2em 0;
229
+ }
230
+
231
+ .ruby .keyword { color: #FF6600; }
232
+ .ruby .constant { color: #339999; }
233
+ .ruby .attribute { color: white; }
234
+ .ruby .global { color: white; }
235
+ .ruby .module { color: white; }
236
+ .ruby .class { color: white; }
237
+ .ruby .string { color: #66FF00; }
238
+ .ruby .ident { color: white; }
239
+ .ruby .method { color: #FFCC00; }
240
+ .ruby .number { color: white; }
241
+ .ruby .char { color: white; }
242
+ .ruby .comment { color: #9933CC; }
243
+ .ruby .symbol { color: white; }
244
+ .ruby .regex { color: #44B4CC; }
245
+ .ruby .punct { color: white; }
246
+ .ruby .escape { color: white; }
247
+ .ruby .interp { color: white; }
248
+ .ruby .expr { color: white; }
249
+
250
+ .ruby .offending { background-color: gray; }
251
+ .ruby .linenum {
252
+ width: 75px;
253
+ padding: 0.1em 1em 0.2em 0;
254
+ color: #000000;
255
+ background-color: #FFFBD3;
256
+ }
257
+
258
+ </style>
259
+ </head>
260
+ <body>
261
+ <div class="rspec-report">
262
+
263
+ <div id="rspec-header">
264
+ <div id="label">
265
+ <h1>RSpec Code Examples</h1>
266
+ </div>
267
+
268
+ <div id="display-filters">
269
+ <input id="passed_checkbox" name="passed_checkbox" type="checkbox" checked="checked" onchange="apply_filters()" value="1" /> <label for="passed_checkbox">Passed</label>
270
+ <input id="failed_checkbox" name="failed_checkbox" type="checkbox" checked="checked" onchange="apply_filters()" value="2" /> <label for="failed_checkbox">Failed</label>
271
+ <input id="pending_checkbox" name="pending_checkbox" type="checkbox" checked="checked" onchange="apply_filters()" value="3" /> <label for="pending_checkbox">Pending</label>
272
+ </div>
273
+
274
+ <div id="summary">
275
+ <p id="totals">&#160;</p>
276
+ <p id="duration">&#160;</p>
277
+ </div>
278
+ </div>
279
+
280
+
281
+ <div class="results">
282
+ <div id="div_group_1" class="example_group passed">
283
+ <dl style="margin-left: 0px;">
284
+ <dt id="example_group_1" class="passed">I18n::HumanizeMissingTranslations</dt>
285
+ </dl>
286
+ </div>
287
+ <div id="div_group_2" class="example_group passed">
288
+ <dl style="margin-left: 15px;">
289
+ <dt id="example_group_2" class="passed">.call</dt>
290
+ </dl>
291
+ </div>
292
+ <div id="div_group_3" class="example_group passed">
293
+ <dl style="margin-left: 30px;">
294
+ <dt id="example_group_3" class="passed">when exception is I18n::MissingTranslation</dt>
295
+ <script type="text/javascript">moveProgressBar('3.1');</script>
296
+ <dd class="example passed"><span class="passed_spec_name">humanizes missing translations</span><span class='duration'>0.12772s</span></dd>
297
+ </dl>
298
+ </div>
299
+ <div id="div_group_4" class="example_group passed">
300
+ <dl style="margin-left: 30px;">
301
+ <dt id="example_group_4" class="passed">when exception is not I18n::MissingTranslation</dt>
302
+ <script type="text/javascript">moveProgressBar('6.2');</script>
303
+ <dd class="example passed"><span class="passed_spec_name">does not intercept it</span><span class='duration'>0.01036s</span></dd>
304
+ </dl>
305
+ </div>
306
+ <div id="div_group_5" class="example_group passed">
307
+ <dl style="margin-left: 0px;">
308
+ <dt id="example_group_5" class="passed">I18n::Backend::Weeler</dt>
309
+ </dl>
310
+ </div>
311
+ <div id="div_group_6" class="example_group passed">
312
+ <dl style="margin-left: 15px;">
313
+ <dt id="example_group_6" class="passed">#lookup</dt>
314
+ <script type="text/javascript">moveProgressBar('9.3');</script>
315
+ <dd class="example passed"><span class="passed_spec_name">returns translation</span><span class='duration'>0.01065s</span></dd>
316
+ </dl>
317
+ </div>
318
+ <div id="div_group_7" class="example_group passed">
319
+ <dl style="margin-left: 30px;">
320
+ <dt id="example_group_7" class="passed">missing translations</dt>
321
+ <script type="text/javascript">moveProgressBar('12.5');</script>
322
+ <dd class="example passed"><span class="passed_spec_name">creates a stub when a custom separator is used and the key contains the flatten separator (a dot character)</span><span class='duration'>0.01711s</span></dd>
323
+ <script type="text/javascript">moveProgressBar('15.6');</script>
324
+ <dd class="example passed"><span class="passed_spec_name">creates one stub per pluralization</span><span class='duration'>0.02318s</span></dd>
325
+ <script type="text/javascript">moveProgressBar('18.7');</script>
326
+ <dd class="example passed"><span class="passed_spec_name">creates a stub per pluralization when a custom separator is used</span><span class='duration'>0.01792s</span></dd>
327
+ <script type="text/javascript">moveProgressBar('21.8');</script>
328
+ <dd class="example passed"><span class="passed_spec_name">lookup persists interpolation keys when looked up directly</span><span class='duration'>0.01146s</span></dd>
329
+ <script type="text/javascript">moveProgressBar('25.0');</script>
330
+ <dd class="example passed"><span class="passed_spec_name">creates no stub for base key in pluralization</span><span class='duration'>0.01677s</span></dd>
331
+ <script type="text/javascript">moveProgressBar('28.1');</script>
332
+ <dd class="example passed"><span class="passed_spec_name">creates a stub when a custom separator is used</span><span class='duration'>0.01429s</span></dd>
333
+ <script type="text/javascript">moveProgressBar('31.2');</script>
334
+ <dd class="example passed"><span class="passed_spec_name">lookup does not persist the key twice</span><span class='duration'>0.01123s</span></dd>
335
+ <script type="text/javascript">moveProgressBar('34.3');</script>
336
+ <dd class="example passed"><span class="passed_spec_name">persists the key</span><span class='duration'>0.01046s</span></dd>
337
+ </dl>
338
+ </div>
339
+ <div id="div_group_8" class="example_group passed">
340
+ <dl style="margin-left: 15px;">
341
+ <dt id="example_group_8" class="passed">#store_translations</dt>
342
+ <script type="text/javascript">moveProgressBar('37.5');</script>
343
+ <dd class="example passed"><span class="passed_spec_name">finds one locale</span><span class='duration'>0.00343s</span></dd>
344
+ <script type="text/javascript">moveProgressBar('40.6');</script>
345
+ <dd class="example passed"><span class="passed_spec_name">finds all existing locales if theres is translations in other locale</span><span class='duration'>0.00895s</span></dd>
346
+ </dl>
347
+ </div>
348
+ <div id="div_group_9" class="example_group passed">
349
+ <dl style="margin-left: 15px;">
350
+ <dt id="example_group_9" class="passed">groups</dt>
351
+ <script type="text/javascript">moveProgressBar('43.7');</script>
352
+ <dd class="example passed"><span class="passed_spec_name">returns 2 groups</span><span class='duration'>0.00442s</span></dd>
353
+ <script type="text/javascript">moveProgressBar('46.8');</script>
354
+ <dd class="example passed"><span class="passed_spec_name">returns ordered list</span><span class='duration'>0.00306s</span></dd>
355
+ </dl>
356
+ </div>
357
+ <div id="div_group_10" class="example_group passed">
358
+ <dl style="margin-left: 15px;">
359
+ <dt id="example_group_10" class="passed">#value</dt>
360
+ <script type="text/javascript">moveProgressBar('50.0');</script>
361
+ <dd class="example passed"><span class="passed_spec_name">returns boolean if translation boolean</span><span class='duration'>0.01143s</span></dd>
362
+ </dl>
363
+ </div>
364
+ <div id="div_group_11" class="example_group passed">
365
+ <dl style="margin-left: 15px;">
366
+ <dt id="example_group_11" class="passed">#store_translations</dt>
367
+ <script type="text/javascript">moveProgressBar('53.1');</script>
368
+ <dd class="example passed"><span class="passed_spec_name">can store translations with keys that are translations containing special chars</span><span class='duration'>0.01174s</span></dd>
369
+ <script type="text/javascript">moveProgressBar('56.2');</script>
370
+ <dd class="example passed"><span class="passed_spec_name">store_translations does not allow ambiguous keys (2)</span><span class='duration'>0.02556s</span></dd>
371
+ <script type="text/javascript">moveProgressBar('59.3');</script>
372
+ <dd class="example passed"><span class="passed_spec_name">store_translations does not allow ambiguous keys (1)</span><span class='duration'>0.02593s</span></dd>
373
+ </dl>
374
+ </div>
375
+ <div id="div_group_12" class="example_group passed">
376
+ <dl style="margin-left: 15px;">
377
+ <dt id="example_group_12" class="passed">#interpolations</dt>
378
+ <script type="text/javascript">moveProgressBar('62.5');</script>
379
+ <dd class="example passed"><span class="passed_spec_name">can persist</span><span class='duration'>0.00841s</span></dd>
380
+ </dl>
381
+ </div>
382
+ <div id="div_group_13" class="example_group passed">
383
+ <dl style="margin-left: 0px;">
384
+ <dt id="example_group_13" class="passed">#&lt;ActionDispatch::Routing::RouteSet:0x007fb1dd007a58&gt;</dt>
385
+ </dl>
386
+ </div>
387
+ <div id="div_group_14" class="example_group passed">
388
+ <dl style="margin-left: 15px;">
389
+ <dt id="example_group_14" class="passed">#weeler_resources</dt>
390
+ <script type="text/javascript">moveProgressBar('65.6');</script>
391
+ <dd class="example passed"><span class="passed_spec_name">mounts resource destroy route</span><span class='duration'>0.02389s</span></dd>
392
+ <script type="text/javascript">moveProgressBar('68.7');</script>
393
+ <dd class="example passed"><span class="passed_spec_name">mounts resource create route</span><span class='duration'>0.02307s</span></dd>
394
+ <script type="text/javascript">moveProgressBar('71.8');</script>
395
+ <dd class="example passed"><span class="passed_spec_name">mounts resource show route</span><span class='duration'>0.02348s</span></dd>
396
+ <script type="text/javascript">moveProgressBar('75.0');</script>
397
+ <dd class="example passed"><span class="passed_spec_name">mounts resource edit route</span><span class='duration'>0.02632s</span></dd>
398
+ <script type="text/javascript">moveProgressBar('78.1');</script>
399
+ <dd class="example passed"><span class="passed_spec_name">mounts resource new route</span><span class='duration'>0.02224s</span></dd>
400
+ <script type="text/javascript">moveProgressBar('81.2');</script>
401
+ <dd class="example passed"><span class="passed_spec_name">mounts resource update route</span><span class='duration'>0.02268s</span></dd>
402
+ <script type="text/javascript">moveProgressBar('84.3');</script>
403
+ <dd class="example passed"><span class="passed_spec_name">mounts resources index route</span><span class='duration'>0.02276s</span></dd>
404
+ </dl>
405
+ </div>
406
+ <div id="div_group_15" class="example_group passed">
407
+ <dl style="margin-left: 30px;">
408
+ <dt id="example_group_15" class="passed">when destroy route is skiped within with only: option</dt>
409
+ <script type="text/javascript">moveProgressBar('87.5');</script>
410
+ <dd class="example passed"><span class="passed_spec_name">does not mount destroy confirm route</span><span class='duration'>0.07051s</span></dd>
411
+ </dl>
412
+ </div>
413
+ <div id="div_group_16" class="example_group passed">
414
+ <dl style="margin-left: 30px;">
415
+ <dt id="example_group_16" class="passed">when custom block given</dt>
416
+ <script type="text/javascript">moveProgressBar('90.6');</script>
417
+ <dd class="example passed"><span class="passed_spec_name">calls it within resources method</span><span class='duration'>0.03966s</span></dd>
418
+ </dl>
419
+ </div>
420
+ <div id="div_group_17" class="example_group passed">
421
+ <dl style="margin-left: 15px;">
422
+ <dt id="example_group_17" class="passed">#add_menu_item</dt>
423
+ <script type="text/javascript">moveProgressBar('93.7');</script>
424
+ <dd class="example passed"><span class="passed_spec_name">adds resource to weeler menu item</span><span class='duration'>0.01719s</span></dd>
425
+ </dl>
426
+ </div>
427
+ <div id="div_group_18" class="example_group passed">
428
+ <dl style="margin-left: 15px;">
429
+ <dt id="example_group_18" class="passed">#mount Weeler::Engine</dt>
430
+ <script type="text/javascript">moveProgressBar('96.8');</script>
431
+ <dd class="example passed"><span class="passed_spec_name">/weeler returns home</span><span class='duration'>0.01893s</span></dd>
432
+ </dl>
433
+ </div>
434
+ <div id="div_group_19" class="example_group passed">
435
+ <dl style="margin-left: 0px;">
436
+ <dt id="example_group_19" class="passed">Weeler::TranslationsController</dt>
437
+ </dl>
438
+ </div>
439
+ <div id="div_group_20" class="example_group passed">
440
+ <dl style="margin-left: 15px;">
441
+ <dt id="example_group_20" class="passed">GET #index</dt>
442
+ <script type="text/javascript">moveProgressBar('100.0');</script>
443
+ <dd class="example passed"><span class="passed_spec_name">list translations</span><span class='duration'>0.04020s</span></dd>
444
+ </dl>
445
+ </div>
446
+ <script type="text/javascript">document.getElementById('duration').innerHTML = "Finished in <strong>0.75284 seconds</strong>";</script>
447
+ <script type="text/javascript">document.getElementById('totals').innerHTML = "32 examples, 0 failures";</script>
448
+ </div>
449
+ </div>
450
+ </body>
451
+ </html>
452
+
453
+ Randomized with seed 19119
454
+