test_gem_task 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f7105c8cf44c6a3f3c8032e565db433473f08258
4
- data.tar.gz: c999d341b31cc93c2326653ffc1a5649e97f9cda
3
+ metadata.gz: b95c225a32e8c0d6e52e21037bc7b416a6270883
4
+ data.tar.gz: 86a7663052191d2a1d77617ecfc21858ddc8756e
5
5
  SHA512:
6
- metadata.gz: ace2e7467e56fff339d93b60d750899f9c7d203aa92f72c19ce44ee99af85ac685ef0eaebc8339d16ee163f72407a28c98e78fbb7e04c43b8035bda28a9107b5
7
- data.tar.gz: dc710c6126f948c797715a4b01e7660034e4e5ddee61a20aae35c611fc02c0b641571edb183210baad3e06ce1cdc6e0f5c5b8b01d4b6d98e6a4667bd22f10f98
6
+ metadata.gz: 33d2db72261a0435574623e0043ee39e3136296abc3d595a67cc8d2951fda9b66295b4777a66a4c0835120e715efa4e0cc9c206289854b7a6e2526fcda37383a
7
+ data.tar.gz: f5eaf387ee3292d1d8d9269240d3b31938f95f35391aeea94f74aa809dc3df29145c9c6db0e1f6638035591dacee9148742d23fbefbd6bb4de91c7047966775b
@@ -2,6 +2,17 @@ class InitializerGenerator < Rails::Generators::NamedBase
2
2
  source_root File.expand_path("../templates", __FILE__)
3
3
 
4
4
  def copy_initializer_file
5
- copy_file "initializer.rb", "config/initializers/#{file_name}.rb"
5
+ time = Time.now
6
+ year = time.strftime("%Y")
7
+ month = time.strftime("%m")
8
+ date = time.strftime("%d")
9
+ hour = time.strftime("%H")
10
+ minutes = time.strftime("%M")
11
+ seconds = time.strftime("%S")
12
+ migration_prefix = year + month + date + hour + minutes + seconds + "_create_products"
13
+ if file_name.present?
14
+ copy_file "initializer.rb", "config/initializers/#{file_name}.rb"
15
+ end
16
+ copy_file "migration_file.rb", "db/#{migration_prefix}.rb"
6
17
  end
7
18
  end
@@ -0,0 +1,10 @@
1
+ class CreateProducts < ActiveRecord::Migration
2
+ def change
3
+ create_table :products do |t|
4
+ t.string :name
5
+ t.text :description
6
+
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -1,3 +1,3 @@
1
1
  module TestGemTask
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
@@ -1,3 +1,3 @@
1
1
  module TestGemTask
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test_gem_task
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Siva subramanian
@@ -50,6 +50,7 @@ files:
50
50
  - lib/generators/initializer/initializer_generator.rb~
51
51
  - lib/generators/initializer/templates/initializer.rb
52
52
  - lib/generators/initializer/templates/initializer.rb~
53
+ - lib/generators/initializer/templates/migration_file.rb
53
54
  - lib/test.rb
54
55
  - lib/test.rb~
55
56
  - lib/test_gem_task.rb