whowish_word 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. data/.gitignore +5 -5
  2. data/.loadpath +5 -5
  3. data/.project +18 -17
  4. data/Gemfile +2 -2
  5. data/HOW_TO_BUILD_WHOWISH_HOOK.md +9 -9
  6. data/ISSUE.md +93 -93
  7. data/README.md +208 -208
  8. data/lib/whowish_word/action_controller/base.rb +44 -44
  9. data/lib/whowish_word/action_mailer/base.rb +11 -11
  10. data/lib/whowish_word/action_view/base.rb +70 -70
  11. data/lib/whowish_word/action_view/template.rb +30 -30
  12. data/lib/whowish_word/authentication.rb +13 -13
  13. data/lib/whowish_word/config.rb +21 -21
  14. data/lib/whowish_word/constant.rb +8 -8
  15. data/lib/whowish_word/db_migration/active_record/whowish_word_html.rb +14 -14
  16. data/lib/whowish_word/db_migration/mongoid/whowish_word_html.rb +5 -5
  17. data/lib/whowish_word/initializer.rb +52 -52
  18. data/lib/whowish_word/rails/app/controllers/whowish_word_controller.rb +60 -60
  19. data/lib/whowish_word/rails/app/models/active_record/whowish_word_html.rb +3 -3
  20. data/lib/whowish_word/rails/app/models/mongoid/whowish_word_html.rb +8 -8
  21. data/lib/whowish_word/rails/public/javascripts/0_jquery-1.6.4-whowish_word.js +9046 -9046
  22. data/lib/whowish_word/rails/public/javascripts/1_csrf_token_hook.js +9 -9
  23. data/lib/whowish_word/rails/public/javascripts/1_jquery.loading_button.js +66 -66
  24. data/lib/whowish_word/rails/public/javascripts/2_whowish_word_variables.js +33 -33
  25. data/lib/whowish_word/rails/public/javascripts/3_whowish_word_dialog.js +136 -136
  26. data/lib/whowish_word/rails/public/javascripts/3_whowish_word_helper.js +116 -116
  27. data/lib/whowish_word/rails/public/javascripts/4_whowish_word_creator.js +69 -69
  28. data/lib/whowish_word/whowish_word.rb +41 -41
  29. data/lib/whowish_word/word_for.rb +93 -93
  30. data/rails/Gemfile +18 -18
  31. data/rails/Gemfile.lock +63 -64
  32. data/rails/app/controllers/application_controller.rb +22 -22
  33. data/rails/app/controllers/home_controller.rb +8 -8
  34. data/rails/app/views/home/index.html.erb +109 -109
  35. data/rails/app/views/home/static_edit.html.erb +50 -50
  36. data/rails/app/views/home/static_edit_select.html.erb +8 -8
  37. data/rails/app/views/integration/attr.html.erb +1 -1
  38. data/rails/app/views/integration/index.html.erb +1 -1
  39. data/rails/app/views/integration/select.html.erb +3 -3
  40. data/rails/app/views/integration/value.html.erb +1 -1
  41. data/rails/app/views/layouts/integration.html.erb +14 -14
  42. data/rails/app/views/layouts/main.html.erb +13 -13
  43. data/rails/app/views/layouts/nested_test_word_for.html.erb +17 -17
  44. data/rails/app/views/layouts/test_javascript.html.erb +13 -13
  45. data/rails/app/views/layouts/test_word_for.html.erb +24 -24
  46. data/rails/app/views/test_javascript/change_value.html.erb +32 -32
  47. data/rails/app/views/test_javascript/index.html.erb +87 -87
  48. data/rails/app/views/test_javascript/replace_with_html.html.erb +96 -96
  49. data/rails/app/views/test_word_for/_partial.html.erb +4 -4
  50. data/rails/app/views/test_word_for/index.html.erb +8 -8
  51. data/rails/config/application.rb +30 -30
  52. data/rails/config/boot.rb +9 -9
  53. data/rails/config/database.yml +24 -24
  54. data/rails/config/environment.rb +16 -16
  55. data/rails/config/initializers/whowish_word.rb +3 -3
  56. data/rails/config/mongoid.rb +6 -6
  57. data/rails/config/mongoid.yml +14 -14
  58. data/rails/config/routes.rb +7 -7
  59. data/rails/config.ru +4 -4
  60. data/rails/log/.gitignore +1 -1
  61. data/rails/mongo.bat +4 -4
  62. data/rails/public/javascripts/jquery.loading_button.js +72 -72
  63. data/rails/public/test/jquery_version.html +26 -26
  64. data/rails/script/rails +6 -6
  65. data/rails/spec/controllers/whowish_word_controller_spec.rb +55 -55
  66. data/rails/spec/integration/whowish_word_generator_spec.rb +139 -139
  67. data/rails/spec/integration/whowish_word_spec.rb +116 -116
  68. data/rails/spec/spec_helper.rb +34 -36
  69. data/rails/spec/support/browser.rb +193 -193
  70. data/rails/spec/support/json_rspec_helper.rb +8 -8
  71. data/rails/spec/support/mongoid_helper.rb +9 -9
  72. data/spec/spec_helper.rb +17 -19
  73. data/spec/unit/word_for_attr_in_edit_mode_spec.rb +43 -43
  74. data/spec/unit/word_for_attr_spec.rb +43 -43
  75. data/spec/unit/word_for_in_edit_mode_spec.rb +43 -43
  76. data/spec/unit/word_for_spec.rb +43 -43
  77. data/whowish_word.gemspec +21 -21
  78. metadata +73 -4
