books 0.0.1

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 (63) hide show
  1. data/README.md +3 -0
  2. data/Rakefile +40 -0
  3. data/app/assets/javascripts/book/application.js +15 -0
  4. data/app/assets/javascripts/book/books.js +2 -0
  5. data/app/assets/stylesheets/book/application.css +13 -0
  6. data/app/assets/stylesheets/book/books.css +4 -0
  7. data/app/assets/stylesheets/scaffold.css +56 -0
  8. data/app/controllers/book/application_controller.rb +4 -0
  9. data/app/controllers/book/books_controller.rb +87 -0
  10. data/app/helpers/book/application_helper.rb +4 -0
  11. data/app/helpers/book/books_helper.rb +4 -0
  12. data/app/models/book/book.rb +5 -0
  13. data/app/views/book/books/_form.html.erb +33 -0
  14. data/app/views/book/books/edit.html.erb +6 -0
  15. data/app/views/book/books/index.html.erb +29 -0
  16. data/app/views/book/books/new.html.erb +5 -0
  17. data/app/views/book/books/show.html.erb +25 -0
  18. data/app/views/layouts/book/application.html.erb +14 -0
  19. data/config/routes.rb +5 -0
  20. data/db/migrate/20130126052634_create_book_books.rb +12 -0
  21. data/lib/book.rb +4 -0
  22. data/lib/book/engine.rb +5 -0
  23. data/lib/book/version.rb +3 -0
  24. data/lib/tasks/book_tasks.rake +4 -0
  25. data/test/book_test.rb +7 -0
  26. data/test/dummy/README.rdoc +261 -0
  27. data/test/dummy/Rakefile +7 -0
  28. data/test/dummy/app/assets/javascripts/application.js +15 -0
  29. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  30. data/test/dummy/app/controllers/application_controller.rb +3 -0
  31. data/test/dummy/app/helpers/application_helper.rb +2 -0
  32. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  33. data/test/dummy/config.ru +4 -0
  34. data/test/dummy/config/application.rb +59 -0
  35. data/test/dummy/config/boot.rb +10 -0
  36. data/test/dummy/config/database.yml +25 -0
  37. data/test/dummy/config/environment.rb +5 -0
  38. data/test/dummy/config/environments/development.rb +37 -0
  39. data/test/dummy/config/environments/production.rb +67 -0
  40. data/test/dummy/config/environments/test.rb +37 -0
  41. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  42. data/test/dummy/config/initializers/inflections.rb +15 -0
  43. data/test/dummy/config/initializers/mime_types.rb +5 -0
  44. data/test/dummy/config/initializers/secret_token.rb +7 -0
  45. data/test/dummy/config/initializers/session_store.rb +8 -0
  46. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  47. data/test/dummy/config/locales/en.yml +5 -0
  48. data/test/dummy/config/routes.rb +4 -0
  49. data/test/dummy/db/development.sqlite3 +0 -0
  50. data/test/dummy/db/schema.rb +25 -0
  51. data/test/dummy/log/development.log +11 -0
  52. data/test/dummy/public/404.html +26 -0
  53. data/test/dummy/public/422.html +26 -0
  54. data/test/dummy/public/500.html +25 -0
  55. data/test/dummy/public/favicon.ico +0 -0
  56. data/test/dummy/script/rails +6 -0
  57. data/test/fixtures/book/books.yml +13 -0
  58. data/test/functional/book/books_controller_test.rb +51 -0
  59. data/test/integration/navigation_test.rb +10 -0
  60. data/test/test_helper.rb +15 -0
  61. data/test/unit/book/book_test.rb +9 -0
  62. data/test/unit/helpers/book/books_helper_test.rb +6 -0
  63. metadata +161 -0
