faker_extension_fr 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/README.rdoc +114 -0
  3. data/Rakefile +38 -0
  4. data/lib/faker_extension_fr.rb +12 -0
  5. data/lib/faker_extension_fr/address.rb +152 -0
  6. data/lib/faker_extension_fr/name.rb +55 -0
  7. data/lib/faker_extension_fr/phone_number.rb +53 -0
  8. data/lib/faker_extension_fr/version.rb +3 -0
  9. data/lib/tasks/faker_extension_fr_tasks.rake +4 -0
  10. data/test/dummy/README.rdoc +261 -0
  11. data/test/dummy/Rakefile +7 -0
  12. data/test/dummy/app/assets/javascripts/application.js +15 -0
  13. data/test/dummy/app/assets/javascripts/posts.js +2 -0
  14. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  15. data/test/dummy/app/assets/stylesheets/posts.css +4 -0
  16. data/test/dummy/app/assets/stylesheets/scaffold.css +56 -0
  17. data/test/dummy/app/controllers/application_controller.rb +3 -0
  18. data/test/dummy/app/controllers/posts_controller.rb +83 -0
  19. data/test/dummy/app/helpers/application_helper.rb +2 -0
  20. data/test/dummy/app/helpers/posts_helper.rb +2 -0
  21. data/test/dummy/app/models/post.rb +3 -0
  22. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  23. data/test/dummy/app/views/posts/_form.html.erb +25 -0
  24. data/test/dummy/app/views/posts/edit.html.erb +6 -0
  25. data/test/dummy/app/views/posts/index.html.erb +25 -0
  26. data/test/dummy/app/views/posts/new.html.erb +5 -0
  27. data/test/dummy/app/views/posts/show.html.erb +15 -0
  28. data/test/dummy/config.ru +4 -0
  29. data/test/dummy/config/application.rb +56 -0
  30. data/test/dummy/config/boot.rb +10 -0
  31. data/test/dummy/config/database.yml +25 -0
  32. data/test/dummy/config/environment.rb +5 -0
  33. data/test/dummy/config/environments/development.rb +37 -0
  34. data/test/dummy/config/environments/production.rb +67 -0
  35. data/test/dummy/config/environments/test.rb +37 -0
  36. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  37. data/test/dummy/config/initializers/inflections.rb +15 -0
  38. data/test/dummy/config/initializers/mime_types.rb +5 -0
  39. data/test/dummy/config/initializers/secret_token.rb +7 -0
  40. data/test/dummy/config/initializers/session_store.rb +8 -0
  41. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  42. data/test/dummy/config/locales/en.yml +5 -0
  43. data/test/dummy/config/routes.rb +60 -0
  44. data/test/dummy/db/migrate/20120429104239_create_posts.rb +10 -0
  45. data/test/dummy/public/404.html +26 -0
  46. data/test/dummy/public/422.html +26 -0
  47. data/test/dummy/public/500.html +25 -0
  48. data/test/dummy/public/favicon.ico +0 -0
  49. data/test/dummy/script/rails +6 -0
  50. data/test/dummy/test/fixtures/posts.yml +9 -0
  51. data/test/dummy/test/functional/posts_controller_test.rb +49 -0
  52. data/test/dummy/test/unit/helpers/posts_helper_test.rb +4 -0
  53. data/test/dummy/test/unit/post_test.rb +7 -0
  54. data/test/faker_extension_fr_test.rb +7 -0
  55. data/test/test_helper.rb +15 -0
  56. metadata +182 -0