@@ -1,44 +1,44 @@
1
- require 'spec_helper'
2
-
3
- describe 'word_for' do
4
-
5
- before(:each) do
6
- WhowishWord.words = {}
7
- end
8
-
9
-
10
- it "no variables, no entry" do
11
-
12
- value = WhowishWord.word_for_in_edit_mode("namespace", "id", "en")
13
- value.should == "<dfn>#{WhowishWord::PREFIX}#{WhowishWord::SEPARATOR}namespace:id(en)#{WhowishWord::SEPARATOR}id(en)</dfn>"
14
-
15
- end
16
-
17
-
18
- it "with variables, no entry" do
19
-
20
- value = WhowishWord.word_for_in_edit_mode("namespace", "id", "en", :number=>5, :name=>"tanin")
21
- value.should == "<dfn>#{WhowishWord::PREFIX}#{WhowishWord::SEPARATOR}namespace:id(en)|number,name#{WhowishWord::SEPARATOR}id(en){number,name}</dfn>"
22
-
23
- end
24
-
25
-
26
- it "no variables, with entry" do
27
-
28
- WhowishWord.words = {"namespace:id(en)" => "hello"}
29
- value = WhowishWord.word_for_in_edit_mode("namespace", "id", "en")
30
- value.should == "<dfn>#{WhowishWord::PREFIX}#{WhowishWord::SEPARATOR}namespace:id(en)#{WhowishWord::SEPARATOR}hello</dfn>"
31
-
32
- end
33
-
34
-
35
- it "with variables, with entry" do
36
-
37
- WhowishWord.words = {"namespace:id(en)" => "hello {name} for {number} times"}
38
- value = WhowishWord.word_for_in_edit_mode("namespace", "id", "en", :number=>5, :name=>"tanin")
39
- value.should == "<dfn>#{WhowishWord::PREFIX}#{WhowishWord::SEPARATOR}namespace:id(en)|number,name#{WhowishWord::SEPARATOR}hello tanin for 5 times</dfn>"
40
-
41
- end
42
-
43
-
1
+ require 'spec_helper'
2
+
3
+ describe 'word_for' do
4
+
5
+ before(:each) do
6
+ WhowishWord.words = {}
7
+ end
8
+
9
+
10
+ it "no variables, no entry" do
11
+
12
+ value = WhowishWord.word_for_in_edit_mode("namespace", "id", "en")
13
+ value.should == "<dfn>#{WhowishWord::PREFIX}#{WhowishWord::SEPARATOR}namespace:id(en)#{WhowishWord::SEPARATOR}id(en)</dfn>"
14
+
15
+ end
16
+
17
+
18
+ it "with variables, no entry" do
19
+
20
+ value = WhowishWord.word_for_in_edit_mode("namespace", "id", "en", :number=>5, :name=>"tanin")
21
+ value.should == "<dfn>#{WhowishWord::PREFIX}#{WhowishWord::SEPARATOR}namespace:id(en)|number,name#{WhowishWord::SEPARATOR}id(en){number,name}</dfn>"
22
+
23
+ end
24
+
25
+
26
+ it "no variables, with entry" do
27
+
28
+ WhowishWord.words = {"namespace:id(en)" => "hello"}
29
+ value = WhowishWord.word_for_in_edit_mode("namespace", "id", "en")
30
+ value.should == "<dfn>#{WhowishWord::PREFIX}#{WhowishWord::SEPARATOR}namespace:id(en)#{WhowishWord::SEPARATOR}hello</dfn>"
31
+
32
+ end
33
+
34
+
35
+ it "with variables, with entry" do
36
+
37
+ WhowishWord.words = {"namespace:id(en)" => "hello {name} for {number} times"}
38
+ value = WhowishWord.word_for_in_edit_mode("namespace", "id", "en", :number=>5, :name=>"tanin")
39
+ value.should == "<dfn>#{WhowishWord::PREFIX}#{WhowishWord::SEPARATOR}namespace:id(en)|number,name#{WhowishWord::SEPARATOR}hello tanin for 5 times</dfn>"
40
+
41
+ end
42
+
43
+
44
44
  end
