ebook_generator 0.0.5 → 1.0.2

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 (73) hide show
  1. checksums.yaml +4 -4
  2. data/{LICENSE.txt → MIT-LICENSE} +1 -3
  3. data/README.md +10 -17
  4. data/Rakefile +17 -1
  5. data/lib/ebook_generator.rb +75 -72
  6. data/lib/ebook_generator/version.rb +1 -1
  7. data/lib/generators/ebook_generator/ebook_generator_generator.rb +16 -0
  8. data/lib/generators/ebook_generator/templates/create_ebooks.rb +18 -0
  9. data/lib/generators/ebook_generator/templates/create_sections.rb +13 -0
  10. data/lib/generators/ebook_generator/templates/ebook.rb +8 -0
  11. data/lib/generators/ebook_generator/templates/section.rb +6 -0
  12. data/lib/tasks/ebook_generator_tasks.rake +4 -0
  13. data/spec/dummy/README.rdoc +28 -0
  14. data/spec/dummy/Rakefile +6 -0
  15. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  16. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  17. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  18. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  19. data/spec/dummy/app/models/ebook.rb +4 -0
  20. data/spec/dummy/app/models/section.rb +7 -0
  21. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  22. data/spec/dummy/bin/bundle +3 -0
  23. data/spec/dummy/bin/rails +4 -0
  24. data/spec/dummy/bin/rake +4 -0
  25. data/spec/dummy/config.ru +4 -0
  26. data/spec/dummy/config/application.rb +34 -0
  27. data/spec/dummy/config/boot.rb +5 -0
  28. data/spec/dummy/config/database.yml +25 -0
  29. data/spec/dummy/config/environment.rb +5 -0
  30. data/spec/dummy/config/environments/development.rb +37 -0
  31. data/spec/dummy/config/environments/production.rb +82 -0
  32. data/spec/dummy/config/environments/test.rb +39 -0
  33. data/spec/dummy/config/initializers/assets.rb +8 -0
  34. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  35. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  36. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  37. data/spec/dummy/config/initializers/inflections.rb +16 -0
  38. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  39. data/spec/dummy/config/initializers/session_store.rb +3 -0
  40. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  41. data/spec/dummy/config/locales/en.yml +23 -0
  42. data/spec/dummy/config/routes.rb +56 -0
  43. data/spec/dummy/config/secrets.yml +22 -0
  44. data/spec/dummy/db/development.sqlite3 +0 -0
  45. data/spec/dummy/db/migrate/20140416030807_ebooks.rb +17 -0
  46. data/spec/dummy/db/migrate/20140416032844_sections.rb +12 -0
  47. data/spec/dummy/db/migrate/20140416033000_add_index_to_sections_ebook_id_position.rb +6 -0
  48. data/spec/dummy/db/migrate/20140416033315_add_column_slug_to_ebooks.rb +6 -0
  49. data/spec/dummy/db/schema.rb +44 -0
  50. data/spec/dummy/db/test.sqlite3 +0 -0
  51. data/spec/dummy/log/development.log +549 -0
  52. data/spec/dummy/log/test.log +4812 -0
  53. data/spec/dummy/public/404.html +67 -0
  54. data/spec/dummy/public/422.html +67 -0
  55. data/spec/dummy/public/500.html +66 -0
  56. data/spec/dummy/public/favicon.ico +0 -0
  57. data/spec/dummy/tmp/Qui-voluptates-consequuntur-aliquam-iste-numquam..epub +0 -0
  58. data/spec/dummy/tmp/Ratione-soluta-magni-consectetur-delectus-sequi-necessitatibus..epub +0 -0
  59. data/spec/ebook_generator_spec.rb +56 -0
  60. data/spec/factories/factories.rb +35 -0
  61. data/spec/helpers/unzip.rb +13 -0
  62. data/spec/models/ebook_spec.rb +5 -0
  63. data/spec/models/section_spec.rb +5 -0
  64. data/spec/spec_helper.rb +21 -0
  65. data/spec/support/factory_girl.rb +3 -0
  66. metadata +176 -43
  67. data/.gitignore +0 -22
  68. data/Changelog.md +0 -23
  69. data/Gemfile +0 -3
  70. data/ebook_generator.gemspec +0 -28
  71. data/lib/ebook_generator/initializer.rb +0 -5
  72. data/lib/ebook_generator/migration.rb +0 -30
  73. data/lib/generators/ebook_generator_generator.rb +0 -17
