loadat 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module Loadat
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -1,6 +1,6 @@
1
1
  namespace :loadat do
2
2
  desc "Load data in <directory>/*.dat into MySQL database"
3
- task :dir, :directory, :needs => :environment do |task, args|
3
+ task :dir, [:directory] => [:environment] do |task, args|
4
4
  total_size = 0
5
5
  dir = args[:directory] ? [args[:directory]] : [Rails.root, "tmp"]
6
6
  files = (dir + ["*.dat"]).flatten
@@ -17,9 +17,11 @@ namespace :loadat do
17
17
  execute("LOAD DATA LOCAL INFILE '#{file}' INTO TABLE #{quoted_table_name}")
18
18
  progress("adding index to #{quoted_table_name}")
19
19
  execute("ALTER TABLE #{quoted_table_name} ENABLE KEYS")
20
+ progress("analyzing #{quoted_table_name}")
21
+ execute("ANALYZE TABLE #{quoted_table_name}")
20
22
  end
21
23
  end
22
- puts "[#{Time.now.to_s}] #{total_size} byte data loaded"
24
+ progress("#{total_size} byte data loaded")
23
25
  end
24
26
 
25
27
  def progress(message)
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
10
10
  s.email = ["seouri@gmail.com"]
11
11
  s.homepage = "https://github.com/seouri/loadat"
12
12
  s.summary = %q{Ruby on Rails Rake task for loading data in text files into MySQL database.}
13
- s.description = %q{load_dat is a Ruby on Rails Rake task that loads data in <tablename>.dat into MySQL database that is defined in the database.yml file.}
13
+ s.description = %q{loaddat is a Ruby on Rails Rake task that loads data in <tablename>.dat into MySQL database that is defined in the database.yml file.}
14
14
 
15
15
  s.rubyforge_project = "loadat"
16
16
 
metadata CHANGED
@@ -1,33 +1,24 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: loadat
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 0
8
- - 1
9
- version: 0.0.1
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2
5
+ prerelease:
10
6
  platform: ruby
11
- authors:
7
+ authors:
12
8
  - Joon Lee
13
9
  autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
-
17
- date: 2011-04-07 00:00:00 -04:00
18
- default_executable:
12
+ date: 2011-08-19 00:00:00.000000000Z
19
13
  dependencies: []
20
-
21
- description: load_dat is a Ruby on Rails Rake task that loads data in <tablename>.dat into MySQL database that is defined in the database.yml file.
22
- email:
14
+ description: loaddat is a Ruby on Rails Rake task that loads data in <tablename>.dat
15
+ into MySQL database that is defined in the database.yml file.
16
+ email:
23
17
  - seouri@gmail.com
24
18
  executables: []
25
-
26
19
  extensions: []
27
-
28
20
  extra_rdoc_files: []
29
-
30
- files:
21
+ files:
31
22
  - .gitignore
32
23
  - Gemfile
33
24
  - Rakefile
@@ -36,37 +27,28 @@ files:
36
27
  - lib/loadat/version.rb
37
28
  - lib/tasks/loadat.rake
38
29
  - loadat.gemspec
39
- has_rdoc: true
40
30
  homepage: https://github.com/seouri/loadat
41
31
  licenses: []
42
-
43
32
  post_install_message:
44
33
  rdoc_options: []
45
-
46
- require_paths:
34
+ require_paths:
47
35
  - lib
48
- required_ruby_version: !ruby/object:Gem::Requirement
36
+ required_ruby_version: !ruby/object:Gem::Requirement
49
37
  none: false
50
- requirements:
51
- - - ">="
52
- - !ruby/object:Gem::Version
53
- segments:
54
- - 0
55
- version: "0"
56
- required_rubygems_version: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ! '>='
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ required_rubygems_version: !ruby/object:Gem::Requirement
57
43
  none: false
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- segments:
62
- - 0
63
- version: "0"
44
+ requirements:
45
+ - - ! '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
64
48
  requirements: []
65
-
66
49
  rubyforge_project: loadat
67
- rubygems_version: 1.3.7
50
+ rubygems_version: 1.8.6
68
51
  signing_key:
69
52
  specification_version: 3
70
53
  summary: Ruby on Rails Rake task for loading data in text files into MySQL database.
71
54
  test_files: []
72
-