@@ -1,44 +1,44 @@
1
- require 'spec_helper'
2
-
3
- describe 'word_for' do
4
-
5
- before(:each) do
6
- WhowishWord.words = {}
7
- end
8
-
9
-
10
- it "no variables, no entry" do
11
-
12
- value = WhowishWord.word_for("namespace", "id", "en")
13
- value.should == "id(en)"
14
-
15
- end
16
-
17
-
18
- it "with variables, no entry" do
19
-
20
- value = WhowishWord.word_for("namespace", "id", "en", :number=>5, :name=>"tanin")
21
- value.should == "id(en){number,name}"
22
-
23
- end
24
-
25
-
26
- it "no variables, with entry" do
27
-
28
- WhowishWord.words = {"namespace:id(en)" => "hello"}
29
- value = WhowishWord.word_for("namespace", "id", "en")
30
- value.should == "hello"
31
-
32
- end
33
-
34
-
35
- it "with variables, with entry" do
36
-
37
- WhowishWord.words = {"namespace:id(en)" => "hello {name} for {number} times"}
38
- value = WhowishWord.word_for("namespace", "id", "en", :number=>5, :name=>"tanin")
39
- value.should == "hello tanin for 5 times"
40
-
41
- end
42
-
43
-
1
+ require 'spec_helper'
2
+
3
+ describe 'word_for' do
4
+
5
+ before(:each) do
6
+ WhowishWord.words = {}
7
+ end
8
+
9
+
10
+ it "no variables, no entry" do
11
+
12
+ value = WhowishWord.word_for("namespace", "id", "en")
13
+ value.should == "id(en)"
14
+
15
+ end
16
+
17
+
18
+ it "with variables, no entry" do
19
+
20
+ value = WhowishWord.word_for("namespace", "id", "en", :number=>5, :name=>"tanin")
21
+ value.should == "id(en){number,name}"
22
+
23
+ end
24
+
25
+
26
+ it "no variables, with entry" do
27
+
28
+ WhowishWord.words = {"namespace:id(en)" => "hello"}
29
+ value = WhowishWord.word_for("namespace", "id", "en")
30
+ value.should == "hello"
31
+
32
+ end
33
+
34
+
35
+ it "with variables, with entry" do
36
+
37
+ WhowishWord.words = {"namespace:id(en)" => "hello {name} for {number} times"}
38
+ value = WhowishWord.word_for("namespace", "id", "en", :number=>5, :name=>"tanin")
39
+ value.should == "hello tanin for 5 times"
40
+
41
+ end
42
+
43
+
44
44
  end
data/whowish_word.gemspec CHANGED
@@ -1,21 +1,21 @@
1
- # -*- encoding: utf-8 -*-
2
- $:.push File.expand_path("../lib", __FILE__)
3
-
4
- Gem::Specification.new do |s|
5
- s.name = "whowish_word"
6
- s.version = "0.3.1"
7
- s.platform = Gem::Platform::RUBY
8
- s.authors = ["Tanin Na Nakorn"]
9
- s.email = ["tanin47@yahoo.com"]
10
- s.homepage = "http://github.com/tanin47/whowish_word"
11
- s.summary = %q{WhowishWord}
12
- s.description = %q{A Rails gem that make static content editable}
13
-
14
- s.rubyforge_project = "whowish_word"
15
-
16
- s.files = `git ls-files`.split("\n")
17
- s.test_files = `git ls-files -- {rails,spec}/*`.split("\n")
18
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
- s.require_paths = ["lib"]
20
-
21
- end
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = "whowish_word"
6
+ s.version = "0.3.2"
7
+ s.platform = Gem::Platform::RUBY
8
+ s.authors = ["Tanin Na Nakorn"]
9
+ s.email = ["tanin47@yahoo.com"]
10
+ s.homepage = "http://github.com/tanin47/whowish_word"
11
+ s.summary = %q{WhowishWord}
12
+ s.description = %q{A Rails gem that make static content editable}
13
+
14
+ s.rubyforge_project = "whowish_word"
15
+
16
+ s.files = `git ls-files`.split("\n")
17
+ s.test_files = `git ls-files -- {rails,spec}/*`.split("\n")
18
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
+ s.require_paths = ["lib"]
20
+
21
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: whowish_word
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  prerelease:
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: 2011-11-10 00:00:00.000000000Z
12
+ date: 2011-12-04 00:00:00.000000000Z
13
13
  dependencies: []
