to_permalink 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.rdoc +3 -0
  3. data/Rakefile +37 -0
  4. data/lib/core_ext.rb +17 -0
  5. data/lib/tasks/to_permalink_tasks.rake +4 -0
  6. data/lib/to_permalink.rb +3 -0
  7. data/lib/to_permalink/version.rb +3 -0
  8. data/test/core_ext_test.rb +9 -0
  9. data/test/dummy/Rakefile +7 -0
  10. data/test/dummy/app/assets/javascripts/application.js +7 -0
  11. data/test/dummy/app/assets/javascripts/links.js +2 -0
  12. data/test/dummy/app/assets/stylesheets/application.css +7 -0
  13. data/test/dummy/app/assets/stylesheets/links.css +4 -0
  14. data/test/dummy/app/assets/stylesheets/scaffold.css +56 -0
  15. data/test/dummy/app/controllers/application_controller.rb +3 -0
  16. data/test/dummy/app/controllers/links_controller.rb +83 -0
  17. data/test/dummy/app/helpers/application_helper.rb +2 -0
  18. data/test/dummy/app/helpers/links_helper.rb +2 -0
  19. data/test/dummy/app/models/link.rb +6 -0
  20. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  21. data/test/dummy/app/views/links/_form.html.erb +25 -0
  22. data/test/dummy/app/views/links/edit.html.erb +6 -0
  23. data/test/dummy/app/views/links/index.html.erb +25 -0
  24. data/test/dummy/app/views/links/new.html.erb +5 -0
  25. data/test/dummy/app/views/links/show.html.erb +15 -0
  26. data/test/dummy/config.ru +4 -0
  27. data/test/dummy/config/application.rb +45 -0
  28. data/test/dummy/config/boot.rb +10 -0
  29. data/test/dummy/config/database.yml +25 -0
  30. data/test/dummy/config/environment.rb +5 -0
  31. data/test/dummy/config/environments/development.rb +30 -0
  32. data/test/dummy/config/environments/production.rb +60 -0
  33. data/test/dummy/config/environments/test.rb +42 -0
  34. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  35. data/test/dummy/config/initializers/inflections.rb +10 -0
  36. data/test/dummy/config/initializers/mime_types.rb +5 -0
  37. data/test/dummy/config/initializers/secret_token.rb +7 -0
  38. data/test/dummy/config/initializers/session_store.rb +8 -0
  39. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  40. data/test/dummy/config/locales/en.yml +5 -0
  41. data/test/dummy/config/routes.rb +60 -0
  42. data/test/dummy/db/development.sqlite3 +0 -0
  43. data/test/dummy/db/migrate/20110915034248_create_links.rb +10 -0
  44. data/test/dummy/db/schema.rb +22 -0
  45. data/test/dummy/db/test.sqlite3 +0 -0
  46. data/test/dummy/log/development.log +511 -0
  47. data/test/dummy/log/test.log +0 -0
  48. data/test/dummy/public/404.html +26 -0
  49. data/test/dummy/public/422.html +26 -0
  50. data/test/dummy/public/500.html +26 -0
  51. data/test/dummy/public/favicon.ico +0 -0
  52. data/test/dummy/script/rails +6 -0
  53. data/test/dummy/test/fixtures/links.yml +9 -0
  54. data/test/dummy/test/functional/links_controller_test.rb +49 -0
  55. data/test/dummy/test/unit/helpers/links_helper_test.rb +4 -0
  56. data/test/dummy/test/unit/link_test.rb +7 -0
  57. data/test/dummy/tmp/cache/assets/CF0/1D0/sprockets%2F6fc757c2c8329244ca95d6909865bbc2 +0 -0
  58. data/test/dummy/tmp/cache/assets/D11/D20/sprockets%2Fcac21eac42152981882bf9e489316af4 +0 -0
  59. data/test/dummy/tmp/cache/assets/D31/0F0/sprockets%2Fb8fc2e1acf200934c716227c0e76bf32 +0 -0
  60. data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
  61. data/test/dummy/tmp/cache/assets/D54/ED0/sprockets%2F71c9fa01091d432b131da3bb73faf3d4 +0 -0
  62. data/test/dummy/tmp/cache/assets/D67/F30/sprockets%2F8cda0bc044ddde203789d2b42c9057b8 +0 -0
  63. data/test/dummy/tmp/cache/assets/D84/210/sprockets%2Fabd0103ccec2b428ac62c94e4c40b384 +0 -0
  64. data/test/dummy/tmp/cache/assets/DAA/FB0/sprockets%2Fcac5c8760fe98b26e526b1c3d97fb57a +0 -0
  65. data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
  66. data/test/dummy/tmp/cache/assets/E2B/970/sprockets%2Fb13dda79ac8dbf0b0dcb6f0c59f6b378 +0 -0
  67. data/test/test_helper.rb +10 -0
  68. data/test/to_permalink_test.rb +7 -0
  69. metadata +193 -0
