one_offs 0.2.1 → 0.2.2

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: e842bde700cda5ebc3641e808a659898c82d3363
4
- data.tar.gz: 22fc524bf9cc8a0df7c92a24b2a11dfd851c292b
3
+ metadata.gz: 9891a04acea75e2f0f97a836971cdeaf0f249f49
4
+ data.tar.gz: ecc913405ed9e4eb5068fe13b711da90ea368e2b
5
5
  SHA512:
6
- metadata.gz: 52f0fd0fc9a96b7335d69a41d8117a125a824b276ea163e084c91544e5185cd3eaf3f0ad87e037212f90b131d5c165dc127b8ec3ee9c92ba608fe8587701379d
7
- data.tar.gz: e5e4dc0df4425616dc88bcf06b9f293427566be6a51bd28d167610cc1c37424cb49d7fcaa95182beaf126f54103ef27b78d0aec0e9f58433f3d68d3f5d51bbe8
6
+ metadata.gz: 6d3bc4add1df3f7351ed5d2f100825dd6b4df11f2e485f3254e1307b095a74cb39bd8c20dde05f7025638371367350404bf9c63e3f05444b94717cc25c426b13
7
+ data.tar.gz: 43101a621c2cc1ead2c0a62de4dcab8b2af9c8e725b2bc9eeb00680110bcfd0f6e6813754577cd81c49ab2327897b9ff025588ef78d09e240b77fabfdeabe25c
data/.gitignore CHANGED
@@ -1,5 +1,6 @@
1
1
  *.gem
2
2
  .bundle
3
+ .idea
3
4
  Gemfile.lock
4
5
  pkg/*
5
6
  *~
data/README.md CHANGED
@@ -26,12 +26,26 @@ After installing the gem, In your Rakefile (/Rakefile) add the following line
26
26
  require 'one_offs/tasks'
27
27
 
28
28
 
29
- And setup a tracker table.
30
-
29
+ And setup a tracker table (creates migration).
31
30
 
32
31
  rake one_offs:generate_tracker_table
33
32
 
33
+ OR using SQL query if you want to avoid a migration (Useful if you need to setup one off tasks before db:migrate).
34
+
35
+ rake one_offs:create_tracker_table_using_sql
36
+
34
37
  Add scripts to `lib/one_offs/`
38
+ * File name should be <code>\<number\>_class_name_inside_file.rb</code> (Rails convention for file name to class name with the order number before that)
39
+
40
+ Example:
41
+
42
+ File: 1_hello_world.rb
43
+ Contents:
44
+ class HelloWorld
45
+ def self.process
46
+ puts("You may write your code in this process method").
47
+ end
48
+ end
35
49
 
36
50
  To run pending one_off scripts.
37
51
 
@@ -10,4 +10,10 @@ namespace :one_offs do
10
10
  task :generate_tracker_table do
11
11
  `rails generate migration CreateOneOffTracker name:string`
12
12
  end
13
+
14
+ desc 'Create one off tracker table using SQL instead of migration'
15
+ task :create_tracker_table_using_sql => :environment do
16
+ sql = 'CREATE TABLE IF NOT EXISTS "one_off_trackers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar);'
17
+ ActiveRecord::Base.connection.execute(sql)
18
+ end
13
19
  end
@@ -1,3 +1,3 @@
1
1
  module OneOffs
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: one_offs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jatin Naik
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-09 00:00:00.000000000 Z
11
+ date: 2016-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -67,9 +67,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
67
67
  version: '0'
68
68
  requirements: []
69
69
  rubyforge_project: one_offs
70
- rubygems_version: 2.2.2
70
+ rubygems_version: 2.4.8
71
71
  signing_key:
72
72
  specification_version: 4
73
73
  summary: Track and manage your one off scripts
74
74
  test_files: []
75
- has_rdoc: