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.
- checksums.yaml +4 -4
- data/{LICENSE.txt → MIT-LICENSE} +1 -3
- data/README.md +10 -17
- data/Rakefile +17 -1
- data/lib/ebook_generator.rb +75 -72
- data/lib/ebook_generator/version.rb +1 -1
- data/lib/generators/ebook_generator/ebook_generator_generator.rb +16 -0
- data/lib/generators/ebook_generator/templates/create_ebooks.rb +18 -0
- data/lib/generators/ebook_generator/templates/create_sections.rb +13 -0
- data/lib/generators/ebook_generator/templates/ebook.rb +8 -0
- data/lib/generators/ebook_generator/templates/section.rb +6 -0
- data/lib/tasks/ebook_generator_tasks.rake +4 -0
- data/spec/dummy/README.rdoc +28 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/javascripts/application.js +13 -0
- data/spec/dummy/app/assets/stylesheets/application.css +15 -0
- data/spec/dummy/app/controllers/application_controller.rb +5 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/models/ebook.rb +4 -0
- data/spec/dummy/app/models/section.rb +7 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +34 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +37 -0
- data/spec/dummy/config/environments/production.rb +82 -0
- data/spec/dummy/config/environments/test.rb +39 -0
- data/spec/dummy/config/initializers/assets.rb +8 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +23 -0
- data/spec/dummy/config/routes.rb +56 -0
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/db/development.sqlite3 +0 -0
- data/spec/dummy/db/migrate/20140416030807_ebooks.rb +17 -0
- data/spec/dummy/db/migrate/20140416032844_sections.rb +12 -0
- data/spec/dummy/db/migrate/20140416033000_add_index_to_sections_ebook_id_position.rb +6 -0
- data/spec/dummy/db/migrate/20140416033315_add_column_slug_to_ebooks.rb +6 -0
- data/spec/dummy/db/schema.rb +44 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +549 -0
- data/spec/dummy/log/test.log +4812 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/tmp/Qui-voluptates-consequuntur-aliquam-iste-numquam..epub +0 -0
- data/spec/dummy/tmp/Ratione-soluta-magni-consectetur-delectus-sequi-necessitatibus..epub +0 -0
- data/spec/ebook_generator_spec.rb +56 -0
- data/spec/factories/factories.rb +35 -0
- data/spec/helpers/unzip.rb +13 -0
- data/spec/models/ebook_spec.rb +5 -0
- data/spec/models/section_spec.rb +5 -0
- data/spec/spec_helper.rb +21 -0
- data/spec/support/factory_girl.rb +3 -0
- metadata +176 -43
- data/.gitignore +0 -22
- data/Changelog.md +0 -23
- data/Gemfile +0 -3
- data/ebook_generator.gemspec +0 -28
- data/lib/ebook_generator/initializer.rb +0 -5
- data/lib/ebook_generator/migration.rb +0 -30
- data/lib/generators/ebook_generator_generator.rb +0 -17
    
        data/.gitignore
    DELETED
    
    | @@ -1,22 +0,0 @@ | |
| 1 | 
            -
            *.gem
         | 
| 2 | 
            -
            *.rbc
         | 
| 3 | 
            -
            .bundle
         | 
| 4 | 
            -
            .config
         | 
| 5 | 
            -
            .yardoc
         | 
| 6 | 
            -
            Gemfile.lock
         | 
| 7 | 
            -
            InstalledFiles
         | 
| 8 | 
            -
            _yardoc
         | 
| 9 | 
            -
            coverage
         | 
| 10 | 
            -
            doc/
         | 
| 11 | 
            -
            lib/bundler/man
         | 
| 12 | 
            -
            pkg
         | 
| 13 | 
            -
            rdoc
         | 
| 14 | 
            -
            spec/reports
         | 
| 15 | 
            -
            test/tmp
         | 
| 16 | 
            -
            test/version_tmp
         | 
| 17 | 
            -
            tmp
         | 
| 18 | 
            -
            *.bundle
         | 
| 19 | 
            -
            *.so
         | 
| 20 | 
            -
            *.o
         | 
| 21 | 
            -
            *.a
         | 
| 22 | 
            -
            mkmf.log
         | 
    
        data/Changelog.md
    DELETED
    
    | @@ -1,23 +0,0 @@ | |
| 1 | 
            -
            # EbookGenerator Changelog
         | 
| 2 | 
            -
             | 
| 3 | 
            -
            ## 0.0.5 (2014-04-30)
         | 
| 4 | 
            -
             | 
| 5 | 
            -
            - Removed code to copy stylesheet, will wait until future version and create it dynamically
         | 
| 6 | 
            -
             | 
| 7 | 
            -
            ## 0.0.4 (2014-04-30)
         | 
| 8 | 
            -
             | 
| 9 | 
            -
            - Added missing file "zip_file_processor"
         | 
| 10 | 
            -
            - Refactored code to use builder instead of strings
         | 
| 11 | 
            -
             | 
| 12 | 
            -
            ## 0.0.3 (2014-04-18)
         | 
| 13 | 
            -
             | 
| 14 | 
            -
            - Added gem dependencies
         | 
| 15 | 
            -
             | 
| 16 | 
            -
            ## 0.0.2 (2014-04-18)
         | 
| 17 | 
            -
             | 
| 18 | 
            -
            - Fixed bug where the methods could not be accessed
         | 
| 19 | 
            -
             | 
| 20 | 
            -
            ## 0.0.1 (2014-04-17)
         | 
| 21 | 
            -
             | 
| 22 | 
            -
            - Added db migrations
         | 