File without changes
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/404.html -->
21
+ <div class="dialog">
22
+ <h1>The page you were looking for doesn't exist.</h1>
23
+ <p>You may have mistyped the address or the page may have moved.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/422.html -->
21
+ <div class="dialog">
22
+ <h1>The change you wanted was rejected.</h1>
23
+ <p>Maybe you tried to change something you didn't have access to.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/500.html -->
21
+ <div class="dialog">
22
+ <h1>We're sorry, but something went wrong.</h1>
23
+ <p>We've been notified about this issue and we'll take a look at it shortly.</p>
24
+ </div>
25
+ </body>
26
+ </html>
File without changes
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby1.8
2
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
+
4
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
5
+ require File.expand_path('../../config/boot', __FILE__)
6
+ require 'rails/commands'
@@ -0,0 +1,9 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/Fixtures.html
2
+
3
+ one:
4
+ name: MyString
5
+ permalink: MyString
6
+
7
+ two:
8
+ name: MyString
9
+ permalink: MyString
@@ -0,0 +1,49 @@
1
+ require 'test_helper'
2
+
3
+ class LinksControllerTest < ActionController::TestCase
4
+ setup do
5
+ @link = links(:one)
6
+ end
7
+
8
+ test "should get index" do
9
+ get :index
10
+ assert_response :success
11
+ assert_not_nil assigns(:links)
12
+ end
13
+
14
+ test "should get new" do
15
+ get :new
16
+ assert_response :success
17
+ end
18
+
19
+ test "should create link" do
20
+ assert_difference('Link.count') do
21
+ post :create, :link => @link.attributes
22
+ end
23
+
24
+ assert_redirected_to link_path(assigns(:link))
25
+ end
26
+
27
+ test "should show link" do
28
+ get :show, :id => @link.to_param
29
+ assert_response :success
30
+ end
31
+
32
+ test "should get edit" do
33
+ get :edit, :id => @link.to_param
34
+ assert_response :success
35
+ end
36
+
37
+ test "should update link" do
38
+ put :update, :id => @link.to_param, :link => @link.attributes
39
+ assert_redirected_to link_path(assigns(:link))
40
+ end
41
+
42
+ test "should destroy link" do
43
+ assert_difference('Link.count', -1) do
44
+ delete :destroy, :id => @link.to_param
45
+ end
46
+
47
+ assert_redirected_to links_path
48
+ end
49
+ end
@@ -0,0 +1,4 @@
1
+ require 'test_helper'
2
+
3
+ class LinksHelperTest < ActionView::TestCase
4
+ end
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class LinkTest < ActiveSupport::TestCase
4
+ # test "the truth" do
5
+ # assert true
6
+ # end
7
+ end
@@ -0,0 +1,10 @@
1
+ # Configure Rails Environment
2
+ ENV["RAILS_ENV"] = "test"
3
+
4
+ require File.expand_path("../dummy/config/environment.rb", __FILE__)
5
+ require "rails/test_help"
6
+
7
+ Rails.backtrace_cleaner.remove_silencers!
8
+
9
+ # Load support files
10
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class ToPermalinkTest < ActiveSupport::TestCase
4
+ test "truth" do
5
+ assert_kind_of Module, ToPermalink
6
+ end
7
+ end
metadata ADDED
@@ -0,0 +1,193 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: to_permalink
3
+ version: !ruby/object:Gem::Version
4
+ hash: 27
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 2
10
+ version: 0.0.2
11
+ platform: ruby
12
+ authors:
13
+ - Pham Trung Nam
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-09-15 00:00:00 Z
19
+ dependencies: []
20
+
21
+ description: This gem will add to_vnlink method for String class.
22
+ email:
23
+ - nampt.kbs@kbsvn.vn
24
+ executables: []
25
+
26
+ extensions: []
27
+
28
+ extra_rdoc_files: []
29
+
30
+ files:
31
+ - lib/to_permalink/version.rb
32
+ - lib/core_ext.rb
33
+ - lib/to_permalink.rb
34
+ - lib/tasks/to_permalink_tasks.rake
35
+ - MIT-LICENSE
36
+ - Rakefile
37
+ - README.rdoc
38
+ - test/to_permalink_test.rb
39
+ - test/dummy/public/500.html
40
+ - test/dummy/public/422.html
41
+ - test/dummy/public/404.html
42
+ - test/dummy/public/favicon.ico
43
+ - test/dummy/db/test.sqlite3
44
+ - test/dummy/db/schema.rb
45
+ - test/dummy/db/development.sqlite3
46
+ - test/dummy/db/migrate/20110915034248_create_links.rb
47
+ - test/dummy/config/environments/production.rb
48
+ - test/dummy/config/environments/development.rb
49
+ - test/dummy/config/environments/test.rb
50
+ - test/dummy/config/environment.rb
51
+ - test/dummy/config/initializers/mime_types.rb
52
+ - test/dummy/config/initializers/backtrace_silencers.rb
53
+ - test/dummy/config/initializers/wrap_parameters.rb
54
+ - test/dummy/config/initializers/secret_token.rb
55
+ - test/dummy/config/initializers/inflections.rb
56
+ - test/dummy/config/initializers/session_store.rb
57
+ - test/dummy/config/routes.rb
58
+ - test/dummy/config/application.rb
59
+ - test/dummy/config/locales/en.yml
60
+ - test/dummy/config/database.yml
61
+ - test/dummy/config/boot.rb
62
+ - test/dummy/tmp/cache/assets/D11/D20/sprockets%2Fcac21eac42152981882bf9e489316af4
63
+ - test/dummy/tmp/cache/assets/D31/0F0/sprockets%2Fb8fc2e1acf200934c716227c0e76bf32
64
+ - test/dummy/tmp/cache/assets/DAA/FB0/sprockets%2Fcac5c8760fe98b26e526b1c3d97fb57a
65
+ - test/dummy/tmp/cache/assets/D67/F30/sprockets%2F8cda0bc044ddde203789d2b42c9057b8
66
+ - test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af
67
+ - test/dummy/tmp/cache/assets/D84/210/sprockets%2Fabd0103ccec2b428ac62c94e4c40b384
68
+ - test/dummy/tmp/cache/assets/CF0/1D0/sprockets%2F6fc757c2c8329244ca95d6909865bbc2
69
+ - test/dummy/tmp/cache/assets/E2B/970/sprockets%2Fb13dda79ac8dbf0b0dcb6f0c59f6b378
70
+ - test/dummy/tmp/cache/assets/D54/ED0/sprockets%2F71c9fa01091d432b131da3bb73faf3d4
71
+ - test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705
72
+ - test/dummy/app/assets/stylesheets/links.css
73
+ - test/dummy/app/assets/stylesheets/application.css
74
+ - test/dummy/app/assets/stylesheets/scaffold.css
75
+ - test/dummy/app/assets/javascripts/application.js
76
+ - test/dummy/app/assets/javascripts/links.js
77
+ - test/dummy/app/helpers/links_helper.rb
78
+ - test/dummy/app/helpers/application_helper.rb
79
+ - test/dummy/app/controllers/links_controller.rb
80
+ - test/dummy/app/controllers/application_controller.rb
81
+ - test/dummy/app/views/layouts/application.html.erb
82
+ - test/dummy/app/views/links/edit.html.erb
83
+ - test/dummy/app/views/links/_form.html.erb
84
+ - test/dummy/app/views/links/show.html.erb
85
+ - test/dummy/app/views/links/index.html.erb
86
+ - test/dummy/app/views/links/new.html.erb
87
+ - test/dummy/app/models/link.rb
88
+ - test/dummy/test/unit/link_test.rb
89
+ - test/dummy/test/unit/helpers/links_helper_test.rb
90
+ - test/dummy/test/fixtures/links.yml
91
+ - test/dummy/test/functional/links_controller_test.rb
92
+ - test/dummy/log/test.log
93
+ - test/dummy/log/development.log
94
+ - test/dummy/config.ru
95
+ - test/dummy/script/rails
96
+ - test/dummy/Rakefile
97
+ - test/test_helper.rb
98
+ - test/core_ext_test.rb
99
+ homepage: http://kbsvn.vn
100
+ licenses: []
101
+
102
+ post_install_message:
103
+ rdoc_options: []
104
+
105
+ require_paths:
106
+ - lib
107
+ required_ruby_version: !ruby/object:Gem::Requirement
108
+ none: false
109
+ requirements:
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ hash: 3
113
+ segments:
114
+ - 0
115
+ version: "0"
116
+ required_rubygems_version: !ruby/object:Gem::Requirement
117
+ none: false
118
+ requirements:
119
+ - - ">="
120
+ - !ruby/object:Gem::Version
121
+ hash: 3
122
+ segments:
123
+ - 0
124
+ version: "0"
125
+ requirements: []
126
+
127
+ rubyforge_project:
128
+ rubygems_version: 1.8.10
129
+ signing_key:
130
+ specification_version: 3
131
+ summary: Summary of ToPermalink.
132
+ test_files:
133
+ - test/to_permalink_test.rb
134
+ - test/dummy/public/500.html
135
+ - test/dummy/public/422.html
136
+ - test/dummy/public/404.html
137
+ - test/dummy/public/favicon.ico
138
+ - test/dummy/db/test.sqlite3
139
+ - test/dummy/db/schema.rb
140
+ - test/dummy/db/development.sqlite3
141
+ - test/dummy/db/migrate/20110915034248_create_links.rb
142
+ - test/dummy/config/environments/production.rb
143
+ - test/dummy/config/environments/development.rb
144
+ - test/dummy/config/environments/test.rb
145
+ - test/dummy/config/environment.rb
146
+ - test/dummy/config/initializers/mime_types.rb
147
+ - test/dummy/config/initializers/backtrace_silencers.rb
148
+ - test/dummy/config/initializers/wrap_parameters.rb
149
+ - test/dummy/config/initializers/secret_token.rb
150
+ - test/dummy/config/initializers/inflections.rb
151
+ - test/dummy/config/initializers/session_store.rb
152
+ - test/dummy/config/routes.rb
153
+ - test/dummy/config/application.rb
154
+ - test/dummy/config/locales/en.yml
155
+ - test/dummy/config/database.yml
156
+ - test/dummy/config/boot.rb
157
+ - test/dummy/tmp/cache/assets/D11/D20/sprockets%2Fcac21eac42152981882bf9e489316af4
158
+ - test/dummy/tmp/cache/assets/D31/0F0/sprockets%2Fb8fc2e1acf200934c716227c0e76bf32
159
+ - test/dummy/tmp/cache/assets/DAA/FB0/sprockets%2Fcac5c8760fe98b26e526b1c3d97fb57a
160
+ - test/dummy/tmp/cache/assets/D67/F30/sprockets%2F8cda0bc044ddde203789d2b42c9057b8
161
+ - test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af
162
+ - test/dummy/tmp/cache/assets/D84/210/sprockets%2Fabd0103ccec2b428ac62c94e4c40b384
163
+ - test/dummy/tmp/cache/assets/CF0/1D0/sprockets%2F6fc757c2c8329244ca95d6909865bbc2
164
+ - test/dummy/tmp/cache/assets/E2B/970/sprockets%2Fb13dda79ac8dbf0b0dcb6f0c59f6b378
165
+ - test/dummy/tmp/cache/assets/D54/ED0/sprockets%2F71c9fa01091d432b131da3bb73faf3d4
166
+ - test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705
167
+ - test/dummy/app/assets/stylesheets/links.css
168
+ - test/dummy/app/assets/stylesheets/application.css
169
+ - test/dummy/app/assets/stylesheets/scaffold.css
170
+ - test/dummy/app/assets/javascripts/application.js
171
+ - test/dummy/app/assets/javascripts/links.js
172
+ - test/dummy/app/helpers/links_helper.rb
173
+ - test/dummy/app/helpers/application_helper.rb
174
+ - test/dummy/app/controllers/links_controller.rb
175
+ - test/dummy/app/controllers/application_controller.rb
176
+ - test/dummy/app/views/layouts/application.html.erb
177
+ - test/dummy/app/views/links/edit.html.erb
178
+ - test/dummy/app/views/links/_form.html.erb
179
+ - test/dummy/app/views/links/show.html.erb
180
+ - test/dummy/app/views/links/index.html.erb
181
+ - test/dummy/app/views/links/new.html.erb
182
+ - test/dummy/app/models/link.rb
183
+ - test/dummy/test/unit/link_test.rb
184
+ - test/dummy/test/unit/helpers/links_helper_test.rb
185
+ - test/dummy/test/fixtures/links.yml
186
+ - test/dummy/test/functional/links_controller_test.rb
187
+ - test/dummy/log/test.log
188
+ - test/dummy/log/development.log
189
+ - test/dummy/config.ru
190
+ - test/dummy/script/rails
191
+ - test/dummy/Rakefile
192
+ - test/test_helper.rb
193
+ - test/core_ext_test.rb