@@ -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,13 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
2
+
3
+ one:
4
+ title: MyString
5
+ summary: MyText
6
+ body: MyText
7
+ writer: MyString
8
+
9
+ two:
10
+ title: MyString
11
+ summary: MyText
12
+ body: MyText
13
+ writer: MyString
@@ -0,0 +1,51 @@
1
+ require 'test_helper'
2
+
3
+ module Book
4
+ class BooksControllerTest < ActionController::TestCase
5
+ setup do
6
+ @book = books(:one)
7
+ end
8
+
9
+ test "should get index" do
10
+ get :index
11
+ assert_response :success
12
+ assert_not_nil assigns(:books)
13
+ end
14
+
15
+ test "should get new" do
16
+ get :new
17
+ assert_response :success
18
+ end
19
+
20
+ test "should create book" do
21
+ assert_difference('Book.count') do
22
+ post :create, book: { body: @book.body, summary: @book.summary, title: @book.title, writer: @book.writer }
23
+ end
24
+
25
+ assert_redirected_to book_path(assigns(:book))
26
+ end
27
+
28
+ test "should show book" do
29
+ get :show, id: @book
30
+ assert_response :success
31
+ end
32
+
33
+ test "should get edit" do
34
+ get :edit, id: @book
35
+ assert_response :success
36
+ end
37
+
38
+ test "should update book" do
39
+ put :update, id: @book, book: { body: @book.body, summary: @book.summary, title: @book.title, writer: @book.writer }
40
+ assert_redirected_to book_path(assigns(:book))
41
+ end
42
+
43
+ test "should destroy book" do
44
+ assert_difference('Book.count', -1) do
45
+ delete :destroy, id: @book
46
+ end
47
+
48
+ assert_redirected_to books_path
49
+ end
50
+ end
51
+ end
@@ -0,0 +1,10 @@
1
+ require 'test_helper'
2
+
3
+ class NavigationTest < ActionDispatch::IntegrationTest
4
+ fixtures :all
5
+
6
+ # test "the truth" do
7
+ # assert true
8
+ # end
9
+ end
10
+
@@ -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
@@ -0,0 +1,9 @@
1
+ require 'test_helper'
2
+
3
+ module Book
4
+ class BookTest < ActiveSupport::TestCase
5
+ # test "the truth" do
6
+ # assert true
7
+ # end
8
+ end
9
+ end
@@ -0,0 +1,6 @@
1
+ require 'test_helper'
2
+
3
+ module Book
4
+ class BooksHelperTest < ActionView::TestCase
5
+ end
6
+ end
metadata ADDED
@@ -0,0 +1,161 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: books
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - ZhangJian
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2013-01-26 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rails
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: 3.2.11
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: 3.2.11
30
+ description: Read books by pages, upload e-books.
31
+ email:
32
+ - zj137@163.com
33
+ executables: []
34
+ extensions: []
35
+ extra_rdoc_files: []
36
+ files:
37
+ - app/models/book/book.rb
38
+ - app/views/layouts/book/application.html.erb
39
+ - app/views/book/books/show.html.erb
40
+ - app/views/book/books/new.html.erb
41
+ - app/views/book/books/index.html.erb
42
+ - app/views/book/books/edit.html.erb
43
+ - app/views/book/books/_form.html.erb
44
+ - app/assets/javascripts/book/books.js
45
+ - app/assets/javascripts/book/application.js
46
+ - app/assets/stylesheets/scaffold.css
47
+ - app/assets/stylesheets/book/books.css
48
+ - app/assets/stylesheets/book/application.css
49
+ - app/helpers/book/application_helper.rb
50
+ - app/helpers/book/books_helper.rb
51
+ - app/controllers/book/books_controller.rb
52
+ - app/controllers/book/application_controller.rb
53
+ - config/routes.rb
54
+ - db/migrate/20130126052634_create_book_books.rb
55
+ - lib/book.rb
56
+ - lib/tasks/book_tasks.rake
57
+ - lib/book/version.rb
58
+ - lib/book/engine.rb
59
+ - Rakefile
60
+ - README.md
61
+ - test/dummy/config.ru
62
+ - test/dummy/log/development.log
63
+ - test/dummy/config/boot.rb
64
+ - test/dummy/config/application.rb
65
+ - test/dummy/config/database.yml
66
+ - test/dummy/config/environment.rb
67
+ - test/dummy/config/routes.rb
68
+ - test/dummy/config/environments/development.rb
69
+ - test/dummy/config/environments/test.rb
70
+ - test/dummy/config/environments/production.rb
71
+ - test/dummy/config/locales/en.yml
72
+ - test/dummy/config/initializers/secret_token.rb
73
+ - test/dummy/config/initializers/wrap_parameters.rb
74
+ - test/dummy/config/initializers/backtrace_silencers.rb
75
+ - test/dummy/config/initializers/mime_types.rb
76
+ - test/dummy/config/initializers/session_store.rb
77
+ - test/dummy/config/initializers/inflections.rb
78
+ - test/dummy/script/rails
79
+ - test/dummy/README.rdoc
80
+ - test/dummy/Rakefile
81
+ - test/dummy/app/views/layouts/application.html.erb
82
+ - test/dummy/app/assets/javascripts/application.js
83
+ - test/dummy/app/assets/stylesheets/application.css
84
+ - test/dummy/app/helpers/application_helper.rb
85
+ - test/dummy/app/controllers/application_controller.rb
86
+ - test/dummy/db/schema.rb
87
+ - test/dummy/db/development.sqlite3
88
+ - test/dummy/public/404.html
89
+ - test/dummy/public/422.html
90
+ - test/dummy/public/500.html
91
+ - test/dummy/public/favicon.ico
92
+ - test/test_helper.rb
93
+ - test/integration/navigation_test.rb
94
+ - test/unit/helpers/book/books_helper_test.rb
95
+ - test/unit/book/book_test.rb
96
+ - test/book_test.rb
97
+ - test/functional/book/books_controller_test.rb
98
+ - test/fixtures/book/books.yml
99
+ homepage: http://mystory.cc/
100
+ licenses: []
101
+ post_install_message:
102
+ rdoc_options: []
103
+ require_paths:
104
+ - lib
105
+ required_ruby_version: !ruby/object:Gem::Requirement
106
+ none: false
107
+ requirements:
108
+ - - ! '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ required_rubygems_version: !ruby/object:Gem::Requirement
112
+ none: false
113
+ requirements:
114
+ - - ! '>='
115
+ - !ruby/object:Gem::Version
116
+ version: '0'
117
+ requirements: []
118
+ rubyforge_project:
119
+ rubygems_version: 1.8.24
120
+ signing_key:
121
+ specification_version: 3
122
+ summary: Read and upload e-books plugin for rails App
123
+ test_files:
124
+ - test/dummy/config.ru
125
+ - test/dummy/log/development.log
126
+ - test/dummy/config/boot.rb
127
+ - test/dummy/config/application.rb
128
+ - test/dummy/config/database.yml
129
+ - test/dummy/config/environment.rb
130
+ - test/dummy/config/routes.rb
131
+ - test/dummy/config/environments/development.rb
132
+ - test/dummy/config/environments/test.rb
133
+ - test/dummy/config/environments/production.rb
134
+ - test/dummy/config/locales/en.yml
135
+ - test/dummy/config/initializers/secret_token.rb
136
+ - test/dummy/config/initializers/wrap_parameters.rb
137
+ - test/dummy/config/initializers/backtrace_silencers.rb
138
+ - test/dummy/config/initializers/mime_types.rb
139
+ - test/dummy/config/initializers/session_store.rb
140
+ - test/dummy/config/initializers/inflections.rb
141
+ - test/dummy/script/rails
142
+ - test/dummy/README.rdoc
143
+ - test/dummy/Rakefile
144
+ - test/dummy/app/views/layouts/application.html.erb
145
+ - test/dummy/app/assets/javascripts/application.js
146
+ - test/dummy/app/assets/stylesheets/application.css
147
+ - test/dummy/app/helpers/application_helper.rb
148
+ - test/dummy/app/controllers/application_controller.rb
149
+ - test/dummy/db/schema.rb
150
+ - test/dummy/db/development.sqlite3
151
+ - test/dummy/public/404.html
152
+ - test/dummy/public/422.html
153
+ - test/dummy/public/500.html
154
+ - test/dummy/public/favicon.ico
155
+ - test/test_helper.rb
156
+ - test/integration/navigation_test.rb
157
+ - test/unit/helpers/book/books_helper_test.rb
158
+ - test/unit/book/book_test.rb
159
+ - test/book_test.rb
160
+ - test/functional/book/books_controller_test.rb
161
+ - test/fixtures/book/books.yml