14
14
  description: A Rails gem that make static content editable
15
15
  email:
@@ -158,8 +158,77 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
158
  version: '0'
159
159
  requirements: []
160
160
  rubyforge_project: whowish_word
161
- rubygems_version: 1.8.9
161
+ rubygems_version: 1.8.10
162
162
  signing_key:
163
163
  specification_version: 3
164
164
  summary: WhowishWord
165
- test_files: []
165
+ test_files:
166
+ - rails/Gemfile
167
+ - rails/Gemfile.lock
168
+ - rails/Rakefile
169
+ - rails/app/assets/javascripts/integration.js
170
+ - rails/app/assets/javascripts/test_javascript.js
171
+ - rails/app/assets/javascripts/test_word_for.js
172
+ - rails/app/assets/stylesheets/integration.css
173
+ - rails/app/assets/stylesheets/test_javascript.css
174
+ - rails/app/assets/stylesheets/test_word_for.css
175
+ - rails/app/controllers/application_controller.rb
176
+ - rails/app/controllers/home_controller.rb
177
+ - rails/app/controllers/integration_controller.rb
178
+ - rails/app/controllers/test_javascript_controller.rb
179
+ - rails/app/controllers/test_word_for_controller.rb
180
+ - rails/app/helpers/integration_helper.rb
181
+ - rails/app/helpers/test_javascript_helper.rb
182
+ - rails/app/helpers/test_word_for_helper.rb
183
+ - rails/app/views/home/index.html.erb
184
+ - rails/app/views/home/static_edit.html.erb
185
+ - rails/app/views/home/static_edit_select.html.erb
186
+ - rails/app/views/integration/attr.html.erb
187
+ - rails/app/views/integration/index.html.erb
188
+ - rails/app/views/integration/select.html.erb
189
+ - rails/app/views/integration/value.html.erb
190
+ - rails/app/views/layouts/integration.html.erb
191
+ - rails/app/views/layouts/main.html.erb
192
+ - rails/app/views/layouts/nested_test_word_for.html.erb
193
+ - rails/app/views/layouts/test_javascript.html.erb
194
+ - rails/app/views/layouts/test_word_for.html.erb
195
+ - rails/app/views/test_javascript/change_value.html.erb
196
+ - rails/app/views/test_javascript/index.html.erb
197
+ - rails/app/views/test_javascript/replace_with_html.html.erb
198
+ - rails/app/views/test_word_for/_partial.html.erb
199
+ - rails/app/views/test_word_for/index.html.erb
200
+ - rails/config.ru
201
+ - rails/config/application.rb
202
+ - rails/config/boot.rb
203
+ - rails/config/database.yml
204
+ - rails/config/environment.rb
205
+ - rails/config/initializers/whowish_word.rb
206
+ - rails/config/mongoid.rb
207
+ - rails/config/mongoid.yml
208
+ - rails/config/routes.rb
209
+ - rails/db/.gitdummy
210
+ - rails/log/.gitignore
211
+ - rails/mongo.bat
212
+ - rails/public/jasmine/MIT.LICENSE
213
+ - rails/public/jasmine/jasmine-html.js
214
+ - rails/public/jasmine/jasmine.css
215
+ - rails/public/jasmine/jasmine.js
216
+ - rails/public/jasmine/jasmine_favicon.png
217
+ - rails/public/javascripts/jquery-1.6.4.js
218
+ - rails/public/javascripts/jquery.loading_button.js
219
+ - rails/public/sinonjs/sinonjs.js
220
+ - rails/public/stylesheets/main.css
221
+ - rails/public/test/jquery_version.html
222
+ - rails/script/rails
223
+ - rails/spec/controllers/whowish_word_controller_spec.rb
224
+ - rails/spec/integration/whowish_word_generator_spec.rb
225
+ - rails/spec/integration/whowish_word_spec.rb
226
+ - rails/spec/spec_helper.rb
227
+ - rails/spec/support/browser.rb
228
+ - rails/spec/support/json_rspec_helper.rb
229
+ - rails/spec/support/mongoid_helper.rb
230
+ - spec/spec_helper.rb
231
+ - spec/unit/word_for_attr_in_edit_mode_spec.rb
232
+ - spec/unit/word_for_attr_spec.rb
233
+ - spec/unit/word_for_in_edit_mode_spec.rb
234
+ - spec/unit/word_for_spec.rb