whowish_word 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +6 -0
- data/.loadpath +5 -0
- data/.project +17 -0
- data/Gemfile +3 -0
- data/HOW_TO_BUILD_WHOWISH_HOOK.md +10 -0
- data/ISSUE.md +93 -0
- data/README.md +72 -0
- data/config.ru +4 -0
- data/lib/legacy/whowish_word/config.rb +1 -0
- data/lib/legacy/whowish_word/init.rb +4 -0
- data/lib/legacy/whowish_word/lib/app/controllers/whowish_word_controller.rb +115 -0
- data/lib/legacy/whowish_word/lib/app/controllers/whowish_word_email_controller.rb +66 -0
- data/lib/legacy/whowish_word/lib/app/controllers/whowish_word_facebook_controller.rb +62 -0
- data/lib/legacy/whowish_word/lib/app/models/mongodb/whowish_word.rb +12 -0
- data/lib/legacy/whowish_word/lib/app/models/mongodb/whowish_word_email.rb +10 -0
- data/lib/legacy/whowish_word/lib/app/models/mongodb/whowish_word_facebook.rb +28 -0
- data/lib/legacy/whowish_word/lib/app/models/mysql/whowish_word.rb +5 -0
- data/lib/legacy/whowish_word/lib/app/models/mysql/whowish_word_email.rb +5 -0
- data/lib/legacy/whowish_word/lib/app/models/mysql/whowish_word_facebook.rb +18 -0
- data/lib/legacy/whowish_word/lib/app/views/layouts/whowish_word_blank.html.erb +94 -0
- data/lib/legacy/whowish_word/lib/app/views/whowish_word/_javascript.html.erb +82 -0
- data/lib/legacy/whowish_word/lib/app/views/whowish_word/_row.html.erb +50 -0
- data/lib/legacy/whowish_word/lib/app/views/whowish_word/index.html.erb +219 -0
- data/lib/legacy/whowish_word/lib/app/views/whowish_word/login.html.erb +5 -0
- data/lib/legacy/whowish_word/lib/app/views/whowish_word_email/_row.html.erb +42 -0
- data/lib/legacy/whowish_word/lib/app/views/whowish_word_email/index.html.erb +99 -0
- data/lib/legacy/whowish_word/lib/app/views/whowish_word_facebook/_row.html.erb +48 -0
- data/lib/legacy/whowish_word/lib/app/views/whowish_word_facebook/index.html.erb +100 -0
- data/lib/legacy/whowish_word/lib/db_migration.rb +2 -0
- data/lib/legacy/whowish_word/lib/db_migration/mongodb.rb +0 -0
- data/lib/legacy/whowish_word/lib/db_migration/mysql.rb +60 -0
- data/lib/legacy/whowish_word/lib/hook.rb +186 -0
- data/lib/whowish_word.rb +1 -0
- data/lib/whowish_word/action_controller/base.rb +35 -0
- data/lib/whowish_word/action_mailer/base.rb +12 -0
- data/lib/whowish_word/action_view/base.rb +65 -0
- data/lib/whowish_word/action_view/template.rb +22 -0
- data/lib/whowish_word/authentication.rb +14 -0
- data/lib/whowish_word/constant.rb +9 -0
- data/lib/whowish_word/db_migration/active_record/whowish_word_html.rb +15 -0
- data/lib/whowish_word/initializer.rb +55 -0
- data/lib/whowish_word/rails/app/controllers/whowish_word_controller.rb +71 -0
- data/lib/whowish_word/rails/app/models/active_record/whowish_word_html.rb +4 -0
- data/lib/whowish_word/rails/app/models/mongoid/whowish_word_html.rb +10 -0
- data/lib/whowish_word/rails/public/javascripts/0_class.js +64 -0
- data/lib/whowish_word/rails/public/javascripts/0_jquery-1.6.4-whowish_word.js +9046 -0
- data/lib/whowish_word/rails/public/javascripts/1_csrf_and_authenticity_token_hook.js +9 -0
- data/lib/whowish_word/rails/public/javascripts/1_jquery.escape.js +23 -0
- data/lib/whowish_word/rails/public/javascripts/1_jquery.loading_button.js +66 -0
- data/lib/whowish_word/rails/public/javascripts/1_jquery.sizes.min.js +8 -0
- data/lib/whowish_word/rails/public/javascripts/2_whowish_word_variables.js +64 -0
- data/lib/whowish_word/rails/public/javascripts/3_whowish_word_dialog.js +136 -0
- data/lib/whowish_word/rails/public/javascripts/3_whowish_word_helper.js +94 -0
- data/lib/whowish_word/rails/public/javascripts/4_whowish_word.js +43 -0
- data/lib/whowish_word/rails/public/javascripts/4_whowish_word_content_handler.js +15 -0
- data/lib/whowish_word/rails/public/javascripts/4_whowish_word_creator.js +62 -0
- data/lib/whowish_word/rails/public/javascripts/5_whowish_word_common_creator.js +49 -0
- data/lib/whowish_word/rails/public/javascripts/6_whowish_word_element_creator.js +72 -0
- data/lib/whowish_word/rails/public/javascripts/6_whowish_word_html_creator.js +19 -0
- data/lib/whowish_word/rails/public/javascripts/6_whowish_word_select_creator.js +11 -0
- data/lib/whowish_word/rails/public/javascripts/6_whowish_word_text_creator.js +20 -0
- data/lib/whowish_word/rails/public/javascripts/6_whowish_word_value_creator.js +20 -0
- data/lib/whowish_word/rails/public/javascripts/7_whowish_word_attribute_handler.js +17 -0
- data/lib/whowish_word/rails/public/javascripts/7_whowish_word_html_handler.js +15 -0
- data/lib/whowish_word/rails/public/javascripts/7_whowish_word_text_handler.js +15 -0
- data/lib/whowish_word/rails/public/javascripts/7_whowish_word_value_handler.js +19 -0
- data/lib/whowish_word/rails/public/stylesheets/whowish_word.css +197 -0
- data/lib/whowish_word/whowish_word.rb +39 -0
- data/lib/whowish_word/word_for.rb +97 -0
- data/rails/Gemfile +18 -0
- data/rails/Gemfile.lock +130 -0
- data/rails/Rakefile +7 -0
- data/rails/app/assets/javascripts/integration.js +2 -0
- data/rails/app/assets/javascripts/test_javascript.js +2 -0
- data/rails/app/assets/javascripts/test_word_for.js +2 -0
- data/rails/app/assets/stylesheets/integration.css +4 -0
- data/rails/app/assets/stylesheets/test_javascript.css +4 -0
- data/rails/app/assets/stylesheets/test_word_for.css +4 -0
- data/rails/app/controllers/application_controller.rb +14 -0
- data/rails/app/controllers/home_controller.rb +9 -0
- data/rails/app/controllers/integration_controller.rb +5 -0
- data/rails/app/controllers/test_javascript_controller.rb +11 -0
- data/rails/app/controllers/test_word_for_controller.rb +5 -0
- data/rails/app/helpers/integration_helper.rb +2 -0
- data/rails/app/helpers/test_javascript_helper.rb +2 -0
- data/rails/app/helpers/test_word_for_helper.rb +2 -0
- data/rails/app/views/home/index.html.erb +95 -0
- data/rails/app/views/home/static_edit.html.erb +50 -0
- data/rails/app/views/home/static_edit_select.html.erb +9 -0
- data/rails/app/views/integration/attr.html.erb +1 -0
- data/rails/app/views/integration/index.html.erb +1 -0
- data/rails/app/views/integration/select.html.erb +3 -0
- data/rails/app/views/integration/value.html.erb +1 -0
- data/rails/app/views/layouts/integration.html.erb +14 -0
- data/rails/app/views/layouts/main.html.erb +14 -0
- data/rails/app/views/layouts/nested_test_word_for.html.erb +14 -0
- data/rails/app/views/layouts/test_javascript.html.erb +13 -0
- data/rails/app/views/layouts/test_word_for.html.erb +22 -0
- data/rails/app/views/test_javascript/change_value.html.erb +32 -0
- data/rails/app/views/test_javascript/index.html.erb +78 -0
- data/rails/app/views/test_word_for/_partial.html.erb +5 -0
- data/rails/app/views/test_word_for/index.html.erb +7 -0
- data/rails/config.ru +4 -0
- data/rails/config/application.rb +30 -0
- data/rails/config/boot.rb +9 -0
- data/rails/config/database.yml +25 -0
- data/rails/config/environment.rb +16 -0
- data/rails/config/initializers/whowish_word.rb +5 -0
- data/rails/config/mongoid.rb +6 -0
- data/rails/config/mongoid.yml +14 -0
- data/rails/config/routes.rb +7 -0
- data/rails/log/.gitignore +2 -0
- data/rails/mongo.bat +5 -0
- data/rails/public/jasmine/MIT.LICENSE +20 -0
- data/rails/public/jasmine/jasmine-html.js +190 -0
- data/rails/public/jasmine/jasmine.css +166 -0
- data/rails/public/jasmine/jasmine.js +2476 -0
- data/rails/public/jasmine/jasmine_favicon.png +0 -0
- data/rails/public/javascripts/jquery-1.6.4.js +9046 -0
- data/rails/public/sinonjs/sinonjs.js +2821 -0
- data/rails/public/stylesheets/main.css +22 -0
- data/rails/public/test/jquery_version.html +26 -0
- data/rails/script/rails +6 -0
- data/rails/spec/controllers/whowish_word_controller_spec.rb +56 -0
- data/rails/spec/integration/whowish_word_generator_spec.rb +116 -0
- data/rails/spec/integration/whowish_word_spec.rb +110 -0
- data/rails/spec/spec_helper.rb +44 -0
- data/rails/spec/support/browser.rb +194 -0
- data/rails/spec/support/json_rspec_helper.rb +9 -0
- data/rails/spec/support/mongoid_helper.rb +10 -0
- data/spec/spec_helper.rb +19 -0
- data/spec/unit/word_for_attr_in_edit_mode_spec.rb +44 -0
- data/spec/unit/word_for_attr_spec.rb +44 -0
- data/spec/unit/word_for_in_edit_mode_spec.rb +44 -0
- data/spec/unit/word_for_spec.rb +44 -0
- data/whowish_word.gemspec +21 -0
- metadata +181 -0
@@ -0,0 +1,50 @@
|
|
1
|
+
<br/>
|
2
|
+
<br/>
|
3
|
+
<div>
|
4
|
+
<b>Textbox on normal div:</b>
|
5
|
+
<input type="text" value="__whowishWord_______normal_div_____value" placeholder="placeholder" name="<%=rand()%>">
|
6
|
+
<br/>
|
7
|
+
<dfn>__whowishWord_______normal_text_____erhreherherh
|
8
|
+
erherherh
|
9
|
+
erherherher
|
10
|
+
herherherh
|
11
|
+
reherherherh</dfn>
|
12
|
+
<br/>
|
13
|
+
<textarea id="test_textarea" title="__whowishWord_______title_textarea_____title" name="<%=rand()%>">__whowishWord_______value_textarea_____123wegwegewg
|
14
|
+
wegewgweg
|
15
|
+
wegwegew
|
16
|
+
gwegwegweg
|
17
|
+
</textarea>
|
18
|
+
</div>
|
19
|
+
|
20
|
+
<div style="float:left;display:block;margin-top:50px;">
|
21
|
+
<b style="float:left;">Textbox on float div:</b>
|
22
|
+
<input type="text" style="float:right;" value="__whowishWord_______float_div_1|a,b,c_____value" placeholder="__whowishWord_______float_div_1_____placeholder" name="<%=rand()%>">
|
23
|
+
<br style="clear:both;"/>
|
24
|
+
<input type="text" style="float:right;" value="__whowishWord_______float_div_2_____value" placeholder="placeholder" name="<%=rand()%>">
|
25
|
+
<br style="clear:both" />
|
26
|
+
<select id="test_select" style="float:left;">
|
27
|
+
<option value="__whowishWord_______option_value_____value1">__whowishWord_______option_text_____text1</option>
|
28
|
+
<option value="__whowishWord_______option_value_____value2">__whowishWord_______option_text_____text2</option>
|
29
|
+
<option value="__whowishWord_______option_value_____value3">__whowishWord_______option_text_____text3</option>
|
30
|
+
<option value="__whowishWord_______option_value_____value4">__whowishWord_______option_text_____text4</option>
|
31
|
+
</select>
|
32
|
+
<br/>
|
33
|
+
<input type="button" onclick="show_content();"/>
|
34
|
+
<span id="late_content"></span>
|
35
|
+
</div>
|
36
|
+
|
37
|
+
<div style="position:absolute;left:400px;top:200px;width:300px;height:100px;background-color:#BBBBBB">
|
38
|
+
<b>Textbox on a absolute-positioned dialog box:</b>
|
39
|
+
<input type="text" value="__whowishWord_______abs_div_____value" placeholder="placeholder" style="margin-left:50px;margin-top:40px;" name="<%=rand()%>">
|
40
|
+
<br/>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
|
44
|
+
<script type="text/javascript">
|
45
|
+
$w.whowishWord(true);
|
46
|
+
|
47
|
+
function show_content() {
|
48
|
+
$('#late_content').html("<dfn>__whowishWord_______late_content_____valueaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</dfn>");
|
49
|
+
}
|
50
|
+
</script>
|
@@ -0,0 +1,9 @@
|
|
1
|
+
<select id="test_select">
|
2
|
+
<option value="__whowishWord_______option_value_____value1">__whowishWord_______option_text_____text1</option>
|
3
|
+
<option value="__whowishWord_______option_value_____value2">__whowishWord_______option_text_____text2</option>
|
4
|
+
<option value="__whowishWord_______option_value_____value3">__whowishWord_______option_text_____text3</option>
|
5
|
+
<option value="__whowishWord_______option_value_____value4">__whowishWord_______option_text_____text4</option>
|
6
|
+
</select>
|
7
|
+
<script type="text/javascript">
|
8
|
+
$w.whowishWord();
|
9
|
+
</script>
|
@@ -0,0 +1 @@
|
|
1
|
+
<input type="text" title="<%=word_for_attr :text%>">
|
@@ -0,0 +1 @@
|
|
1
|
+
<%=word_for :text%>
|
@@ -0,0 +1 @@
|
|
1
|
+
<input type="text" value="<%=word_for_attr :text%>">
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
5
|
+
<title>Rails testing for whowish_word</title>
|
6
|
+
<%= csrf_meta_tag%>
|
7
|
+
<%= javascript_include_tag "jquery-1.6.4.js" %>
|
8
|
+
<%= whowish_word_javascript_and_css %>
|
9
|
+
<%= stylesheet_link_tag "main.css"%>
|
10
|
+
</head>
|
11
|
+
<body>
|
12
|
+
<%= content_for?(:nested_layout) ? yield(:nested_layout) : yield %>
|
13
|
+
</body>
|
14
|
+
</html>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<%
|
2
|
+
content_for :nested_layout do
|
3
|
+
%>
|
4
|
+
<%=yield%>
|
5
|
+
<span id="nested_layout"><%= word_for :text%></span>
|
6
|
+
<span id="nested_layout_attr"><%= word_for_attr :text%></span>
|
7
|
+
|
8
|
+
<span id="nested_layout_with_variables"><%= word_for :text, :number=>5, :name=>"tanin" %></span>
|
9
|
+
<span id="nested_layout_attr_with_variables"><%= word_for_attr :text, :number=>5, :name=>"tanin"%></span>
|
10
|
+
<%
|
11
|
+
end
|
12
|
+
%>
|
13
|
+
|
14
|
+
<%= render :template => 'layouts/test_word_for' %>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
5
|
+
<title>Rails testing for whowish_word</title>
|
6
|
+
<style>
|
7
|
+
body > span {
|
8
|
+
display: block;
|
9
|
+
}
|
10
|
+
</style>
|
11
|
+
<%= stylesheet_link_tag "whowish_word.css"%>
|
12
|
+
</head>
|
13
|
+
<body>
|
14
|
+
<%= content_for?(:nested_layout) ? yield(:nested_layout) : yield %>
|
15
|
+
|
16
|
+
<span id="layout"><%= word_for :text%></span>
|
17
|
+
<span id="layout_attr"><%= word_for_attr :text%></span>
|
18
|
+
|
19
|
+
<span id="layout_with_variables"><%= word_for :text, :number=>5, :name=>"tanin" %></span>
|
20
|
+
<span id="layout_attr_with_variables"><%= word_for_attr :text, :number=>5, :name=>"tanin"%></span>
|
21
|
+
</body>
|
22
|
+
</html>
|
@@ -0,0 +1,32 @@
|
|
1
|
+
<span style="width:600px;">
|
2
|
+
<p>This page tests changing value of a textbox and a textarea to some constant before running WhowishWord.</p>
|
3
|
+
|
4
|
+
<p>
|
5
|
+
I have found out that changing value through Javascript does not actually change the value of the attribute 'value'.
|
6
|
+
</p>
|
7
|
+
|
8
|
+
<p>
|
9
|
+
This causes problem in the previous version because it detects that the attribute 'value' needs a WhowishWord, but
|
10
|
+
when the value of the element is retrieved, it does not conform with WhowishWord edit format.
|
11
|
+
</p>
|
12
|
+
|
13
|
+
<p>
|
14
|
+
So, <i>WhowishWordElementCreator</i> explicitly exclude the attribute 'value'
|
15
|
+
and let <i>WhowishWordValueCreator</i> deals with it.<br/>
|
16
|
+
</p>
|
17
|
+
</span>
|
18
|
+
<span>
|
19
|
+
<b>Textbox: </b> <input type="textbox" id="change_textbox"
|
20
|
+
title="__whowishWord_______title_textbox|name,value_____title"
|
21
|
+
value="__whowishWord_______value_textbox|name,value_____value"
|
22
|
+
placeholder="__whowishWord_______placeholder_textbox|name,value_____placeholder">
|
23
|
+
</span>
|
24
|
+
<span>
|
25
|
+
<b>Textarea: </b> <textarea id="change_textarea"
|
26
|
+
title="__whowishWord_______title_textarea|name,value_____title"
|
27
|
+
placeholder="__whowishWord_______placeholder_textarea|name,value_____placeholder">__whowishWord_______value_textarea|name,value_____value</textarea>
|
28
|
+
</span>
|
29
|
+
<script type="text/javascript">
|
30
|
+
$('#change_textbox').val("something else");
|
31
|
+
$('#change_textarea').val("something other than this");
|
32
|
+
</script>
|
@@ -0,0 +1,78 @@
|
|
1
|
+
<span style="width:600px;">
|
2
|
+
<p>This is the page that tests every element.</p>
|
3
|
+
</span>
|
4
|
+
<span>
|
5
|
+
<b>Text: </b> <dfn>__whowishWord_______text_text|name,value_____text</dfn>
|
6
|
+
</span>
|
7
|
+
<span>
|
8
|
+
<b>Label: </b> <label for="some_textbox">__whowishWord_______text_label|name,value_____text</label>
|
9
|
+
<input type="text" name="some_textbox">
|
10
|
+
</span>
|
11
|
+
<span>
|
12
|
+
<b>Textbox: </b> <input type="textbox"
|
13
|
+
title="__whowishWord_______title_textbox|name,value_____title"
|
14
|
+
value="__whowishWord_______value_textbox|name,value_____value"
|
15
|
+
placeholder="__whowishWord_______placeholder_textbox|name,value_____placeholder">
|
16
|
+
</span>
|
17
|
+
<span>
|
18
|
+
<b>Textarea: </b> <textarea
|
19
|
+
title="__whowishWord_______title_textarea|name,value_____title"
|
20
|
+
placeholder="__whowishWord_______placeholder_textarea|name,value_____placeholder">__whowishWord_______value_textarea|name,value_____value</textarea>
|
21
|
+
</span>
|
22
|
+
<span>
|
23
|
+
<b>Checkbox: </b> <input type="checkbox"
|
24
|
+
title="__whowishWord_______title_checkbox|name,value_____title"
|
25
|
+
value="__whowishWord_______value_checkbox|name,value_____value">
|
26
|
+
</span>
|
27
|
+
<span>
|
28
|
+
<b>Radio: </b> <input type="radio"
|
29
|
+
title="__whowishWord_______title_radio|name,value_____title"
|
30
|
+
value="__whowishWord_______value_radio|name,value_____value">
|
31
|
+
</span>
|
32
|
+
<span>
|
33
|
+
<b>Select: </b> <select title="__whowishWord_______title_select|name,value_____title">
|
34
|
+
<option value="__whowishWord_______option_value_0|name,value_____value_0">__whowishWord_______option_text_0_____text_0</option>
|
35
|
+
<option value="__whowishWord_______option_value_1|name,value_____value_1">__whowishWord_______option_text_1_____text_1</option>
|
36
|
+
</select>
|
37
|
+
</span>
|
38
|
+
<span>
|
39
|
+
<b>Button(Input): </b> <input type="button"
|
40
|
+
title="__whowishWord_______title_input_button|name,value_____title"
|
41
|
+
value="__whowishWord_______value_input_button|name,value_____value" >
|
42
|
+
</span>
|
43
|
+
<span>
|
44
|
+
<b>Submit(Input): </b> <input type="submit"
|
45
|
+
title="__whowishWord_______title_input_submit|name,value_____title"
|
46
|
+
value="__whowishWord_______value_input_submit|name,value_____value" >
|
47
|
+
</span>
|
48
|
+
<span>
|
49
|
+
<b>Button: </b> <button title="__whowishWord_______title_button|name,value_____title">__whowishWord_______value_button|name,value_____value</button>
|
50
|
+
</span>
|
51
|
+
<span>
|
52
|
+
<b>Late Text: </b> <span id="late_text"></span>
|
53
|
+
|
54
|
+
<script type="text/javascript">
|
55
|
+
|
56
|
+
setTimeout(function() {
|
57
|
+
$('#late_text').html("<dfn>__whowishWord_______text_late_text|name,value_____text</dfn>");
|
58
|
+
},5000);
|
59
|
+
|
60
|
+
</script>
|
61
|
+
</span>
|
62
|
+
<span>
|
63
|
+
<b>Late Textbox: </b> <input type="textbox" id="late_textbox"
|
64
|
+
title="title"
|
65
|
+
value="value"
|
66
|
+
placeholder="placeholder">
|
67
|
+
|
68
|
+
<script type="text/javascript">
|
69
|
+
|
70
|
+
setTimeout(function() {
|
71
|
+
$('#late_textbox').attr("title","__whowishWord_______title_late_textbox|name,value_____title");
|
72
|
+
$('#late_textbox').attr("value","__whowishWord_______value_late_textbox|name,value_____value");
|
73
|
+
$('#late_textbox').attr("placeholder","__whowishWord_______placeholder_late_textbox|name,value_____placeholder");
|
74
|
+
},5000);
|
75
|
+
|
76
|
+
</script>
|
77
|
+
</span>
|
78
|
+
|
@@ -0,0 +1,5 @@
|
|
1
|
+
<span id="partial"><%= word_for :text%></span>
|
2
|
+
<span id="partial_attr"><%= word_for_attr :text%></span>
|
3
|
+
|
4
|
+
<span id="partial_with_variables"><%= word_for :text, :number=>5, :name=>"tanin" %></span>
|
5
|
+
<span id="partial_attr_with_variables"><%= word_for_attr :text, :number=>5, :name=>"tanin"%></span>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<span id="view"><%= word_for :text%></span>
|
2
|
+
<span id="view_attr"><%= word_for_attr :text%></span>
|
3
|
+
|
4
|
+
<span id="view_with_variables"><%= word_for :text, :number=>5, :name=>"tanin" %></span>
|
5
|
+
<span id="view_attr_with_variables"><%= word_for_attr :text, :number=>5, :name=>"tanin"%></span>
|
6
|
+
|
7
|
+
<%= render :partial=>"partial"%>
|
data/rails/config.ru
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
$ORM_ENGINE = :active_record
|
2
|
+
#$ORM_ENGINE = :mongoid
|
3
|
+
|
4
|
+
require File.expand_path('../boot', __FILE__)
|
5
|
+
|
6
|
+
# Pick the frameworks you want:
|
7
|
+
|
8
|
+
require "active_record/railtie"
|
9
|
+
require "action_controller/railtie"
|
10
|
+
require "action_mailer/railtie"
|
11
|
+
require "active_resource/railtie"
|
12
|
+
#require "rails/test_unit/railtie"
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
# If you have a Gemfile, require the gems listed there, including any gems
|
17
|
+
# you've limited to :test, :development, or :production.
|
18
|
+
Bundler.require(:default, $ORM_ENGINE, Rails.env) if defined?(Bundler)
|
19
|
+
|
20
|
+
module WhowishWordRails
|
21
|
+
|
22
|
+
class Application < Rails::Application
|
23
|
+
|
24
|
+
config.encoding = "utf-8"
|
25
|
+
config.filter_parameters += [:password]
|
26
|
+
config.active_support.deprecation = :stderr
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
|
3
|
+
# Set up gems listed in the Gemfile.
|
4
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
|
5
|
+
|
6
|
+
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
|
7
|
+
|
8
|
+
|
9
|
+
require File.expand_path('../../../lib/whowish_word', __FILE__)
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# SQLite version 3.x
|
2
|
+
# gem install sqlite3
|
3
|
+
#
|
4
|
+
# Ensure the SQLite 3 gem is defined in your Gemfile
|
5
|
+
# gem 'sqlite3'
|
6
|
+
development:
|
7
|
+
adapter: sqlite3
|
8
|
+
database: db/development.sqlite3
|
9
|
+
pool: 5
|
10
|
+
timeout: 5000
|
11
|
+
|
12
|
+
# Warning: The database defined as "test" will be erased and
|
13
|
+
# re-generated from your development database when you run "rake".
|
14
|
+
# Do not set this db to the same as development or production.
|
15
|
+
test:
|
16
|
+
adapter: sqlite3
|
17
|
+
database: db/test.sqlite3
|
18
|
+
pool: 5
|
19
|
+
timeout: 5000
|
20
|
+
|
21
|
+
production:
|
22
|
+
adapter: sqlite3
|
23
|
+
database: db/production.sqlite3
|
24
|
+
pool: 5
|
25
|
+
timeout: 5000
|
@@ -0,0 +1,16 @@
|
|
1
|
+
|
2
|
+
# Load the rails application
|
3
|
+
require File.expand_path('../application', __FILE__)
|
4
|
+
|
5
|
+
|
6
|
+
if $ORM_ENGINE == :mongoid
|
7
|
+
require File.expand_path('../mongoid', __FILE__)
|
8
|
+
end
|
9
|
+
|
10
|
+
# Initialize the rails application
|
11
|
+
WhowishWordRails::Application.initialize!
|
12
|
+
|
13
|
+
WhowishWordRails::Application.config.secret_token = '81c5a4d251df513e47294d8ca73770dd43039b821f06e0a6161f93f1cbdfecd1d7e57f20ceeb6c2ce7e12e5b595c55808a403859cc4b0c324c4760bac9645bb9'
|
14
|
+
|
15
|
+
Rails.logger = Logger.new(STDOUT)
|
16
|
+
|
data/rails/mongo.bat
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2008-2011 Pivotal Labs
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|