@@ -0,0 +1,56 @@
1
+ Rails.application.routes.draw do
2
+ # The priority is based upon order of creation: first created -> highest priority.
3
+ # See how all your routes lay out with "rake routes".
4
+
5
+ # You can have the root of your site routed with "root"
6
+ # root 'welcome#index'
7
+
8
+ # Example of regular route:
9
+ # get 'products/:id' => 'catalog#view'
10
+
11
+ # Example of named route that can be invoked with purchase_url(id: product.id)
12
+ # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
13
+
14
+ # Example resource route (maps HTTP verbs to controller actions automatically):
15
+ # resources :products
16
+
17
+ # Example resource route with options:
18
+ # resources :products do
19
+ # member do
20
+ # get 'short'
21
+ # post 'toggle'
22
+ # end
23
+ #
24
+ # collection do
25
+ # get 'sold'
26
+ # end
27
+ # end
28
+
29
+ # Example resource route with sub-resources:
30
+ # resources :products do
31
+ # resources :comments, :sales
32
+ # resource :seller
33
+ # end
34
+
35
+ # Example resource route with more complex sub-resources:
36
+ # resources :products do
37
+ # resources :comments
38
+ # resources :sales do
39
+ # get 'recent', on: :collection
40
+ # end
41
+ # end
42
+
43
+ # Example resource route with concerns:
44
+ # concern :toggleable do
45
+ # post 'toggle'
46
+ # end
47
+ # resources :posts, concerns: :toggleable
48
+ # resources :photos, concerns: :toggleable
49
+
50
+ # Example resource route within a namespace:
51
+ # namespace :admin do
52
+ # # Directs /admin/products/* to Admin::ProductsController
53
+ # # (app/controllers/admin/products_controller.rb)
54
+ # resources :products
55
+ # end
56
+ end
@@ -0,0 +1,22 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key is used for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+
6
+ # Make sure the secret is at least 30 characters and all random,
7
+ # no regular words or you'll be exposed to dictionary attacks.
8
+ # You can use `rake secret` to generate a secure secret key.
9
+
10
+ # Make sure the secrets in this file are kept private
11
+ # if you're sharing your code publicly.
12
+
13
+ development:
14
+ secret_key_base: e9858e6255aa158d5fc59256b07c8caf7941f4042cd087bfa32c22900d9cf5cfa4fb8c8582411f3d97196aac7fb3b1f6c406f099af9d3974ba4a46745e29100b
15
+
16
+ test:
17
+ secret_key_base: b20034a647e883a03d5c0f1a7d67b3d731286a409dbff6c789c27d446e1ce5cbe5e81e19e986262a885416fe59e83ba61acb9c98fa3fe25768e0f859fd4de919
18
+
19
+ # Do not keep production secrets in the repository,
20
+ # instead read values from the environment.
21
+ production:
22
+ secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
Binary file
@@ -0,0 +1,17 @@
1
+ class Ebooks < ActiveRecord::Migration
2
+ def change
3
+ create_table :ebooks, force: true do |t|
4
+ t.string :title, null: false
5
+ t.string :creator
6
+ t.string :language, limit: 2
7
+ t.string :contributor
8
+ t.text :description
9
+ t.string :publisher
10
+ t.text :rights
11
+ t.string :subject
12
+
13
+ t.datetime :created_at
14
+ t.datetime :updated_at
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,12 @@
1
+ class Sections < ActiveRecord::Migration
2
+ def change
3
+ create_table :sections, force: true do |t|
4
+ t.string :title, null: false
5
+ t.text :content, null: false
6
+ t.string :ebook_id, null: false
7
+ t.integer :position, null: false
8
+ t.datetime :created_at
9
+ t.datetime :updated_at
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,6 @@
1
+ class AddIndexToSectionsEbookIdPosition < ActiveRecord::Migration
2
+ def change
3
+ add_index :sections, ["ebook_id"], name: "index_sections_on_ebook_id", using: :btree
4
+ add_index :sections, ["position"], name: "index_sections_on_position", using: :btree
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ class AddColumnSlugToEbooks < ActiveRecord::Migration
2
+ def change
3
+ add_column :ebooks, :slug, :string
4
+ add_index :ebooks, :slug, unique: true
5
+ end
6
+ end
@@ -0,0 +1,44 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended that you check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(version: 20140416033315) do
15
+
16
+ create_table "ebooks", force: true do |t|
17
+ t.string "title", null: false
18
+ t.string "creator"
19
+ t.string "language", limit: 2
20
+ t.string "contributor"
21
+ t.text "description"
22
+ t.string "publisher"
23
+ t.text "rights"
24
+ t.string "subject"
25
+ t.datetime "created_at"
26
+ t.datetime "updated_at"
27
+ t.string "slug"
28
+ end
29
+
30
+ add_index "ebooks", ["slug"], name: "index_ebooks_on_slug", unique: true
31
+
32
+ create_table "sections", force: true do |t|
33
+ t.string "title", null: false
34
+ t.text "content", null: false
35
+ t.string "ebook_id", null: false
36
+ t.integer "position", null: false
37
+ t.datetime "created_at"
38
+ t.datetime "updated_at"
39
+ end
40
+
41
+ add_index "sections", ["ebook_id"], name: "index_sections_on_ebook_id"
42
+ add_index "sections", ["position"], name: "index_sections_on_position"
43
+
44
+ end
Binary file
@@ -0,0 +1,549 @@
1
+  (0.9ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
2
+  (0.4ms) select sqlite_version(*)
3
+  (1.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
4
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
5
+ Migrating to CreateEbooks (20140828204514)
6
+  (0.1ms) begin transaction
7
+  (0.3ms) CREATE TABLE "ebooks" ("id" uuid, "title" varchar(255) NOT NULL, "creator" varchar(255), "language" varchar(2), "contributor" varchar(255), "description" text, "publisher" varchar(255), "rights" text, "subject" varchar(255), "created_at" datetime, "updated_at" datetime)
8
+ SQL (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140828204514"]]
9
+  (0.8ms) commit transaction
10
+ Migrating to CreateSections (20140828204557)
11
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
12
+ Migrating to CreateSections (20140828204557)
13
+  (0.1ms) begin transaction
14
+  (0.0ms) rollback transaction
15
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
16
+ Migrating to CreateSections (20140828204557)
17
+  (0.1ms) begin transaction
18
+  (0.5ms) CREATE TABLE "sections" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255) NOT NULL, "content" text NOT NULL, "ebook_id" varchar(255) NOT NULL, "position" integer NOT NULL, "created_at" datetime, "updated_at" datetime) 
19
+  (0.1ms) select sqlite_version(*)
20
+  (0.1ms) CREATE INDEX "index_sections_on_ebook_id" ON "sections" ("ebook_id")
21
+  (0.1ms) SELECT sql
22
+ FROM sqlite_master
23
+ WHERE name='index_sections_on_ebook_id' AND type='index'
24
+ UNION ALL
25
+ SELECT sql
26
+ FROM sqlite_temp_master
27
+ WHERE name='index_sections_on_ebook_id' AND type='index'
28
+
29
+  (0.1ms) CREATE INDEX "index_sections_on_position" ON "sections" ("position")
30
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140828204557"]]
31
+  (1.2ms) commit transaction
32
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
33
+  (0.1ms)  SELECT sql
34
+ FROM sqlite_master
35
+ WHERE name='index_sections_on_position' AND type='index'
36
+ UNION ALL
37
+ SELECT sql
38
+ FROM sqlite_temp_master
39
+ WHERE name='index_sections_on_position' AND type='index'
40
+ 
41
+  (0.1ms) SELECT sql
42
+ FROM sqlite_master
43
+ WHERE name='index_sections_on_ebook_id' AND type='index'
44
+ UNION ALL
45
+ SELECT sql
46
+ FROM sqlite_temp_master
47
+ WHERE name='index_sections_on_ebook_id' AND type='index'
48
+
49
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
50
+ Migrating to CreateFriendlyIdSlugs (20140829033201)
51
+  (0.1ms) begin transaction
52
+  (0.5ms) CREATE TABLE "friendly_id_slugs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "slug" varchar(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" varchar(50), "scope" varchar(255), "created_at" datetime) 
53
+  (0.1ms) select sqlite_version(*)
54
+  (0.1ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" ("sluggable_id")
55
+  (0.1ms) SELECT sql
56
+ FROM sqlite_master
57
+ WHERE name='index_friendly_id_slugs_on_sluggable_id' AND type='index'
58
+ UNION ALL
59
+ SELECT sql
60
+ FROM sqlite_temp_master
61
+ WHERE name='index_friendly_id_slugs_on_sluggable_id' AND type='index'
62
+
63
+  (0.1ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" ("slug", "sluggable_type")
64
+  (0.1ms) SELECT sql
65
+ FROM sqlite_master
66
+ WHERE name='index_friendly_id_slugs_on_slug_and_sluggable_type' AND type='index'
67
+ UNION ALL
68
+ SELECT sql
69
+ FROM sqlite_temp_master
70
+ WHERE name='index_friendly_id_slugs_on_slug_and_sluggable_type' AND type='index'
71
+
72
+  (0.1ms)  SELECT sql
73
+ FROM sqlite_master
74
+ WHERE name='index_friendly_id_slugs_on_sluggable_id' AND type='index'
75
+ UNION ALL
76
+ SELECT sql
77
+ FROM sqlite_temp_master
78
+ WHERE name='index_friendly_id_slugs_on_sluggable_id' AND type='index'
79
+ 
80
+  (1.0ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" ("slug", "sluggable_type", "scope")
81
+  (0.1ms)  SELECT sql
82
+ FROM sqlite_master
83
+ WHERE name='index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope' AND type='index'
84
+ UNION ALL
85
+ SELECT sql
86
+ FROM sqlite_temp_master
87
+ WHERE name='index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope' AND type='index'
88
+ 
89
+  (0.1ms) SELECT sql
90
+ FROM sqlite_master
91
+ WHERE name='index_friendly_id_slugs_on_slug_and_sluggable_type' AND type='index'
92
+ UNION ALL
93
+ SELECT sql
94
+ FROM sqlite_temp_master
95
+ WHERE name='index_friendly_id_slugs_on_slug_and_sluggable_type' AND type='index'
96
+
97
+  (0.0ms)  SELECT sql
98
+ FROM sqlite_master
99
+ WHERE name='index_friendly_id_slugs_on_sluggable_id' AND type='index'
100
+ UNION ALL
101
+ SELECT sql
102
+ FROM sqlite_temp_master
103
+ WHERE name='index_friendly_id_slugs_on_sluggable_id' AND type='index'
104
+ 
105
+  (0.1ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" ("sluggable_type")
106
+ SQL (0.5ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140829033201"]]
107
+  (1.7ms) commit transaction
108
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
109
+  (0.4ms) SELECT sql
110
+ FROM sqlite_master
111
+ WHERE name='index_friendly_id_slugs_on_sluggable_type' AND type='index'
112
+ UNION ALL
113
+ SELECT sql
114
+ FROM sqlite_temp_master
115
+ WHERE name='index_friendly_id_slugs_on_sluggable_type' AND type='index'
116
+
117
+  (0.3ms)  SELECT sql
118
+ FROM sqlite_master
119
+ WHERE name='index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope' AND type='index'
120
+ UNION ALL
121
+ SELECT sql
122
+ FROM sqlite_temp_master
123
+ WHERE name='index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope' AND type='index'
124
+ 
125
+  (0.3ms) SELECT sql
126
+ FROM sqlite_master
127
+ WHERE name='index_friendly_id_slugs_on_slug_and_sluggable_type' AND type='index'
128
+ UNION ALL
129
+ SELECT sql
130
+ FROM sqlite_temp_master
131
+ WHERE name='index_friendly_id_slugs_on_slug_and_sluggable_type' AND type='index'
132
+
133
+  (0.8ms)  SELECT sql
134
+ FROM sqlite_master
135
+ WHERE name='index_friendly_id_slugs_on_sluggable_id' AND type='index'
136
+ UNION ALL
137
+ SELECT sql
138
+ FROM sqlite_temp_master
139
+ WHERE name='index_friendly_id_slugs_on_sluggable_id' AND type='index'
140
+ 
141
+  (0.5ms) SELECT sql
142
+ FROM sqlite_master
143
+ WHERE name='index_sections_on_position' AND type='index'
144
+ UNION ALL
145
+ SELECT sql
146
+ FROM sqlite_temp_master
147
+ WHERE name='index_sections_on_position' AND type='index'
148
+
149
+  (0.9ms)  SELECT sql
150
+ FROM sqlite_master
151
+ WHERE name='index_sections_on_ebook_id' AND type='index'
152
+ UNION ALL
153
+ SELECT sql
154
+ FROM sqlite_temp_master
155
+ WHERE name='index_sections_on_ebook_id' AND type='index'
156
+ 
157
+ ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
158
+ Migrating to EnableUuidOssp (20140416021117)
159
+  (0.1ms) begin transaction
160
+ SQL (0.5ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140416021117"]]
161
+  (0.6ms) commit transaction
162
+ Migrating to Ebooks (20140416030807)
163
+  (0.1ms) begin transaction
164
+  (0.2ms) CREATE TABLE "ebooks" ("id" uuid, "title" varchar(255) NOT NULL, "creator" varchar(255), "language" varchar(2), "contributor" varchar(255), "description" text, "publisher" varchar(255), "rights" text, "subject" varchar(255), "created_at" datetime, "updated_at" datetime)
165
+ SQLite3::SQLException: table "ebooks" already exists: CREATE TABLE "ebooks" ("id" uuid, "title" varchar(255) NOT NULL, "creator" varchar(255), "language" varchar(2), "contributor" varchar(255), "description" text, "publisher" varchar(255), "rights" text, "subject" varchar(255), "created_at" datetime, "updated_at" datetime)
166
+  (0.1ms) rollback transaction
167
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
168
+ Migrating to Ebooks (20140416030807)
169
+  (0.1ms) begin transaction
170
+  (0.7ms) CREATE TABLE "ebooks" ("id" uuid, "title" varchar(255) NOT NULL, "creator" varchar(255), "language" varchar(2), "contributor" varchar(255), "description" text, "publisher" varchar(255), "rights" text, "subject" varchar(255), "created_at" datetime, "updated_at" datetime) 
171
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140416030807"]]
172
+  (1.0ms) commit transaction
173
+ Migrating to Sections (20140416032844)
174
+  (0.1ms) begin transaction
175
+  (0.1ms) rollback transaction
176
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
177
+ Migrating to Sections (20140416032844)
178
+  (0.0ms) begin transaction
179
+  (0.4ms) CREATE TABLE "sections" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255) NOT NULL, "content" text NOT NULL, "ebook_id" varchar(255) NOT NULL, "position" integer NOT NULL, "created_at" datetime, "updated_at" datetime) 
180
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140416032844"]]
181
+  (1.2ms) commit transaction
182
+ Migrating to AddIndexToSectionsEbookIdPosition (20140416033000)
183
+  (0.1ms) begin transaction
184
+  (0.1ms) select sqlite_version(*)
185
+  (0.3ms) CREATE INDEX "index_sections_on_ebook_id" ON "sections" ("ebook_id")
186
+  (0.1ms)  SELECT sql
187
+ FROM sqlite_master
188
+ WHERE name='index_sections_on_ebook_id' AND type='index'
189
+ UNION ALL
190
+ SELECT sql
191
+ FROM sqlite_temp_master
192
+ WHERE name='index_sections_on_ebook_id' AND type='index'
193
+ 
194
+  (0.1ms) CREATE INDEX "index_sections_on_position" ON "sections" ("position")
195
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140416033000"]]
196
+  (0.7ms) commit transaction
197
+ Migrating to CreateFriendlyIdSlugs (20140416033201)
198
+  (0.1ms) begin transaction
199
+  (0.5ms) CREATE TABLE "friendly_id_slugs" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "slug" varchar(255) NOT NULL, "sluggable_id" integer NOT NULL, "sluggable_type" varchar(50), "scope" varchar(255), "created_at" datetime)
200
+  (0.2ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_id" ON "friendly_id_slugs" ("sluggable_id")
201
+  (0.2ms) SELECT sql
202
+ FROM sqlite_master
203
+ WHERE name='index_friendly_id_slugs_on_sluggable_id' AND type='index'
204
+ UNION ALL
205
+ SELECT sql
206
+ FROM sqlite_temp_master
207
+ WHERE name='index_friendly_id_slugs_on_sluggable_id' AND type='index'
208
+
209
+  (0.3ms) CREATE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type" ON "friendly_id_slugs" ("slug", "sluggable_type")
210
+  (0.1ms) SELECT sql
211
+ FROM sqlite_master
212
+ WHERE name='index_friendly_id_slugs_on_slug_and_sluggable_type' AND type='index'
213
+ UNION ALL
214
+ SELECT sql
215
+ FROM sqlite_temp_master
216
+ WHERE name='index_friendly_id_slugs_on_slug_and_sluggable_type' AND type='index'
217
+
218
+  (0.1ms)  SELECT sql
219
+ FROM sqlite_master
220
+ WHERE name='index_friendly_id_slugs_on_sluggable_id' AND type='index'
221
+ UNION ALL
222
+ SELECT sql
223
+ FROM sqlite_temp_master
224
+ WHERE name='index_friendly_id_slugs_on_sluggable_id' AND type='index'
225
+ 
226
+  (1.2ms) CREATE UNIQUE INDEX "index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope" ON "friendly_id_slugs" ("slug", "sluggable_type", "scope")
227
+  (0.1ms)  SELECT sql
228
+ FROM sqlite_master
229
+ WHERE name='index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope' AND type='index'
230
+ UNION ALL
231
+ SELECT sql
232
+ FROM sqlite_temp_master
233
+ WHERE name='index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope' AND type='index'
234
+ 
235
+  (0.1ms) SELECT sql
236
+ FROM sqlite_master
237
+ WHERE name='index_friendly_id_slugs_on_slug_and_sluggable_type' AND type='index'
238
+ UNION ALL
239
+ SELECT sql
240
+ FROM sqlite_temp_master
241
+ WHERE name='index_friendly_id_slugs_on_slug_and_sluggable_type' AND type='index'
242
+
243
+  (0.1ms)  SELECT sql
244
+ FROM sqlite_master
245
+ WHERE name='index_friendly_id_slugs_on_sluggable_id' AND type='index'
246
+ UNION ALL
247
+ SELECT sql
248
+ FROM sqlite_temp_master
249
+ WHERE name='index_friendly_id_slugs_on_sluggable_id' AND type='index'
250
+ 
251
+  (0.1ms) CREATE INDEX "index_friendly_id_slugs_on_sluggable_type" ON "friendly_id_slugs" ("sluggable_type")
252
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140416033201"]]
253
+  (2.0ms) commit transaction
254
+ Migrating to AddColumnSlugToEbooks (20140416033315)
255
+  (0.3ms) begin transaction
256
+  (1.1ms) ALTER TABLE "ebooks" ADD "slug" varchar(255)
257
+  (0.6ms) CREATE UNIQUE INDEX "index_ebooks_on_slug" ON "ebooks" ("slug")
258
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140416033315"]]
259
+  (3.5ms) commit transaction
260
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
261
+  (0.7ms)  SELECT sql
262
+ FROM sqlite_master
263
+ WHERE name='index_friendly_id_slugs_on_sluggable_type' AND type='index'
264
+ UNION ALL
265
+ SELECT sql
266
+ FROM sqlite_temp_master
267
+ WHERE name='index_friendly_id_slugs_on_sluggable_type' AND type='index'
268
+ 
269
+  (0.3ms) SELECT sql
270
+ FROM sqlite_master
271
+ WHERE name='index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope' AND type='index'
272
+ UNION ALL
273
+ SELECT sql
274
+ FROM sqlite_temp_master
275
+ WHERE name='index_friendly_id_slugs_on_slug_and_sluggable_type_and_scope' AND type='index'
276
+
277
+  (0.3ms)  SELECT sql
278
+ FROM sqlite_master
279
+ WHERE name='index_friendly_id_slugs_on_slug_and_sluggable_type' AND type='index'
280
+ UNION ALL
281
+ SELECT sql
282
+ FROM sqlite_temp_master
283
+ WHERE name='index_friendly_id_slugs_on_slug_and_sluggable_type' AND type='index'
284
+ 
285
+  (0.2ms) SELECT sql
286
+ FROM sqlite_master
287
+ WHERE name='index_friendly_id_slugs_on_sluggable_id' AND type='index'
288
+ UNION ALL
289
+ SELECT sql
290
+ FROM sqlite_temp_master
291
+ WHERE name='index_friendly_id_slugs_on_sluggable_id' AND type='index'
292
+
293
+  (0.2ms)  SELECT sql
294
+ FROM sqlite_master
295
+ WHERE name='index_sections_on_position' AND type='index'
296
+ UNION ALL
297
+ SELECT sql
298
+ FROM sqlite_temp_master
299
+ WHERE name='index_sections_on_position' AND type='index'
300
+ 
301
+  (0.1ms) SELECT sql
302
+ FROM sqlite_master
303
+ WHERE name='index_sections_on_ebook_id' AND type='index'
304
+ UNION ALL
305
+ SELECT sql
306
+ FROM sqlite_temp_master
307
+ WHERE name='index_sections_on_ebook_id' AND type='index'
308
+
309
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
310
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
311
+  (0.1ms)  SELECT sql
312
+ FROM sqlite_master
313
+ WHERE name='index_sections_on_position' AND type='index'
314
+ UNION ALL
315
+ SELECT sql
316
+ FROM sqlite_temp_master
317
+ WHERE name='index_sections_on_position' AND type='index'
318
+ 
319
+  (0.1ms) SELECT sql
320
+ FROM sqlite_master
321
+ WHERE name='index_sections_on_ebook_id' AND type='index'
322
+ UNION ALL
323
+ SELECT sql
324
+ FROM sqlite_temp_master
325
+ WHERE name='index_sections_on_ebook_id' AND type='index'
326
+
327
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
328
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
329
+  (1.5ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
330
+  (0.1ms) select sqlite_version(*)
331
+  (1.2ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
332
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
333
+ Migrating to EnableUuidOssp (20140416021117)
334
+  (0.1ms) begin transaction
335
+ SQL (0.5ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140416021117"]]
336
+  (0.9ms) commit transaction
337
+ Migrating to Ebooks (20140416030807)
338
+  (0.1ms) begin transaction
339
+  (0.8ms) CREATE TABLE "ebooks" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255) NOT NULL, "creator" varchar(255), "language" varchar(2), "contributor" varchar(255), "description" text, "publisher" varchar(255), "rights" text, "subject" varchar(255), "created_at" datetime, "updated_at" datetime) 
340
+ SQL (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140416030807"]]
341
+  (1.1ms) commit transaction
342
+ Migrating to Sections (20140416032844)
343
+  (0.1ms) begin transaction
344
+  (1.6ms) CREATE TABLE "sections" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255) NOT NULL, "content" text NOT NULL, "ebook_id" varchar(255) NOT NULL, "position" integer NOT NULL, "created_at" datetime, "updated_at" datetime) 
345
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140416032844"]]
346
+  (2.2ms) commit transaction
347
+ Migrating to AddIndexToSectionsEbookIdPosition (20140416033000)
348
+  (0.2ms) begin transaction
349
+  (0.8ms) CREATE INDEX "index_sections_on_ebook_id" ON "sections" ("ebook_id")
350
+  (0.3ms) SELECT sql
351
+ FROM sqlite_master
352
+ WHERE name='index_sections_on_ebook_id' AND type='index'
353
+ UNION ALL
354
+ SELECT sql
355
+ FROM sqlite_temp_master
356
+ WHERE name='index_sections_on_ebook_id' AND type='index'
357
+
358
+  (0.4ms) CREATE INDEX "index_sections_on_position" ON "sections" ("position")
359
+ SQL (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140416033000"]]
360
+  (1.3ms) commit transaction
361
+ Migrating to AddColumnSlugToEbooks (20140416033315)
362
+  (0.4ms) begin transaction
363
+  (0.9ms) ALTER TABLE "ebooks" ADD "slug" varchar(255)
364
+  (3.3ms) CREATE UNIQUE INDEX "index_ebooks_on_slug" ON "ebooks" ("slug")
365
+ SQL (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140416033315"]]
366
+  (1.6ms) commit transaction
367
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
368
+  (0.1ms) SELECT sql
369
+ FROM sqlite_master
370
+ WHERE name='index_ebooks_on_slug' AND type='index'
371
+ UNION ALL
372
+ SELECT sql
373
+ FROM sqlite_temp_master
374
+ WHERE name='index_ebooks_on_slug' AND type='index'
375
+
376
+  (0.1ms)  SELECT sql
377
+ FROM sqlite_master
378
+ WHERE name='index_sections_on_position' AND type='index'
379
+ UNION ALL
380
+ SELECT sql
381
+ FROM sqlite_temp_master
382
+ WHERE name='index_sections_on_position' AND type='index'
383
+ 
384
+  (0.1ms) SELECT sql
385
+ FROM sqlite_master
386
+ WHERE name='index_sections_on_ebook_id' AND type='index'
387
+ UNION ALL
388
+ SELECT sql
389
+ FROM sqlite_temp_master
390
+ WHERE name='index_sections_on_ebook_id' AND type='index'
391
+
392
+  (2.4ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
393
+  (0.3ms) select sqlite_version(*)
394
+  (2.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
395
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
396
+ Migrating to Ebooks (20140416030807)
397
+  (0.1ms) begin transaction
398
+  (0.5ms) CREATE TABLE "ebooks" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255) NOT NULL, "creator" varchar(255), "language" varchar(2), "contributor" varchar(255), "description" text, "publisher" varchar(255), "rights" text, "subject" varchar(255), "created_at" datetime, "updated_at" datetime)
399
+ SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140416030807"]]
400
+  (0.7ms) commit transaction
401
+ Migrating to Sections (20140416032844)
402
+  (0.1ms) begin transaction
403
+  (0.3ms) CREATE TABLE "sections" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255) NOT NULL, "content" text NOT NULL, "ebook_id" varchar(255) NOT NULL, "position" integer NOT NULL, "created_at" datetime, "updated_at" datetime)
404
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140416032844"]]
405
+  (0.6ms) commit transaction
406
+ Migrating to AddIndexToSectionsEbookIdPosition (20140416033000)
407
+  (0.0ms) begin transaction
408
+  (0.3ms) CREATE INDEX "index_sections_on_ebook_id" ON "sections" ("ebook_id")
409
+  (0.1ms)  SELECT sql
410
+ FROM sqlite_master
411
+ WHERE name='index_sections_on_ebook_id' AND type='index'
412
+ UNION ALL
413
+ SELECT sql
414
+ FROM sqlite_temp_master
415
+ WHERE name='index_sections_on_ebook_id' AND type='index'
416
+ 
417
+  (0.1ms) CREATE INDEX "index_sections_on_position" ON "sections" ("position")
418
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140416033000"]]
419
+  (0.7ms) commit transaction
420
+ Migrating to AddColumnSlugToEbooks (20140416033315)
421
+  (0.1ms) begin transaction
422
+  (0.4ms) ALTER TABLE "ebooks" ADD "slug" varchar(255)
423
+  (1.1ms) CREATE UNIQUE INDEX "index_ebooks_on_slug" ON "ebooks" ("slug")
424
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140416033315"]]
425
+  (0.8ms) commit transaction
426
+ ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
427
+  (0.2ms)  SELECT sql
428
+ FROM sqlite_master
429
+ WHERE name='index_ebooks_on_slug' AND type='index'
430
+ UNION ALL
431
+ SELECT sql
432
+ FROM sqlite_temp_master
433
+ WHERE name='index_ebooks_on_slug' AND type='index'
434
+ 
435
+  (0.1ms) SELECT sql
436
+ FROM sqlite_master
437
+ WHERE name='index_sections_on_position' AND type='index'
438
+ UNION ALL
439
+ SELECT sql
440
+ FROM sqlite_temp_master
441
+ WHERE name='index_sections_on_position' AND type='index'
442
+
443
+  (0.1ms)  SELECT sql
444
+ FROM sqlite_master
445
+ WHERE name='index_sections_on_ebook_id' AND type='index'
446
+ UNION ALL
447
+ SELECT sql
448
+ FROM sqlite_temp_master
449
+ WHERE name='index_sections_on_ebook_id' AND type='index'
450
+ 
451
+  (1.6ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
452
+  (0.1ms) select sqlite_version(*)
453
+  (0.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
454
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
455
+ Migrating to Ebooks (20140416030807)
456
+  (0.1ms) begin transaction
457
+  (0.5ms) CREATE TABLE "ebooks" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255) NOT NULL, "creator" varchar(255), "language" varchar(2), "contributor" varchar(255), "description" text, "publisher" varchar(255), "rights" text, "subject" varchar(255), "created_at" datetime, "updated_at" datetime)
458
+ SQL (0.5ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140416030807"]]
459
+  (1.1ms) commit transaction
460
+ Migrating to Sections (20140416032844)
461
+  (0.1ms) begin transaction
462
+  (0.4ms) CREATE TABLE "sections" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "title" varchar(255) NOT NULL, "content" text NOT NULL, "ebook_id" varchar(255) NOT NULL, "position" integer NOT NULL, "created_at" datetime, "updated_at" datetime)
463
+ SQL (0.5ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140416032844"]]
464
+  (0.6ms) commit transaction
465
+ Migrating to AddIndexToSectionsEbookIdPosition (20140416033000)
466
+  (0.0ms) begin transaction
467
+  (0.3ms) CREATE INDEX "index_sections_on_ebook_id" ON "sections" ("ebook_id")
468
+  (0.1ms)  SELECT sql
469
+ FROM sqlite_master
470
+ WHERE name='index_sections_on_ebook_id' AND type='index'
471
+ UNION ALL
472
+ SELECT sql
473
+ FROM sqlite_temp_master
474
+ WHERE name='index_sections_on_ebook_id' AND type='index'
475
+ 
476
+  (0.1ms) CREATE INDEX "index_sections_on_position" ON "sections" ("position")
477
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140416033000"]]
478
+  (0.6ms) commit transaction
479
+ Migrating to AddColumnSlugToEbooks (20140416033315)
480
+  (0.1ms) begin transaction
481
+  (0.3ms) ALTER TABLE "ebooks" ADD "slug" varchar(255)
482
+  (0.9ms) CREATE UNIQUE INDEX "index_ebooks_on_slug" ON "ebooks" ("slug")
483
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140416033315"]]
484
+  (0.7ms) commit transaction
485
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
486
+  (0.1ms)  SELECT sql
487
+ FROM sqlite_master
488
+ WHERE name='index_ebooks_on_slug' AND type='index'
489
+ UNION ALL
490
+ SELECT sql
491
+ FROM sqlite_temp_master
492
+ WHERE name='index_ebooks_on_slug' AND type='index'
493
+ 
494
+  (0.1ms) SELECT sql
495
+ FROM sqlite_master
496
+ WHERE name='index_sections_on_position' AND type='index'
497
+ UNION ALL
498
+ SELECT sql
499
+ FROM sqlite_temp_master
500
+ WHERE name='index_sections_on_position' AND type='index'
501
+
502
+  (0.1ms)  SELECT sql
503
+ FROM sqlite_master
504
+ WHERE name='index_sections_on_ebook_id' AND type='index'
505
+ UNION ALL
506
+ SELECT sql
507
+ FROM sqlite_temp_master
508
+ WHERE name='index_sections_on_ebook_id' AND type='index'
509
+ 
510
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
511
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
512
+  (0.1ms)  SELECT sql
513
+ FROM sqlite_master
514
+ WHERE name='index_ebooks_on_slug' AND type='index'
515
+ UNION ALL
516
+ SELECT sql
517
+ FROM sqlite_temp_master
518
+ WHERE name='index_ebooks_on_slug' AND type='index'
519
+ 
520
+  (0.1ms) SELECT sql
521
+ FROM sqlite_master
522
+ WHERE name='index_sections_on_position' AND type='index'
523
+ UNION ALL
524
+ SELECT sql
525
+ FROM sqlite_temp_master
526
+ WHERE name='index_sections_on_position' AND type='index'
527
+
528
+  (0.1ms)  SELECT sql
529
+ FROM sqlite_master
530
+ WHERE name='index_sections_on_ebook_id' AND type='index'
531
+ UNION ALL
532
+ SELECT sql
533
+ FROM sqlite_temp_master
534
+ WHERE name='index_sections_on_ebook_id' AND type='index'
535
+ 
536
+  (0.2ms) begin transaction
537
+ SQL (1.5ms) INSERT INTO "ebooks" ("created_at", "title", "updated_at") VALUES (?, ?, ?) [["created_at", "2014-08-29 09:13:54.421627"], ["title", "Test"], ["updated_at", "2014-08-29 09:13:54.421627"]]
538
+  (2.9ms) commit transaction
539
+  (0.1ms) begin transaction
540
+ SQL (0.5ms) INSERT INTO "ebooks" ("created_at", "slug", "title", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-08-29 09:14:08.017491"], ["slug", "test"], ["title", "Test"], ["updated_at", "2014-08-29 09:14:08.017491"]]
541
+  (1.4ms) commit transaction
542
+  (0.1ms) begin transaction
543
+ SQL (0.3ms) INSERT INTO "ebooks" ("created_at", "slug", "title", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-08-29 10:30:56.255981"], ["slug", "test"], ["title", "Test"], ["updated_at", "2014-08-29 10:30:56.255981"]]
544
+ SQLite3::ConstraintException: column slug is not unique: INSERT INTO "ebooks" ("created_at", "slug", "title", "updated_at") VALUES (?, ?, ?, ?)
545
+  (0.0ms) rollback transaction
546
+  (0.1ms) begin transaction
547
+ SQL (0.4ms) INSERT INTO "ebooks" ("created_at", "slug", "title", "updated_at") VALUES (?, ?, ?, ?) [["created_at", "2014-08-29 10:31:13.992547"], ["slug", "test2"], ["title", "Test2"], ["updated_at", "2014-08-29 10:31:13.992547"]]
548
+  (1.4ms) commit transaction
549
+ Section Load (0.5ms) SELECT "sections".* FROM "sections" WHERE "sections"."ebook_id" = ? ORDER BY "sections"."position" ASC [["ebook_id", 3]]