tkh_illustrations 0.0.2 → 0.0.3

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.
data/CHANGELOG.md CHANGED
@@ -1,7 +1,12 @@
1
1
  # TKH Illustrations
2
2
 
3
3
 
4
- ## 0.0.x
4
+ ## 0.0.3
5
+
6
+ * Added an install generator to copy over migration to the host app
7
+
8
+
9
+ ## 0.0.2
5
10
 
6
11
  * Fixed bug in require 'RMagick' line. Case sensitive :-(
7
12
  * Locale is now part of the url instead of a param
data/README.md CHANGED
@@ -16,7 +16,17 @@ And then execute:
16
16
 
17
17
  $ bundle
18
18
 
19
- And then of course restart your server!
19
+ Import migration
20
+
21
+ $ rails g tkh_illustrations:install
22
+
23
+ Run the migration
24
+
25
+ $ rake db:migrate
26
+
27
+ And then of course restart your server! Typically:
28
+
29
+ $ rails s
20
30
 
21
31
  Your dev machine and production server must have imagemagick installed.
22
32
 
@@ -0,0 +1,25 @@
1
+ require 'rails/generators/migration'
2
+
3
+ module TkhIllustrations
4
+ module Generators
5
+ class InstallGenerator < ::Rails::Generators::Base
6
+ include Rails::Generators::Migration
7
+ source_root File.expand_path('../templates', __FILE__)
8
+ desc "add the migration"
9
+ def self.next_migration_number(path)
10
+ unless @prev_migration_nr
11
+ @prev_migration_nr = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i
12
+ else
13
+ @prev_migration_nr += 1
14
+ end
15
+ @prev_migration_nr.to_s
16
+ end
17
+
18
+ def copy_migrations
19
+ puts 'creating illustration migration'
20
+ migration_template "create_illustrations.rb", "db/migrate/create_illustrations.rb"
21
+ end
22
+
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,10 @@
1
+ class CreateIllustrations < ActiveRecord::Migration
2
+ def change
3
+ create_table :illustrations do |t|
4
+ t.string :name
5
+ t.string :image
6
+
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -1,3 +1,3 @@
1
1
  module TkhIllustrations
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tkh_illustrations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-27 00:00:00.000000000 Z
12
+ date: 2012-07-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -123,6 +123,8 @@ files:
123
123
  - app/views/illustrations/new.html.erb
124
124
  - app/views/illustrations/show.html.erb
125
125
  - config/routes.rb
126
+ - lib/generators/tkh_illustrations/install/install_generator.rb
127
+ - lib/generators/tkh_illustrations/install/templates/create_illustrations.rb
126
128
  - lib/tasks/tkh_illustrations_tasks.rake
127
129
  - lib/tkh_illustrations/version.rb
128
130
  - lib/tkh_illustrations.rb
@@ -174,7 +176,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
174
176
  version: '0'
175
177
  segments:
176
178
  - 0
177
- hash: -1490081993982127481
179
+ hash: 1564260776884740944
178
180
  required_rubygems_version: !ruby/object:Gem::Requirement
179
181
  none: false
180
182
  requirements:
@@ -183,7 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
183
185
  version: '0'
184
186
  segments:
185
187
  - 0
186
- hash: -1490081993982127481
188
+ hash: 1564260776884740944
187
189
  requirements: []
188
190
  rubyforge_project:
189
191
  rubygems_version: 1.8.23