@@ -0,0 +1,60 @@
1
+ Dummy::Application.routes.draw do
2
+ resources :posts
3
+
4
+ # The priority is based upon order of creation:
5
+ # first created -> highest priority.
6
+
7
+ # Sample of regular route:
8
+ # match 'products/:id' => 'catalog#view'
9
+ # Keep in mind you can assign values other than :controller and :action
10
+
11
+ # Sample of named route:
12
+ # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
13
+ # This route can be invoked with purchase_url(:id => product.id)
14
+
15
+ # Sample resource route (maps HTTP verbs to controller actions automatically):
16
+ # resources :products
17
+
18
+ # Sample resource route with options:
19
+ # resources :products do
20
+ # member do
21
+ # get 'short'
22
+ # post 'toggle'
23
+ # end
24
+ #
25
+ # collection do
26
+ # get 'sold'
27
+ # end
28
+ # end
29
+
30
+ # Sample resource route with sub-resources:
31
+ # resources :products do
32
+ # resources :comments, :sales
33
+ # resource :seller
34
+ # end
35
+
36
+ # Sample resource route with more complex sub-resources
37
+ # resources :products do
38
+ # resources :comments
39
+ # resources :sales do
40
+ # get 'recent', :on => :collection
41
+ # end
42
+ # end
43
+
44
+ # Sample resource route within a namespace:
45
+ # namespace :admin do
46
+ # # Directs /admin/products/* to Admin::ProductsController
47
+ # # (app/controllers/admin/products_controller.rb)
48
+ # resources :products
49
+ # end
50
+
51
+ # You can have the root of your site routed with "root"
52
+ # just remember to delete public/index.html.
53
+ # root :to => 'welcome#index'
54
+
55
+ # See how all your routes lay out with "rake routes"
56
+
57
+ # This is a legacy wild controller route that's not recommended for RESTful applications.
58
+ # Note: This route will make all actions in every controller accessible via GET requests.
59
+ # match ':controller(/:action(/:id))(.:format)'
60
+ end
@@ -0,0 +1,10 @@
1
+ class CreatePosts < ActiveRecord::Migration
2
+ def change
3
+ create_table :posts do |t|
4
+ t.string :title
5
+ t.text :body
6
+
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -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,25 @@
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
+ </div>
24
+ </body>
25
+ </html>
File without changes
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
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/ActiveRecord/Fixtures.html
2
+
3
+ one:
4
+ title: MyString
5
+ body: MyText
6
+
7
+ two:
8
+ title: MyString
9
+ body: MyText
@@ -0,0 +1,49 @@
1
+ require 'test_helper'
2
+
3
+ class PostsControllerTest < ActionController::TestCase
4
+ setup do
5
+ @post = posts(:one)
6
+ end
7
+
8
+ test "should get index" do
9
+ get :index
10
+ assert_response :success
11
+ assert_not_nil assigns(:posts)
12
+ end
13
+
14
+ test "should get new" do
15
+ get :new
16
+ assert_response :success
17
+ end
18
+
19
+ test "should create post" do
20
+ assert_difference('Post.count') do
21
+ post :create, post: { body: @post.body, title: @post.title }
22
+ end
23
+
24
+ assert_redirected_to post_path(assigns(:post))
25
+ end
26
+
27
+ test "should show post" do
28
+ get :show, id: @post
29
+ assert_response :success
30
+ end
31
+
32
+ test "should get edit" do
33
+ get :edit, id: @post
34
+ assert_response :success
35
+ end
36
+
37
+ test "should update post" do
38
+ put :update, id: @post, post: { body: @post.body, title: @post.title }
39
+ assert_redirected_to post_path(assigns(:post))
40
+ end
41
+
42
+ test "should destroy post" do
43
+ assert_difference('Post.count', -1) do
44
+ delete :destroy, id: @post
45
+ end
46
+
47
+ assert_redirected_to posts_path
48
+ end
49
+ end
@@ -0,0 +1,4 @@
1
+ require 'test_helper'
2
+
3
+ class PostsHelperTest < ActionView::TestCase
4
+ end
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class PostTest < ActiveSupport::TestCase
4
+ # test "the truth" do
5
+ # assert true
6
+ # end
7
+ end
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class FakerExtensionFrTest < ActiveSupport::TestCase
4
+ test "truth" do
5
+ assert_kind_of Module, FakerExtensionFr
6
+ end
7
+ end
@@ -0,0 +1,15 @@
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 }
11
+
12
+ # Load fixtures from the engine
13
+ if ActiveSupport::TestCase.method_defined?(:fixture_path=)
14
+ ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
15
+ end
metadata ADDED
@@ -0,0 +1,182 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: faker_extension_fr
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Benjamin Curtis
9
+ - kadoudal
10
+ autorequire:
11
+ bindir: bin
12
+ cert_chain: []
13
+ date: 2012-05-01 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: rails
17
+ requirement: &70303928083100 !ruby/object:Gem::Requirement
18
+ none: false
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
22
+ version: '3.1'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: *70303928083100
26
+ - !ruby/object:Gem::Dependency
27
+ name: faker
28
+ requirement: &70303928082540 !ruby/object:Gem::Requirement
29
+ none: false
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: *70303928082540
37
+ - !ruby/object:Gem::Dependency
38
+ name: sqlite3
39
+ requirement: &70303928116700 !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ! '>='
43
+ - !ruby/object:Gem::Version
44
+ version: '0'
45
+ type: :development
46
+ prerelease: false
47
+ version_requirements: *70303928116700
48
+ description: ! 'Faker, a port of Data::Faker from Perl, is used to easily generate
49
+ fake data: names, addresses, phone numbers, etc.'
50
+ email:
51
+ - benjamin.curtis@gmail.com
52
+ - kadoudal@gmail.com
53
+ executables: []
54
+ extensions: []
55
+ extra_rdoc_files: []
56
+ files:
57
+ - lib/faker_extension_fr/address.rb
58
+ - lib/faker_extension_fr/name.rb
59
+ - lib/faker_extension_fr/phone_number.rb
60
+ - lib/faker_extension_fr/version.rb
61
+ - lib/faker_extension_fr.rb
62
+ - lib/tasks/faker_extension_fr_tasks.rake
63
+ - MIT-LICENSE
64
+ - Rakefile
65
+ - README.rdoc
66
+ - test/dummy/app/assets/javascripts/application.js
67
+ - test/dummy/app/assets/javascripts/posts.js
68
+ - test/dummy/app/assets/stylesheets/application.css
69
+ - test/dummy/app/assets/stylesheets/posts.css
70
+ - test/dummy/app/assets/stylesheets/scaffold.css
71
+ - test/dummy/app/controllers/application_controller.rb
72
+ - test/dummy/app/controllers/posts_controller.rb
73
+ - test/dummy/app/helpers/application_helper.rb
74
+ - test/dummy/app/helpers/posts_helper.rb
75
+ - test/dummy/app/models/post.rb
76
+ - test/dummy/app/views/layouts/application.html.erb
77
+ - test/dummy/app/views/posts/_form.html.erb
78
+ - test/dummy/app/views/posts/edit.html.erb
79
+ - test/dummy/app/views/posts/index.html.erb
80
+ - test/dummy/app/views/posts/new.html.erb
81
+ - test/dummy/app/views/posts/show.html.erb
82
+ - test/dummy/config/application.rb
83
+ - test/dummy/config/boot.rb
84
+ - test/dummy/config/database.yml
85
+ - test/dummy/config/environment.rb
86
+ - test/dummy/config/environments/development.rb
87
+ - test/dummy/config/environments/production.rb
88
+ - test/dummy/config/environments/test.rb
89
+ - test/dummy/config/initializers/backtrace_silencers.rb
90
+ - test/dummy/config/initializers/inflections.rb
91
+ - test/dummy/config/initializers/mime_types.rb
92
+ - test/dummy/config/initializers/secret_token.rb
93
+ - test/dummy/config/initializers/session_store.rb
94
+ - test/dummy/config/initializers/wrap_parameters.rb
95
+ - test/dummy/config/locales/en.yml
96
+ - test/dummy/config/routes.rb
97
+ - test/dummy/config.ru
98
+ - test/dummy/db/migrate/20120429104239_create_posts.rb
99
+ - test/dummy/public/404.html
100
+ - test/dummy/public/422.html
101
+ - test/dummy/public/500.html
102
+ - test/dummy/public/favicon.ico
103
+ - test/dummy/Rakefile
104
+ - test/dummy/README.rdoc
105
+ - test/dummy/script/rails
106
+ - test/dummy/test/fixtures/posts.yml
107
+ - test/dummy/test/functional/posts_controller_test.rb
108
+ - test/dummy/test/unit/helpers/posts_helper_test.rb
109
+ - test/dummy/test/unit/post_test.rb
110
+ - test/faker_extension_fr_test.rb
111
+ - test/test_helper.rb
112
+ homepage: http://faker.rubyforge.org
113
+ licenses: []
114
+ post_install_message:
115
+ rdoc_options: []
116
+ require_paths:
117
+ - lib
118
+ required_ruby_version: !ruby/object:Gem::Requirement
119
+ none: false
120
+ requirements:
121
+ - - ! '>='
122
+ - !ruby/object:Gem::Version
123
+ version: '0'
124
+ required_rubygems_version: !ruby/object:Gem::Requirement
125
+ none: false
126
+ requirements:
127
+ - - ! '>='
128
+ - !ruby/object:Gem::Version
129
+ version: '0'
130
+ requirements: []
131
+ rubyforge_project:
132
+ rubygems_version: 1.8.15
133
+ signing_key:
134
+ specification_version: 3
135
+ summary: Easily generate fake data
136
+ test_files:
137
+ - test/dummy/app/assets/javascripts/application.js
138
+ - test/dummy/app/assets/javascripts/posts.js
139
+ - test/dummy/app/assets/stylesheets/application.css
140
+ - test/dummy/app/assets/stylesheets/posts.css
141
+ - test/dummy/app/assets/stylesheets/scaffold.css
142
+ - test/dummy/app/controllers/application_controller.rb
143
+ - test/dummy/app/controllers/posts_controller.rb
144
+ - test/dummy/app/helpers/application_helper.rb
145
+ - test/dummy/app/helpers/posts_helper.rb
146
+ - test/dummy/app/models/post.rb
147
+ - test/dummy/app/views/layouts/application.html.erb
148
+ - test/dummy/app/views/posts/_form.html.erb
149
+ - test/dummy/app/views/posts/edit.html.erb
150
+ - test/dummy/app/views/posts/index.html.erb
151
+ - test/dummy/app/views/posts/new.html.erb
152
+ - test/dummy/app/views/posts/show.html.erb
153
+ - test/dummy/config/application.rb
154
+ - test/dummy/config/boot.rb
155
+ - test/dummy/config/database.yml
156
+ - test/dummy/config/environment.rb
157
+ - test/dummy/config/environments/development.rb
158
+ - test/dummy/config/environments/production.rb
159
+ - test/dummy/config/environments/test.rb
160
+ - test/dummy/config/initializers/backtrace_silencers.rb
161
+ - test/dummy/config/initializers/inflections.rb
162
+ - test/dummy/config/initializers/mime_types.rb
163
+ - test/dummy/config/initializers/secret_token.rb
164
+ - test/dummy/config/initializers/session_store.rb
165
+ - test/dummy/config/initializers/wrap_parameters.rb
166
+ - test/dummy/config/locales/en.yml
167
+ - test/dummy/config/routes.rb
168
+ - test/dummy/config.ru
169
+ - test/dummy/db/migrate/20120429104239_create_posts.rb
170
+ - test/dummy/public/404.html
171
+ - test/dummy/public/422.html
172
+ - test/dummy/public/500.html
173
+ - test/dummy/public/favicon.ico
174
+ - test/dummy/Rakefile
175
+ - test/dummy/README.rdoc
176
+ - test/dummy/script/rails
177
+ - test/dummy/test/fixtures/posts.yml
178
+ - test/dummy/test/functional/posts_controller_test.rb
179
+ - test/dummy/test/unit/helpers/posts_helper_test.rb
180
+ - test/dummy/test/unit/post_test.rb
181
+ - test/faker_extension_fr_test.rb
182
+ - test/test_helper.rb