| 23 | 
            -
            - Added generate ePub class
         | 
    
        data/Gemfile
    DELETED
    
    
    
        data/ebook_generator.gemspec
    DELETED
    
    | @@ -1,28 +0,0 @@ | |
| 1 | 
            -
            # -*- encoding: utf-8 -*-
         | 
| 2 | 
            -
            $:.push File.expand_path("../lib", __FILE__)
         | 
| 3 | 
            -
            require "ebook_generator/version"
         | 
| 4 | 
            -
             | 
| 5 | 
            -
            Gem::Specification.new do |s|
         | 
| 6 | 
            -
              s.name        = 'ebook_generator'
         | 
| 7 | 
            -
              s.version     = EbookGenerator::VERSION
         | 
| 8 | 
            -
              s.platform    = Gem::Platform::RUBY
         | 
| 9 | 
            -
              s.summary     = "Generates eBooks"
         | 
| 10 | 
            -
              s.description = "A simple eBook (ePub) generator gem"
         | 
| 11 | 
            -
              s.authors     = ["Kris Quigley"]
         | 
| 12 | 
            -
              s.email       = 'kris@krisquigley.co.uk'
         | 
| 13 | 
            -
              s.homepage    =
         | 
| 14 | 
            -
                'https://github.com/krisquigley/ebook_generator'
         | 
| 15 | 
            -
             | 
| 16 | 
            -
              s.add_runtime_dependency 'rails', '>= 4.0.0'
         | 
| 17 | 
            -
              s.add_runtime_dependency 'friendly_id', '>= 5.0.3'
         | 
| 18 | 
            -
              s.add_runtime_dependency 'pg',  '>= 0.17.1'
         | 
| 19 | 
            -
              s.add_runtime_dependency 'redcarpet',  '>= 3.0.0'
         | 
| 20 | 
            -
              s.add_runtime_dependency 'rubyzip',  '>= 1.0.0'
         | 
| 21 | 
            -
             | 
| 22 | 
            -
              s.files         = `git ls-files`.split("\n")
         | 
| 23 | 
            -
              s.test_files    = `git ls-files -- {test,spec,features}/*`.split("\n")
         | 
| 24 | 
            -
              s.executables   = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
         | 
| 25 | 
            -
              s.require_paths = ["lib"]
         | 
| 26 | 
            -
             | 
| 27 | 
            -
              s.license       = 'MIT'
         | 
| 28 | 
            -
            end
         | 
| @@ -1,30 +0,0 @@ | |
| 1 | 
            -
            class CreateEbookGeneratorTables < ActiveRecord::Migration
         | 
| 2 | 
            -
              def change
         | 
| 3 | 
            -
                enable_extension 'uuid-ossp'
         | 
| 4 | 
            -
             | 
| 5 | 
            -
                create_table :ebooks, id: :uuid, default: "uuid_generate_v4()" do |t|
         | 
| 6 | 
            -
                  t.string    "title",      null: false
         | 
| 7 | 
            -
                  t.string    "creator"
         | 
| 8 | 
            -
                  t.string    "language",   limit: 2
         | 
| 9 | 
            -
                  t.string    "contributor"
         | 
| 10 | 
            -
                  t.text      "description"
         | 
| 11 | 
            -
                  t.string    "publisher"
         | 
| 12 | 
            -
                  t.text      "rights"
         | 
| 13 | 
            -
                  t.string    "subject"
         | 
| 14 | 
            -
                  t.datetime  "created_at"
         | 
| 15 | 
            -
                  t.datetime  "updated_at"
         | 
| 16 | 
            -
                end
         | 
| 17 | 
            -
             | 
| 18 | 
            -
                create_table "sections", force: true do |t|
         | 
| 19 | 
            -
                  t.string   "title",      null: false
         | 
| 20 | 
            -
                  t.text     "content",    null: false
         | 
| 21 | 
            -
                  t.uuid     "ebook_id",   null: false
         | 
| 22 | 
            -
                  t.integer  "position",   null: false
         | 
| 23 | 
            -
                  t.datetime "created_at"
         | 
| 24 | 
            -
                  t.datetime "updated_at"
         | 
| 25 | 
            -
                end
         | 
| 26 | 
            -
             | 
| 27 | 
            -
                add_index "sections", ["ebook_id"], name: "index_sections_on_ebook_id", using: :btree
         | 
| 28 | 
            -
                add_index "sections", ["position"], name: "index_sections_on_position", using: :btree
         | 
| 29 | 
            -
              end
         | 
| 30 | 
            -
            end
         | 
| @@ -1,17 +0,0 @@ | |
| 1 | 
            -
            require 'rails/generators'
         | 
| 2 | 
            -
            require "rails/generators/active_record"
         | 
| 3 | 
            -
             | 
| 4 | 
            -
            class EbookGeneratorGenerator < ActiveRecord::Generators::Base
         | 
| 5 | 
            -
              argument :name, type: :string, default: 'random_name'
         | 
| 6 | 
            -
             | 
| 7 | 
            -
              source_root File.expand_path('../../ebook_generator', __FILE__)
         | 
| 8 | 
            -
             | 
| 9 | 
            -
              # Copies the migration template to db/migrate.
         | 
| 10 | 
            -
              def copy_files
         | 
| 11 | 
            -
                migration_template 'migration.rb', 'db/migrate/create_ebook_generator_tables.rb'
         | 
| 12 | 
            -
              end
         | 
| 13 | 
            -
             | 
| 14 | 
            -
              def create_initializer
         | 
| 15 | 
            -
                copy_file 'initializer.rb', 'config/initializers/ebook_generator.rb'
         | 
| 16 | 
            -
              end
         | 
| 17 | 
            -
            end
         |